Skip to content
Snippets Groups Projects
Commit 2673af1d authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Kernel: added lightweight FX editor framework to kernel.common.ui.

New graphical editors should be based on this framework.

Issue-Ref: 3815
Issue-Url: https://af3-developer.fortiss.org/issues/3815


Signed-off-by: default avatarFlorian Hoelzl <hoelzl@fortiss.org>
parent 67a83f14
No related branches found
No related tags found
1 merge request!743815 LWFXEditorFramework integration and FX Component Editor
......@@ -3,6 +3,8 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="external-src"/>
<classpathentry kind="src" path="res"/>
<classpathentry exported="true" kind="lib" path="lib/org.eclipse.systemfocus.kernel.common_0.0.3.201909091119.jar"/>
<classpathentry exported="true" kind="lib" path="lib/org.eclipse.systemfocus.kernel.common.ui_0.0.3.201909091119.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="module" value="true"/>
......
......@@ -24,8 +24,13 @@ Require-Bundle: org.fortiss.tooling.common;bundle-version="2.15.0";visibility:=r
Bundle-ClassPath: .,
lib/org.conqat.ide.commons.gef.jar,
lib/org.conqat.ide.commons.ui.jar,
lib/swt-grouplayout.jar
Export-Package: org.conqat.ide.commons.gef,
lib/swt-grouplayout.jar,
lib/org.eclipse.systemfocus.kernel.common_0.0.3.201909091119.jar,
lib/org.eclipse.systemfocus.kernel.common.ui_0.0.3.201909091119.jar
Export-Package: aerofx,
aquafx,
jfxtras,
org.conqat.ide.commons.gef,
org.conqat.ide.commons.gef.directediting,
org.conqat.ide.commons.gef.draw2d,
org.conqat.ide.commons.gef.editor,
......@@ -69,6 +74,27 @@ Export-Package: org.conqat.ide.commons.gef,
org.eclipse.gmf.runtime.draw2d.ui.figures,
org.eclipse.gmf.runtime.draw2d.ui.geometry,
org.eclipse.jface.viewers,
org.eclipse.systemfocus.internal.kernel.common;x-internal:=true,
org.eclipse.systemfocus.internal.kernel.common.ui;x-internal:=true,
org.eclipse.systemfocus.kernel.common.ui.javafx.control.treetableview,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.change,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.base,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.elliptic,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.rectangular,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.layout,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.impl,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.base,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.elliptic,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.rectangular,
org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.widgets,
org.eclipse.systemfocus.kernel.common.ui.javafx.mesh,
org.eclipse.systemfocus.kernel.common.ui.javafx.style,
org.eclipse.systemfocus.kernel.common.ui.javafx.util,
org.eclipse.ui.actions,
org.eclipse.wb.swt,
org.eclipse.wb.swt.layout.grouplayout,
......
......@@ -5,7 +5,9 @@ bin.includes = .,\
lib/org.conqat.ide.commons.gef.jar,\
lib/org.conqat.ide.commons.ui.jar,\
lib/swt-grouplayout.jar,\
res/
res/,\
lib/org.eclipse.systemfocus.kernel.common_0.0.3.201909091119.jar,\
lib/org.eclipse.systemfocus.kernel.common.ui_0.0.3.201909091119.jar
jars.compile.order = .
source.. = src/,\
res/,\
......
......@@ -5,7 +5,9 @@ EObjectActionBase.java 4ef9f8be59e64d4838acc9e268d418ba5d94fa1a GREEN
EReferenceListPropertySectionBase.java 7390dd7bfdc979e8ff0c5c30c67ab7b6c9d70c92 GREEN
EReferencePropertySectionBase.java 0548da6778516003257f59d0b4c2b60d458be3b6 GREEN
EditorBase.java 9c09fff92945256bb8680992ae7bb2c78f47b150 GREEN
FXEditorBase.java 2e520be0bbae7d0aebdff70218a124dbe0896ce2 YELLOW
IListPropertySection.java 8bb00fe7959583e794ff9437b7a77404c9a9e70f GREEN
LWFXEFEditorBase.java deabdd92833c75ffcc43bcc5eab05c4d74164b6d YELLOW
ModelEditorBindingBase.java 4c5ac569c0b6e7678fc8191096b26dfd09fdcb98 GREEN
ModelElementHandlerBase.java 384727748f125c9d43f19d9c0eba4ba1be5a7a26 GREEN
MultiEObjectActionBase.java 9e237d8ea640c4194e4877af4a9cfce88698e543 GREEN
......
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.extension.base;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import javafx.embed.swt.FXCanvas;
import javafx.scene.Parent;
import javafx.scene.Scene;
/**
* Base implementation of model element editors which are using JavaFX.
*
* @author hoelzlf
*/
public abstract class FXEditorBase<T extends EObject> extends EditorBase<T> {
/** {@inheritDoc} */
@Override
public final void createPartControl(Composite parent) {
FXCanvas canvas = new FXCanvas(parent, SWT.NONE);
Scene scene = new Scene(createSceneRoot());
canvas.setScene(scene);
}
/** Creates the root node of the scene. */
protected abstract Parent createSceneRoot();
}
/*-------------------------------------------------------------------------+
| Copyright 2019 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.extension.base;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewer;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IControllerFactory;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelFactory;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.IVisualFactory;
import javafx.scene.Parent;
/**
* Base implementation of model element editors which are using LWFXEF DiaViewer.
*
* @author hoelzlf
*/
public abstract class LWFXEFEditorBase<T extends EObject> extends FXEditorBase<T> {
/** The diagram viewer. */
protected DiagramViewer viewer;
/** {@inheritDoc} */
@Override
protected final Parent createSceneRoot() {
viewer = new DiagramViewer(createModelFactory(), createVisualFactory(),
createControllerFactory(), cb -> {
modelSelected(cb);
});
return viewer.getVisualNode();
}
/** Create the {@link IModelFactory}. */
protected abstract IModelFactory createModelFactory();
/** Create the {@link IVisualFactory}. */
protected abstract IVisualFactory createVisualFactory();
/** Create the {@link IControllerFactory}. */
protected abstract IControllerFactory createControllerFactory();
/** Called when a model element is selected in the diagram viewer. */
protected abstract void modelSelected(Object model);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment