Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2013-12-05 14:36:13 +0000
committerGerrit Code Review @ Eclipse.org2013-12-09 09:25:48 +0000
commitc4ab02c594517ea6b5802485a478ae7795313934 (patch)
treea57d2eea549718ec385e41de7965fbfe86202ddc
parent5b1f65b905fd05ac9bed84be39716e0da2ef3e7f (diff)
downloadorg.eclipse.sirius-c4ab02c594517ea6b5802485a478ae7795313934.tar.gz
org.eclipse.sirius-c4ab02c594517ea6b5802485a478ae7795313934.tar.xz
org.eclipse.sirius-c4ab02c594517ea6b5802485a478ae7795313934.zip
[422957] Remove some of the deprecated methods Sirius's APIs
See the release notes for the details of what methods and types have been removed and what to replace them with. Change-Id: I8a35c3d8bacb311eac0c656c88ce720b3c6446a9 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/IInterpreterSiriusVariables.java23
-rw-r--r--plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/util/DelegatingDiagramCommandFactory.java12
-rw-r--r--plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Execution.java23
-rw-r--r--plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectUIServices.java36
-rw-r--r--plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/AbstractDiagramEdgeEditPart.java13
-rw-r--r--plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/IDiagramEdgeEditPart.java8
-rw-r--r--plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/ui/tools/api/figure/WorkspaceImageFigure.java8
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.textile34
-rw-r--r--plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/CompositeMetamodelExtender.java10
-rw-r--r--plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/IMetamodelExtender.java14
-rw-r--r--plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/ModelAccessor.java28
-rw-r--r--plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/internal/accessor/ecore/EcoreIntrinsicExtender.java9
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java6
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/CreateRepresentationFromRepresentationCreationDescription.java11
-rw-r--r--plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/api/helper/TableHelper.java46
-rw-r--r--plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java32
-rw-r--r--plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/CreateRepresentationFromRepresentationCreationDescription.java11
-rw-r--r--plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/OpenRepresentationAction.java4
-rw-r--r--plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/control/SiriusControlCommand.java358
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/control/SiriusUncontrolCommand.java283
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java18
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/marker/TraceabilityMarkerNavigationProvider.java3
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionEditorInput.java4
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionHelper.java32
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelection.java43
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallback.java33
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallbackWithConfimation.java16
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java13
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusControlHandler.java40
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusUncontrolHandler.java20
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java16
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java4
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationCommand.java77
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/SiriusHelper.java19
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskHelper.java7
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.java14
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SessionManager.java29
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSession.java27
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/factory/SessionFactory.java33
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingTableEntry.java20
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingsTable.java14
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java58
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java17
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java19
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java7
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IDiagramCommandFactory.java17
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IEMFCommandFactory.java22
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RefreshSiriusElement.java13
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RevealDDiagramElement.java52
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RevealSiriusElement.java53
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java61
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/UndoRedoCapableEMFCommandFactory.java17
53 files changed, 185 insertions, 1605 deletions
diff --git a/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/IInterpreterSiriusVariables.java b/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/IInterpreterSiriusVariables.java
index fee3a7ba8e..b42d9448e9 100644
--- a/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/IInterpreterSiriusVariables.java
+++ b/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/IInterpreterSiriusVariables.java
@@ -81,32 +81,13 @@ public interface IInterpreterSiriusVariables {
/** "newViewContainer". */
String CONTAINER_VIEW_NEW = "newViewContainer";
-
+
/** "copiedView". */
String COPIED_VIEW = "copiedView";
-
+
/** "copiedElement". */
String COPIED_ELEMENT = "copiedElement";
/** "root" representation root element. */
String ROOT = "root";
-
- /**
- * the line semantic element.
- *
- * @deprecated since 2.3.0 : Use
- * IInterpreterSiriusTableVariables.LINE_SEMANTIC instead.
- */
- @Deprecated
- String LINE_SEMANTIC = "lineSemantic";
-
- /**
- * The column semantic element.
- *
- * @deprecated since 2.3.0 : Use
- * IInterpreterSiriusTableVariables.LINE_SEMANTIC instead.
- */
- @Deprecated
- String COLUMN_SEMANTIC = "columnSemantic";
-
}
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/util/DelegatingDiagramCommandFactory.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/util/DelegatingDiagramCommandFactory.java
index d584ea3ff9..76326d6639 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/util/DelegatingDiagramCommandFactory.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/util/DelegatingDiagramCommandFactory.java
@@ -16,9 +16,6 @@ import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EObject;
-
-import com.google.common.base.Preconditions;
-
import org.eclipse.sirius.business.api.dialect.command.CreateRepresentationCommand;
import org.eclipse.sirius.tools.api.command.DCommand;
import org.eclipse.sirius.tools.api.command.IDiagramCommandFactory;
@@ -53,6 +50,8 @@ import org.eclipse.sirius.viewpoint.description.tool.SelectionWizardDescription;
import org.eclipse.sirius.viewpoint.description.tool.ToolDescription;
import org.eclipse.sirius.viewpoint.description.validation.ValidationFix;
+import com.google.common.base.Preconditions;
+
/**
* An implementation of <code>IDiagramCommandFactory</code> which delegates to
* another one. Useful to customize only some of the methods when one does not
@@ -98,13 +97,6 @@ public class DelegatingDiagramCommandFactory implements IDiagramCommandFactory {
/**
* {@inheritDoc}
*/
- public DCommand buildCreateDiagramFromDescription(DiagramDescription description, EObject semanticElement) {
- return baseFactory.buildCreateDiagramFromDescription(description, semanticElement);
- }
-
- /**
- * {@inheritDoc}
- */
public DCommand buildCreateDiagramFromDescription(DiagramDescription description, EObject semanticElement, IProgressMonitor monitor) {
return baseFactory.buildCreateDiagramFromDescription(description, semanticElement, monitor);
}
diff --git a/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Execution.java b/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Execution.java
index aad059c877..475d03fdfb 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Execution.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Execution.java
@@ -19,13 +19,6 @@ import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
-
-import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
import org.eclipse.sirius.common.tools.api.util.Option;
import org.eclipse.sirius.common.tools.api.util.Options;
import org.eclipse.sirius.diagram.sequence.business.internal.layout.LayoutConstants;
@@ -43,6 +36,12 @@ import org.eclipse.sirius.diagram.sequence.util.NotationPredicate;
import org.eclipse.sirius.diagram.sequence.util.Range;
import org.eclipse.sirius.viewpoint.DDiagramElement;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+
/**
* Represents an execution on a lifeline or another parent execution.
*
@@ -98,11 +97,11 @@ public class Execution extends AbstractNodeEvent {
}
/**
- * Returns a predicate to check whether a Sirius DDiagramElement
- * represents an execution.
+ * Returns a predicate to check whether a Sirius DDiagramElement represents
+ * an execution.
*
- * @return a predicate to check whether a Sirius DDiagramElement
- * represents an execution.
+ * @return a predicate to check whether a Sirius DDiagramElement represents
+ * an execution.
*/
public static Predicate<DDiagramElement> viewpointElementPredicate() {
return SiriusElementPredicate.INSTANCE;
@@ -406,9 +405,7 @@ public class Execution extends AbstractNodeEvent {
* @param recurse
* investigate recursively if true
* @return the list of linked {@link Execution} from executionEditPart
- * @deprecated
*/
- @Deprecated
public List<Execution> findLinkedExecutions(boolean recurse) {
List<Execution> impactedExecutions = Lists.newArrayList();
findLinkedExecutions(impactedExecutions, this, recurse);
diff --git a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectUIServices.java b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectUIServices.java
index 6590fb6ebf..559fa142da 100644
--- a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectUIServices.java
+++ b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectUIServices.java
@@ -25,7 +25,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.emf.common.command.Command;
@@ -55,20 +54,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-import org.eclipse.sirius.common.tools.DslCommonPlugin;
-import org.eclipse.sirius.common.tools.api.util.StringUtil;
import org.eclipse.sirius.business.api.diagramtype.DiagramTypeDescriptorRegistry;
import org.eclipse.sirius.business.api.diagramtype.IDiagramTypeDescriptor;
import org.eclipse.sirius.business.api.helper.SiriusResourceHelper;
@@ -76,6 +61,8 @@ import org.eclipse.sirius.business.api.query.URIQuery;
import org.eclipse.sirius.business.api.session.CustomDataConstants;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionManager;
+import org.eclipse.sirius.common.tools.DslCommonPlugin;
+import org.eclipse.sirius.common.tools.api.util.StringUtil;
import org.eclipse.sirius.diagram.business.api.view.refresh.CanonicalSynchronizer;
import org.eclipse.sirius.diagram.business.api.view.refresh.CanonicalSynchronizerFactory;
import org.eclipse.sirius.diagram.business.internal.command.CreateAndStoreGMFDiagramCommand;
@@ -115,6 +102,17 @@ import org.eclipse.sirius.viewpoint.description.tool.ToolFactory;
import org.eclipse.sirius.viewpoint.description.tool.provider.ToolItemProviderAdapterFactory;
import org.eclipse.sirius.viewpoint.description.validation.provider.ValidationItemProviderAdapterFactory;
import org.eclipse.sirius.viewpoint.provider.ViewpointItemProviderAdapterFactory;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
/**
* The default diagram ui services.
@@ -131,14 +129,6 @@ public class DiagramDialectUIServices implements DialectUIServices {
private static final String EXPORT_DIAGRAM_AS_IMAGE_ERROR_ON_CREATE_IMAGE = "The program was not able to create image file ";
/**
- *
- * {@inheritDoc}
- */
- public IEditorPart openEditor(final Session session, final DRepresentation representation) {
- return openEditor(session, representation, new NullProgressMonitor());
- }
-
- /**
* {@inheritDoc}
*/
public IEditorPart openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor) {
diff --git a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/AbstractDiagramEdgeEditPart.java b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/AbstractDiagramEdgeEditPart.java
index 6653f70a14..b9e3c58992 100644
--- a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/AbstractDiagramEdgeEditPart.java
+++ b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/AbstractDiagramEdgeEditPart.java
@@ -39,9 +39,8 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnecti
import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
import org.eclipse.gmf.runtime.draw2d.ui.internal.routers.ITreeConnection;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.sirius.common.tools.api.util.StringUtil;
import org.eclipse.sirius.business.api.query.DDiagramElementQuery;
+import org.eclipse.sirius.common.tools.api.util.StringUtil;
import org.eclipse.sirius.diagram.edit.internal.part.CommonEditPartOperation;
import org.eclipse.sirius.diagram.edit.internal.part.DiagramEdgeEditPartOperation;
import org.eclipse.sirius.diagram.edit.internal.part.DiagramElementEditPartOperation;
@@ -62,6 +61,7 @@ import org.eclipse.sirius.viewpoint.description.tool.AbstractToolDescription;
import org.eclipse.sirius.viewpoint.description.tool.PaneBasedSelectionWizardDescription;
import org.eclipse.sirius.viewpoint.description.tool.RequestDescription;
import org.eclipse.sirius.viewpoint.description.tool.SelectionWizardDescription;
+import org.eclipse.swt.graphics.Image;
/**
* Implementation of the default behaviors of edges.
@@ -322,15 +322,6 @@ public abstract class AbstractDiagramEdgeEditPart extends ConnectionNodeEditPart
/**
* {@inheritDoc}
*
- * @see org.eclipse.sirius.diagram.edit.api.part.IDiagramEdgeEditPart#refreshPath()
- */
- public void refreshPath() {
- // Do nothing
- }
-
- /**
- * {@inheritDoc}
- *
* @see org.eclipse.sirius.diagram.edit.api.part.IDiagramElementEditPart#getEAdapterDiagramElement()
*/
public NotificationListener getEAdapterDiagramElement() {
diff --git a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/IDiagramEdgeEditPart.java b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/IDiagramEdgeEditPart.java
index 0814abbeb8..28f8b1ca6c 100644
--- a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/IDiagramEdgeEditPart.java
+++ b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/edit/api/part/IDiagramEdgeEditPart.java
@@ -59,14 +59,6 @@ public interface IDiagramEdgeEditPart extends IDiagramElementEditPart, INodeEdit
void refreshLineStyle();
/**
- * Refreshes the path of the edge.
- *
- * @deprecated
- */
- @Deprecated
- void refreshPath();
-
- /**
* Returns the listener that listens the routing style of the connection.
*
* @return the listener that listens the routing style of the connection.
diff --git a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/ui/tools/api/figure/WorkspaceImageFigure.java b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/ui/tools/api/figure/WorkspaceImageFigure.java
index 0bc4c8a085..72df9fb11b 100644
--- a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/ui/tools/api/figure/WorkspaceImageFigure.java
+++ b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/ui/tools/api/figure/WorkspaceImageFigure.java
@@ -16,12 +16,12 @@ import java.net.MalformedURLException;
import org.eclipse.core.runtime.Path;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.sirius.common.tools.api.resource.FileProvider;
import org.eclipse.sirius.diagram.part.SiriusDiagramEditorPlugin;
import org.eclipse.sirius.diagram.tools.internal.image.ImagesPath;
import org.eclipse.sirius.viewpoint.ContainerStyle;
import org.eclipse.sirius.viewpoint.WorkspaceImage;
+import org.eclipse.swt.graphics.Image;
/**
* The {@link WorkspaceImageFigure} is useful to load images using a cache. The
@@ -101,9 +101,7 @@ public class WorkspaceImageFigure extends AbstractTransparentImage implements IW
* the path is a "/project/file" path, if it's not found in the
* workspace, the class will look for the file in the plug-ins.
* @return an image instance given the path.
- * @deprecated
*/
- @Deprecated
public static Image flyWeightImage(final String path) {
if (path != null) {
final File imageFile = FileProvider.getDefault().getFile(new Path(path));
@@ -126,9 +124,7 @@ public class WorkspaceImageFigure extends AbstractTransparentImage implements IW
* @param desc
* the image descriptor
* @return an image instance given the image descriptor.
- * @deprecated
*/
- @Deprecated
public static Image flyWeightImage(final ImageDescriptor desc) {
if (desc != null) {
return SiriusDiagramEditorPlugin.getInstance().getImage(desc);
@@ -149,7 +145,6 @@ public class WorkspaceImageFigure extends AbstractTransparentImage implements IW
* workspace, the class will look for the file in the plug-ins.
* @return an image instance given the path.
*/
- @Deprecated
public static WorkspaceImageFigure createImageFigure(final String path) {
final WorkspaceImageFigure fig = new WorkspaceImageFigure(WorkspaceImageFigure.flyWeightImage(path));
return fig;
@@ -162,7 +157,6 @@ public class WorkspaceImageFigure extends AbstractTransparentImage implements IW
* : an instance of {@link WorkspaceImage}.
* @return the image figure built using the {@link WorkspaceImage} object.
*/
- @Deprecated
public static WorkspaceImageFigure createImageFigure(final WorkspaceImage wksImage) {
final String path = wksImage.getWorkspacePath();
return WorkspaceImageFigure.createImageFigure(path);
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
index 882b8640c4..e58837e7b7 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
@@ -18,6 +18,7 @@ h4. Changes in @org.eclipse.sirius.common@
* The deprecated method @IEditingDomainFactory.createEditingDomain()@ has been removed. Use the (inherited) @createEditingDomain(ResourceSet)@ instead, which ensures correct behavior for all kinds of models (Xtext for example).
* The deprecated field @org.eclipse.sirius.common.tools.api.listener.Notification.FOLD@ has been removed. It was never used by Sirius itself, so if your code tried to listen to this kind of notification it was never actually called and can be safely removed.
* The deprecated methods @getExtensionPlugins()@ and @getElementsProvidedByPlugin@ from @EcliseUtil@ have been removed. If you need this kind of functionality, use the Eclipse APIs directly instead.
+* The deprecated fields @COLUMN_SEMANTIC@ and @LINE_SEMANTIC@ of @IInterpreterSiriusVariables@ have been removed. Use the constants of @org.eclipse.sirius.table.tools.api.interpreter.IInterpreterSiriusTableVariables@ instead.
h4. Changes in @org.eclipse.sirius@
@@ -43,10 +44,43 @@ h4. Changes in @org.eclipse.sirius@
* The deprecated constructor @AddSemanticResourceCommand(Session, URI)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
* The deprecated constructors of @RemoveSemanticResourceCommand@ have been removed. Use the variants which takes an additional @IProgressMonitor@ instead.
* The deprecated constructor in @CreateDiagramWithInitialOperation@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* The deprecated method @SessionManager.addResource(Session, Resource)@ has been removed. Use the @Session.addSemanticResource(URI, IProgressMonitor)@ instead. In code, @mySessionManager.addResource(mySession, myResource)@ should be replaced by @mySession.addSemanticResource(myResource.getURI(), new NullProgressMonitor())@. Notice that this replacement has not the exact same behavior. The notifications @SessionListener.ABOUT_TO_BE_REPLACED@ and @SessionListener.REPLACED@ are not thrown with @addSemanticResource@ contrary to @addResource@. But this kind of notifications is more for reloading of resource.
+* The deprecated constructor of @DefaultLocalSessionCreationOperation@ have been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* The deprecated method @SessionManager.getSession(URI)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* The deprecated method @SessionFactory.createSession(URI)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* Deprecated class @RefreshRepresentationCommand@ has been removed. Use the class @RefreshRepresentationsCommand@ instead.
+* Deprecated classes @RevealSiriusElement@ and @RevealDDiagramElement@ have been removed. Use the class @RevealDDiagramElements@ instead.
+* The deprecated method @DAnalysisSession.save(Map<?, ?>)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* The deprecated method @MappingTableEntry.getImporter()@ has been updated. It now returns an optional (@org.eclipse.sirius.common.tools.api.util.Option@) of @MappingTableEntry@.
+* The deprecated class @IEMFCommandFactory@ has been removed. It is not used in Sirius code anymore.
+* The deprecated method @IDiagramCommandFactory.buildCreateDiagramFromDescription(DiagramDescription, EObject)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* The deprecated methods @dispose()@ and @disposeInterpreterRegistry(EObject)@ have been removed from @InterpreterRegistry@. They corresponded to dead code.
+* The deprecated method @InterpreterRegistry.prepareImportsFromModelElement(IInterpreter, EObject)@ has been removed. Use @InterpreterRegistry.prepareImportsFromSession(IInterpreter, Session)@ instead. To get @Session@ from @EObject@, you can use @SessionManager.INSTANCE.getSession(EObject)@.
+* The deprecated method @SiriusHelper.createDAnalysis()@ has been removed. Use @ViewpointFactory.eINSTANCE.createDAnalysis()@ instead.
+* The deprecated method @SessionFactory.createSession(DAnalysis)@ has been removed. It is not intended to be used, but it can be replaced by @SessionFactory.INSTANCE.createSession(analysis.eResource().getURI(), new NullProgressMonitor())@.
+
+h4. Changes in @org.eclipse.sirius.diagram@
+
+* The deprecated methods @IDiagramEdgeEditPart.refreshPath()@ and @AbstractDiagramEdgeEditPart.refreshPath()@ have been removed. It is not called in Sirius code anymore
+
+h4. Changes in @org.eclipse.sirius.ecore.extender@
+
+* The deprecated methods @IMetamodelExtender.eDelete(EObject)@, @CompositeMetamodelExtender.eDelete(EObject)@ and @ModelAccessor.eDelete(EObject)@ have been removed. Use the variants which takes an additional @ECrossReferenceAdapter@ instead. This @ECrossReferenceAdapter@ can be null.
h4. Changes in @org.eclipse.sirius.ui@
* All deprecated methods in @ModelingProjectManager@ have been removed. Use the corresponding versions which take an additional @IProgressMonitor@ parameter instead.
+* All deprecated methods in @ViewpointSelection@ have been removed. Use the corresponding versions which take an additional @IProgressMonitor@ parameter instead.
+* Deprecated class @org.eclipse.sirius.ui.business.api.control.SiriusControlCommand@ has been removed. Use the class @org.eclipse.sirius.business.api.control.SiriusControlCommand@ instead (same constructor but with an additional @IProgressMonitor@ parameter).
+** Ditto for @SiriusUnControlCommand@
+* The deprecated method @DialectUIServices.openEditor(Session, DRepresentation)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* The deprecated method @SessionHelper.openStartupRepresentations(Session)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* The deprecated method @SiriusControlHandler.performControl(Shell, EObject)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+* The deprecated method @SiriusUncontrolHandler.performUncontrol(Shell, EObject)@ has been removed. Use the variant which takes an additional @IProgressMonitor@ instead.
+
+h4. Changes in @org.eclipse.sirius.table@
+
+* The deprecated method @TableHelper.getCell(DLine, String)@ has been removed. Use the variant which take a DLine and a DColumn as parameters.
h4. Changes in @org.eclipse.sirius.tree@
diff --git a/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/CompositeMetamodelExtender.java b/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/CompositeMetamodelExtender.java
index 841d5c0324..367a8afa16 100644
--- a/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/CompositeMetamodelExtender.java
+++ b/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/CompositeMetamodelExtender.java
@@ -21,14 +21,13 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
+import org.eclipse.sirius.ecore.extender.business.internal.common.ExtenderDescriptor;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
-import org.eclipse.sirius.ecore.extender.business.internal.common.ExtenderDescriptor;
-
/**
* Aggregate more {@link IMetamodelExtender}'s using a priority system.
*
@@ -235,13 +234,6 @@ public class CompositeMetamodelExtender extends AbstractMetamodelExtender {
}
/**
- * {@inheritDoc}
- */
- public EObject eDelete(final EObject objectToRemove) {
- return eDelete(objectToRemove, null);
- }
-
- /**
*
* {@inheritDoc}
*
diff --git a/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/IMetamodelExtender.java b/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/IMetamodelExtender.java
index 4ba2fe8c39..5a87a72f8e 100644
--- a/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/IMetamodelExtender.java
+++ b/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/IMetamodelExtender.java
@@ -240,20 +240,6 @@ public interface IMetamodelExtender {
*
* @param objectToRemove
* object to delete.
- * @return the deleted instance or null if it was not able to delete it.
- *
- * @deprecated Use {@link #eDelete(EObject, ECrossReferenceAdapter)}
- * instead.
- */
- @Deprecated
- EObject eDelete(EObject objectToRemove);
-
- /**
- * Remove the Object from its container and delete all the dangling
- * references.
- *
- * @param objectToRemove
- * object to delete.
* @param xref
* the optional cross-referencer to use to locate all the
* dangling references.
diff --git a/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/ModelAccessor.java b/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/ModelAccessor.java
index e6a94e8e1e..c8defa9a46 100644
--- a/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/ModelAccessor.java
+++ b/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/api/accessor/ModelAccessor.java
@@ -21,9 +21,6 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EStructuralFeature.Setting;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
-
-import com.google.common.base.Predicate;
-
import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.FeatureNotFoundException;
import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaClassNotFoundException;
import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuthority;
@@ -31,6 +28,8 @@ import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAutho
import org.eclipse.sirius.ecore.extender.business.api.permission.exception.LockedInstanceException;
import org.eclipse.sirius.ecore.extender.business.internal.permission.PermissionService;
+import com.google.common.base.Predicate;
+
/**
* This class is the common layer to access emf models. You may want to use it
* when you want to extend Ecore meta-model or if you want to handle the
@@ -407,29 +406,6 @@ public class ModelAccessor {
*
* @param objectToRemove
* object to delete.
- * @deprecated Use {@link #eDelete(EObject, ECrossReferenceAdapter)}
- * instead.
- */
- @Deprecated
- public void eDelete(final EObject objectToRemove) {
- if (authority.canDeleteInstance(objectToRemove)) {
- final EObject container = extender.eContainer(objectToRemove);
- if (container != null && authority.canEditInstance(container)) {
- final String featureName = extender.eContainingFeatureName(objectToRemove);
- final Object value = extender.eRemove(container, featureName, objectToRemove);
- if (value != null) {
- authority.notifyInstanceDeletion(objectToRemove);
- }
- }
- }
- }
-
- /**
- * Remove the Object from its container and delete all the dangling
- * references.
- *
- * @param objectToRemove
- * object to delete.
* @param xref
* the optional cross-referencer to use to locate all the
* dangling references.
diff --git a/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/internal/accessor/ecore/EcoreIntrinsicExtender.java b/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/internal/accessor/ecore/EcoreIntrinsicExtender.java
index b9b42606c9..a1deff55c9 100644
--- a/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/internal/accessor/ecore/EcoreIntrinsicExtender.java
+++ b/plugins/org.eclipse.sirius.ecore.extender/src/org/eclipse/sirius/ecore/extender/business/internal/accessor/ecore/EcoreIntrinsicExtender.java
@@ -156,13 +156,6 @@ public class EcoreIntrinsicExtender extends AbstractMetamodelExtender {
/**
* {@inheritDoc}
*/
- public EObject eDelete(final EObject objectToRemove) {
- return eDelete(objectToRemove, null);
- }
-
- /**
- * {@inheritDoc}
- */
public EObject eDelete(final EObject objectToRemove, final ECrossReferenceAdapter xref) {
return eDelete(objectToRemove, xref, null);
}
@@ -389,7 +382,7 @@ public class EcoreIntrinsicExtender extends AbstractMetamodelExtender {
}
return literal;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
index 2448149daa..9a04044028 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
@@ -16,7 +16,6 @@ import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
import org.eclipse.emf.common.util.URI;
@@ -78,13 +77,8 @@ import com.google.common.collect.Sets;
*/
public class TableDialectUIServices implements DialectUIServices {
/**
- *
* {@inheritDoc}
*/
- public IEditorPart openEditor(final Session session, final DRepresentation representation) {
- return openEditor(session, representation, new NullProgressMonitor());
- }
-
public IEditorPart openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor) {
IEditorPart editorPart = null;
try {
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/CreateRepresentationFromRepresentationCreationDescription.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/CreateRepresentationFromRepresentationCreationDescription.java
index cd335e8f38..59d2df88d5 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/CreateRepresentationFromRepresentationCreationDescription.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/CreateRepresentationFromRepresentationCreationDescription.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.action;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.notify.AdapterFactory;
@@ -18,14 +19,14 @@ import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException;
-import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
-import org.eclipse.sirius.common.tools.api.util.StringUtil;
-import org.eclipse.sirius.common.ui.SiriusTransPlugin;
import org.eclipse.sirius.business.api.dialect.command.CreateRepresentationCommand;
import org.eclipse.sirius.business.api.logger.RuntimeLoggerManager;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionManager;
+import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException;
+import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
+import org.eclipse.sirius.common.tools.api.util.StringUtil;
+import org.eclipse.sirius.common.ui.SiriusTransPlugin;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.sirius.tools.api.interpreter.InterpreterUtil;
import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
@@ -135,7 +136,7 @@ public class CreateRepresentationFromRepresentationCreationDescription extends A
final Session session = SessionManager.INSTANCE.getSession(target.getTarget());
- DialectUIManager.INSTANCE.openEditor(session, command.getCreatedRepresentation());
+ DialectUIManager.INSTANCE.openEditor(session, command.getCreatedRepresentation(), new NullProgressMonitor());
} catch (final InterruptedException e) {
// the user pressed "cancel", let's do nothing
}
diff --git a/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/api/helper/TableHelper.java b/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/api/helper/TableHelper.java
index 6bbfd6a7a4..8806d48930 100644
--- a/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/api/helper/TableHelper.java
+++ b/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/api/helper/TableHelper.java
@@ -20,9 +20,6 @@ import org.eclipse.emf.common.util.UniqueEList;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
-
-import com.google.common.collect.Maps;
-
import org.eclipse.sirius.common.tools.api.util.Option;
import org.eclipse.sirius.common.tools.api.util.Options;
import org.eclipse.sirius.common.tools.api.util.StringUtil;
@@ -51,6 +48,8 @@ import org.eclipse.sirius.tools.api.ui.color.EnvironmentSystemColorFactory;
import org.eclipse.sirius.viewpoint.RGBValues;
import org.eclipse.sirius.viewpoint.description.SystemColor;
+import com.google.common.collect.Maps;
+
/**
* Utility methods to handle Table models.
*
@@ -211,36 +210,6 @@ public final class TableHelper {
}
/**
- * Get the {@link DCell} corresponding to the intersection of this line with
- * the column which have the featureName.<BR>
- * If there are two columns with the same feature names, the first is
- * returned.
- *
- * @param line
- * The line
- * @param featureName
- * the featureName mapping of the column
- * @return A {@link DCell}
- * @deprecated The featureName is not necessarily unique among the columns
- * of a given table, and this methods only sees the first one.
- * Use {@link #getCell(DLine, DColumn)} instead.
- */
- public static DCell getCell(final DLine line, final String featureName) {
- DCell result = null;
- // Get the table of this line
- final DTable table = TableHelper.getTable(line);
- // Get the Column corresponding to the index
- final DColumn column = TableHelper.getColumn(table, featureName);
- // Search the corresponding cells
- for (final DCell cell : line.getCells()) {
- if (column.equals(cell.getColumn())) {
- result = cell;
- }
- }
- return result;
- }
-
- /**
* Get the {@link DColumn} with a mapping on featureName attribute.
*
* @param table
@@ -525,17 +494,6 @@ public final class TableHelper {
* Return The default background color for the cell of the table.
*
* @return The default background color for the cell of the table
- * @deprecated Use getCellDefaultFixedBackgroundColor() instead.
- */
- @Deprecated
- public static SystemColor getCellDefaultBackgroundColor() {
- return EnvironmentSystemColorFactory.getDefault().getSystemColorDescription("white");
- }
-
- /**
- * Return The default background color for the cell of the table.
- *
- * @return The default background color for the cell of the table
*/
public static SystemColor getCellDefaultForegroundColor() {
return EnvironmentSystemColorFactory.getDefault().getSystemColorDescription("gray");
diff --git a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java
index a69d59e432..5bdecab9fe 100644
--- a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java
+++ b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java
@@ -16,7 +16,6 @@ import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
@@ -29,19 +28,9 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
+import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.common.tools.DslCommonPlugin;
import org.eclipse.sirius.common.tools.api.util.StringUtil;
-import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey;
import org.eclipse.sirius.tree.DTree;
import org.eclipse.sirius.tree.DTreeItem;
@@ -61,6 +50,15 @@ import org.eclipse.sirius.viewpoint.DRepresentationElement;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.description.DescriptionPackage;
import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
/**
* Implementation of the UI services for the tree dialect.
@@ -89,16 +87,6 @@ public class TreeDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#openEditor(org.eclipse.sirius.business.api.session.Session,
- * org.eclipse.sirius.viewpoint.DRepresentation)
- */
- public IEditorPart openEditor(Session session, DRepresentation representation) {
- return openEditor(session, representation, new NullProgressMonitor());
- }
-
- /**
- * {@inheritDoc}
*/
public IEditorPart openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor) {
IEditorPart editorPart = null;
diff --git a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/CreateRepresentationFromRepresentationCreationDescription.java b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/CreateRepresentationFromRepresentationCreationDescription.java
index 0a41fe47c4..2616772aef 100644
--- a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/CreateRepresentationFromRepresentationCreationDescription.java
+++ b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/CreateRepresentationFromRepresentationCreationDescription.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.tree.ui.tools.internal.editor.actions;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.notify.AdapterFactory;
@@ -18,14 +19,14 @@ import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException;
-import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
-import org.eclipse.sirius.common.tools.api.util.StringUtil;
-import org.eclipse.sirius.common.ui.SiriusTransPlugin;
import org.eclipse.sirius.business.api.dialect.command.CreateRepresentationCommand;
import org.eclipse.sirius.business.api.logger.RuntimeLoggerManager;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionManager;
+import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException;
+import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
+import org.eclipse.sirius.common.tools.api.util.StringUtil;
+import org.eclipse.sirius.common.ui.SiriusTransPlugin;
import org.eclipse.sirius.tools.api.interpreter.InterpreterUtil;
import org.eclipse.sirius.tree.business.api.command.ITreeCommandFactory;
import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
@@ -133,7 +134,7 @@ public class CreateRepresentationFromRepresentationCreationDescription extends A
final Session session = SessionManager.INSTANCE.getSession(target.getTarget());
- DialectUIManager.INSTANCE.openEditor(session, command.getCreatedRepresentation());
+ DialectUIManager.INSTANCE.openEditor(session, command.getCreatedRepresentation(), new NullProgressMonitor());
} catch (final InterruptedException e) {
// the user pressed "cancel", let's do nothing
}
diff --git a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/OpenRepresentationAction.java b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/OpenRepresentationAction.java
index 7ddf3fc016..24c5ff0c56 100644
--- a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/OpenRepresentationAction.java
+++ b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/actions/OpenRepresentationAction.java
@@ -15,7 +15,6 @@ import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorPart;
import org.eclipse.sirius.business.api.dialect.DialectManager;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.ui.business.api.dialect.DialectEditor;
@@ -23,6 +22,7 @@ import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
import org.eclipse.sirius.ui.business.api.session.IEditingSession;
import org.eclipse.sirius.ui.business.api.session.SessionUIManager;
import org.eclipse.sirius.viewpoint.DRepresentation;
+import org.eclipse.ui.IEditorPart;
public final class OpenRepresentationAction extends Action {
@@ -85,7 +85,7 @@ public final class OpenRepresentationAction extends Action {
protected void doExecute() {
final IEditingSession ui = SessionUIManager.INSTANCE.getUISession(session);
DialectManager.INSTANCE.refresh(representation, new NullProgressMonitor());
- final IEditorPart part = DialectUIManager.INSTANCE.openEditor(session, representation);
+ final IEditorPart part = DialectUIManager.INSTANCE.openEditor(session, representation, new NullProgressMonitor());
if (part != null && ui != null) {
ui.attachEditor((DialectEditor) part);
}
diff --git a/plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF
index d22bf9f723..428ca23502 100644
--- a/plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF
@@ -8,8 +8,7 @@ Bundle-Activator: org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin$Impleme
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.sirius.ui.business.api.action,
- org.eclipse.sirius.ui.business.api.control,
- org.eclipse.sirius.ui.business.api.delete,
+ org.eclipse.sirius.ui.business.api.delete,
org.eclipse.sirius.ui.business.api.descriptor,
org.eclipse.sirius.ui.business.api.dialect,
org.eclipse.sirius.ui.business.api.dialect.marker,
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/control/SiriusControlCommand.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/control/SiriusControlCommand.java
deleted file mode 100644
index a3205c3695..0000000000
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/control/SiriusControlCommand.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 THALES GLOBAL SERVICES.
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.sirius.ui.business.api.control;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.ui.IEditorPart;
-
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Sets;
-
-import org.eclipse.sirius.common.tools.api.util.Option;
-import org.eclipse.sirius.business.api.preferences.SiriusPreferencesKeys;
-import org.eclipse.sirius.business.api.query.DAnalysisQuery;
-import org.eclipse.sirius.business.api.query.EObjectQuery;
-import org.eclipse.sirius.business.api.session.Session;
-import org.eclipse.sirius.business.api.session.SessionManager;
-import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession;
-import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSessionHelper;
-import org.eclipse.sirius.business.internal.command.control.ControlCommand;
-import org.eclipse.sirius.ui.business.api.session.IEditingSession;
-import org.eclipse.sirius.ui.business.api.session.SessionUIManager;
-import org.eclipse.sirius.viewpoint.DAnalysis;
-import org.eclipse.sirius.viewpoint.DRepresentation;
-import org.eclipse.sirius.viewpoint.DRepresentationContainer;
-import org.eclipse.sirius.viewpoint.DSemanticDecorator;
-import org.eclipse.sirius.viewpoint.DView;
-import org.eclipse.sirius.viewpoint.ViewpointFactory;
-import org.eclipse.sirius.viewpoint.SiriusPlugin;
-import org.eclipse.sirius.viewpoint.description.Viewpoint;
-
-/**
- * An extension of the basic {@link ControlCommand} to handle both the semantic
- * model and the corresponding Sirius representations. Also handles session
- * state and modification-tracking management.
- *
- * @since 0.9.0
- *
- * @author pcdavid
- * @deprecated use
- * {@link org.eclipse.sirius.business.api.control.SiriusControlCommand}
- * instead
- */
-public class SiriusControlCommand extends ControlCommand {
- /**
- * The session containing the models to modify.
- */
- private final Session session;
-
- /**
- * The representations which must be controlled in addition to the semantic
- * element.
- */
- private final Set<DRepresentation> representations;
-
- /**
- * The URI of the <code>.aird</code> resource in which to move the
- * representations.
- */
- private final URI representationsDestination;
-
- /**
- * A boolean to set if the session should be save at the end of this
- * command.
- */
- private final boolean shouldEndBySaving;
-
- /**
- * Create a new {@link SiriusControlCommand}.
- *
- * @param semanticRoot
- * the semantic element to control.
- * @param semanticDest
- * the URI of the resource in which to control the semantic
- * element.
- * @param representations
- * the set of representations to control in addition to the
- * semantic element.
- * @param representationsDest
- * the URI of the <code>.aird</code> resource in which to move
- * the representations.
- */
- public SiriusControlCommand(final EObject semanticRoot, final URI semanticDest, final Set<DRepresentation> representations, final URI representationsDest) {
- super(semanticRoot, semanticDest);
- this.session = SessionManager.INSTANCE.getSession(semanticRoot);
- this.representations = Sets.newHashSet(representations);
- this.representationsDestination = representationsDest;
- this.shouldEndBySaving = true;
- }
-
- /**
- * Create a new {@link SiriusControlCommand}.
- *
- * @param semanticRoot
- * the semantic element to control.
- * @param semanticDest
- * the URI of the resource in which to control the semantic
- * element.
- * @param representations
- * the set of representations to control in addition to the
- * semantic element.
- * @param representationsDest
- * the URI of the <code>.aird</code> resource in which to move
- * the representations.
- * @param shouldEndBySaving
- * A boolean to set if the session should be save at the end of
- * this command.
- */
- public SiriusControlCommand(final EObject semanticRoot, final URI semanticDest, final Set<DRepresentation> representations, final URI representationsDest, final boolean shouldEndBySaving) {
- super(semanticRoot, semanticDest);
- this.session = SessionManager.INSTANCE.getSession(semanticRoot);
- this.representations = Sets.newHashSet(representations);
- this.representationsDestination = representationsDest;
- this.shouldEndBySaving = shouldEndBySaving;
- }
-
- /**
- * Executes the control command.
- */
- @Override
- protected void doExecute() {
- super.doExecute(); // Control the semantic model
- markContainerResourceAsModified(semanticObjectToControl.eContainer());
- enableTrackingModification(controlledResource);
- createNewRepresentationsFileAndMoveRepresentations();
- notifySessionAboutControlledModel();
- if (shouldEndBySaving) {
- saveSession(); // Auto save the session
- }
- }
-
- private void markContainerResourceAsModified(final EObject obj) {
- EObject rootContainer = getRootContainer(obj);
- if (obj != null && rootContainer != null && rootContainer.eResource() != null) {
- rootContainer.eResource().setModified(true);
- }
- }
-
- /**
- * Get root container of specified object.<br>
- * Default implementation consists in getting the resource container i.e the
- * first parent container serialized in its own resource.
- *
- * @param eObject
- * the current EObject.
- * @return should not be <code>null</code>
- */
- protected EObject getRootContainer(EObject eObject) {
- return new EObjectQuery(eObject).getResourceContainer();
- }
-
- private void enableTrackingModification(final Resource resource) {
- if (!resource.isTrackingModification()) {
- resource.setTrackingModification(true);
- }
- }
-
- /**
- * Create a new representations resource if needed :
- * <UL>
- * <LI>some representations must be moved</LI>
- * <LI>or the preference to create empty representations file is set to true
- * </LI>
- * </UL>
- * then move the representations to this new resource (if there are some
- * representations to move).
- */
- private void createNewRepresentationsFileAndMoveRepresentations() {
- boolean emptyAirdFragmentOnControl = Platform.getPreferencesService().getBoolean(SiriusPlugin.ID, SiriusPreferencesKeys.PREF_EMPTY_AIRD_FRAGMENT_ON_CONTROL.name(), false, null);
- if (representations.isEmpty() && !emptyAirdFragmentOnControl) {
- return;
- }
- final Resource newRepresentationsFile;
- if (representations.isEmpty() && emptyAirdFragmentOnControl) {
- // It is allowed to create an aird fragment with no representation
- Resource firstAird = session.getSessionResource();
- newRepresentationsFile = firstAird.getResourceSet().createResource(representationsDestination);
- // Creation of a DRepresentationContainer for each session
- // viewpoint. This way, we will be able to open the empty aird
- // fragment with the viewpoints properly set
- DAnalysis newDAnalysis = getDAnalysis(newRepresentationsFile);
- for (Viewpoint viewpoint : session.getSelectedViewpoints(false)) {
- DRepresentationContainer createDRepresentationContainer = ViewpointFactory.eINSTANCE.createDRepresentationContainer();
- createDRepresentationContainer.setViewpoint(viewpoint);
- newDAnalysis.getOwnedViews().add(createDRepresentationContainer);
- newDAnalysis.getSelectedViews().add(createDRepresentationContainer);
- }
-
- } else {
- newRepresentationsFile = getOrCreateChildResource(getParentAird(), representationsDestination);
- }
- final DAnalysis newDAnalysis = getDAnalysis(newRepresentationsFile);
- // Add the new semantic root to the models reference of the new analysis
- newDAnalysis.getModels().add(this.controlledResource.getContents().get(0));
- // Update the referencedAnalysis according to the new analysis
- updateReferencedAnalysisReferences(newDAnalysis);
-
- // Move the selected representations to the new analysis
- moveRepresentations(newDAnalysis);
- // Update the models references of all representations files (except the
- // representations file of the new analysis that will be updated during
- // the moveRepresentations) of this session according to the
- // representations
- updateModelsReferences(newDAnalysis);
- }
-
- /**
- * The new analysis is added to the referencedAnalysis of the first parent
- * representations file and the children analysis of this first parent
- * representations file are analyzed to be eventually moved.<BR>
- * <UL>
- * <LI>Take the root of the resource container the parent of the controlled
- * semantic element</LI>
- * <LI>For each analysis that have this root as first models:</LI>
- * <UL>
- * <LI>If the controlled semantic element contains the first models of a
- * referencedAnalysis of the current analysis, then move this one in the new
- * analysis (this corresponds to a fragmentation of intermediate level).</LI>
- * <LI>Add the new analysis to the referencedAnalysis references</LI>
- * <UL>
- * </UL>
- *
- * @param newDAnalysis
- * The new analysis
- */
- private void updateReferencedAnalysisReferences(final DAnalysis newDAnalysis) {
- EObject semanticParentRoot = getRootContainer(semanticObjectToControl.eContainer());
- Set<DAnalysis> referencers = Sets.newLinkedHashSet();
-
- for (Resource aird : session.getAllSessionResources()) {
- DAnalysis currentAnalysis = getDAnalysis(aird);
- Option<EObject> optionalMainModel = new DAnalysisQuery(currentAnalysis).getMainModel();
- if (optionalMainModel.some() && optionalMainModel.get().equals(semanticParentRoot)) {
- List<DAnalysis> referencedAnalysis = new ArrayList<DAnalysis>(currentAnalysis.getReferencedAnalysis());
- for (DAnalysis childrenAnalysis : referencedAnalysis) {
- Option<EObject> optionalChildrenMainModel = new DAnalysisQuery(childrenAnalysis).getMainModel();
- if (optionalChildrenMainModel.some() && new EObjectQuery(optionalChildrenMainModel.get()).isContainedIn(semanticObjectToControl)) {
- currentAnalysis.getReferencedAnalysis().remove(childrenAnalysis);
- newDAnalysis.getReferencedAnalysis().add(childrenAnalysis);
- }
- }
- referencers.add(currentAnalysis);
- }
- }
-
- if (!referencers.isEmpty() && session instanceof DAnalysisSession) {
- // Let the session set the reference and add adapters (visibility
- // propagator, semantic cross referencer, representation change
- // adapter, ...)
- ((DAnalysisSession) session).addReferencedAnalysis(newDAnalysis, referencers);
- }
- }
-
- /**
- * Move the selected representations from this session to another analysis.
- * The models references of the target analysis are updated according to the
- * moved representations.
- *
- * @param targetAnalysis
- * The analysis in which the representations must be moved.
- */
- private void moveRepresentations(final DAnalysis targetAnalysis) {
- final IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session);
- // Close the editor (if opened) of each representation and move it
- for (final DRepresentation representation : representations) {
- if (uiSession != null) {
- closeOpenedEditor(uiSession, representation);
- }
- ((DAnalysisSession) session).moveRepresentation(targetAnalysis, representation);
- }
- }
-
- /**
- * Update the models references of all representations files of this
- * session.
- *
- * @param analysisToIgnore
- * The models references of this DAnalysis will not be updated.
- */
- private void updateModelsReferences(DAnalysis analysisToIgnore) {
- for (Resource resource : ((DAnalysisSession) session).getAllSessionResources()) {
- for (EObject content : resource.getContents()) {
- if (content instanceof DAnalysis && !content.equals(analysisToIgnore)) {
- for (final DView view : ((DAnalysis) content).getOwnedViews()) {
- if (view instanceof DRepresentationContainer) {
- DAnalysisSessionHelper.updateModelsReferences((DAnalysis) content, Iterators.filter(((DRepresentationContainer) view).eAllContents(), DSemanticDecorator.class));
- }
- }
- }
- }
- }
- }
-
- /**
- * Returns the current resource containing the representations to move.
- */
- private Resource getParentAird() {
- return representations.iterator().next().eResource();
- }
-
- /**
- * Close any editor opened on a representation about to move.
- */
- private void closeOpenedEditor(final IEditingSession uiSession, final DRepresentation representation) {
- final IEditorPart editor = uiSession.getEditor(representation);
- if (editor != null) {
- editor.getEditorSite().getPage().closeEditor(editor, false);
- }
- }
-
- /**
- * Returns the first DAnalysis among the roots of the specified resource.
- * Creates and adds a new one if none is found.
- */
- private DAnalysis getDAnalysis(final Resource aird) {
- for (EObject root : aird.getContents()) {
- if (root instanceof DAnalysis) {
- return (DAnalysis) root;
- }
- }
-
- final DAnalysis newAnalysis = ViewpointFactory.eINSTANCE.createDAnalysis();
- aird.getContents().add(newAnalysis);
- return newAnalysis;
- }
-
- private void notifySessionAboutControlledModel() {
- if (session instanceof DAnalysisSession) {
- ((DAnalysisSession) session).notifyControlledModel(controlledResource);
- }
- }
-
- private void saveSession() {
- final IEditingSession ui = SessionUIManager.INSTANCE.getUISession(session);
- if (ui != null) {
- ui.close();
- }
- session.save(new NullProgressMonitor());
- if (ui != null) {
- ui.open();
- }
- }
-}
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/control/SiriusUncontrolCommand.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/control/SiriusUncontrolCommand.java
deleted file mode 100644
index 23c8e95e20..0000000000
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/control/SiriusUncontrolCommand.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 THALES GLOBAL SERVICES.
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.sirius.ui.business.api.control;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.sirius.business.api.query.DAnalysisQuery;
-import org.eclipse.sirius.business.api.query.EObjectQuery;
-import org.eclipse.sirius.business.api.session.Session;
-import org.eclipse.sirius.business.api.session.SessionManager;
-import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession;
-import org.eclipse.sirius.business.internal.command.control.UncontrolCommand;
-import org.eclipse.sirius.common.tools.api.util.Option;
-import org.eclipse.sirius.ui.business.api.session.IEditingSession;
-import org.eclipse.sirius.ui.business.api.session.SessionUIManager;
-import org.eclipse.sirius.viewpoint.DAnalysis;
-import org.eclipse.sirius.viewpoint.DRepresentation;
-import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin;
-import org.eclipse.ui.IEditorPart;
-
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-/**
- * An extension of the basic {@link UncontrolCommand} to handle both the
- * semantic model and the corresponding Sirius representations. Also handles
- * session state and modification-tracking management.
- *
- * @since 0.9.0
- *
- * @author pcdavid
- * @deprecated use
- * {@link org.eclipse.sirius.business.api.control.SiriusUncontrolCommand}
- * instead
- */
-public class SiriusUncontrolCommand extends UncontrolCommand {
-
- /**
- * The session containing the models to modify.
- */
- private final Session session;
-
- /**
- * A flag to indicate if we should uncontrol the representations in addition
- * to the semantic elements.
- */
- private final boolean uncontrolRepresentations;
-
- /**
- * Create a new {@link SiriusUncontrolCommand}.
- *
- * @param semanticRoot
- * the semantic model element to uncontrol.
- * @param uncontrolRepresentations
- * indicate if we should uncontrol the representations in
- * addition to the semantic elements.
- */
- public SiriusUncontrolCommand(final EObject semanticRoot, final boolean uncontrolRepresentations) {
- super(semanticRoot);
- this.uncontrolRepresentations = uncontrolRepresentations;
- this.session = SessionManager.INSTANCE.getSession(semanticRoot);
- }
-
- /**
- * Get root container of specified object.<br>
- * Default implementation consists in getting the resource container i.e the
- * first parent container serialized in its own resource.
- *
- * @param eObject
- * the current EObject.
- * @return should not be <code>null</code>
- */
- protected EObject getRootContainer(EObject eObject) {
- return new EObjectQuery(eObject).getResourceContainer();
- }
-
- /**
- * Execute the uncontrol action.
- */
- @Override
- protected void doExecute() {
- Resource childSemanticResource = semanticElementToUncontrol.eResource();
- Resource childAirdResource = getChildAirdResource();
-
- // get the parent aird resource before uncontrol.
- Resource parentAirdResource = getParentAirdResource();
-
- // Uncontrol the semantic model
- super.doExecute();
-
- markContainerResourceAsModified(semanticElementToUncontrol.eContainer());
- if (uncontrolRepresentations && childAirdResource != null) {
- moveRepresentations(childAirdResource, parentAirdResource, semanticElementToUncontrol.eResource());
- }
- cleanupChildrenResources(childSemanticResource, childAirdResource);
- saveSession(); // Auto save the session
- }
-
- /**
- * Remove the children semantic and representation resources after
- * uncontrol, both from the session and from the disk, if they are empty.
- */
- private void cleanupChildrenResources(final Resource childSemanticResource, final Resource childAirdResource) {
- notifySessionAboutUncontrolledResource(childSemanticResource);
- deleteResource(childSemanticResource);
- if (childAirdResource != null && uncontrolRepresentations && airdResourceHasNoRepresentations(childAirdResource)) {
- removeObsoleteAnalyis(childAirdResource);
- notifySessionAboutUncontrolledResource(childAirdResource);
- deleteResource(childAirdResource);
- }
- }
-
- private void removeObsoleteAnalyis(final Resource childAirdResource) {
- if (session instanceof DAnalysisSession) {
- ((DAnalysisSession) session).removeReferencedAnalysis(getDAnalysis(childAirdResource));
- }
- }
-
- private boolean airdResourceHasNoRepresentations(final Resource childAirdResource) {
- return Iterators.size(Iterators.filter(EcoreUtil.getAllProperContents(childAirdResource, true), DRepresentation.class)) == 0;
- }
-
- private Resource getChildAirdResource() {
- return getAirdResourceWithAnalysisOn(semanticElementToUncontrol);
- }
-
- private Resource getParentAirdResource() {
- return getAirdResourceWithAnalysisOn(getRootContainer(semanticElementToUncontrol.eContainer()));
- }
-
- /**
- * Get the resource that contains the analysis which has the specified
- * object as main models references.
- *
- * @param object
- * The object to search. This object must be a root of a semantic
- * model.
- * @return the corresponding resource if found, false otherwise.
- */
- protected Resource getAirdResourceWithAnalysisOn(final EObject object) {
-
- for (final Resource anResource : session.getAllSessionResources()) {
- for (final DAnalysis analysis : getAnalyses(anResource)) {
- Option<EObject> optionalMainModel = new DAnalysisQuery(analysis).getMainModel();
- if (optionalMainModel.some() && optionalMainModel.get().equals(object)) {
- return anResource;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns all DAnalysis among the roots of the specified resource.
- *
- * @param aird
- * the resource in which to search
- * @return list of DAnalysis of this resource
- */
- protected Collection<DAnalysis> getAnalyses(final Resource aird) {
- final Collection<DAnalysis> analyses = Lists.newArrayList();
- for (EObject root : aird.getContents()) {
- if (root instanceof DAnalysis) {
- analyses.add((DAnalysis) root);
- }
- }
- return analyses;
- }
-
- /**
- * Moves all the representations stored in <code>childResource</code> into
- * <code>parentResource</code>.
- */
- private void moveRepresentations(final Resource childResource, final Resource parentResource, final Resource parentSemanticResource) {
- final Collection<DRepresentation> representations = collectExistingRepresentations(childResource);
- final DAnalysis parentAnalysis = getDAnalysis(parentResource);
- final DAnalysis childAnalysis = getDAnalysis(childResource);
-
- final DAnalysisSession aSession = (DAnalysisSession) session;
- final IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session);
- for (final DRepresentation representation : representations) {
- if (uiSession != null) {
- closeOpenedEditor(uiSession, representation);
- }
- aSession.moveRepresentation(parentAnalysis, representation);
- }
-
- if (childAnalysis != null) {
- parentAnalysis.getReferencedAnalysis().addAll(childAnalysis.getReferencedAnalysis());
- }
- }
-
- /**
- * Close any editor opened on a representation about to move.
- */
- private void closeOpenedEditor(final IEditingSession uiSession, final DRepresentation representation) {
- final IEditorPart editor = uiSession.getEditor(representation);
- if (editor != null) {
- editor.getEditorSite().getPage().closeEditor(editor, false);
- }
- }
-
- private DAnalysis getDAnalysis(final Resource parentResource) {
- for (final EObject root : parentResource.getContents()) {
- if (root instanceof DAnalysis) {
- return (DAnalysis) root;
- }
- }
- return null;
- }
-
- private Collection<DRepresentation> collectExistingRepresentations(final Resource resource) {
- return Sets.newHashSet(Iterators.filter(EcoreUtil.getAllProperContents(resource, true), DRepresentation.class));
- }
-
- private void markContainerResourceAsModified(final EObject obj) {
- EObject resourceContainer = getRootContainer(obj);
- if (obj != null && resourceContainer != null && resourceContainer.eResource() != null) {
- resourceContainer.eResource().setModified(true);
- }
- }
-
- private void saveSession() {
- final IEditingSession ui = SessionUIManager.INSTANCE.getUISession(session);
- if (ui != null) {
- ui.close();
- }
- session.save(new NullProgressMonitor());
- if (ui != null) {
- ui.open();
- }
- }
-
- /**
- * Delete the physical workspace file underlying a resource, if any and
- * unload and remove this resource from its resourceSet.
- *
- * @param res
- * the resource to delete
- */
- protected void deleteResource(final Resource res) {
- if (res != null) {
- final IFile file = WorkspaceSynchronizer.getFile(res);
- try {
- res.save(Collections.emptyMap());
- res.delete(Collections.emptyMap());
-
- // Delete physical file (if any)
- if (file != null) {
- file.delete(true, true, new NullProgressMonitor());
- }
- } catch (IOException e) {
- SiriusEditPlugin.getPlugin().log(e);
- } catch (final CoreException e) {
- SiriusEditPlugin.getPlugin().log(e);
- }
- }
- }
-
- private void notifySessionAboutUncontrolledResource(final Resource controlledSemanticResource) {
- if (session instanceof DAnalysisSession) {
- ((DAnalysisSession) session).notifyUnControlledModel(semanticElementToUncontrol, controlledSemanticResource);
- }
- }
-}
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java
index acd851c343..5c7cd093cb 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java
@@ -19,13 +19,13 @@ import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.CommandParameter;
import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.ui.IEditorPart;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.ui.tools.api.actions.export.SizeTooLargeException;
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.DRepresentationElement;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
+import org.eclipse.ui.IEditorPart;
/**
* User-interface centric services for dialects.
@@ -89,22 +89,6 @@ public interface DialectUIServices {
* Open an editor for the given representation (if only you know about this
* kind of representation).
*
- * @param representation
- * representation to open.
- * @param session
- * the current session.
- * @return the opened editor.
- *
- * @deprecated use
- * {@link DialectUIServices#openEditor(Session, DRepresentation, IProgressMonitor)}
- * instead
- */
- IEditorPart openEditor(Session session, DRepresentation representation);
-
- /**
- * Open an editor for the given representation (if only you know about this
- * kind of representation).
- *
* @param dRepresentation
* {@link DRepresentation} to open.
* @param session
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/marker/TraceabilityMarkerNavigationProvider.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/marker/TraceabilityMarkerNavigationProvider.java
index 271ab01913..0fc542bb38 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/marker/TraceabilityMarkerNavigationProvider.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/marker/TraceabilityMarkerNavigationProvider.java
@@ -17,6 +17,7 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.URI;
@@ -533,7 +534,7 @@ public class TraceabilityMarkerNavigationProvider implements IGotoMarker {
public void run() {
// We create a new Dialect editor
- final IEditorPart editor = DialectUIManager.INSTANCE.openEditor(currentSession, selectedRepresentation);
+ final IEditorPart editor = DialectUIManager.INSTANCE.openEditor(currentSession, selectedRepresentation, new NullProgressMonitor());
if (editor != null && uiSession != null) {
// That we attach to the UI Session
uiSession.attachEditor((DialectEditor) editor);
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionEditorInput.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionEditorInput.java
index 1ef2320f0e..9c8386b47d 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionEditorInput.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionEditorInput.java
@@ -154,7 +154,7 @@ public class SessionEditorInput extends URIEditorInput {
protected Session getSession(URI sessionModelURI) {
Session sessionFromURI;
try {
- sessionFromURI = SessionManager.INSTANCE.getSession(sessionModelURI);
+ sessionFromURI = SessionManager.INSTANCE.getSession(sessionModelURI, new NullProgressMonitor());
if (sessionFromURI != null) {
if (!sessionFromURI.isOpen()) {
sessionFromURI.open(new NullProgressMonitor());
@@ -198,7 +198,7 @@ public class SessionEditorInput extends URIEditorInput {
public static SessionEditorInput create(final URI sessionResourceURI) {
Session session;
try {
- session = SessionFactory.INSTANCE.createSession(sessionResourceURI);
+ session = SessionFactory.INSTANCE.createSession(sessionResourceURI, new NullProgressMonitor());
} catch (CoreException e) {
return null;
}
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionHelper.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionHelper.java
index ee3993921e..a4f6982529 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionHelper.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/SessionHelper.java
@@ -15,14 +15,8 @@ import java.util.Collection;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-import com.google.common.collect.Maps;
-
import org.eclipse.sirius.business.api.dialect.DialectManager;
import org.eclipse.sirius.business.api.query.RepresentationDescriptionQuery;
import org.eclipse.sirius.business.api.session.Session;
@@ -31,6 +25,10 @@ import org.eclipse.sirius.ui.tools.internal.dialogs.RepresentationsSelectionDial
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
import org.eclipse.sirius.viewpoint.description.Viewpoint;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+
+import com.google.common.collect.Maps;
/**
* Utility class for clients wanting to start their own sessions.
@@ -56,28 +54,6 @@ public final class SessionHelper {
*
* @param session
* the session for which to open the startup representations.
- * @since 0.9.0
- * @deprecated use
- * {@link SessionHelper#openStartupRepresentations(Session, IProgressMonitor)}
- * instead
- */
- public static void openStartupRepresentations(final Session session) {
- openStartupRepresentations(session, new NullProgressMonitor());
- }
-
- /**
- * Open existing representations whose description has the
- * <code>showOnStartup</code> flag.
- * <p>
- * If there is only one such representation, it is opened automatically. If
- * there are several, a dialog box opens allowing the user to select which
- * ones to open (including none).
- * <p>
- * No new representations are created. Only the existing ones are
- * candidates.
- *
- * @param session
- * the session for which to open the startup representations.
* @param monitor
* the monitor that displays the status.
* @since 0.9.0
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelection.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelection.java
index d59943760c..aab0898785 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelection.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelection.java
@@ -628,49 +628,6 @@ public final class ViewpointSelection {
* the {@link Viewpoint} to select
* @param session
* the current session
- * @deprecated use
- * {@link Callback#selectViewpoint(Viewpoint, Session, IProgressMonitor)}
- * instead
- */
- void selectViewpoint(Viewpoint viewpoint, Session session);
-
- /**
- * Select a {@link Viewpoint}.
- *
- * @param viewpoint
- * the {@link Viewpoint} to select
- * @param session
- * the current session
- * @param createNewRepresentations
- * true to create new DRepresentation for
- * RepresentationDescription having their initialization
- * attribute at true for selected {@link Viewpoint}s.
- * @deprecated use
- * {@link Callback#selectViewpoint(Viewpoint, Session, boolean,IProgressMonitor)}
- * instead
- */
- void selectViewpoint(Viewpoint viewpoint, Session session, boolean createNewRepresentations);
-
- /**
- * deselect a viewpoint.
- *
- * @param deselectedViewpoint
- * the deselected viewpoint
- * @param session
- * the current session
- * @deprecated use
- * {@link Callback#deselectViewpoint(Viewpoint, Session, IProgressMonitor)}
- * instead
- */
- void deselectViewpoint(Viewpoint deselectedViewpoint, Session session);
-
- /**
- * Select a {@link Viewpoint}.
- *
- * @param viewpoint
- * the {@link Viewpoint} to select
- * @param session
- * the current session
* @param monitor
* a {@link IProgressMonitor} to show progression
*/
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallback.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallback.java
index 1c7d32f53c..9f01f2f259 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallback.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallback.java
@@ -13,20 +13,18 @@ package org.eclipse.sirius.ui.business.api.viewpoint;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-
-import com.google.common.collect.Lists;
-
-import org.eclipse.sirius.common.tools.api.util.EqualityHelper;
import org.eclipse.sirius.business.api.dialect.DialectManager;
import org.eclipse.sirius.business.api.helper.SiriusResourceHelper;
import org.eclipse.sirius.business.api.session.Session;
+import org.eclipse.sirius.common.tools.api.util.EqualityHelper;
import org.eclipse.sirius.viewpoint.DView;
import org.eclipse.sirius.viewpoint.description.Viewpoint;
+import com.google.common.collect.Lists;
+
/**
* The callback for selection.
* <p>
@@ -39,31 +37,6 @@ public class ViewpointSelectionCallback implements ViewpointSelection.Callback {
/**
* {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelection.Callback#deselectSirius(org.eclipse.sirius.viewpoint.description.Viewpoint)
- */
- public void deselectViewpoint(final Viewpoint deselectedViewpoint, final Session session) {
- deselectViewpoint(deselectedViewpoint, session, new NullProgressMonitor());
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelection.Callback#selectSirius(org.eclipse.sirius.viewpoint.description.Viewpoint)
- */
- public void selectViewpoint(final Viewpoint viewpoint, final Session session) {
- selectViewpoint(viewpoint, session, true, new NullProgressMonitor());
- }
-
- /**
- * {@inheritDoc}
- */
- public void selectViewpoint(Viewpoint viewpoint, Session session, boolean createNewRepresentations) {
- selectViewpoint(viewpoint, session, createNewRepresentations, new NullProgressMonitor());
- }
-
- /**
- * {@inheritDoc}
*/
public void selectViewpoint(Viewpoint viewpoint, Session session, IProgressMonitor monitor) {
selectViewpoint(viewpoint, session, true, monitor);
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallbackWithConfimation.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallbackWithConfimation.java
index 66efcf5d84..1c411b3489 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallbackWithConfimation.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/viewpoint/ViewpointSelectionCallbackWithConfimation.java
@@ -14,13 +14,8 @@ import java.text.MessageFormat;
import java.util.Collection;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-
-import com.google.common.collect.Sets;
-
import org.eclipse.sirius.business.api.query.IdentifiedElementQuery;
import org.eclipse.sirius.business.api.query.ViewpointQuery;
import org.eclipse.sirius.business.api.session.Session;
@@ -29,6 +24,11 @@ import org.eclipse.sirius.ui.business.api.session.IEditingSession;
import org.eclipse.sirius.ui.business.api.session.SessionUIManager;
import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
import org.eclipse.sirius.viewpoint.description.Viewpoint;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+
+import com.google.common.collect.Sets;
/**
* Asks the user for confirmation when de-selecting a viewpoint if there are
@@ -49,7 +49,7 @@ public class ViewpointSelectionCallbackWithConfimation extends ViewpointSelectio
* {@inheritDoc}
*/
@Override
- public void deselectViewpoint(Viewpoint deselectedViewpoint, Session session) {
+ public void deselectViewpoint(Viewpoint deselectedViewpoint, Session session, IProgressMonitor monitor) {
IEditingSession editingSession = SessionUIManager.INSTANCE.getUISession(session);
Collection<IEditorPart> openedEditors = Sets.newHashSet();
if (editingSession != null) {
@@ -59,7 +59,7 @@ public class ViewpointSelectionCallbackWithConfimation extends ViewpointSelectio
for (IEditorPart iEditorPart : openedEditors) {
DialectUIManager.INSTANCE.closeEditor(iEditorPart, false);
}
- super.deselectViewpoint(deselectedViewpoint, session);
+ super.deselectViewpoint(deselectedViewpoint, session, monitor);
}
}
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java
index 4ebcc32c03..96f60cd117 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java
@@ -20,15 +20,13 @@ import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.CommandParameter;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.sirius.common.tools.api.util.EclipseUtil;
import org.eclipse.sirius.business.api.session.Session;
+import org.eclipse.sirius.common.tools.api.util.EclipseUtil;
import org.eclipse.sirius.ui.business.api.dialect.DialectEditor;
import org.eclipse.sirius.ui.business.api.dialect.DialectUI;
import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
@@ -39,6 +37,7 @@ import org.eclipse.sirius.viewpoint.DRepresentationElement;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
+import org.eclipse.ui.IEditorPart;
/**
* Class able to manage a set of dialects to provides the usual dialect services
@@ -84,14 +83,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
}
/**
- *
- * {@inheritDoc}
- */
- public IEditorPart openEditor(final Session session, final DRepresentation representation) {
- return openEditor(session, representation, new NullProgressMonitor());
- }
-
- /**
* {@inheritDoc}
*/
public IEditorPart openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor) {
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusControlHandler.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusControlHandler.java
index 5d4220525c..5eeba93b9f 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusControlHandler.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusControlHandler.java
@@ -24,7 +24,6 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.emf.common.command.Command;
@@ -39,16 +38,6 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import com.google.common.collect.Sets;
-
import org.eclipse.sirius.business.api.control.SiriusControlCommand;
import org.eclipse.sirius.business.api.dialect.DialectManager;
import org.eclipse.sirius.business.api.helper.SiriusUtil;
@@ -58,12 +47,20 @@ import org.eclipse.sirius.ui.tools.internal.util.EMFCoreUtil;
import org.eclipse.sirius.ui.tools.internal.wizards.SelectRepresentationsWizard;
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import com.google.common.collect.Sets;
/**
* Implements the UI part of the "Control" operation. This class gathers the
* required parameters from the user and the invokes the properly configured
- * {@link org.eclipse.sirius.business.internal.command.control.ControlCommand}
- * .
+ * {@link org.eclipse.sirius.business.internal.command.control.ControlCommand} .
*
* @since 0.9.0
*
@@ -105,23 +102,6 @@ public class SiriusControlHandler extends AbstractHandler {
* parameters.
*
* @param shell
- * the shell to use to interact with the user.
- * @param semanticRoot
- * the semantic element to control.
- * @deprecated use
- * {@link SiriusControlHandler#performControl(Shell, EObject, IProgressMonitor)}
- * instead
- */
- public void performControl(final Shell shell, final EObject semanticRoot) {
- performControl(shell, semanticRoot, new NullProgressMonitor());
- }
-
- /**
- * Performs the control operation on the specified semantic element, using
- * the provided shell to interact with the end-user, gathering the required
- * parameters.
- *
- * @param shell
* the shell to use to interact with the user
* @param semanticRoot
* the semantic element to control
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusUncontrolHandler.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusUncontrolHandler.java
index 648c34d64a..989d3b8b3f 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusUncontrolHandler.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/control/SiriusUncontrolHandler.java
@@ -18,7 +18,6 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.emf.common.command.Command;
@@ -28,12 +27,12 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.sirius.business.api.control.SiriusUncontrolCommand;
+import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.sirius.business.api.control.SiriusUncontrolCommand;
-import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin;
/**
* Implements the UI part of the "Uncontrol" operation. This class gathers the
@@ -82,21 +81,6 @@ public class SiriusUncontrolHandler extends AbstractHandler {
* the shell to use to interact with users.
* @param semanticRoot
* the semantic root element to uncontrol.
- * @deprecated use
- * {@link SiriusUncontrolHandler#performUncontrol(Shell, EObject, IProgressMonitor)}
- * instead
- */
- public void performUncontrol(final Shell shell, final EObject semanticRoot) {
- performUncontrol(shell, semanticRoot, new NullProgressMonitor());
- }
-
- /**
- * Performs the uncontrol operation.
- *
- * @param shell
- * the shell to use to interact with users.
- * @param semanticRoot
- * the semantic root element to uncontrol.
* @param monitor
* a {@link IProgressMonitor} to show progression of uncontrol
*/
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java
index bbb82c65a9..75bcfd8bf0 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java
@@ -20,11 +20,6 @@ import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Sets;
-
-import org.eclipse.sirius.common.tools.api.util.Option;
import org.eclipse.sirius.business.api.preferences.SiriusPreferencesKeys;
import org.eclipse.sirius.business.api.query.DAnalysisQuery;
import org.eclipse.sirius.business.api.query.EObjectQuery;
@@ -33,18 +28,23 @@ import org.eclipse.sirius.business.api.session.SessionManager;
import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession;
import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSessionHelper;
import org.eclipse.sirius.business.internal.command.control.ControlCommand;
+import org.eclipse.sirius.common.tools.api.util.Option;
import org.eclipse.sirius.viewpoint.DAnalysis;
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.DRepresentationContainer;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.DView;
-import org.eclipse.sirius.viewpoint.ViewpointFactory;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
+import org.eclipse.sirius.viewpoint.ViewpointFactory;
import org.eclipse.sirius.viewpoint.description.Viewpoint;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Sets;
+
/**
- * A command to control semantic element in its own semantic resource and the
- * some associated representations in its own representations resource.
+ * An extension of the basic {@link ControlCommand} to handle both the semantic
+ * model and the corresponding Sirius representations. Also handles session
+ * state and modification-tracking management.
*
* @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
*/
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java
index 5c4f8759fc..fcdf896382 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java
@@ -56,9 +56,7 @@ public interface DialectManager extends DialectServices {
*
* @return <code>true</code> if the refresh should be done on representation
* opening.
- * @deprecated will be removed in future version
*/
- @Deprecated
boolean isRefreshActivatedOnRepresentationOpening();
/**
@@ -67,9 +65,7 @@ public interface DialectManager extends DialectServices {
* @param activated
* <code>true</code> if the refresh should be done on
* representation opening.
- * @deprecated will be removed in future version
*/
- @Deprecated
void setRefreshActivatedOnRepresentationOpening(final boolean activated);
}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationCommand.java
deleted file mode 100644
index f6383b61d4..0000000000
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationCommand.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 THALES GLOBAL SERVICES.
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.sirius.business.api.dialect.command;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.sirius.business.api.dialect.DialectManager;
-import org.eclipse.sirius.viewpoint.DRepresentation;
-
-/**
- * Create representation command.
- *
- * @author mchauvin
- * @since 0.9.0
- * @deprecated since 3.1 (replace by {@link RefreshRepresentationsCommand}
- */
-@Deprecated
-public class RefreshRepresentationCommand extends RecordingCommand {
-
- private DRepresentation representation;
-
- private IProgressMonitor monitor;
-
- /**
- * Construct a new instance.
- *
- * @param domain
- * the editing domain.
- * @param representation
- * the representation to refresh.
- * @param monitor
- * a progress monitor.
- */
- public RefreshRepresentationCommand(TransactionalEditingDomain domain, DRepresentation representation, IProgressMonitor monitor) {
- super(domain, "Refresh representation");
- this.representation = representation;
- this.monitor = monitor;
- }
-
- /**
- * Construct a new instance.
- *
- * @param domain
- * the editing domain.
- * @param representation
- * the representation to refresh.
- */
- public RefreshRepresentationCommand(TransactionalEditingDomain domain, DRepresentation representation) {
- this(domain, representation, null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void doExecute() {
- if (representation == null) {
- return;
- }
-
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
- DialectManager.INSTANCE.refresh(representation, monitor);
- }
-
-}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/SiriusHelper.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/SiriusHelper.java
index 3dc98bf012..d12cb005f2 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/SiriusHelper.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/SiriusHelper.java
@@ -24,7 +24,6 @@ import org.eclipse.sirius.business.api.query.DRepresentationQuery;
import org.eclipse.sirius.business.api.query.GroupQuery;
import org.eclipse.sirius.common.tools.api.util.Option;
import org.eclipse.sirius.viewpoint.AbstractDNode;
-import org.eclipse.sirius.viewpoint.DAnalysis;
import org.eclipse.sirius.viewpoint.DDiagram;
import org.eclipse.sirius.viewpoint.DDiagramElement;
import org.eclipse.sirius.viewpoint.DNode;
@@ -35,7 +34,6 @@ import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.DRepresentationElement;
import org.eclipse.sirius.viewpoint.DSemanticDiagram;
import org.eclipse.sirius.viewpoint.DragAndDropTarget;
-import org.eclipse.sirius.viewpoint.ViewpointFactory;
import org.eclipse.sirius.viewpoint.ViewpointPackage;
import org.eclipse.sirius.viewpoint.description.AnnotationEntry;
import org.eclipse.sirius.viewpoint.description.ContainerMapping;
@@ -288,23 +286,6 @@ public final class SiriusHelper {
}
/**
- * Create a dAnalysis.
- *
- * @return a new dAnalysis
- *
- * @deprecated since 4.0.0 the session root model element must be created
- * internally by a
- * {@link org.eclipse.sirius.business.api.session.factory.SessionFactory}
- * , in future move this in internal.
- */
- @Deprecated
- public static DAnalysis createDAnalysis() {
- final DAnalysis analysis = ViewpointFactory.eINSTANCE.createDAnalysis();
-
- return analysis;
- }
-
- /**
* Get, or create if there is none, a migration annotation for a group.
*
* @param source
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskHelper.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskHelper.java
index 00b442780c..be371d28d9 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskHelper.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskHelper.java
@@ -15,11 +15,12 @@ import java.util.Iterator;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask;
import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException;
import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
import org.eclipse.sirius.common.tools.api.interpreter.IInterpreterSiriusVariables;
import org.eclipse.sirius.common.tools.api.util.StringUtil;
-import org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask;
+import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor;
import org.eclipse.sirius.tools.api.command.ui.UICallBack;
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.DRepresentationElement;
@@ -27,7 +28,6 @@ import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
import org.eclipse.sirius.viewpoint.description.tool.AbstractToolDescription;
import org.eclipse.sirius.viewpoint.description.tool.ModelOperation;
-import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor;
/**
* Helper for get tasks from ModelOperation. Provide some utilities reused in
@@ -122,9 +122,6 @@ public class TaskHelper {
* {@link org.eclipse.sirius.viewpoint.description.tool.ToolDescription}
* .
* @return <code>true</code> if the predicate is <code>true</code>.
- * @deprecated the code will be in
- * {@link org.eclipse.sirius.tools.internal.command.builders.AbstractCommandBuilder}
- * in future refactoring
*/
@Deprecated
public boolean checkPrecondition(final EObject container, final AbstractToolDescription toolDescription) {
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.java
index 1a103f28c4..8c6cd92aad 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.java
@@ -15,7 +15,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.emf.common.util.URI;
-
import org.eclipse.sirius.business.api.session.factory.SessionFactory;
/**
@@ -44,19 +43,6 @@ public class DefaultLocalSessionCreationOperation implements SessionCreationOper
*
* @param sessionResourceURI
* the {@link URI} of the Resource {@link Session} model
- * @deprecated use
- * {@link DefaultLocalSessionCreationOperation#DefaultLocalSessionCreationOperation(URI, IProgressMonitor)}
- * instead
- */
- public DefaultLocalSessionCreationOperation(URI sessionResourceURI) {
- this(sessionResourceURI, new NullProgressMonitor());
- }
-
- /**
- * Constructor.
- *
- * @param sessionResourceURI
- * the {@link URI} of the Resource {@link Session} model
* @param monitor
* {@link IProgressMonitor} to show progression of
* {@link Session} creation
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SessionManager.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SessionManager.java
index 30b429d90b..9c1e683733 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SessionManager.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SessionManager.java
@@ -73,20 +73,6 @@ public interface SessionManager {
void remove(Session removedSession);
/**
- * Add a new resource in the session notifying all the manager listeners.
- *
- * @param session
- * session in which we'll add the resource.
- * @param newResource
- * resource to add.
- *
- * @deprecated since 4.0 add
- * {@link Session#addSemanticResource(URI, org.eclipse.core.runtime.IProgressMonitor)}
- * instead to add semantic Resource.
- */
- void addResource(Session session, Resource newResource);
-
- /**
* Notify the session manager listeners of a Representation creation.
*
* @param session
@@ -136,21 +122,6 @@ public interface SessionManager {
*
* @param sessionResourceURI
* a session Resource {@link URI}
- * @return the corresponding session if exist.
- *
- * @since 0.9.0
- * @deprecated use {@link SessionManager#getSession(URI, IProgressMonitor)}
- * instead
- */
- Session getSession(URI sessionResourceURI);
-
- /**
- * Return the {@link Session} whose Resource's URI correspond to
- * sessionResourceURI. If the Resource has already been loaded returns the
- * existing Session else try to load it.
- *
- * @param sessionResourceURI
- * a session Resource {@link URI}
* @param monitor
* a {@link IProgressMonitor} to show progression of Session
* getting, especially if there is a resource loading
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSession.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSession.java
index 21538f72d2..393ae5d39e 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSession.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSession.java
@@ -11,7 +11,6 @@
package org.eclipse.sirius.business.api.session.danalysis;
import java.util.Collection;
-import java.util.Map;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
@@ -139,32 +138,6 @@ public interface DAnalysisSession extends Session {
void notifyUnControlledModel(EObject uncontrolled, Resource resource);
/**
- * Saves the session data using the specified options.
- *
- * <p>
- * Options are handled generically as feature-to-setting entries; the
- * resource will ignore options it doesn't recognize. The options could even
- * include things like an Eclipse progress monitor...
- * </p>
- * <p>
- * An implementation typically uses the
- * {@link org.eclipse.emf.ecore.resource.ResourceSet#getURIConverter URI
- * converter} of the {@link #getResourceSet containing} resource set to
- * {@link org.eclipse.emf.ecore.resource.URIConverter#createOutputStream
- * create} an output stream, and then delegates to
- * {@link #save(java.io.OutputStream, Map) save(OutputStream, Map)}.
- * </p>
- *
- * @param options
- * the save options.
- * @since 0.9.0
- * @deprecated use
- * {@link Session#save(Map, org.eclipse.core.runtime.IProgressMonitor)}
- * instead
- */
- void save(Map<?, ?> options);
-
- /**
* Add adapters on the current analysis.
*
* @param analysis
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/factory/SessionFactory.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/factory/SessionFactory.java
index 5ba1ab6deb..185ace63d2 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/factory/SessionFactory.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/factory/SessionFactory.java
@@ -15,7 +15,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.internal.session.SessionFactoryImpl;
-import org.eclipse.sirius.viewpoint.DAnalysis;
/**
* The factory to create sessions.
@@ -30,38 +29,6 @@ public interface SessionFactory {
SessionFactory INSTANCE = SessionFactoryImpl.init();
/**
- * Create a new session from a analysis.
- *
- * @param analysis
- * the analysis
- * @return the created session.
- *
- * @deprecated since 4.0.0 use {@link SessionFactory#createSession(URI)}
- * instead.
- */
- @Deprecated
- Session createSession(DAnalysis analysis);
-
- /**
- * Create a new empty {@link Session} instance from the sessionModelURI. If
- * a underlying Resource exist, use it otherwise create a new Session
- * Resource.
- *
- * @param sessionResourceURI
- * the location URI of the new {@link Session} to create
- *
- * @return the newly created {@link Session}
- *
- * @throws CoreException
- * exception when session resource creation failed
- *
- * @since 0.9.0
- * @deprecated use
- * {@link SessionFactory#createSession(URI, IProgressMonitor)}
- */
- Session createSession(URI sessionResourceURI) throws CoreException;
-
- /**
* Create a new empty {@link Session} instance from the sessionModelURI. If
* a underlying Resource exist, use it otherwise create a new Session
* Resource.
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingTableEntry.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingTableEntry.java
index 894af9ee9c..8c5c3e5965 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingTableEntry.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingTableEntry.java
@@ -14,12 +14,14 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import com.google.common.collect.Lists;
-
import org.eclipse.sirius.common.tools.api.util.EqualityHelper;
+import org.eclipse.sirius.common.tools.api.util.Option;
+import org.eclipse.sirius.common.tools.api.util.Options;
import org.eclipse.sirius.viewpoint.description.DiagramElementMapping;
import org.eclipse.sirius.viewpoint.description.Layer;
+import com.google.common.collect.Lists;
+
/**
* A mapping node is wrapper to a mapping with references to its importer and
* children.
@@ -158,17 +160,17 @@ public class MappingTableEntry {
}
/**
- * Get the mappings node which imports this mapping.
+ * Get the first mappings node which imports this mapping, None
+ * {@link Option} if any.
*
- * @return the {@link MappingTableEntry} instance which import this mapping
- * @deprecated
+ * @return an optional {@link MappingTableEntry} instance which import this
+ * mapping
*/
- @Deprecated
- public MappingTableEntry getImporter() {
+ public Option<MappingTableEntry> getImporter() {
if (mappingImporters == null || mappingImporters.isEmpty()) {
- return null;
+ return Options.newNone();
}
- return this.mappingImporters.get(0);
+ return Options.newSome(this.mappingImporters.get(0));
}
/**
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingsTable.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingsTable.java
index 857901c362..856d60f96e 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingsTable.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/layers/MappingsTable.java
@@ -17,10 +17,10 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import org.eclipse.sirius.common.tools.api.util.Option;
-import org.eclipse.sirius.common.tools.api.util.Options;
import org.eclipse.sirius.business.api.query.IEdgeMappingQuery;
import org.eclipse.sirius.business.internal.componentization.mappings.table.CandidateMapping;
+import org.eclipse.sirius.common.tools.api.util.Option;
+import org.eclipse.sirius.common.tools.api.util.Options;
import org.eclipse.sirius.viewpoint.description.AbstractMappingImport;
import org.eclipse.sirius.viewpoint.description.ContainerMappingImport;
import org.eclipse.sirius.viewpoint.description.DiagramElementMapping;
@@ -212,8 +212,8 @@ public class MappingsTable<T extends DiagramElementMapping> {
list.add(0, (T) mappingNode.getMapping());
}
- while (current.getImporter() != null) {
- current = current.getImporter();
+ while (current.getImporter().some()) {
+ current = current.getImporter().get();
others = current.getOtherImporters();
for (final MappingTableEntry mappingNode : others) {
list.add(0, (T) mappingNode.getMapping());
@@ -294,9 +294,9 @@ public class MappingsTable<T extends DiagramElementMapping> {
* imported mapping entry was found => We take the last importer and
* add the previous one as others
*/
- final MappingTableEntry previousImporter = importedMappingExistingEntry.getImporter();
- if (previousImporter != null) {
- importedMappingExistingEntry.addOtherImporters(previousImporter);
+ final Option<MappingTableEntry> previousImporter = importedMappingExistingEntry.getImporter();
+ if (previousImporter.some()) {
+ importedMappingExistingEntry.addOtherImporters(previousImporter.get());
}
importedMappingExistingEntry.setImporter(entry);
}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java
index 66832e41b8..d710bab17e 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java
@@ -20,11 +20,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
-import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -32,9 +27,7 @@ import java.util.Map.Entry;
import java.util.Properties;
import java.util.regex.Pattern;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
@@ -152,57 +145,6 @@ public final class MigrationUtil {
/**
* Returns the contents of the file.
*
- * @param initialContent
- * the initial content
- * @param file
- * the file
- * @param monitor
- * the progress monitor
- * @return the contents of the file.
- * @deprecated Use {@link MigrationUtil#getContents(File, IProgressMonitor)}
- * instead : This new method used less memory to read the
- * content of the file.
- */
- public static String getContents(final String initialContent, final IFile file, final IProgressMonitor monitor) {
- if (initialContent == null) {
- monitor.subTask("Loading File");
- StringBuilder contentBuilder = new StringBuilder();
- FileChannel fileChannel = null;
- FileInputStream fileInputStream = null;
- try {
- URL fileUrl = file.getLocationURI().toURL();
- fileInputStream = new FileInputStream(URI.decode(fileUrl.getFile()));
- fileChannel = fileInputStream.getChannel();
- ByteBuffer buffer = ByteBuffer.allocate(8192); // Same value as
- // Eclipse EFS.
- while (fileChannel.read(buffer) != -1) {
- buffer.flip();
- contentBuilder.append(Charset.forName(UTF_8).decode(buffer));
- buffer.clear();
- }
- } catch (final MalformedURLException e) {
- SiriusPlugin.getDefault().error(e.getMessage(), e);
- } catch (final IOException e) {
- SiriusPlugin.getDefault().error(e.getMessage(), e);
- } finally {
- try {
- if (fileChannel != null && fileChannel.isOpen()) {
- fileChannel.close();
- fileInputStream.close();
- }
- } catch (IOException e) {
- SiriusPlugin.getDefault().error(e.getMessage(), e);
- }
- }
- monitor.worked(1);
- return contentBuilder.toString();
- }
- return initialContent;
- }
-
- /**
- * Returns the contents of the file.
- *
* @param file
* the file
* @param monitor
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java
index 3726cf05e4..a4fa6dfdc8 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java
@@ -26,18 +26,18 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.sirius.common.tools.api.editing.EditingDomainFactoryService;
-import org.eclipse.sirius.common.tools.api.resource.ResourceSetFactory;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.factory.SessionFactory;
import org.eclipse.sirius.business.internal.movida.Movida;
import org.eclipse.sirius.business.internal.movida.registry.ViewpointRegistry;
import org.eclipse.sirius.business.internal.movida.registry.ViewpointURIConverter;
import org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl;
+import org.eclipse.sirius.common.tools.api.editing.EditingDomainFactoryService;
+import org.eclipse.sirius.common.tools.api.resource.ResourceSetFactory;
import org.eclipse.sirius.tools.internal.resource.ResourceSetUtil;
import org.eclipse.sirius.viewpoint.DAnalysis;
-import org.eclipse.sirius.viewpoint.ViewpointFactory;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
+import org.eclipse.sirius.viewpoint.ViewpointFactory;
/**
* Default implementation of a session factory.
@@ -66,13 +66,6 @@ public final class SessionFactoryImpl implements SessionFactory {
/**
* {@inheritDoc}
*/
- public Session createSession(DAnalysis analysis) {
- return new DAnalysisSessionImpl(analysis);
- }
-
- /**
- * {@inheritDoc}
- */
public Session createSession(URI sessionResourceURI) throws CoreException {
return createSession(sessionResourceURI, new NullProgressMonitor());
}
@@ -85,8 +78,8 @@ public final class SessionFactoryImpl implements SessionFactory {
final TransactionalEditingDomain transactionalEditingDomain = EditingDomainFactoryService.INSTANCE.getEditingDomainFactory().createEditingDomain(set);
if (Movida.isEnabled()) {
- transactionalEditingDomain.getResourceSet().setURIConverter(
- new ViewpointURIConverter((ViewpointRegistry) org.eclipse.sirius.business.api.componentization.ViewpointRegistry.getInstance()));
+ transactionalEditingDomain.getResourceSet()
+ .setURIConverter(new ViewpointURIConverter((ViewpointRegistry) org.eclipse.sirius.business.api.componentization.ViewpointRegistry.getInstance()));
}
boolean alreadyExistingResource = exists(sessionResourceURI, transactionalEditingDomain.getResourceSet());
Session session = null;
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java
index 868bece1d1..93462a552e 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java
@@ -196,18 +196,6 @@ public class SessionManagerImpl extends SessionManagerEObjectImpl implements Ses
}
/**
- *
- * {@inheritDoc}
- */
- public void addResource(final Session session, final Resource newResource) {
- if (doGetSessions().contains(session) && newResource.getURI() != null) {
- notifyUpdatedSession(session, SessionListener.ABOUT_TO_BE_REPLACED);
- session.addSemanticResource(newResource.getURI(), new NullProgressMonitor());
- notifyUpdatedSession(session, SessionListener.REPLACED);
- }
- }
-
- /**
* {@inheritDoc}
*/
public Session getSession(final EObject any) {
@@ -227,7 +215,8 @@ public class SessionManagerImpl extends SessionManagerEObjectImpl implements Ses
if (attachment.some()) {
return attachment.get().getSession();
}
- // TODO remove this try/catch once the offline mode will be supported
+ // TODO remove this try/catch once the offline mode will be
+ // supported
try {
final EObject root = EcoreUtil.getRootContainer(any);
final Resource res = root != null ? root.eResource() : null;
@@ -419,8 +408,8 @@ public class SessionManagerImpl extends SessionManagerEObjectImpl implements Ses
/**
* @return an iterable over the listeners provide by the extension point
- * org.eclipse.sirius.sessionManagerListener and the listeners
- * added programmatically.
+ * org.eclipse.sirius.sessionManagerListener and the listeners added
+ * programmatically.
*/
private synchronized Iterable<SessionManagerListener> getAllListeners() {
return Iterables.concat(getExtensionPointListeners(), programmaticListeners);
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
index f478c36330..141083ebd2 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
@@ -878,13 +878,6 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements
/**
* {@inheritDoc}
*/
- public void save(Map<?, ?> options) {
- save(options, new NullProgressMonitor());
- }
-
- /**
- * {@inheritDoc}
- */
public void save(Map<?, ?> options, IProgressMonitor monitor) {
try {
monitor.beginTask("Session saving", 3);
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IDiagramCommandFactory.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IDiagramCommandFactory.java
index 02b42b7afe..6b894497a1 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IDiagramCommandFactory.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IDiagramCommandFactory.java
@@ -171,8 +171,7 @@ public interface IDiagramCommandFactory extends ICommandFactory {
* @param javaAction
* the java action to execute.
* @return a command that is able to execute the operations of
- * {@link org.eclipse.sirius.description.tool.JavaActionMenuItem}
- * .
+ * {@link org.eclipse.sirius.description.tool.JavaActionMenuItem} .
*/
Command buildJavaActionFromTool(ExternalJavaAction tool, Collection<DSemanticDecorator> selectedViews, IExternalJavaAction javaAction);
@@ -449,20 +448,6 @@ public interface IDiagramCommandFactory extends ICommandFactory {
* the tool that describes how to create the diagram.
* @param semanticElement
* the element from which the diagram will be created.
- * @return a command that is able to create a diagram.
- * @deprecated use
- * {@link IDiagramCommandFactory#buildCreateDiagramFromDescription(DiagramDescription, EObject, IProgressMonitor)}
- * instead
- */
- DCommand buildCreateDiagramFromDescription(DiagramDescription description, EObject semanticElement);
-
- /**
- * Create a command that is able to create a diagram.
- *
- * @param description
- * the tool that describes how to create the diagram.
- * @param semanticElement
- * the element from which the diagram will be created.
* @param monitor
* a {@link IProgressMonitor} to show progression of
* {@link DDiagram} creation
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IEMFCommandFactory.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IEMFCommandFactory.java
deleted file mode 100644
index 666255b332..0000000000
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/IEMFCommandFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES.
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.sirius.tools.api.command;
-
-/**
- * Describes the contract of a command factory.
- *
- * @author mchauvin
- * @deprecated
- */
-@Deprecated
-public interface IEMFCommandFactory {
-
-}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RefreshSiriusElement.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RefreshSiriusElement.java
index 25ddbd3f6f..4e4d951bff 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RefreshSiriusElement.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RefreshSiriusElement.java
@@ -15,13 +15,13 @@ import java.util.Iterator;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.sirius.common.tools.api.listener.Notification;
-import org.eclipse.sirius.common.tools.api.listener.NotificationUtil;
import org.eclipse.sirius.business.api.componentization.DiagramMappingsManager;
import org.eclipse.sirius.business.api.componentization.DiagramMappingsManagerRegistry;
import org.eclipse.sirius.business.api.helper.display.DisplayServiceManager;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionManager;
+import org.eclipse.sirius.common.tools.api.listener.Notification;
+import org.eclipse.sirius.common.tools.api.listener.NotificationUtil;
import org.eclipse.sirius.tools.api.command.ui.RefreshFilter;
import org.eclipse.sirius.viewpoint.DDiagram;
import org.eclipse.sirius.viewpoint.DDiagramElement;
@@ -66,9 +66,6 @@ public class RefreshSiriusElement extends RecordingCommand {
* the objects to refresh.
* @param filters
* the filters.
- * @deprecated use
- * {@link RefreshSiriusElement#RefreshSiriusElement(TransactionalEditingDomain, DRefreshable)}
- * instead
*/
public RefreshSiriusElement(final TransactionalEditingDomain domain, final Collection<?> objectsToRefresh, final Collection<RefreshFilter> filters) {
super(domain, "Refresh representation");
@@ -123,7 +120,8 @@ public class RefreshSiriusElement extends RecordingCommand {
}
/**
- * Tells wether a {@link DRepresentation} is filtered by the filters or not.
+ * Tells whether a {@link DRepresentation} is filtered by the filters or
+ * not.
*
* @param vp
* {@link DRepresentation} to test.
@@ -152,7 +150,8 @@ public class RefreshSiriusElement extends RecordingCommand {
}
if (diagram != null) {
- NotificationUtil.sendNotification(diagram, org.eclipse.sirius.common.tools.api.listener.Notification.Kind.START, org.eclipse.sirius.common.tools.api.listener.Notification.VISIBILITY_UPDATE);
+ NotificationUtil.sendNotification(diagram, org.eclipse.sirius.common.tools.api.listener.Notification.Kind.START,
+ org.eclipse.sirius.common.tools.api.listener.Notification.VISIBILITY_UPDATE);
}
}
}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RevealDDiagramElement.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RevealDDiagramElement.java
deleted file mode 100644
index 9653d847a4..0000000000
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RevealDDiagramElement.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.sirius.tools.api.command.view;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.sirius.business.api.helper.graphicalfilters.HideFilterHelper;
-import org.eclipse.sirius.viewpoint.DDiagramElement;
-
-/**
- * A simple command to reveal a diagram element.
- *
- * @author Mariot Chauvin (mchauvin)
- * @deprecated Use {@link RevealDDiagramElements} instead.
- */
-@Deprecated
-public class RevealDDiagramElement extends RecordingCommand {
-
- /** The viewpoint element to reveal. */
- private final DDiagramElement dde;
-
- /**
- * Create a new {@link RevealDDiagramElement}.
- *
- * @param domain
- * the editing domain.
- * @param dde
- * the diagram element.
- */
- public RevealDDiagramElement(final TransactionalEditingDomain domain, final DDiagramElement dde) {
- super(domain);
- this.dde = dde;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.transaction.RecordingCommand#doExecute()
- */
- @Override
- protected void doExecute() {
- HideFilterHelper.INSTANCE.reveal(dde);
- }
-}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RevealSiriusElement.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RevealSiriusElement.java
deleted file mode 100644
index 69ae967c55..0000000000
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/RevealSiriusElement.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.sirius.tools.api.command.view;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.sirius.business.api.helper.graphicalfilters.HideFilterHelper;
-import org.eclipse.sirius.viewpoint.DDiagramElement;
-
-/**
- * A simple command to reveal a view point element.
- *
- * @author Mariot Chauvin (mchauvin)
- * @deprecated
- * @see RevealDDiagramElements
- */
-@Deprecated
-public class RevealSiriusElement extends RecordingCommand {
-
- /** The viewpoint element to reveal. */
- private DDiagramElement vpe;
-
- /**
- * Create a new {@link RevealSiriusElement}.
- *
- * @param domain
- * the editing domain.
- * @param vpe
- * the viewpoint element.
- */
- public RevealSiriusElement(final TransactionalEditingDomain domain, final DDiagramElement vpe) {
- super(domain);
- this.vpe = vpe;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.transaction.RecordingCommand#doExecute()
- */
- @Override
- protected void doExecute() {
- HideFilterHelper.INSTANCE.reveal(vpe);
- }
-}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java
index d1b97a5986..d279307c35 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java
@@ -12,29 +12,25 @@ package org.eclipse.sirius.tools.api.interpreter;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
-import java.util.Map;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-
-import com.google.common.collect.Iterables;
-
-import org.eclipse.sirius.common.tools.api.interpreter.CompoundInterpreter;
-import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
import org.eclipse.sirius.business.api.query.EObjectQuery;
import org.eclipse.sirius.business.api.query.FileQuery;
import org.eclipse.sirius.business.api.session.Session;
-import org.eclipse.sirius.business.api.session.SessionManager;
+import org.eclipse.sirius.common.tools.api.interpreter.CompoundInterpreter;
+import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
import org.eclipse.sirius.viewpoint.description.JavaExtension;
import org.eclipse.sirius.viewpoint.description.Viewpoint;
+import com.google.common.collect.Iterables;
+
/**
* This class registers all {@link AcceleoInterpreter} for each viewpoint
* specification file.
@@ -50,9 +46,6 @@ public class InterpreterRegistry {
*/
public static final String ERROR_MSG_IMPOSSIBLE_TO_FIND_AN_INTERPRETER = "Impossible to find an interpreter";
- /** Map a TODO. */
- private Map<String, IInterpreter> root2ExPackage = new HashMap<String, IInterpreter>();
-
/**
* Return the resource that contains the current specification.
*
@@ -126,39 +119,8 @@ public class InterpreterRegistry {
}
/**
- * Dispose the registry. Clear the cache for the specified element.
- *
- * @param modelElement
- * a model element.
- * @deprecated this method is now useless because there is nothing to
- * dispose.
- */
- public void disposeInterpreterRegistry(final EObject modelElement) {
- final String uri = getMapKeyFromResource(modelElement);
- if (root2ExPackage.containsKey(uri)) {
- root2ExPackage.remove(uri);
- }
- }
-
- /**
- * Prepare all imports of the specified model request interpreter and model
- * element.
- *
- * @param inter
- * the model requests interpreter to prepare.
- * @param modelElement
- * a model element.
- * @deprecated
- * @see InterpreterRegistry#prepareImportsFromSession(IInterpreter, Session)
- */
- @Deprecated
- public static void prepareImportsFromModelElement(final IInterpreter inter, final EObject modelElement) {
- InterpreterRegistry.prepareImportsFromSession(inter, SessionManager.INSTANCE.getSession(modelElement));
- }
-
- /**
- * Prepare all imports of the specified model request interpreter and model
- * element.
+ * Prepare all imports of the specified model request interpreter and
+ * session.
*
* @param inter
* the model requests interpreter to prepare.
@@ -188,15 +150,4 @@ public class InterpreterRegistry {
}
}
}
-
- /**
- * Dispose all model requests interpreter.
- *
- * @deprecated this method is now useless because there is nothing to
- * dispose.
- */
- public void dispose() {
- root2ExPackage.clear();
- }
-
}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/UndoRedoCapableEMFCommandFactory.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/UndoRedoCapableEMFCommandFactory.java
index 66145223c2..e7fa30c0da 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/UndoRedoCapableEMFCommandFactory.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/UndoRedoCapableEMFCommandFactory.java
@@ -19,7 +19,6 @@ import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.command.UnexecutableCommand;
@@ -231,7 +230,8 @@ public class UndoRedoCapableEMFCommandFactory extends AbstractCommandFactory imp
* {@inheritDoc}
*
* @see org.eclipse.sirius.tools.api.command.IDiagramCommandFactory#buildSelectionWizardCommandFromTool(org.eclipse.sirius.viewpoint.description.tool.SelectionWizardDescription,
- * org.eclipse.sirius.viewpoint.DSemanticDecorator, java.util.Collection)
+ * org.eclipse.sirius.viewpoint.DSemanticDecorator,
+ * java.util.Collection)
*/
public Command buildSelectionWizardCommandFromTool(final SelectionWizardDescription tool, final DSemanticDecorator containerView, final Collection<EObject> selectedElement) {
final CommandBuilder builder = new SelectionWizardCommandBuilder(tool, containerView, selectedElement);
@@ -243,7 +243,8 @@ public class UndoRedoCapableEMFCommandFactory extends AbstractCommandFactory imp
* {@inheritDoc}
*
* @see org.eclipse.sirius.tools.api.command.IDiagramCommandFactory#buildPaneBasedSelectionWizardCommandFromTool(org.eclipse.sirius.viewpoint.description.tool.PaneBasedSelectionWizardDescription,
- * org.eclipse.sirius.viewpoint.DSemanticDecorator, java.util.Collection)
+ * org.eclipse.sirius.viewpoint.DSemanticDecorator,
+ * java.util.Collection)
*/
public Command buildPaneBasedSelectionWizardCommandFromTool(final PaneBasedSelectionWizardDescription tool, final DSemanticDecorator containerView, final Collection<EObject> selectedElement) {
final CommandBuilder builder = new PaneBasedSelectionWizardCommandBuilder(tool, containerView, selectedElement);
@@ -352,7 +353,8 @@ public class UndoRedoCapableEMFCommandFactory extends AbstractCommandFactory imp
* {@inheritDoc}
*
* @see org.eclipse.sirius.tools.api.command.IDiagramCommandFactory#buildReconnectEdgeCommandFromTool(org.eclipse.sirius.viewpoint.description.tool.ReconnectEdgeDescription,
- * org.eclipse.sirius.viewpoint.DEdge, org.eclipse.sirius.viewpoint.EdgeTarget,
+ * org.eclipse.sirius.viewpoint.DEdge,
+ * org.eclipse.sirius.viewpoint.EdgeTarget,
* org.eclipse.sirius.viewpoint.EdgeTarget)
*/
public Command buildReconnectEdgeCommandFromTool(final ReconnectEdgeDescription tool, final DEdge edge, final EdgeTarget source, final EdgeTarget target) {
@@ -591,13 +593,6 @@ public class UndoRedoCapableEMFCommandFactory extends AbstractCommandFactory imp
/**
* {@inheritDoc}
*/
- public DCommand buildCreateDiagramFromDescription(final DiagramDescription description, final EObject semanticElement) {
- return buildCreateDiagramFromDescription(description, semanticElement, new NullProgressMonitor());
- }
-
- /**
- * {@inheritDoc}
- */
public DCommand buildCreateDiagramFromDescription(final DiagramDescription description, final EObject semanticElement, IProgressMonitor monitor) {
final DCommand command = new SiriusCommand(domain, "Create new diagram") {
/**

Back to the top