Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TextEditorPartModel.java')
-rw-r--r--examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TextEditorPartModel.java81
1 files changed, 81 insertions, 0 deletions
diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TextEditorPartModel.java b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TextEditorPartModel.java
new file mode 100644
index 00000000000..949e0d8fb17
--- /dev/null
+++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TextEditorPartModel.java
@@ -0,0 +1,81 @@
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST & LIFL
+ *
+ *
+ * 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.example.core.sashwindows.fulleditor.texteditor;
+
+import org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorActionBarContributor;
+
+/**
+ * Description of the first page
+ *
+ * @author dumoulin
+ */
+
+public class TextEditorPartModel implements IEditorModel {
+
+ /** The text editor used in page 0. */
+ private TabTextEditor editor;
+
+ private String title;
+
+ static private int count = 0;
+
+ /**
+ * @param title
+ */
+ public TextEditorPartModel(String title) {
+ this.title = title;
+ }
+
+ /**
+ *
+ */
+ public TextEditorPartModel() {
+ title = "newText" + count++;
+ }
+
+ public IEditorPart createIEditorPart() throws PartInitException {
+ editor = new TabTextEditor();
+ if(title == null)
+ title = "newText" + count++;
+ return editor;
+ }
+
+ public Image getTabIcon() {
+ return null;
+ }
+
+ public String getTabTitle() {
+ return title;
+ }
+
+ /**
+ * Return this. In this implementation, the rawModel and the IEditorModel are the same.
+ *
+ */
+ public Object getRawModel() {
+ return this;
+ }
+
+ /**
+ * Return the ActionBarContributor dedicated to the created editor.
+ * Can return null if no particular ActionBarContributor is required.;
+ */
+ public EditorActionBarContributor getActionBarContributor() {
+ return null;
+ }
+}

Back to the top