Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmallet2017-04-20 15:26:43 +0000
committerPierre-Charles David2017-04-24 13:32:44 +0000
commit28c0e2b00b06e6f69c94eb21d7fafa50a0dc4bc6 (patch)
tree97cfb48561fd4d2ad51dcab7aa6f7a7f16b8e95c
parente43c85067b1160040636481c40480e9cb1b971be (diff)
downloadorg.eclipse.sirius-28c0e2b00b06e6f69c94eb21d7fafa50a0dc4bc6.tar.gz
org.eclipse.sirius-28c0e2b00b06e6f69c94eb21d7fafa50a0dc4bc6.tar.xz
org.eclipse.sirius-28c0e2b00b06e6f69c94eb21d7fafa50a0dc4bc6.zip
[442150] Provide expand/collapse actions in VSM editor.
- Addition of expand/collapse action in VSM toolbar in order to discover or not all VSM elements. - update VSM documentation Bug: 442150 Change-Id: If81149e4e755d953ce4d19417dfa20829c8071ed Signed-off-by: jmallet <jessy.mallet@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html15
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.textile2
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/specifier/general/images/specifier-guide/collapseall.pngbin0 -> 245 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/specifier/general/images/specifier-guide/expandall.pngbin0 -> 255 bytes
-rw-r--r--plugins/org.eclipse.sirius.editor/icons/full/collapseall.gifbin0 -> 157 bytes
-rw-r--r--plugins/org.eclipse.sirius.editor/icons/full/expandall.gifbin0 -> 165 bytes
-rw-r--r--plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/CustomSiriusEditor.java61
7 files changed, 70 insertions, 8 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html
index 4730e78bb5..81cea078c2 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html
@@ -2,9 +2,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title>Specifying_Viewpoints</title>
- <link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
- <link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
</head>
<body>
<h1 id="SpecifyingViewpoints">Specifying Viewpoints</h1>
@@ -160,7 +157,7 @@
<code>description</code> folder. If you want to place them in a different location, make sure to add this location into the plug-in&#8217;s
<code>build.properties</code> so that it is included in the deployed version.
</p>
- <p>The VSM name is given according to the project name defined when using the previous wizard. If the project name is suffixed with &#8220;design&#8221;, the VSM name is provided by the last word before this suffix. Otherwise, the VSM name is given by the last word of the project name.</p>
+ <p>The VSM name is given according to the project name defined when using the previous wizard. If the project name is suffixed with &#171;design&#187;, the VSM name is provided by the last word before this suffix. Otherwise, the VSM name is given by the last word of the project name.</p>
<p>Other than that, the project is a normal Java plug-in project. You can add
<a href="Writing_Queries.html#service_methods">service classes</a> into it if the query language you use support it, and any other Java code, including Eclipse views, actions, etc.
</p>
@@ -243,6 +240,10 @@
<a href="Writing_Queries.html#acceleo">use Acceleo 3 to write your expressions</a>, you can also use these elements to declare Acceleo modules in the project that define MTL queries you want to use in your expressions.
</li>
</ul>
+ <p>To discover all elements in the
+ <em>VSM</em>, it is possible to use the button <img src="images/specifier-guide/expandall.png" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/>, at the top right corner of the editor to expand the
+ <em>VSM</em> tree. Obviously, it is possible to collapse this tree by using the button <img src="images/specifier-guide/collapseall.png" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/>, at the top right corner of the editor.
+ </p>
<h3 id="common_attributes">Common attributes</h3>
<p>Many of the elements used to specify viewpoint share some common configuration attributes. They are described in general terms in this section, and referenced from the specific element&#8217;s sections which used them (sometimes with additional details only relevant for this element).</p>
<p><img src="images/common_attributes.png" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/></p>
@@ -320,7 +321,7 @@
<p>
<img border="0" src="images/interpreted_expressions.png"/>
</p>
- <p>Also, by clicking on the button next to the text field, you can open a dialog with a bigger text area (providing auto-completion too) to type your expression more comfortably. Note that you can add line feeds or tabulations if you want, since they are removed when clicking on the &#8220;OK&#8221; button.</p>
+ <p>Also, by clicking on the button next to the text field, you can open a dialog with a bigger text area (providing auto-completion too) to type your expression more comfortably. Note that you can add line feeds or tabulations if you want, since they are removed when clicking on the &#171;OK&#187; button.</p>
<p>
<img border="0" src="images/textAreaDialog.png"/>
</p>
@@ -454,7 +455,7 @@
<p>To validate your VSM, open your
<code>odesign</code> file, right-click on the top-level
<em>Group</em> element and select
- <em>Viewpoint specification Editor &gt; Validate</em>. A dialog Box will appear and indicate if the validation succeeded. If not, it will give you details about the detected problems (click on the &#8216;details&#8217; button of the dialog box). If problems are detected, they will also be added to the Eclipse
+ <em>Viewpoint specification Editor &gt; Validate</em>. A dialog Box will appear and indicate if the validation succeeded. If not, it will give you details about the detected problems (click on the &#8249;details&#8250; button of the dialog box). If problems are detected, they will also be added to the Eclipse
<em>Problems</em> view. Double-clicking on one of these problems will select the concerned element in the
<a href="../../Glossary.html#VSM">
<em>Viewpoint Specification Model</em>
@@ -476,7 +477,7 @@
</p>
<p>Keep both your representations and the VSM that define them open at the same time. Whenever you change some definition or add new elements into your VSM, simply save it. Sirius will automatically detect the change, reload the new definition and apply it to your existing representations. This way you can develop your representations iteratively, for example starting from an empty diagram and adding more elements, styles and tools while and testing them immediately.</p>
<p><div style="display: none">
- <br/> TODO Add a screenshot with both a VSM (on the left) and the corresponding diagram (on the right) opened at the same time. Make sure the &#8220;Model Explorer&#8221; is also visible to show both the VSP and the Modeling project they correspond to.
+ <br/> TODO Add a screenshot with both a VSM (on the left) and the corresponding diagram (on the right) opened at the same time. Make sure the &#171;Model Explorer&#187; is also visible to show both the VSP and the Modeling project they correspond to.
<br/></div>
</p>
<p>Note that Sirius does its best to take into account any change in the VSM, even for existing and opened representations. Sometimes, if the changes are too complex or in some corner cases not yet supported, you may need to close and reopen your representation, or in extreme case delete it and create a new one, in order to take the VSM changes into account properly.</p>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.textile b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.textile
index 5c4f0c760c..7da06975c9 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.textile
@@ -71,6 +71,8 @@ Inside a _Viewpoint_ element, you can create:
* "_Validation Rules_":../diagrams/Diagrams.html#validation, which will apply to all representations defined inside this viewpoint.
* And finally _Java Extensions_. These refer (through its fully qualified name), to a Java class defined in the _Viewpoint Specification Project_ which defines "service methods":Writing_Queries.html#service_methods and make these services available inside all the representations defined in the viewpoint. If you "use Acceleo 3 to write your expressions":Writing_Queries.html#acceleo, you can also use these elements to declare Acceleo modules in the project that define MTL queries you want to use in your expressions.
+To discover all elements in the _VSM_, it is possible to use the button <img src="images/specifier-guide/expandall.png" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/>, at the top right corner of the editor to expand the _VSM_ tree. Obviously, it is possible to collapse this tree by using the button <img src="images/specifier-guide/collapseall.png" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/>, at the top right corner of the editor.
+
h3(#common_attributes). Common attributes
Many of the elements used to specify viewpoint share some common configuration attributes. They are described in general terms in this section, and referenced from the specific element's sections which used them (sometimes with additional details only relevant for this element).
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/specifier-guide/collapseall.png b/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/specifier-guide/collapseall.png
new file mode 100644
index 0000000000..fa9b646640
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/specifier-guide/collapseall.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/specifier-guide/expandall.png b/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/specifier-guide/expandall.png
new file mode 100644
index 0000000000..6687a955c3
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/specifier-guide/expandall.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.editor/icons/full/collapseall.gif b/plugins/org.eclipse.sirius.editor/icons/full/collapseall.gif
new file mode 100644
index 0000000000..dc923f5e82
--- /dev/null
+++ b/plugins/org.eclipse.sirius.editor/icons/full/collapseall.gif
Binary files differ
diff --git a/plugins/org.eclipse.sirius.editor/icons/full/expandall.gif b/plugins/org.eclipse.sirius.editor/icons/full/expandall.gif
new file mode 100644
index 0000000000..c4a67bb21f
--- /dev/null
+++ b/plugins/org.eclipse.sirius.editor/icons/full/expandall.gif
Binary files differ
diff --git a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/CustomSiriusEditor.java b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/CustomSiriusEditor.java
index ee4458464c..dd49d16159 100644
--- a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/CustomSiriusEditor.java
+++ b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/CustomSiriusEditor.java
@@ -35,12 +35,15 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -80,6 +83,7 @@ import org.eclipse.ui.IPathEditorInput;
import org.eclipse.ui.IURIEditorInput;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.contexts.IContextService;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Version;
import com.google.common.base.Predicate;
@@ -98,6 +102,10 @@ public class CustomSiriusEditor extends SiriusEditor implements IEObjectNavigabl
*/
public static final String CONTEXT_ID = "org.eclipse.sirius.editor.siriusEditorContext"; //$NON-NLS-1$
+ private static final ImageDescriptor EXPAND_IMAGE_DESCRIPTOR = AbstractUIPlugin.imageDescriptorFromPlugin(SiriusEditorPlugin.PLUGIN_ID, "icons/full/expandall.gif");
+
+ private static final ImageDescriptor COLLAPSE_IMAGE_DESCRIPTOR = AbstractUIPlugin.imageDescriptorFromPlugin(SiriusEditorPlugin.PLUGIN_ID, "icons/full/collapseall.gif");
+
private final RepresentationTemplateUpdateTrigger templateUpdateTrigger = new RepresentationTemplateUpdateTrigger();
private final ViewpointURIHandler vsmURIHandler;
@@ -273,12 +281,63 @@ public class CustomSiriusEditor extends SiriusEditor implements IEObjectNavigabl
revealRepresentationDescriptions();
final ToolBarManager tbm = getToolBarManager();
- tbm.add(new ValidateAction(selectionViewer, this));
+ addTooBarActions(tbm);
tbm.update(true);
}
editingDomain.getResourceSet().eAdapters().add(templateUpdateTrigger);
}
+ private void addTooBarActions(final ToolBarManager tbm) {
+ // Expand All
+ tbm.add(new Action() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return EXPAND_IMAGE_DESCRIPTOR;
+ }
+
+ @Override
+ public String getToolTipText() {
+ return "Expand All";
+ }
+
+ @Override
+ public void run() {
+ try {
+ selectionViewer.getControl().setRedraw(false);
+ selectionViewer.expandAll();
+ } finally {
+ selectionViewer.getControl().setRedraw(true);
+ }
+
+ }
+ });
+ // Collapse All
+ tbm.add(new Action() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return COLLAPSE_IMAGE_DESCRIPTOR;
+ }
+
+ @Override
+ public String getToolTipText() {
+ return "Collapse All";
+ }
+
+ @Override
+ public void run() {
+ try {
+ selectionViewer.getControl().setRedraw(false);
+ selectionViewer.collapseToLevel(selectionViewer.getInput(), AbstractTreeViewer.ALL_LEVELS);
+ } finally {
+ selectionViewer.getControl().setRedraw(true);
+ }
+
+ }
+ });
+ // Validate
+ tbm.add(new ValidateAction(selectionViewer, this));
+ }
+
/**
* Auto-expand just enough to make the representation descriptions initially visible, but nothing else. They are the
* main point of focus of the specifier.

Back to the top