Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2016-09-16 14:48:32 +0000
committerJuergen Haug2016-09-16 16:51:56 +0000
commitf6349a1e5dab3f360aa1d5f9de7b3de0ca4bd705 (patch)
tree4083c08cd4cf930ac2eb818b50628b4bffa345cc /plugins/org.eclipse.etrice.ui.common.base
parenta6aac19132242eabbd67aff372bbf55c6fce0694 (diff)
downloadorg.eclipse.etrice-f6349a1e5dab3f360aa1d5f9de7b3de0ca4bd705.tar.gz
org.eclipse.etrice-f6349a1e5dab3f360aa1d5f9de7b3de0ca4bd705.tar.xz
org.eclipse.etrice-f6349a1e5dab3f360aa1d5f9de7b3de0ca4bd705.zip
[ui.behavior] fixed inheritance computation + fixed inherited
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/support/RemoveBendpointsFeature.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/RemoveBendpointsFeature.java b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/RemoveBendpointsFeature.java
index cf50e80bd..214c87242 100644
--- a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/RemoveBendpointsFeature.java
+++ b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/RemoveBendpointsFeature.java
@@ -13,6 +13,7 @@
package org.eclipse.etrice.ui.common.base.support;
import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.features.context.IContext;
import org.eclipse.graphiti.features.context.ICustomContext;
import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
@@ -40,14 +41,22 @@ public class RemoveBendpointsFeature extends AbstractCustomFeature {
public String getDescription() {
return "remove all bend points of the selected connection(s)";
}
-
- public boolean canExecute(ICustomContext context) {
- return true;
+
+ @Override
+ public boolean isAvailable(IContext context) {
+ if(!(context instanceof ICustomContext))
+ return false;
+
+ boolean allFreeForm = true;
+ PictogramElement[] pes = ((ICustomContext)context).getPictogramElements();
+ for (PictogramElement pe : pes) {
+ if (!(pe instanceof FreeFormConnection))
+ allFreeForm = false;
+ }
+
+ return allFreeForm;
}
- /* (non-Javadoc)
- * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
- */
@Override
public void execute(ICustomContext context) {
for (PictogramElement pe : context.getPictogramElements()) {

Back to the top