Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2017-02-28 12:19:46 +0000
committerGerrit Code Review @ Eclipse.org2017-03-03 14:59:36 +0000
commitedded3048c754e466504cc8ebcc0a6e68a053791 (patch)
tree67238c9542bb7196e9631601a3b03abd050249f3 /plugins/infra/ui
parent6adfa6c5368f18f28943db46486c892e276dd0cb (diff)
downloadorg.eclipse.papyrus-edded3048c754e466504cc8ebcc0a6e68a053791.tar.gz
org.eclipse.papyrus-edded3048c754e466504cc8ebcc0a6e68a053791.tar.xz
org.eclipse.papyrus-edded3048c754e466504cc8ebcc0a6e68a053791.zip
Bug 512748 - OperationCanceledException in NestingNotifyingWorkspaceCommandStack.handleError
- Capture OperationCanceledException in ReferenceDialog and MultipleValueEditor - Correct method name (was partly in french): API break, but major revision number has changed
Diffstat (limited to 'plugins/infra/ui')
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java32
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java21
2 files changed, 31 insertions, 22 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
index 575b9038a5e..04115a8c099 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
@@ -275,7 +275,7 @@ public class MultipleValueEditor<T extends IElementSelector> extends AbstractLis
}
}
- updateBoutons();
+ updateButtons();
}
@@ -405,20 +405,24 @@ public class MultipleValueEditor<T extends IElementSelector> extends AbstractLis
if (e.widget == null) {
return;
}
- if (e.widget == add) {
- if (this.upperBound == MANY || modelProperty.size() < this.upperBound) {
- addAction();
+ try {
+ if (e.widget == add) {
+ if (this.upperBound == MANY || modelProperty.size() < this.upperBound) {
+ addAction();
+ }
+ } else if (e.widget == remove) {
+ removeAction();
+ } else if (e.widget == up) {
+ upAction();
+ } else if (e.widget == down) {
+ downAction();
+ } else if (e.widget == edit) {
+ editAction();
}
- } else if (e.widget == remove) {
- removeAction();
- } else if (e.widget == up) {
- upAction();
- } else if (e.widget == down) {
- downAction();
- } else if (e.widget == edit) {
- editAction();
+ } catch (OperationCanceledException canceledException) {
+ // do nothing, this exception occurs whenever one of the actions above
+ // gets canceled
}
-
updateControls();
}
@@ -728,7 +732,7 @@ public class MultipleValueEditor<T extends IElementSelector> extends AbstractLis
this.upperBound = upperBound;
}
- public void updateBoutons() {
+ public void updateButtons() {
/* Disable the button 'add' if the upperBound is reached */
if (this.upperBound != MANY) {
if (modelProperty.size() >= this.upperBound) {
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java
index 95775b4483d..70c69048c01 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java
@@ -434,14 +434,19 @@ public class ReferenceDialog extends AbstractReferenceDialog implements Selectio
@Override
public void widgetSelected(SelectionEvent e) {
Widget widget = e.widget;
- if (widget == browseValuesButton) {
- browseAction();
- } else if (widget == createInstanceButton) {
- createAction();
- } else if (widget == editInstanceButton) {
- editAction();
- } else if (widget == unsetButton) {
- unsetAction();
+ try {
+ if (widget == browseValuesButton) {
+ browseAction();
+ } else if (widget == createInstanceButton) {
+ createAction();
+ } else if (widget == editInstanceButton) {
+ editAction();
+ } else if (widget == unsetButton) {
+ unsetAction();
+ }
+ } catch (OperationCanceledException canceledException) {
+ // do nothing, this exception occurs whenever one of the actions above
+ // gets canceled
}
}

Back to the top