Skip to content

Commit

Permalink
Add siteplan implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
pstuecker committed Sep 28, 2023
1 parent c6f4300 commit 4f4b51f
Show file tree
Hide file tree
Showing 448 changed files with 95,876 additions and 103 deletions.
51 changes: 50 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ jobs:
path: web/about/dist
retention-days: 1

developerhelp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Asciidoctor & Hugo
uses: eclipse-set/build/.github/actions/setup-asciidoctor@main

- name: Build About
run: hugo
working-directory: web/developerhelp

- name: Store artifact
uses: actions/upload-artifact@v3
with:
name: developerhelp-artifact
path: web/developerhelp/dist
retention-days: 1

textviewer:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -63,12 +82,30 @@ jobs:
path: web/pdf/dist
retention-days: 1

siteplan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
npm ci
npm run build-prod
working-directory: web/siteplan
- name: Store artifact
uses: actions/upload-artifact@v3
with:
name: siteplan-artifact
path: web/siteplan/dist
retention-days: 1

java:
runs-on: ubuntu-latest
needs:
- docs
- textviewer
- pdfviewer
- siteplan
- developerhelp
permissions:
contents: read
packages: write
Expand Down Expand Up @@ -108,7 +145,19 @@ jobs:
uses: actions/download-artifact@v3
with:
name: about-artifact
path: web/about/dist
path: web/about/dist

- name: Fetch siteplan
uses: actions/download-artifact@v3
with:
name: siteplan-artifact
path: web/siteplan/dist

- name: Fetch developerhelp
uses: actions/download-artifact@v3
with:
name: developerhelp-artifact
path: web/developerhelp/dist

- name: Build
run: mvn -T 1.5C -B -U clean verify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_D9x1kB5jEeW1jPyxhgRGUg" elementId="org.eclipse.e4.ide.application" bindingContexts="_D9x1mR5jEeW1jPyxhgRGUg">
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmlns:ui="http://www.eclipse.org/ui/2010/UIModel/application/ui" xmi:id="_D9x1kB5jEeW1jPyxhgRGUg" elementId="org.eclipse.e4.ide.application" bindingContexts="_D9x1mR5jEeW1jPyxhgRGUg">
<children xsi:type="basic:TrimmedWindow" xmi:id="_D9x1kR5jEeW1jPyxhgRGUg" elementId="planpro.mainwindow" selectedElement="_D9x1sB5jEeW1jPyxhgRGUg" label="%trimmedwindow.title" iconURI="">
<persistedState/>
<children xsi:type="advanced:PerspectiveStack" xmi:id="_D9x1sB5jEeW1jPyxhgRGUg">
Expand Down Expand Up @@ -27,6 +27,9 @@
</children>
<children xsi:type="menu:Menu" xmi:id="_D9x1rh5jEeW1jPyxhgRGUg" label="%menu.label.help">
<children xsi:type="menu:HandledMenuItem" xmi:id="_6mUoYBJcEem7h5-_uEYOFw" elementId="org.eclipse.set.application.handledmenuitem.help.news" label="%menu.label.help.toolboxnews" iconURI="platform:/plugin/org.eclipse.set.utils/icons/baseline_fiber_new_black_24dp.png" command="_cHSywBJfEem7h5-_uEYOFw"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_sG__QF0vEe6gKuocBy_cVw" elementId="org.eclipse.set.application.handledmenuitem.help.developerhelp" label="%menu.label.help.developerhelp" iconURI="platform:/plugin/org.eclipse.set.utils/icons/outline_help_center_black_24dp.png" command="_e2hnsF0vEe6gKuocBy_cVw">
<visibleWhen xsi:type="ui:ImperativeExpression" xmi:id="_vdHmgF0vEe6gKuocBy_cVw" contributionURI="bundleclass://org.eclipse.set.application/org.eclipse.set.application.handler.DeveloperHelpHandler"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_D9x1rx5jEeW1jPyxhgRGUg" label="%menu.label.help.about" iconURI="platform:/plugin/org.eclipse.set.utils/icons/ic_info_outline_black_24dp_1x.png" command="_D9x1ph5jEeW1jPyxhgRGUg"/>
</children>
</mainMenu>
Expand Down Expand Up @@ -57,6 +60,7 @@
<handlers xmi:id="_PrAmUBJhEem7h5-_uEYOFw" elementId="org.eclipse.set.application.handler.toolboxnews" contributionURI="bundleclass://org.eclipse.set.application/org.eclipse.set.application.handler.ToolboxNews" command="_cHSywBJfEem7h5-_uEYOFw"/>
<handlers xmi:id="_ot2bECiOEemmpqOXtBHImg" elementId="org.eclipse.set.application.handler.revert" contributionURI="bundleclass://org.eclipse.set.application/org.eclipse.set.application.handler.RevertHandler" command="_jy488CiOEemmpqOXtBHImg"/>
<handlers xmi:id="_tJU5UIYxEeuNU-GyWYwVKw" elementId="org.eclipse.set.application.set.handler.restoreactionarea" contributionURI="bundleclass://org.eclipse.set.application/org.eclipse.set.application.handler.RestoreActionAreaHandler" command="_HBip8IYxEeuNU-GyWYwVKw"/>
<handlers xmi:id="_kiN_MF0vEe6gKuocBy_cVw" elementId="org.eclipse.set.application.handler.developerHelpCommand" contributionURI="bundleclass://org.eclipse.set.application/org.eclipse.set.application.handler.DeveloperHelpHandler" command="_e2hnsF0vEe6gKuocBy_cVw"/>
<bindingTables xmi:id="_D9x1nh5jEeW1jPyxhgRGUg" bindingContext="_D9x1mR5jEeW1jPyxhgRGUg">
<bindings xmi:id="_D9x1nx5jEeW1jPyxhgRGUg" keySequence="M1+Q" command="_D9x1nB5jEeW1jPyxhgRGUg"/>
<bindings xmi:id="_D9x1oh5jEeW1jPyxhgRGUg" keySequence="M1+O" command="_D9x1oB5jEeW1jPyxhgRGUg"/>
Expand All @@ -74,6 +78,7 @@
<commands xmi:id="_k_djsFYPEeWj9J5PLz_yfw" elementId="org.eclipse.set.application.closeSession" commandName="closeSessionCommand"/>
<commands xmi:id="_D9x1ph5jEeW1jPyxhgRGUg" elementId="org.eclipse.ui.help.aboutAction" commandName="aboutCommand"/>
<commands xmi:id="_xcZPcJUnEeaxG6q_hAfBDQ" elementId="org.eclipse.set.application.command.details" commandName="%toolbar.details"/>
<commands xmi:id="_e2hnsF0vEe6gKuocBy_cVw" elementId="org.eclipse.set.application.developerHelpCommand" commandName="developerHelpCommand"/>
<commands xmi:id="_cHSywBJfEem7h5-_uEYOFw" elementId="org.eclipse.set.application.command.toolboxnews" commandName="Toolboxnews"/>
<commands xmi:id="_jy488CiOEemmpqOXtBHImg" elementId="org.eclipse.set.application.command.revert" commandName="Revert"/>
<commands xmi:id="_HBip8IYxEeuNU-GyWYwVKw" elementId="org.eclipse.set.application.set.command.restoreactionarea" commandName="RestoreActionArea"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ menu.label.file.restoreactionarea=Aktionsbereich anzeigen
menu.label.file.revert = Alle ungespeicherten Änderungen verwerfen
menu.label.file.save = Speichern
menu.label.help = Hilfe
menu.label.help.developerhelp = Werkzeugkoffer-Hilfe für Entwickler
menu.label.help.about = Versions- und Lizenz-Informationen
menu.label.help.toolboxnews = Neuigkeiten
org.eclipse.set.application.part.actions.label=Aktionen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Service-Component: OSGI-INF/org.eclipse.set.application.actionservice.ActionServ
OSGI-INF/org.eclipse.set.application.descriptions.ChromiumCreditsPartDescriptionService.xml,
OSGI-INF/org.eclipse.set.application.descriptions.SourceWebTextViewDescriptionService.xml,
OSGI-INF/org.eclipse.set.application.descriptions.ViewPdfPartDescriptionService.xml,
OSGI-INF/org.eclipse.set.application.descriptions.WebDeveloperHelpPartDescription.xml,
OSGI-INF/org.eclipse.set.application.descriptions.WebNewsPartDescriptionService.xml,
OSGI-INF/org.eclipse.set.application.exampleservice.ExampleServiceImpl.xml,
OSGI-INF/org.eclipse.set.application.initializationservice.CommonPlanProInitialization.xml,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ ViewPdfPart_ExportErrorText=Die Datei %s konnte nicht gespeichert werden.

