Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2013-12-04 07:10:33 -0500
committerCamille Letavernier2013-12-04 07:10:33 -0500
commit9e5a1e17be7ac080130a2bba5aff62bf6b18ffda (patch)
treebfaad9b4e712113720a746164eb130ee56b75f0d /plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties
parent9e4aeb2c15eb24b47b3c372fc7aadeddac3c46bb (diff)
downloadorg.eclipse.papyrus-9e5a1e17be7ac080130a2bba5aff62bf6b18ffda.tar.gz
org.eclipse.papyrus-9e5a1e17be7ac080130a2bba5aff62bf6b18ffda.tar.xz
org.eclipse.papyrus-9e5a1e17be7ac080130a2bba5aff62bf6b18ffda.zip
370797: [Theme] Papyrus should provide a support for CSS files on its
diagrams https://bugs.eclipse.org/bugs/show_bug.cgi?id=370797 Fix the reset style handler
Diffstat (limited to 'plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/MultipleStylableElement.xwt2
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleDiagram.xwt2
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleStylableElement.xwt2
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java30
4 files changed, 19 insertions, 17 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/MultipleStylableElement.xwt b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/MultipleStylableElement.xwt
index f4d2cf428bf..208f3a1d236 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/MultipleStylableElement.xwt
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/MultipleStylableElement.xwt
@@ -8,5 +8,5 @@
<Composite.layout>
<GridLayout numColumns="1"></GridLayout>
</Composite.layout>
- <css:ResetStyleWidget></css:ResetStyleWidget>
+ <css:ResetStyleWidget input="{Binding}"></css:ResetStyleWidget>
</Composite> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleDiagram.xwt b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleDiagram.xwt
index 36e0cdb35e2..64704634d72 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleDiagram.xwt
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleDiagram.xwt
@@ -18,7 +18,7 @@
<Composite.layout>
<GridLayout></GridLayout>
</Composite.layout>
- <css:ResetStyleWidget></css:ResetStyleWidget>
+ <css:ResetStyleWidget input="{Binding}"></css:ResetStyleWidget>
</Composite>
<Composite>
<Composite.layout>
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleStylableElement.xwt b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleStylableElement.xwt
index d993f070dd5..b4b4f789285 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleStylableElement.xwt
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleStylableElement.xwt
@@ -11,7 +11,7 @@
<Composite.layout>
<GridLayout></GridLayout>
</Composite.layout>
- <css:ResetStyleWidget></css:ResetStyleWidget>
+ <css:ResetStyleWidget input="{Binding}"></css:ResetStyleWidget>
</Composite>
<Composite>
<Composite.layout>
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java
index d514aa3b5d6..470316e7202 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java
@@ -11,12 +11,9 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.properties.widgets;
-import java.util.HashMap;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.papyrus.infra.gmfdiag.css.handler.ResetStyleHandler;
-import org.eclipse.papyrus.infra.gmfdiag.css.properties.Activator;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.ResetStyleHelper;
+import org.eclipse.papyrus.views.properties.modelelement.DataSource;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -28,6 +25,8 @@ public class ResetStyleWidget implements SelectionListener {
private Button button;
+ private DataSource input;
+
public ResetStyleWidget(Composite parent, int style) {
button = new Button(parent, SWT.PUSH);
button.addSelectionListener(this);
@@ -36,17 +35,12 @@ public class ResetStyleWidget implements SelectionListener {
}
public void widgetSelected(SelectionEvent event) {
- if(event.widget != button) {
+ if(event.widget != button || input == null) {
return;
}
- ResetStyleHandler handler = new ResetStyleHandler();
- try {
- //FIXME: The ExecutionEvent needs the EclipseContext
- handler.execute(new ExecutionEvent(null, new HashMap<String, String>(), event, null));
- } catch (ExecutionException ex) {
- Activator.log.error(ex);
- }
+ IStructuredSelection viewSelection = input.getSelection();
+ ResetStyleHelper.resetStyle(viewSelection);
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -68,4 +62,12 @@ public class ResetStyleWidget implements SelectionListener {
public String getToolTipText() {
return button.getToolTipText();
}
+
+ public void setInput(DataSource input) {
+ this.input = input;
+ }
+
+ public DataSource getInput() {
+ return input;
+ }
}

Back to the top