Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2016-01-17 17:27:59 +0000
committerChristian W. Damus2016-01-22 15:57:11 +0000
commitb089eab1fca586752027404cc398a173237337f8 (patch)
tree3d5f106bd6ba19ab6364284dec8cd34341cfd758 /plugins/views
parente8587f9c60ed458d6daee5128186f5b1ee54ac00 (diff)
downloadorg.eclipse.papyrus-b089eab1fca586752027404cc398a173237337f8.tar.gz
org.eclipse.papyrus-b089eab1fca586752027404cc398a173237337f8.tar.xz
org.eclipse.papyrus-b089eab1fca586752027404cc398a173237337f8.zip
Bug 485220: [Architecture] Provide a more modular architecture
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485220 Move UI-dependent APIs from the org.eclipse.papyrus.infra.tools bundle to org.eclipse.papyrus.infra.ui. Accordingly move tests into a new org.eclipse.papyrus.infra.ui.tests bundle. Two crucial UI dependencies are inverted by introduction of new OSGi services with core interfaces specified in the non-UI layer: * IExecutorService extends Java Platform's ExecutorService with APIs for synchronous execution (a la Display.syncExec). A new CoreExecutors class in the infra.tools bundle supplies the instance provided by the OSGi service implementation in the infra.ui bundle. This provides compatibility for clients of various UIUtil APIs that they can no longer access * IContextualServiceRegistryTracker abstracts the concept of the default ServicesRegistry found in the currently active editor, which the ServiceUtilsForHandlers class (and hence all of its clients) relies on. Again an OSGi service implementation in the infra.ui bundle supplies the implementation of this tracker, which is exposed in infra.core through the service-utils API Also move UI-dependent APIs from the org.eclipse.papyrus.infra.core bundle into org.eclipse.papyrus.infra.ui. This includes * moving the 'papyrusDiagram' and 'papyrusContentOutline' extension points into the org.eclipse.papyrus.infra.ui namespace * moving various UI-related services such as EditorLifeycleManager, SaveLayoutBeforeClose, and the IMultiDiagramEditor, itself, into the org.eclipse.papyrus.infra.ui bundle This necessitates not only widespread refactorings on the moved APIs, but also concomitant move of other APIs in other bundles because they cannot plausibly use these moved APIs from their new home in org.eclipse.papyrus.infra.ui and/or they cannot reasonably also be moved to the UI bundle and/or they must be used by bundles that now have no UI dependency: * the DI/sash-windows EMF model is moved out of infra.core.sasheditor.di bundle into a new model-only org.eclipse.papyrus.infra.sashwindows.di bundle (which symbolic name incidentally now better reflects the contained Java package names) * the IPageManager and ILocalPageService interfaces are moved out of infra.core.sasheditor.di bundle because they need to remain accessible by headless code such as the edit advices that ensure deletion of sash-model pages for notations that are deleted. These are now in a package named org.eclipse.papyrus.infra.code.sashwindows.di.service. Accordingly the class hierarchy implementing the IPageManager interface is changed: the obsolete PageMngrImpl is deleted, replaced by a BasicPageManagerImpl which now the PageManagerImpl extends. A service factory creates the basic page manager in a headless context, but is overridden by the UI-aware implementation when the UI bundles are installed * the MultiDiagramEditorGefDelegate (which has a GEF 3 dependency) is moved from the org.eclipse.papyrus.infra.core.sasheditor bundle to a new org.eclipse.papyrus.infra.gmfdiag.gef bundle. Its usage for an adapter of ActionRegistry type is extracted out of the CoreMultiDiagramEditor class into a new external adapter-factory in the infra.gmfdiag.gef bundle Tests all still pass (inasmuch as they do in the nightly master builds). Change-Id: I573dee5d9312d6e5746d74575350d0152b591ab3
Diffstat (limited to 'plugins/views')
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF4
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkHelper.java10
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerPage.java2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerTreeViewerContext.java2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java61
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actionprovider/EditingDomainActionProvider.java2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actions/OpenWithMenu.java2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/core/ui/pagebookview/MultiViewPageBookView.java2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java8
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java6
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/DeleteCommandHandler.java14
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java15
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/listener/DoubleClickListener.java14
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/PropertyTester.java11
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/AbstractGetEditorIconQuery.java6
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpenedPage.java9
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/META-INF/MANIFEST.MF3
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeEntry.java2
-rw-r--r--plugins/views/validation/org.eclipse.papyrus.views.validation/META-INF/MANIFEST.MF3
-rw-r--r--plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java2
22 files changed, 113 insertions, 69 deletions
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
index 98d1f603c90..2845497ce6d 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
@@ -52,7 +52,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.emf.facet.efacet;bundle-version="1.2.0",
org.eclipse.papyrus.emf.facet.efacet.metamodel;bundle-version="1.2.0",
org.eclipse.papyrus.emf.facet.util.emf.core;bundle-version="1.2.0",
- org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.2.0"
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.2.0.qualifier
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkHelper.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkHelper.java
index 7725e29c554..d48240555f9 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkHelper.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkHelper.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +8,7 @@
*
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer;
@@ -21,8 +21,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForWorkbenchPage;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForWorkbenchPage;
import org.eclipse.papyrus.infra.widgets.util.IRevealSemanticElement;
import org.eclipse.papyrus.infra.widgets.util.NavigationTarget;
import org.eclipse.ui.IEditorInput;
@@ -44,6 +44,7 @@ public class LinkHelper implements ILinkHelper {
* @see org.eclipse.ui.navigator.ILinkHelper#findSelection(org.eclipse.ui.IEditorInput)
*
*/
+ @Override
public IStructuredSelection findSelection(IEditorInput anInput) {
return null;
}
@@ -53,6 +54,7 @@ public class LinkHelper implements ILinkHelper {
* @see org.eclipse.ui.navigator.ILinkHelper#activateEditor(org.eclipse.ui.IWorkbenchPage, org.eclipse.jface.viewers.IStructuredSelection)
*
*/
+ @Override
public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
// no selection
if (aSelection == null || aSelection.isEmpty()) {
@@ -65,7 +67,7 @@ public class LinkHelper implements ILinkHelper {
// if the diagram has been selected the selection is not a TreeSelection
if (selection instanceof ITreeSelection) {
try {
- ISashWindowsContainer windowsContainer = ServiceUtilsForWorkbenchPage.getInstance().getISashWindowsContainer(aPage);
+ ISashWindowsContainer windowsContainer = ServiceUtilsForWorkbenchPage.getInstance().getService(ISashWindowsContainer.class, aPage);
Iterator<IEditorPart> iterPart = windowsContainer.getVisibleIEditorParts().iterator();
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerPage.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerPage.java
index d9eafdb9713..8471551eab6 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerPage.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerPage.java
@@ -16,7 +16,7 @@
package org.eclipse.papyrus.views.modelexplorer;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.views.modelexplorer.core.ui.pagebookview.ViewPartPage;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerTreeViewerContext.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerTreeViewerContext.java
index 4364ac9db1f..60305c0e877 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerTreeViewerContext.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerTreeViewerContext.java
@@ -20,10 +20,10 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.papyrus.infra.core.editor.reload.EMFTreeViewerContext;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.additional.AdditionalResourcesModel;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.ui.editor.reload.EMFTreeViewerContext;
import org.eclipse.papyrus.views.modelexplorer.matching.IMatchingItem;
import org.eclipse.papyrus.views.modelexplorer.matching.LinkItemMatchingItem;
import org.eclipse.papyrus.views.modelexplorer.matching.ModelElementItemMatchingItem;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
index f62485ecdc4..61daef45ed0 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2014 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,12 +9,8 @@
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - post refreshes for transaction commit asynchronously (CDO)
- * Christian W. Damus (CEA) - bug 429826
- * Christian W. Damus (CEA) - bug 434635
- * Christian W. Damus (CEA) - bug 437217
- * Christian W. Damus (CEA) - bug 441857
- * Christian W. Damus - bug 450235
- * Christian W. Damus - bug 451683
+ * Christian W. Damus (CEA) - bugs 429826, 434635, 437217, 441857
+ * Christian W. Damus - bugs 450235, 451683, 485220
*
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer;
@@ -52,22 +48,15 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerColumn;
import org.eclipse.jface.window.ToolTip;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.editor.IReloadableEditor;
-import org.eclipse.papyrus.infra.core.editor.reload.EditorReloadAdapter;
-import org.eclipse.papyrus.infra.core.editor.reload.EditorReloadEvent;
-import org.eclipse.papyrus.infra.core.editor.reload.TreeViewerContext;
-import org.eclipse.papyrus.infra.core.lifecycleevents.IEditorInputChangedListener;
-import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveAndDirtyService;
import org.eclipse.papyrus.infra.core.resource.IReadOnlyHandler2;
import org.eclipse.papyrus.infra.core.resource.IReadOnlyListener;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.ReadOnlyEvent;
import org.eclipse.papyrus.infra.core.resource.additional.AdditionalResourcesModel;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage;
import org.eclipse.papyrus.infra.core.sasheditor.editor.IPageLifeCycleEventsListener;
import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.core.utils.AdapterUtils;
@@ -78,6 +67,13 @@ import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderSer
import org.eclipse.papyrus.infra.services.navigation.service.NavigableElement;
import org.eclipse.papyrus.infra.services.navigation.service.NavigationMenu;
import org.eclipse.papyrus.infra.services.navigation.service.NavigationService;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.ui.editor.IReloadableEditor;
+import org.eclipse.papyrus.infra.ui.editor.reload.EditorReloadAdapter;
+import org.eclipse.papyrus.infra.ui.editor.reload.EditorReloadEvent;
+import org.eclipse.papyrus.infra.ui.editor.reload.TreeViewerContext;
+import org.eclipse.papyrus.infra.ui.lifecycleevents.IEditorInputChangedListener;
+import org.eclipse.papyrus.infra.ui.lifecycleevents.ISaveAndDirtyService;
import org.eclipse.papyrus.infra.widgets.util.IRevealSemanticElement;
import org.eclipse.papyrus.views.modelexplorer.SharedModelExplorerState.StateChangedEvent;
import org.eclipse.papyrus.views.modelexplorer.listener.DoubleClickListener;
@@ -118,6 +114,7 @@ import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
import com.google.common.base.Supplier;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -172,6 +169,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
*/
private ISelectionListener pageSelectionListener = new ISelectionListener() {
+ @Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
handleSelectionChangedFromDiagramEditor(part, selection);
}
@@ -185,10 +183,11 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
/**
* This method is called when the editor input is changed from the ISaveAndDirtyService.
*
- * @see org.eclipse.papyrus.infra.core.lifecycleevents.IEditorInputChangedListener#editorInputChanged(org.eclipse.ui.part.FileEditorInput)
+ * @see org.eclipse.papyrus.infra.ui.lifecycleevents.IEditorInputChangedListener#editorInputChanged(org.eclipse.ui.part.FileEditorInput)
*
* @param fileEditorInput
*/
+ @Override
public void editorInputChanged(FileEditorInput fileEditorInput) {
// Change the editor input.
setPartName(fileEditorInput.getName());
@@ -197,9 +196,10 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
/**
* The isDirty flag has changed, reflect its new value
*
- * @see org.eclipse.papyrus.infra.core.lifecycleevents.IEditorInputChangedListener#isDirtyChanged()
+ * @see org.eclipse.papyrus.infra.ui.lifecycleevents.IEditorInputChangedListener#isDirtyChanged()
*
*/
+ @Override
public void isDirtyChanged() {
firePropertyChange(IEditorPart.PROP_DIRTY);
}
@@ -322,7 +322,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
// IPageMngr iPageMngr = EditorUtils.getIPageMngr();
IPageManager iPageMngr;
try {
- iPageMngr = ServiceUtils.getInstance().getIPageManager(serviceRegistry);
+ iPageMngr = ServiceUtils.getInstance().getService(IPageManager.class, serviceRegistry);
} catch (ServiceException e) {
// This shouldn't happen.
return Collections.emptyList();
@@ -391,6 +391,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
viewer.getNavigatorContentService().getActivationService().addExtensionActivationListener(new IExtensionActivationListener() {
+ @Override
public void onExtensionActivation(String aViewerId, String[] theNavigatorExtensionIds, boolean isActive) {
sharedState.updateNavigatorContentExtensions(theNavigatorExtensionIds, isActive);
}
@@ -454,6 +455,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
getCommonViewer().setSorter(null);
((CustomCommonViewer) getCommonViewer()).getDropAdapter().setFeedbackEnabled(true);
getCommonViewer().addDoubleClickListener(new DoubleClickListener(new Supplier<ServicesRegistry>() {
+ @Override
public ServicesRegistry get() {
return serviceRegistry;
}
@@ -473,6 +475,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
tree.addKeyListener(new KeyListener() {
+ @Override
public void keyReleased(KeyEvent e) {
if (navigationMenu != null) {
if (e.keyCode == SWT.ALT) {
@@ -481,6 +484,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
}
}
+ @Override
public void keyPressed(KeyEvent e) {
if (e.keyCode != SWT.ALT) {
return;
@@ -535,6 +539,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
tree.addMouseMoveListener(new MouseMoveListener() {
+ @Override
public void mouseMove(MouseEvent e) {
if (navigationMenu != null) {
navigationMenu.handleRequest(e, getTreeItem(e));
@@ -592,6 +597,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
// Self-listen for property changes
addPropertyListener(new IPropertyListener() {
+ @Override
public void propertyChanged(Object source, int propId) {
switch (propId) {
case IS_LINKING_ENABLED_PROPERTY:
@@ -671,6 +677,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
private Runnable createRefreshRunnable() {
return new Runnable() {
+ @Override
public void run() {
// Only run if I'm still pending
synchronized (ModelExplorerView.this) {
@@ -937,6 +944,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
*
* @return the EditingDomain used by the properties view
*/
+ @Override
public EditingDomain getEditingDomain() {
return editingDomain;
}
@@ -952,6 +960,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
}
}
+ @Override
public void revealSemanticElement(List<?> elementList) {
// Ensure that the ModelExplorer is refreshed before
// trying to display an element. Useful if the element has just been created,
@@ -1003,6 +1012,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
if (rs instanceof ModelSet && AdditionalResourcesModel.isAdditionalResource((ModelSet) rs, r.getURI())) {
commonViewer.getControl().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
commonViewer.expandToLevel(new ReferencableMatchingItem(rs), 1);
commonViewer.expandToLevel(new ReferencableMatchingItem(resource), 1);
@@ -1034,6 +1044,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
commonViewer.getControl().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
commonViewer.expandToLevel(itemToExpand, 1);
}
@@ -1046,6 +1057,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
commonViewer.getControl().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
commonViewer.expandToLevel(itemToExpand, 1);
}
@@ -1067,6 +1079,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
public static void selectReveal(final ISelection structuredSelection, final Viewer commonViewer) {
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
commonViewer.setSelection(structuredSelection, true);
}
@@ -1088,6 +1101,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
} else {
viewer.getControl().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
viewer.setSelection(selection);
}
@@ -1095,10 +1109,12 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
}
}
+ @Override
public void pageOpened(IPage page) {
refreshTree();
}
+ @Override
public void pageClosed(IPage page) {
refreshTree();
}
@@ -1106,6 +1122,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
private void refreshTree() {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
if (getCommonViewer().getControl() == null || getCommonViewer().getControl().isDisposed()) {
return;
@@ -1117,22 +1134,27 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
});
}
+ @Override
public void pageChanged(IPage newPage) {
// Nothing
}
+ @Override
public void pageActivated(IPage page) {
// Nothing
}
+ @Override
public void pageDeactivated(IPage page) {
// Nothing
}
+ @Override
public void pageAboutToBeOpened(IPage page) {
// Nothing
}
+ @Override
public void pageAboutToBeClosed(IPage page) {
// Nothing
}
@@ -1140,6 +1162,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
private IReadOnlyListener createReadOnlyListener() {
return new IReadOnlyListener() {
+ @Override
public void readOnlyStateChanged(ReadOnlyEvent event) {
switch (event.getEventType()) {
case ReadOnlyEvent.RESOURCE_READ_ONLY_STATE_CHANGED:
@@ -1200,6 +1223,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
private volatile Runnable contentUpdate;
+ @Override
public void sharedStateChanged(StateChangedEvent event) {
switch (event.getEventType()) {
case StateChangedEvent.LINKING_ENABLED:
@@ -1220,6 +1244,7 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
if (contentUpdate == null) {
contentUpdate = new Runnable() {
+ @Override
public void run() {
CommonViewer viewer = getCommonViewer();
if ((viewer != null) && (viewer.getControl() != null) && !viewer.getControl().isDisposed()) {
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actionprovider/EditingDomainActionProvider.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actionprovider/EditingDomainActionProvider.java
index 748a08b4436..810bb9389a5 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actionprovider/EditingDomainActionProvider.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actionprovider/EditingDomainActionProvider.java
@@ -28,7 +28,7 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.infra.ui.util.EditorUtils;
import org.eclipse.papyrus.views.modelexplorer.factory.IActionHandlerFactory;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.navigator.CommonNavigator;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actions/OpenWithMenu.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actions/OpenWithMenu.java
index 6d83f81aac4..6566708136c 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actions/OpenWithMenu.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/actions/OpenWithMenu.java
@@ -20,9 +20,9 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelManager;
import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IOpenable;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/core/ui/pagebookview/MultiViewPageBookView.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/core/ui/pagebookview/MultiViewPageBookView.java
index e628c202ebd..58843573b46 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/core/ui/pagebookview/MultiViewPageBookView.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/core/ui/pagebookview/MultiViewPageBookView.java
@@ -15,7 +15,7 @@
package org.eclipse.papyrus.views.modelexplorer.core.ui.pagebookview;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.views.modelexplorer.Activator;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewPart;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java
index 08645f83cc3..3ee852677e6 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010-2014 CEA LIST.
- *
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -11,6 +10,8 @@
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
* CĂ©line Janssens (ALL4TEC) Celine.Janssens@all4tec.net - Bug 420593
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 447025
+ * Christian W. Damus - bug 485220
+ *
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer.dnd;
@@ -48,6 +49,7 @@ import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
@@ -448,7 +450,7 @@ public class CommonDropAdapterAssistant extends org.eclipse.ui.navigator.CommonD
*/
private List<Object> getEditors(EObject context) {
try {
- return ServiceUtilsForEObject.getInstance().getIPageManager(context).allPages();
+ return ServiceUtilsForEObject.getInstance().getService(IPageManager.class, context).allPages();
} catch (ServiceException ex) {
return Collections.emptyList();
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java
index cdc02e5420c..674a6d23703 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java
@@ -25,10 +25,10 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers;
import org.eclipse.ui.handlers.HandlerUtil;
/**
@@ -48,7 +48,7 @@ public abstract class AbstractModelExplorerHandler extends AbstractHandler {
protected TransactionalEditingDomain getEditingDomain() {
TransactionalEditingDomain editingDomain = null;
try {
- editingDomain = org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain();
+ editingDomain = org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain();
} catch (ServiceException e) {
// we are closing the editor, so the model explorer has nothing to display
// e.printStackTrace();
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java
index 396afa0cc23..f1aecd3601a 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java
@@ -22,7 +22,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/DeleteCommandHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/DeleteCommandHandler.java
index 2de12e791ce..eb7a9dbc318 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/DeleteCommandHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/DeleteCommandHandler.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2014 CEA LIST and others.
- *
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -11,6 +10,7 @@
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
* Benoit Maggi (CEA LIST) benoit.maggi@cea.fr _ Bug 436952
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec - Bug 436952
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer.handler;
@@ -27,7 +27,7 @@ import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
@@ -79,7 +79,7 @@ public class DeleteCommandHandler extends AbstractCommandHandler implements IHan
*/
protected static boolean isPage(EObject current) {
try {
- IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(current);
+ IPageManager pageManager = ServiceUtilsForEObject.getInstance().getService(IPageManager.class, current);
if (pageManager.allPages().contains(current)) {
return true;
}
@@ -95,10 +95,10 @@ public class DeleteCommandHandler extends AbstractCommandHandler implements IHan
* Build the delete command for a set of EObject selected in the ModelExplorer.
* The delete command is given by the {@link IElementEditService} of selected
* elements.
- * @param selectedElements elements to delete
- * @return the composite deletion command for current selection
+ * &#64;param selectedElements elements to delete
+ * &#64;return the composite deletion command for current selection
*
- * @TODO : Manage possible Diagrams listed in the selection
+ * &#64;TODO : Manage possible Diagrams listed in the selection
*
* </pre>
*/
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
index 07885c4d5ce..d45b9051c64 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +8,7 @@
*
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer.handler;
@@ -40,7 +40,7 @@ import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialogCal
import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialogCallbackWithPreCommit;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.ModelUtils;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
@@ -80,6 +80,7 @@ public class LoadBrowserCustomization extends AbstractHandler {
/**
* {@inheritDoc}
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (Activator.getDefault().getCustomizationManager() != null) {
@@ -92,11 +93,13 @@ public class LoadBrowserCustomization extends AbstractHandler {
Shell shell = HandlerUtil.getActiveShell(event);
IDialogCallbackWithPreCommit<List<Customization>, Boolean, Dialog> dialogCallBack = new IDialogCallbackWithPreCommit<List<Customization>, Boolean, Dialog>() {
+ @Override
public void committed(List<Customization> result, Boolean precommitResult) {
// TODO Auto-generated method stub
}
+ @Override
public Dialog openPrecommitDialog(List<Customization> result, IDialogCallback<Boolean> precommitCallback) {
// TODO Auto-generated method stub
return null;
@@ -239,12 +242,12 @@ public class LoadBrowserCustomization extends AbstractHandler {
// } catch (Exception e) {
// Activator.log.error(e);
// }
- // return ""; //$NON-NLS-1$
+ // return ""; //$NON-NLS-1$
// }
/**
* Get the metmodel URI
- * **/
+ **/
protected List<EPackage> getMetamodels(ServicesRegistry serviceRegistry) {
List<EPackage> ePackages = new ArrayList<EPackage>();
@@ -254,7 +257,7 @@ public class LoadBrowserCustomization extends AbstractHandler {
*/
IPageManager pageMngr = null;
try {
- pageMngr = ServiceUtils.getInstance().getIPageManager(serviceRegistry);
+ pageMngr = ServiceUtils.getInstance().getService(IPageManager.class, serviceRegistry);
List<Object> pages = pageMngr.allPages();
for (int i = 0; i < pages.size(); i++) {
if (pages.get(i) instanceof EObject) {
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java
index 7209c3c30d7..726b957edb7 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java
@@ -24,7 +24,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/listener/DoubleClickListener.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/listener/DoubleClickListener.java
index 3b2f5c0b1c4..32601727417 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/listener/DoubleClickListener.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/listener/DoubleClickListener.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2014 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
* Christian W. Damus - bug 450235
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer.listener;
@@ -23,8 +24,8 @@ import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IOpenable;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
@@ -45,7 +46,8 @@ public class DoubleClickListener implements IDoubleClickListener {
/**
* Initializes me with a fixed service registry.
*
- * @param servicesRegistry a service registry
+ * @param servicesRegistry
+ * a service registry
*
* @deprecated The editor that the Model Explorer views can change dynamically, replacing its service registry. Use the {@link #DoubleClickListener(Supplier)} constructor instead to account for the variability of the registry.
*/
@@ -57,7 +59,8 @@ public class DoubleClickListener implements IDoubleClickListener {
/**
* Initializes me with a variable service registry.
*
- * @param servicesRegistrySupplier a supplier of a dynamically variable service registry
+ * @param servicesRegistrySupplier
+ * a supplier of a dynamically variable service registry
*/
public DoubleClickListener(Supplier<ServicesRegistry> servicesRegistrySupplier) {
this.servicesRegistry = servicesRegistrySupplier;
@@ -68,12 +71,13 @@ public class DoubleClickListener implements IDoubleClickListener {
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
*
*/
+ @Override
public void doubleClick(DoubleClickEvent event) {
ISelection selection = event.getSelection();
final IPageManager pageManager;
// get the page Manager
try {
- pageManager = ServiceUtils.getInstance().getIPageManager(servicesRegistry.get());
+ pageManager = ServiceUtils.getInstance().getService(IPageManager.class, servicesRegistry.get());
} catch (Exception e) {
Activator.log.error(Messages.DoubleClickListener_Error_NoLoadManagerToOpen, e);
return;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/PropertyTester.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/PropertyTester.java
index d83150b6375..f4bee137ce2 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/PropertyTester.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/PropertyTester.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2014 CEA LIST and others.
- *
+ * Copyright (c) 2011, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -10,6 +9,7 @@
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 408491
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer.provider;
@@ -23,8 +23,8 @@ import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IOpenable;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForSelection;
@@ -66,6 +66,7 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
* @param expectedValue
* @return
*/
+ @Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (IS_EOBJECT.equals(property) && receiver instanceof IStructuredSelection) {
boolean answer = isObject((IStructuredSelection) receiver);
@@ -124,14 +125,14 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
* Returns the page manager
*
* @return
- * the page manager
+ * the page manager
*/
protected IPageManager getPageManager(IStructuredSelection selection) {
IPageManager pageMngr = null;
try {
ServiceUtilsForSelection instance = ServiceUtilsForSelection.getInstance();
if (instance != null) {
- pageMngr = instance.getIPageManager(selection);
+ pageMngr = instance.getService(IPageManager.class, selection);
}
} catch (NullPointerException npe) {
// We cannot find the page manager. Just return null.
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/AbstractGetEditorIconQuery.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/AbstractGetEditorIconQuery.java
index 5170de1cdbd..48ce8f89fae 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/AbstractGetEditorIconQuery.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/AbstractGetEditorIconQuery.java
@@ -15,11 +15,11 @@
package org.eclipse.papyrus.views.modelexplorer.queries;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
-import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistryExtended;
-import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.ui.editorsfactory.IPageIconsRegistry;
+import org.eclipse.papyrus.infra.ui.editorsfactory.IPageIconsRegistryExtended;
+import org.eclipse.papyrus.infra.ui.editorsfactory.PageIconsRegistry;
/**
*
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpenedPage.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpenedPage.java
index 285eab5d568..803d05f8072 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpenedPage.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpenedPage.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2016 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer.queries;
@@ -16,7 +18,7 @@ import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
@@ -24,9 +26,10 @@ import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
public class IsOpenedPage implements IJavaQuery2<EObject, Boolean> {
+ @Override
public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
try {
- IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(source);
+ IPageManager pageManager = ServiceUtilsForEObject.getInstance().getService(IPageManager.class, source);
return pageManager.isOpen(source);
} catch (ServiceException ex) {
// Ignore
diff --git a/plugins/views/org.eclipse.papyrus.views.search/META-INF/MANIFEST.MF b/plugins/views/org.eclipse.papyrus.views.search/META-INF/MANIFEST.MF
index 1378d5f30ad..4c0b72f2e9d 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/META-INF/MANIFEST.MF
+++ b/plugins/views/org.eclipse.papyrus.views.search/META-INF/MANIFEST.MF
@@ -20,7 +20,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.105.0",
org.eclipse.ui.ide,
org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.2.0",
- org.eclipse.papyrus.infra.services.openelement;bundle-version="1.2.0"
+ org.eclipse.papyrus.infra.services.openelement;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0"
Bundle-Vendor: %vendorName
Bundle-Version: 1.2.0.qualifier
Bundle-ManifestVersion: 2
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeEntry.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeEntry.java
index 06e40cf7fe7..5b5a0e85c58 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeEntry.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeEntry.java
@@ -25,12 +25,12 @@ import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServiceMultiException;
import org.eclipse.papyrus.infra.core.services.ServiceNotFoundException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
import org.eclipse.papyrus.infra.services.labelprovider.service.impl.LabelProviderServiceImpl;
import org.eclipse.papyrus.infra.services.openelement.service.OpenElementService;
import org.eclipse.papyrus.infra.services.openelement.service.impl.OpenElementServiceImpl;
+import org.eclipse.papyrus.infra.ui.util.EditorUtils;
import org.eclipse.papyrus.views.search.Activator;
import org.eclipse.papyrus.views.search.Messages;
import org.eclipse.papyrus.views.search.utils.IServiceRegistryTracker;
diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/META-INF/MANIFEST.MF b/plugins/views/validation/org.eclipse.papyrus.views.validation/META-INF/MANIFEST.MF
index 3440cf75631..9a0f80ff1c2 100644
--- a/plugins/views/validation/org.eclipse.papyrus.views.validation/META-INF/MANIFEST.MF
+++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/META-INF/MANIFEST.MF
@@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0",
com.google.guava;bundle-version="11.0.0",
org.eclipse.ui.ide;bundle-version="3.10.100",
- org.eclipse.core.expressions;bundle-version="3.4.600"
+ org.eclipse.core.expressions;bundle-version="3.4.600",
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.2.0.qualifier
diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java
index 88ff665bb60..fb6317f127d 100644
--- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java
+++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java
@@ -11,9 +11,9 @@
*****************************************************************************/
package org.eclipse.papyrus.views.validation.internal;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;

Back to the top