AboutPartDescriptionService_ViewName=Versions- und Lizenz-Informationen
WebNewsPartDescriptionService_ViewName=Neuigkeiten
ChromiumCreditsPartDescriptionService_ViewName=Chromium Lizenzinformationen
ChromiumCreditsPartDescriptionService_ViewName=Chromium Lizenzinformationen
WebDeveloperHelpPartDescriptionService_ViewName=Werkzeugkoffer-Hilfe für Entwickler
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,9 @@ public class Messages {
* Chromium Lizenzinformationen
*/
public String ChromiumCreditsPartDescriptionService_ViewName;

/**
* Werkzeugkoffer-Hilfe für Entwickler
*/
public String WebDeveloperHelpPartDescriptionService_ViewName;
}
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();
}
}
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();
}
}
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
*/
package org.eclipse.set.application.parts;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -113,7 +111,6 @@ protected void createView(final Composite parent) {
SourceWebTextViewPart::serveProblems);
browser.serveFile(LAYOUT_XML, "text/plain",
session.getToolboxFile().getLayoutPath());
browser.serveUri("font", this::serveFont);

browser.setToolboxUrl("index.html");
} catch (final Exception e) {
Expand Down Expand Up @@ -151,13 +148,6 @@ private static void serveProblems(

}

@SuppressWarnings("resource") // Stream is closed by the browser
private void serveFont(final Response response) throws IOException {
response.setMimeType("application/x-font-ttf");
response.setResponseData(
Files.newInputStream(fontService.getSiteplanFont()));
}

private void handleJumpToSourceLineEvent(
final JumpToSourceLineEvent event) {
final Pair<ObjectState, Integer> lineNumber = event.getLineNumber();
Expand Down

0 comments on commit 4f4b51f

Please sign in to comment.