Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/CreateClassDiagramCommandHandler.java')
-rw-r--r--uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/CreateClassDiagramCommandHandler.java61
1 files changed, 61 insertions, 0 deletions
diff --git a/uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/CreateClassDiagramCommandHandler.java b/uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/CreateClassDiagramCommandHandler.java
new file mode 100644
index 00000000000..4beff41e41e
--- /dev/null
+++ b/uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/CreateClassDiagramCommandHandler.java
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.Dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.diagram.clazz;
+
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.papyrus.core.adaptor.gmf.AbstractGmfCreateDiagramCommandHandler;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.ModelEditPart;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * Action creating a new diagram. This handler is used with editors using SharedObject.
+ *
+ * @deprecated Now use Context
+ * @author dumoulin
+ *
+ */
+public class CreateClassDiagramCommandHandler extends AbstractGmfCreateDiagramCommandHandler implements IHandler {
+
+ /**
+ * Create the first element of the uml part.
+ */
+ @Override
+ protected Package createInitialModel() {
+ return UMLFactory.eINSTANCE.createPackage();
+ }
+
+ @Override
+ protected String getDiagramName() {
+ // TODO Auto-generated method stub
+ return "PapyrusClassDiagram";
+ }
+
+ /**
+ * @return
+ */
+ protected String getDiagramNotationID() {
+ return ModelEditPart.MODEL_ID;
+ }
+
+ /**
+ * @return
+ */
+ protected PreferencesHint getPreferenceHint() {
+ return org.eclipse.papyrus.diagram.clazz.part.UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
+ }
+
+}

Back to the top