Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmallet2017-09-22 14:37:55 +0000
committerjmallet2017-12-06 08:21:29 +0000
commit2ca75c75795a88aca71321d791b3006ee19c3e49 (patch)
tree8cd4f18511b6b72cd5cdb966e8037e21ebcf9c69
parent379d03bd545f92a7a53ac974bf2500b9ca3ff211 (diff)
downloadorg.eclipse.sirius-2ca75c75795a88aca71321d791b3006ee19c3e49.tar.gz
org.eclipse.sirius-2ca75c75795a88aca71321d791b3006ee19c3e49.tar.xz
org.eclipse.sirius-2ca75c75795a88aca71321d791b3006ee19c3e49.zip
[517561] Update model explorer representation double click behavior.
Now the double click on aird in model explorer view opens the session editor even if aird editor is opened for an other session or if none editor is already opened. Bug: 517561 Change-Id: I3a5a9f2b66282d5b2836e9f31bc9405874e2d941 Signed-off-by: jmallet <jessy.mallet@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/modelexplorer/ModelExplorerView.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/modelexplorer/ModelExplorerView.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/modelexplorer/ModelExplorerView.java
index a5a98eb029..1da4430299 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/modelexplorer/ModelExplorerView.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/modelexplorer/ModelExplorerView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2017 THALES GLOBAL SERVICES.
+ * Copyright (c) 2011, 2017 THALES GLOBAL SERVICES and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -357,14 +357,14 @@ public class ModelExplorerView extends CommonNavigator implements IModelExplorer
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
FileEditorInput fileEditorInput = new FileEditorInput((IFile) element);
IEditorReference[] airdEditorReferences = activePage.findEditors(fileEditorInput, SESSION_EDITOR_ID, IWorkbenchPage.MATCH_ID);
- if (airdEditorReferences.length > 0) {
- try {
+ try {
+ if (canOpenEditor(airdEditorReferences, fileEditorInput)) {
activePage.openEditor(fileEditorInput, SESSION_EDITOR_ID);
- } catch (PartInitException e) {
- SiriusEditPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SiriusEditPlugin.ID, e.getLocalizedMessage(), e));
+ } else {
+ super.handleDoubleClick(anEvent);
}
- } else {
- super.handleDoubleClick(anEvent);
+ } catch (PartInitException e) {
+ SiriusEditPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SiriusEditPlugin.ID, e.getLocalizedMessage(), e));
}
} else {
super.handleDoubleClick(anEvent);
@@ -395,6 +395,15 @@ public class ModelExplorerView extends CommonNavigator implements IModelExplorer
}
}
+ private boolean canOpenEditor(IEditorReference[] airdEditorReferences, FileEditorInput fileEditorInput) throws PartInitException {
+ for (IEditorReference iEditorReference : airdEditorReferences) {
+ if (((FileEditorInput) iEditorReference.getEditorInput()).getPath().equals(fileEditorInput.getPath())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
private void hookGlobalActions() {
final IActionBars bars = this.getViewSite().getActionBars();
deleteActionHandler = new DeleteActionHandler(this.getSite().getSelectionProvider());

Back to the top