diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse')
4 files changed, 29 insertions, 23 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java index c3fb62d7d6d..7a2da5361c0 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java @@ -11,7 +11,7 @@ package org.eclipse.papyrus.uml.diagram.clazz;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.core.extension.commands.PerspectiveContextDependence;
+import org.eclipse.papyrus.infra.ui.extension.commands.PerspectiveContextDependence;
/**
* ClassDiagramCreationCondition class allows to check if a Class diagram can be added to the
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/hyperlink/NestedPackageHyperlinkContributor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/hyperlink/NestedPackageHyperlinkContributor.java index d877d170142..989e85b0db9 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/hyperlink/NestedPackageHyperlinkContributor.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/hyperlink/NestedPackageHyperlinkContributor.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST and others. + * Copyright (c) 2015, 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 @@ -8,6 +8,7 @@ * * Contributors: * Shuai Li (CEA LIST) <shuai.li@cea.fr> - Initial API and implementation + * Christian W. Damus - bug 485220 * *****************************************************************************/ @@ -20,6 +21,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; import org.eclipse.papyrus.infra.core.services.BadStateException; import org.eclipse.papyrus.infra.core.services.ServiceException; @@ -47,13 +49,14 @@ public class NestedPackageHyperlinkContributor implements HyperlinkContributor { * @param fromElement * @return */ + @Override public List<HyperLinkObject> getHyperlinks(Object fromElement) { ArrayList<HyperLinkObject> hyperlinks = new ArrayList<HyperLinkObject>(); - + if (fromElement instanceof org.eclipse.uml2.uml.Package) { List<org.eclipse.uml2.uml.Package> nestedPackages = ((org.eclipse.uml2.uml.Package) fromElement).getNestedPackages(); List<Object> pages = new ArrayList<Object>(); - + for (org.eclipse.uml2.uml.Package nestedPackage : nestedPackages) { ViewerSearchService viewerSearchService = null; try { @@ -76,34 +79,34 @@ public class NestedPackageHyperlinkContributor implements HyperlinkContributor { } } } - + if (viewerSearchService != null) { List<Object> viewerSearchResults = viewerSearchService.getViewersInCurrentModel(null, nestedPackage, true, false); pages.addAll(viewerSearchResults); } } - + for (Object page : pages) { - + if (page instanceof Diagram && ((Diagram) page).getType().equals(ModelEditPart.MODEL_ID)) { try { // Page must not be active page - IPage activeSashPage = ServiceUtilsForEObject.getInstance().getISashWindowsContainer((org.eclipse.uml2.uml.Package) fromElement).getActiveSashWindowsPage(); + IPage activeSashPage = ServiceUtilsForEObject.getInstance().getService(ISashWindowsContainer.class, (org.eclipse.uml2.uml.Package) fromElement).getActiveSashWindowsPage(); Object activePage = null; - + if (activeSashPage != null) { Object pageId = activeSashPage.getRawModel(); - + if (pageId instanceof PageRef) { Object emfPageId = ((PageRef) pageId).getEmfPageIdentifier(); - + if (emfPageId instanceof View) { activePage = emfPageId; } } } - + if (activePage == null || !activePage.equals(page)) { HyperLinkEditor hyperlink = new HyperLinkEditor(); hyperlink.setObject(page); @@ -113,11 +116,11 @@ public class NestedPackageHyperlinkContributor implements HyperlinkContributor { Activator.log.error(e); } } - - + + } } - + return hyperlinks; } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/hyperlink/NestingPackageHyperlinkContributor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/hyperlink/NestingPackageHyperlinkContributor.java index bd6648763df..93385ea1499 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/hyperlink/NestingPackageHyperlinkContributor.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/hyperlink/NestingPackageHyperlinkContributor.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST and others. + * Copyright (c) 2015, 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 @@ -8,6 +8,7 @@ * * Contributors: * Shuai Li (CEA LIST) <shuai.li@cea.fr> - Initial API and implementation + * Christian W. Damus - bug 485220 * *****************************************************************************/ @@ -20,6 +21,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; import org.eclipse.papyrus.infra.core.services.BadStateException; import org.eclipse.papyrus.infra.core.services.ServiceException; @@ -47,13 +49,14 @@ public class NestingPackageHyperlinkContributor implements HyperlinkContributor * @param fromElement * @return */ + @Override public List<HyperLinkObject> getHyperlinks(Object fromElement) { ArrayList<HyperLinkObject> hyperlinks = new ArrayList<HyperLinkObject>(); - + if (fromElement instanceof org.eclipse.uml2.uml.Package) { org.eclipse.uml2.uml.Package nestingPackage = ((org.eclipse.uml2.uml.Package) fromElement).getNestingPackage(); List<Object> pages = new ArrayList<Object>(); - + if (nestingPackage != null) { ViewerSearchService viewerSearchService = null; try { @@ -76,19 +79,19 @@ public class NestingPackageHyperlinkContributor implements HyperlinkContributor } } } - + if (viewerSearchService != null) { List<Object> viewerSearchResults = viewerSearchService.getViewersInCurrentModel(null, nestingPackage, true, false); pages.addAll(viewerSearchResults); } } - + for (Object page : pages) { if (page instanceof Diagram && ((Diagram) page).getType().equals(ModelEditPart.MODEL_ID)) { try { // Page must not be active page - IPage activeSashPage = ServiceUtilsForEObject.getInstance().getISashWindowsContainer((org.eclipse.uml2.uml.Package) fromElement).getActiveSashWindowsPage(); + IPage activeSashPage = ServiceUtilsForEObject.getInstance().getService(ISashWindowsContainer.class, (org.eclipse.uml2.uml.Package) fromElement).getActiveSashWindowsPage(); Object activePage = null; if (activeSashPage != null) { @@ -114,7 +117,7 @@ public class NestingPackageHyperlinkContributor implements HyperlinkContributor } } } - + return hyperlinks; } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/providers/ClassDiagramContributionPolicyClass.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/providers/ClassDiagramContributionPolicyClass.java index 552dfd6cb9f..c9843902f07 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/providers/ClassDiagramContributionPolicyClass.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/providers/ClassDiagramContributionPolicyClass.java @@ -18,7 +18,7 @@ import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.IPopup import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ModelEditPart;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
|