-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
448 changed files
with
95,876 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
...ication/src/org/eclipse/set/application/descriptions/WebDeveloperHelpPartDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** | ||
* Copyright (c) 2022 DB Netz AG and others. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.eclipse.set.application.descriptions; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.eclipse.e4.core.contexts.ContextInjectionFactory; | ||
import org.eclipse.e4.core.contexts.IEclipseContext; | ||
import org.eclipse.e4.core.services.nls.Translation; | ||
import org.eclipse.set.application.Messages; | ||
import org.eclipse.set.basis.constants.ToolboxConstants; | ||
import org.eclipse.set.basis.part.PartDescription; | ||
import org.eclipse.set.basis.viewgroups.ToolboxViewGroup; | ||
import org.eclipse.set.core.services.part.PartDescriptionService; | ||
import org.eclipse.set.utils.viewgroups.SetViewGroups; | ||
import org.osgi.service.component.annotations.Component; | ||
|
||
/** | ||
* The Developer Help Part Description | ||
* | ||
* @author Truong | ||
*/ | ||
@Component(service = PartDescriptionService.class) | ||
public class WebDeveloperHelpPartDescription implements PartDescriptionService { | ||
private static class InjectionHelper { | ||
@Inject | ||
@Translation | ||
Messages messages; | ||
|
||
@SuppressWarnings("unused") | ||
public InjectionHelper() { | ||
} | ||
} | ||
|
||
@Override | ||
public PartDescription getDescription(final IEclipseContext context) { | ||
final InjectionHelper injectionHelper = ContextInjectionFactory | ||
.make(InjectionHelper.class, context); | ||
return new PartDescription( | ||
// ID | ||
ToolboxConstants.WEB_DEVELOPER_HELP_PART_ID, | ||
// contributionURI | ||
"bundleclass://org.eclipse.set.application/org.eclipse.set.application.nosessionpart.WebDeveloperHelpPart", //$NON-NLS-1$ | ||
// toolboxViewName | ||
injectionHelper.messages.WebDeveloperHelpPartDescriptionService_ViewName, | ||
// toolboxViewToolTip | ||
"", //$NON-NLS-1$ | ||
// toolboxViewType | ||
getToolboxViewGroup(), | ||
// defaultForNature | ||
null, | ||
// toolboxViewNeedsLoadedModel | ||
false, | ||
// toolboxViewNeedsXsdValidation | ||
false, | ||
// toolboxViewNeedsEmfValidation | ||
false, | ||
// toolboxViewProcessState | ||
false, | ||
// toolboxViewProcessPlanning | ||
false, | ||
// toolboxViewProcessIntegration | ||
false, | ||
// toolboxViewProcessInvalid | ||
true, | ||
// toolboxViewNeedsCleanSession | ||
false, | ||
// toolboxViewExclusiveEditor | ||
false); | ||
} | ||
|
||
@Override | ||
public ToolboxViewGroup getToolboxViewGroup() { | ||
return SetViewGroups.getInvisible(); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...eclipse.set.application/src/org/eclipse/set/application/handler/DeveloperHelpHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2021 DB Netz AG and others. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
package org.eclipse.set.application.handler; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.eclipse.e4.core.di.annotations.Evaluate; | ||
import org.eclipse.e4.core.di.annotations.Execute; | ||
import org.eclipse.set.basis.constants.ToolboxConstants; | ||
import org.eclipse.set.core.services.part.ToolboxPartService; | ||
import org.eclipse.set.utils.ToolboxConfiguration; | ||
|
||
/** | ||
* This handler controls an developer help dialog. | ||
* | ||
* @author Peters | ||
*/ | ||
public final class DeveloperHelpHandler { | ||
|
||
@Inject | ||
ToolboxPartService partService; | ||
|
||
@Execute | ||
private void execute() { | ||
partService.showPart(ToolboxConstants.WEB_DEVELOPER_HELP_PART_ID); | ||
} | ||
|
||
/** | ||
* @return whether the developer help should be visible | ||
*/ | ||
@Evaluate | ||
public static boolean isDeveloperHelpVisible() { | ||
return ToolboxConfiguration.isDevelopmentMode(); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...e.set.application/src/org/eclipse/set/application/nosessionpart/WebDeveloperHelpPart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright (c) 2022 DB Netz AG and others. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.eclipse.set.application.nosessionpart; | ||
|
||
import java.nio.file.Path; | ||
|
||
import org.eclipse.set.utils.PartInitializationException; | ||
import org.eclipse.set.utils.WebNoSessionBasePart; | ||
import org.eclipse.swt.widgets.Composite; | ||
|
||
/** | ||
* The Develper Help part | ||
* | ||
* @author Truong | ||
*/ | ||
public class WebDeveloperHelpPart extends WebNoSessionBasePart { | ||
|
||
private static final String HELP_DIRECTORY = "./web/developerhelp"; //$NON-NLS-1$ | ||
private static final String HELP_FILENAME = "index.html"; //$NON-NLS-1$ | ||
|
||
private void setupRouteHandler() { | ||
try { | ||
browser.serveRootDirectory(Path.of(HELP_DIRECTORY)); | ||
} catch (final Exception e) { | ||
throw new PartInitializationException( | ||
"Failed to setup route handler"); //$NON-NLS-1$ | ||
} | ||
} | ||
|
||
@Override | ||
protected void createView(final Composite parent) { | ||
super.createView(parent); | ||
setupRouteHandler(); | ||
browser.setToolboxUrl(HELP_FILENAME); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.