Commit a959a528 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

JFX Platform editors: Fix bindings & editor naming

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

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent afe0e4f2
......@@ -67,7 +67,7 @@
<!--======================-->
<extension point="org.fortiss.tooling.kernel.ui.modelEditorBinding">
<modelEditorBinding
binding="org.fortiss.af3.platform.hierarchic.ui.editor.fx.PlatformArchitectureFXEditor">
binding="org.fortiss.af3.platform.hierarchic.ui.editor.fx.PlatformArchitectureFXEditorBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.platform.model.PlatformArchitecture"></modelElementClass>
</modelEditorBinding>
......
PlatformArchitectureControllerFactory.java c49e4fb96ca1cbb796163cf0dcd6da97b650c13b YELLOW
PlatformArchitectureFXEditor.java e5596e3c2f94bfc7a7461e22206fe97640ff6d2b YELLOW
PlatformArchitectureFXEditorBinding.java 5937356c5bffb7089a20392fe146cfe1159c3d84 YELLOW
PlatformArchitectureFXEditorBinding.java a0d5fae2d2e375ec1c4daf9431a5068fc737f1dc YELLOW
PlatformComponentControllerFactory.java b9e09906c0d5428d507d3affd879f30d9ed7d697 YELLOW
PlatformComponentFXEditor.java 579bda140d6d490e40c49386957bf63af345f373 YELLOW
PlatformComponentFXEditorBinding.java 8f60633fa717afbb80e0f3b672a6de83042c85e1 RED
PlatformComponentFXEditorBinding.java 5bf6f07c6661f05817870d1fb3cfb5139e4d6cb1 YELLOW
PlatformComponentModelFactory.java c834311e842c9e7638e70dac6d095ce0c7595637 YELLOW
PlatformComponentVisualFactory.java 716c16155a90740e7ed9e28100a2814dc151b46d YELLOW
/*-------------------------------------------------------------------------+
| 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.af3.platform.hierarchic.ui.editor.fx;
import org.fortiss.af3.platform.hierarchic.compose.HierarchicalCompositionRules;
import org.fortiss.af3.platform.hierarchic.compose.base.IArchitectureDomainDependant;
import org.fortiss.af3.platform.hierarchic.compose.base.IPlatformHierarchicalCompositionRules;
import org.fortiss.af3.platform.model.IArchitectureDomain;
import org.fortiss.af3.platform.model.IPlatformDomain;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.tooling.kernel.ui.extension.base.LWFXEFEditorBase;
/**
* Editor for the top-most layer of hierarchical {@link PlatformArchitecture}s.
*
* @author diewald
*/
final class PlatformArchitectureFXEditor extends LWFXEFEditorBase<PlatformArchitecture>
implements IArchitectureDomainDependant {
/** {@inheritDoc} */
@Override
public IPlatformHierarchicalCompositionRules getPlatformCompositionRules() {
return HierarchicalCompositionRules.INSTANCE;
}
/** {@inheritDoc} */
@Override
public Class<? extends IArchitectureDomain> getArchitectureDomain() {
return IPlatformDomain.class;
}
}
......@@ -15,30 +15,26 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.ui.editor.fx;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getInterfaceType;
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 org.eclipse.ui.IEditorPart;
import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.ui.editor.fx.PlatformArchitectureFXEditor;
import org.fortiss.tooling.kernel.ui.extension.IModelEditorBinding;
import org.fortiss.tooling.kernel.ui.extension.base.ModelEditorBindingBase;
import com.google.common.reflect.TypeToken;
/**
* Generic {@link IModelEditorBinding} for the multiple layers of hierarchical
* {@link PlatformArchitecture}s.
*
* @author diewald
*/
public class PlatformArchitectureFXEditorBinding<T extends IPlatformArchitectureElement>
public class PlatformArchitectureFXEditorBinding<T extends PlatformArchitecture>
extends ModelEditorBindingBase<T> {
/** Token of the generic parameter defining the type of the edited element. */
TypeToken<T> token = new TypeToken<>(getClass()) { /**/
};
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass() {
......@@ -65,13 +61,13 @@ public class PlatformArchitectureFXEditorBinding<T extends IPlatformArchitecture
/** {@inheritDoc} */
@Override
public String getLabel() {
return token.getRawType().getSimpleName() + " Structure (FX)";
public String getLabel(T object) {
return getInterfaceType(object).getSimpleName() + " Structure (FX)";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return -100;
return -101;
}
}
......@@ -15,6 +15,8 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.ui.editor.fx;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getInterfaceType;
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;
......@@ -65,14 +67,13 @@ public class PlatformComponentFXEditorBinding<T extends IPlatformArchitectureEle
/** {@inheritDoc} */
@Override
// TODO(AD): This does not correctly name the editor as of now...
public String getLabel() {
return token.getRawType().getSimpleName() + " Structure (FX)";
public String getLabel(T object) {
return getInterfaceType(object).getSimpleName() + " Structure (FX)";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return -100;
return -101;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment