Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrodt2014-08-05 08:33:24 -0400
committerrbrodt2014-08-05 08:33:24 -0400
commit3415b8cea5804c0558924f337a373e1c8bfd9c0d (patch)
treec72344655e9accb3a51b93059feacdbd9071346e
parentcd1f27c49e320120025d6b16f14a33dacd684514 (diff)
downloadorg.eclipse.bpmn2-modeler-3415b8cea5804c0558924f337a373e1c8bfd9c0d.tar.gz
org.eclipse.bpmn2-modeler-3415b8cea5804c0558924f337a373e1c8bfd9c0d.tar.xz
org.eclipse.bpmn2-modeler-3415b8cea5804c0558924f337a373e1c8bfd9c0d.zip
Added feature to show/hide specific elements.
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java10
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java4
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java29
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/SequenceFlowFeatureContainer.java2
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/Messages.java8
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/messages.properties8
6 files changed, 60 insertions, 1 deletions
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java
index e08b5413..78427f24 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/AnchorUtil.java
@@ -184,6 +184,16 @@ public class AnchorUtil {
}
return result;
}
+
+ public static int countAnchors(AnchorContainer ac, AnchorSite site) {
+ int count = 0;
+ for (Anchor anchor : ac.getAnchors()) {
+ if (peService.getPropertyValue(anchor, GraphitiConstants.ANCHOR_TYPE)!=null &&
+ AnchorSite.getSite((FixPointAnchor)anchor)==site)
+ ++count;
+ }
+ return count;
+ }
public static void moveAnchor(FixPointAnchor anchor, int x, int y) {
moveAnchor(anchor, GraphicsUtil.createPoint(x,y));
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java
index 4bb5b565..9f9b5ebe 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorDiagramBehavior.java
@@ -93,6 +93,10 @@ public class BPMN2EditorDiagramBehavior extends DiagramBehavior {
action = getDiagramContainer().getActionRegistry().getAction("show.property.view"); //$NON-NLS-1$
action.setText(action.getText());
manager.add(action);
+
+ action = getDiagramContainer().getActionRegistry().getAction("show.hide.elements"); //$NON-NLS-1$
+ action.setText(action.getText());
+ manager.add(action);
}
};
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java
index 0099e701..a02960e9 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DesignEditor.java
@@ -30,6 +30,7 @@ import org.eclipse.bpmn2.modeler.core.di.DIUtils;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
import org.eclipse.bpmn2.modeler.ui.Activator;
+import org.eclipse.bpmn2.modeler.ui.property.dialogs.ShowHideElementsDialog;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.URI;
@@ -50,6 +51,7 @@ import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
@@ -461,6 +463,33 @@ public class DesignEditor extends BPMN2Editor {
}
};
registry.registerAction(action);
+
+ action = new WorkbenchPartAction(multipageEditor.getDesignEditor()) {
+
+ @Override
+ protected void init() {
+ super.init();
+ setId("show.hide.elements"); //$NON-NLS-1$
+ }
+
+ @Override
+ public String getText() {
+ return "Show or Hide Elements...";
+ }
+
+ @Override
+ protected boolean calculateEnabled() {
+ return true;
+ }
+
+ public void run() {
+ ShowHideElementsDialog dialog = new ShowHideElementsDialog(getEditorSite().getShell());
+ if (dialog.open()==Window.OK) {
+
+ }
+ }
+ };
+ registry.registerAction(action);
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/SequenceFlowFeatureContainer.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/SequenceFlowFeatureContainer.java
index 139ce5c6..00ef2030 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/SequenceFlowFeatureContainer.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/SequenceFlowFeatureContainer.java
@@ -115,7 +115,7 @@ public class SequenceFlowFeatureContainer extends BaseElementConnectionFeatureCo
return null;
}
- public class AddSequenceFlowFeature extends AbstractAddFlowFeature<SequenceFlow> {
+ public static class AddSequenceFlowFeature extends AbstractAddFlowFeature<SequenceFlow> {
public AddSequenceFlowFeature(IFeatureProvider fp) {
super(fp);
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/Messages.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/Messages.java
index b9bc0159..27d376bf 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/Messages.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/Messages.java
@@ -26,6 +26,14 @@ public class Messages extends NLS {
public static String SchemaSelectionDialog_Loaded;
public static String SchemaSelectionDialog_Structure;
public static String SchemaSelectionDialog_TItle;
+ public static String ShowHideElementsDialog_Event_Labels;
+ public static String ShowHideElementsDialog_Gateway_Labels;
+ public static String ShowHideElementsDialog_Message_Flows;
+ public static String ShowHideElementsDialog_Message_Icons;
+ public static String ShowHideElementsDialog_Message_Labels;
+ public static String ShowHideElementsDialog_SequenceFlow_Labels;
+ public static String ShowHideElementsDialog_Prompt;
+ public static String ShowHideElementsDialog_Title;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/messages.properties b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/messages.properties
index 30fe2fe8..43d3c1fa 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/messages.properties
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/dialogs/messages.properties
@@ -20,3 +20,11 @@ SchemaSelectionDialog_Imports=Imports
SchemaSelectionDialog_Loaded=Loaded {0}
SchemaSelectionDialog_Structure=Structure
SchemaSelectionDialog_TItle=Schema Selection
+ShowHideElementsDialog_Event_Labels=Event Labels
+ShowHideElementsDialog_Gateway_Labels=Gateway Labels
+ShowHideElementsDialog_Message_Flows=Message Flows
+ShowHideElementsDialog_Message_Icons=Message Icons
+ShowHideElementsDialog_Message_Labels=Message Labels
+ShowHideElementsDialog_SequenceFlow_Labels=Sequence Flow Labels
+ShowHideElementsDialog_Prompt=Select Elements to Hide
+ShowHideElementsDialog_Title=Show or Hide Graphical Elements

Back to the top