Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2015-07-02 18:34:14 +0000
committerJuergen Haug2015-07-03 14:31:00 +0000
commitf15fa71ce444ed9a5bf7d36c2f0926a05b90e70a (patch)
tree214deb430b7c084ba5ededbf2db0883e5de37752 /plugins/org.eclipse.etrice.ui.common.base
parentf7439c472f9d6a309af4a2a6d6628a21a2ad8b76 (diff)
downloadorg.eclipse.etrice-f15fa71ce444ed9a5bf7d36c2f0926a05b90e70a.tar.gz
org.eclipse.etrice-f15fa71ce444ed9a5bf7d36c2f0926a05b90e70a.tar.xz
org.eclipse.etrice-f15fa71ce444ed9a5bf7d36c2f0926a05b90e70a.zip
[doc] refactoring, removed generated files + pdf, more content
Diffstat (limited to 'plugins/org.eclipse.etrice.ui.common.base')
-rw-r--r--plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java2
-rw-r--r--plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/SelectedModelHelpProvider.java21
-rw-r--r--plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java9
3 files changed, 20 insertions, 12 deletions
diff --git a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java
index fb1a184f8..e9077eeff 100644
--- a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java
+++ b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java
@@ -370,7 +370,7 @@ public abstract class DiagramEditorBase extends DiagramEditor implements IInputU
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
if (key.equals(IContextProvider.class)) {
- return new SelectedModelHelpProvider(getDiagramBehavior());
+ return new SelectedModelHelpProvider(this);
}
return super.getAdapter(key);
diff --git a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/SelectedModelHelpProvider.java b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/SelectedModelHelpProvider.java
index 5ac171f9d..9f157f4ae 100644
--- a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/SelectedModelHelpProvider.java
+++ b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/SelectedModelHelpProvider.java
@@ -16,17 +16,16 @@ import org.eclipse.etrice.doc.ContextHelpProvider;
import org.eclipse.etrice.ui.common.base.support.HelpFeature;
import org.eclipse.graphiti.features.context.ICustomContext;
import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.help.HelpSystem;
import org.eclipse.help.IContext;
import org.eclipse.help.IContextProvider;
public class SelectedModelHelpProvider implements IContextProvider {
- private DiagramBehavior diagramBehavior;
+ private DiagramEditorBase diagramEditor;
- public SelectedModelHelpProvider(DiagramBehavior diagramBehavior) {
- this.diagramBehavior = diagramBehavior;
+ public SelectedModelHelpProvider(DiagramEditorBase diagramEditor) {
+ this.diagramEditor = diagramEditor;
}
@Override
@@ -36,13 +35,17 @@ public class SelectedModelHelpProvider implements IContextProvider {
@Override
public IContext getContext(Object target) {
- HelpFeature help = new HelpFeature(diagramBehavior.getDiagramTypeProvider().getFeatureProvider());
- ICustomContext context = new CustomContext(diagramBehavior.getSelectedPictogramElements());
- String featureId = help.getFeatureId(context);
+ HelpFeature helpFeature = new HelpFeature(diagramEditor.getDiagramTypeProvider().getFeatureProvider());
+ ICustomContext featureContext = new CustomContext(diagramEditor.getSelectedPictogramElements());
+ String featureId = helpFeature.getFeatureId(featureContext);
+
+ IContext context = null;
if (featureId != null)
- return HelpSystem.getContext(ContextHelpProvider.getContextId(featureId));
+ context = HelpSystem.getContext(ContextHelpProvider.getContextId(featureId));
+ if (context == null)
+ context = HelpSystem.getContext(ContextHelpProvider.getContextId(diagramEditor.getClass().getSimpleName()));
- return null;
+ return context;
}
@Override
diff --git a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java
index fb3db9df6..02918d8e8 100644
--- a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java
+++ b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java
@@ -37,8 +37,13 @@ public class HelpFeature extends AbstractCustomFeature {
public String getFeatureId(ICustomContext context) {
if (context instanceof ICustomContext) {
ICustomContext peContext = (ICustomContext) context;
- if (peContext.getPictogramElements() != null && peContext.getPictogramElements().length == 1)
- return getBoClassName(peContext.getPictogramElements()[0]);
+ if (peContext.getPictogramElements() != null && peContext.getPictogramElements().length == 1){
+ PictogramElement pe = peContext.getPictogramElements()[0];
+ // don't show help for diagram input
+ if(getBusinessObjectForPictogramElement(pe) == getBusinessObjectForPictogramElement(getDiagram()))
+ return null;
+ return getBoClassName(pe);
+ }
}
return null;

Back to the top