Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2013-11-15 13:26:02 +0000
committerCamille Letavernier2013-11-15 13:36:13 +0000
commit5398f194eb38c228cbdc477db5fca146930822f0 (patch)
treecf03dc290174cd7f8edc03e2b017837ca6844365 /plugins
parent8679ab48de78be75e277aa0c18c17ac6595e2404 (diff)
downloadorg.eclipse.papyrus-5398f194eb38c228cbdc477db5fca146930822f0.tar.gz
org.eclipse.papyrus-5398f194eb38c228cbdc477db5fca146930822f0.tar.xz
org.eclipse.papyrus-5398f194eb38c228cbdc477db5fca146930822f0.zip
420568: [All diagrams] Hard to draw nice links
https://bugs.eclipse.org/bugs/show_bug.cgi?id=420568
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/RoundedCornersStyle.xwt7
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/SingleRoutingStyle.xwt8
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java11
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerSpinner.java29
4 files changed, 45 insertions, 10 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/RoundedCornersStyle.xwt b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/RoundedCornersStyle.xwt
index 3d9ef82206f..153489f2dc3 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/RoundedCornersStyle.xwt
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/RoundedCornersStyle.xwt
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt"
- xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
- xmlns="http://www.eclipse.org/xwt/presentation"
+<Composite xmlns:j="clr-namespace:java.lang"
xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
- xmlns:j="clr-namespace:java.lang">
+ xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"
+ xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets">
<Composite.layout>
<ppel:PropertiesLayout></ppel:PropertiesLayout>
</Composite.layout>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/SingleRoutingStyle.xwt b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/SingleRoutingStyle.xwt
index 9030b0db748..35750fb13cd 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/SingleRoutingStyle.xwt
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/style/ui/SingleRoutingStyle.xwt
@@ -2,9 +2,9 @@
<Composite xmlns:j="clr-namespace:java.lang"
xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
- xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt">
+ xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation">
<Composite.layout>
- <GridLayout numColumns="2" makeColumnsEqualWidth="true"></GridLayout>
+ <GridLayout makeColumnsEqualWidth="true" numColumns="2"></GridLayout>
</Composite.layout>
<Group text="Routing">
<Group.layout>
@@ -14,7 +14,7 @@
<Group.layout>
<FillLayout></FillLayout>
</Group.layout>
- <ppe:EnumRadio numColumns="2" input="{Binding}"
+ <ppe:EnumRadio input="{Binding}" numColumns="2"
property="notation:RoutingStyle:routing" showLabel="false"></ppe:EnumRadio>
</Group>
<Composite>
@@ -26,6 +26,8 @@
property="notation:RoutingStyle:avoidObstructions"></ppe:BooleanCheckbox>
<ppe:BooleanCheckbox input="{Binding}"
property="notation:RoutingStyle:closestDistance"></ppe:BooleanCheckbox>
+ <ppe:IntegerSpinner input="{Binding}"
+ property="notation:RoundedCornersStyle:roundedBendpointsRadius"></ppe:IntegerSpinner>
</Composite>
</Group>
<Group text="Jump links">
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java
index e51f43cb1ad..88a93060f14 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java
@@ -17,6 +17,7 @@ import java.util.Set;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.constraints.Activator;
import org.eclipse.papyrus.infra.constraints.ConstraintDescriptor;
import org.eclipse.papyrus.infra.constraints.DisplayUnit;
import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
@@ -67,9 +68,15 @@ public abstract class DefaultConstraintEngine<E extends DisplayUnit> implements
}
for(Constraint c : constraints) {
- if(c.match(selection)) {
- matchedConstraints.add(c);
+ try {
+ if(c.match(selection)) {
+ matchedConstraints.add(c);
+ }
+ } catch (Throwable ex) {
+ String errorMessage = String.format("An error occurred when executing the matching constraint %s. This constraint will be ignored", c.getDescriptor().getName());
+ Activator.log.error(errorMessage, ex);
}
+
}
// String logValue;
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerSpinner.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerSpinner.java
index bc8fbf62126..e79ca707faa 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerSpinner.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerSpinner.java
@@ -14,9 +14,13 @@ package org.eclipse.papyrus.infra.widgets.editors;
import org.eclipse.core.databinding.conversion.IConverter;
import org.eclipse.core.databinding.conversion.StringToNumberConverter;
import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Spinner;
/**
@@ -26,7 +30,7 @@ import org.eclipse.swt.widgets.Spinner;
*
* @see Spinner
*/
-public class IntegerSpinner extends AbstractValueEditor {
+public class IntegerSpinner extends AbstractValueEditor implements KeyListener {
/**
* The SWT Spinner
@@ -52,6 +56,7 @@ public class IntegerSpinner extends AbstractValueEditor {
setWidgetObservable(new AbstractObservableValue() {
+ @Override
public Object getValueType() {
return Integer.class;
}
@@ -68,6 +73,9 @@ public class IntegerSpinner extends AbstractValueEditor {
});
+ spinner.addKeyListener(this);
+ setCommitOnFocusLost(spinner);
+
targetToModelConverter = StringToNumberConverter.toInteger(false);
}
@@ -85,10 +93,12 @@ public class IntegerSpinner extends AbstractValueEditor {
spinner.addFocusListener(new FocusListener() {
+ @Override
public void focusGained(FocusEvent e) {
//Nothing
}
+ @Override
public void focusLost(FocusEvent e) {
binding.updateTargetToModel();
}
@@ -155,4 +165,21 @@ public class IntegerSpinner extends AbstractValueEditor {
spinner.setIncrement(increment);
}
+ @Override
+ public void keyPressed(KeyEvent e) {
+ //Nothing
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if(e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
+ notifyChange();
+ }
+ }
+
+ protected void notifyChange() {
+ spinner.notifyListeners(SWT.FocusOut, new Event());
+ commit();
+ }
+
}

Back to the top