Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormvelten2012-04-10 13:12:12 +0000
committermvelten2012-04-10 13:12:12 +0000
commit6140a1dda1d8d1c447f5656b88facfad38be467e (patch)
treec07584e56dd98fecaf8c01a4324874eba31818a2
parent218c2e5ec4350501941e5d05d90f36a817019ff9 (diff)
downloadorg.eclipse.papyrus-6140a1dda1d8d1c447f5656b88facfad38be467e.tar.gz
org.eclipse.papyrus-6140a1dda1d8d1c447f5656b88facfad38be467e.tar.xz
org.eclipse.papyrus-6140a1dda1d8d1c447f5656b88facfad38be467e.zip
NEW - bug 374243: In Papyrus 0.8.X force one editor writable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=374243 allow back multiple editors
-rw-r--r--plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/CoreMultiDiagramEditor.java24
-rw-r--r--plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/OneInstanceUtils.java3
2 files changed, 14 insertions, 13 deletions
diff --git a/plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/CoreMultiDiagramEditor.java b/plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/CoreMultiDiagramEditor.java
index c24101d4095..638c8bc5d53 100644
--- a/plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/CoreMultiDiagramEditor.java
+++ b/plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/CoreMultiDiagramEditor.java
@@ -585,18 +585,18 @@ public class CoreMultiDiagramEditor extends AbstractMultiPageSashEditor implemen
* @throws PartInitException
*/
protected void assertOneEditorOpen(IEditorSite site) throws PartInitException {
-// IWorkbenchWindow window = site.getWorkbenchWindow();
-// if (OneInstanceUtils.isPapyrusOpen(window,this)) {
-// String errorMessage = Messages.CoreMultiDiagramEditor_only_one;
-// if (MessageDialog.openQuestion(window.getShell(), Messages.CoreMultiDiagramEditor_warning, Messages.CoreMultiDiagramEditor_do_you_want_to_close +
-// Messages.CoreMultiDiagramEditor_if_not_close)){
-// if (!OneInstanceUtils.closeAllPapyrusOpened(window, this)){
-// throw new PartInitException(errorMessage) ;
-// }
-// } else {
-// throw new PartInitException(errorMessage) ;
-// }
-// }
+ IWorkbenchWindow window = site.getWorkbenchWindow();
+ if (OneInstanceUtils.isPapyrusOpen(window,this)) {
+ String errorMessage = Messages.CoreMultiDiagramEditor_only_one;
+ if (MessageDialog.openQuestion(window.getShell(), Messages.CoreMultiDiagramEditor_warning, Messages.CoreMultiDiagramEditor_do_you_want_to_close +
+ Messages.CoreMultiDiagramEditor_if_not_close)){
+ if (!OneInstanceUtils.closeAllPapyrusOpened(window, this)){
+ throw new PartInitException(errorMessage) ;
+ }
+ } else {
+ throw new PartInitException(errorMessage) ;
+ }
+ }
}
/**
diff --git a/plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/OneInstanceUtils.java b/plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/OneInstanceUtils.java
index d3ed3bf8ddc..0d28ae96430 100644
--- a/plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/OneInstanceUtils.java
+++ b/plugins/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/OneInstanceUtils.java
@@ -57,7 +57,8 @@ public final class OneInstanceUtils {
* @return
*/
public static boolean isPapyrusOpen(IWorkbenchWindow window, CoreMultiDiagramEditor reference) {
- return getAllEdtiorsExceptReference(window,reference).size() > 0 ;
+ return false;
+// return getAllEdtiorsExceptReference(window,reference).size() > 0 ;
}
/**

Back to the top