diff options
author | Laurent Wouters | 2014-03-14 13:51:50 +0000 |
---|---|---|
committer | Laurent Wouters | 2014-03-14 13:54:22 +0000 |
commit | f515b310417b386c79d9fbd2500c5373a7179aa7 (patch) | |
tree | 1785439bb2467282b35964ab71c18f8e2fffff38 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src | |
parent | 832ceab5e78772d2b483348f620de7b47a4c091f (diff) | |
download | org.eclipse.papyrus-f515b310417b386c79d9fbd2500c5373a7179aa7.tar.gz org.eclipse.papyrus-f515b310417b386c79d9fbd2500c5373a7179aa7.tar.xz org.eclipse.papyrus-f515b310417b386c79d9fbd2500c5373a7179aa7.zip |
399860: Papyrus shall enable to customize the creation policy of views
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399860
Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src')
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java | 74 |
1 files changed, 55 insertions, 19 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java index cf4e726d3f5..532f4ebe38b 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java @@ -12,7 +12,10 @@ package org.eclipse.papyrus.commands; import org.eclipse.emf.ecore.EObject; import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram; +import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype; /** * Define a command use to create new diagram. It use to provide Eclipse @@ -24,33 +27,66 @@ import org.eclipse.papyrus.infra.core.resource.ModelSet; public interface ICreationCommand { /** - * Create a new diagram in diResourceSet with the given name and open it. + * Create a diagram. + * This method will try to find an adequate view for the passed arguments * * @param modelSet - * the resourceSet containing all diagrams - * @param container - * of the diagram, if container is null, the diagram is contained - * by the top level container - * @param diagramName - * the name of the new diagram or null to use a dialog to choose - * the name + * the current model set + * @param owner + * the diagram's owner and root element + * @param name + * the diagram's name + * @return the created diagram, or <code>null</code> if the creation failed */ - public void createDiagram(ModelSet modelSet, EObject container, String diagramName); + public Diagram createDiagram(ModelSet modelSet, EObject owner, String name); /** - * Get a command to create a new diagram in diResourceSet with the given - * name. + * Create a diagram. * * @param modelSet - * the resourceSet containing all diagrams - * @param container - * of the diagram, if container is null, the diagram is contained - * by the top level container - * @param diagramName - * the name of the new diagram or null to use a dialog to choose - * the name + * the current model set + * @param owner + * the diagram's owner + * @param element + * the diagram's model element + * @param prototype + * the diagram's prototype + * @param name + * the diagram's name + * @return the created diagram, or <code>null</code> if the creation failed */ - public ICommand getCreateDiagramCommand(final ModelSet modelSet, final EObject container, final String diagramName); + public Diagram createDiagram(ModelSet modelSet, EObject owner, EObject element, ViewPrototype prototype, String name); + + /** + * Gets the GMF command for the diagram creation + * This method will try to find an adequate view for the passed arguments + * + * @param modelSet + * the current model set + * @param owner + * the diagram's owner and root element + * @param name + * the diagram's name + * @return the created diagram, or <code>null</code> if the creation failed + */ + public ICommand getCreateDiagramCommand(ModelSet modelSet, EObject owner, String name); + + /** + * Gets the GMF command for the diagram creation + * + * @param modelSet + * the current model set + * @param owner + * the diagram's owner + * @param element + * the diagram's model element + * @param prototype + * the diagram's prototype + * @param name + * the diagram's name + * @return the created diagram, or <code>null</code> if the creation failed + */ + public ICommand getCreateDiagramCommand(ModelSet modelSet, EObject owner, EObject element, ViewPrototype prototype, String name); /** * Get the type of the diagram to create. |