]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.ui/src/org/simantics/ui/workbench/editor/EditorAdapter.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.ui / src / org / simantics / ui / workbench / editor / EditorAdapter.java
index 1343cd51630b0e0db7ef7c221d484522d2a8f2ee..62be237631d80bd1c0df14dc2df460853073631f 100644 (file)
@@ -1,94 +1,94 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.ui.workbench.editor;\r
-\r
-import org.eclipse.jface.resource.ImageDescriptor;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-\r
-/**\r
- * The purpose of an {@link EditorAdapter} is two-fold:\r
- * <ol>\r
- * <li>Checking whether an action can be performed on an input object (see\r
- * {@link #canHandle(ReadGraph, Object)}</li>\r
- * <li>Performing the action on that input object (see\r
- * {@link #openEditor(Object)}</li>\r
- * </ol>\r
- * An action can be anything, but for the purposes this interface is intended\r
- * for, the action is most often <em>opening an editor</em>.\r
- * {@link #canHandle(ReadGraph, Object)} is performed within a graph database\r
- * read transaction to make data model based decision making easier.\r
- * \r
- * <p>\r
- * #openEditor(Object) shall be called only if\r
- * {@link #canHandle(ReadGraph, Object)} returns true for the same input. It is\r
- * possible that the data model has changed between invocations of\r
- * {@link #canHandle(ReadGraph, Object)} and {@link #openEditor(Object)} so\r
- * {@link #openEditor(Object)} implementations should always check the input\r
- * throughly instead of assuming that the data model state in\r
- * {@link #canHandle(ReadGraph, Object)} still holds.\r
- * \r
- * Clients should extend at least {@link AbstractEditorAdapter} instead of\r
- * implementing this interface. This allows the extension point handler to set\r
- * the priority of the adapter according to what is described in extensions. The\r
- * only things that really need to be implemented are\r
- * {@link #canHandle(ReadGraph, Object)} and {@link #openEditor(Object)}.\r
- * \r
- * <p>\r
- * These classes are instantiated by {@link EditorRegistry} from Eclipse\r
- * extensions so make sure that your implementations have a default constructor\r
- * available, or no constructors at all.\r
- * </p>\r
- * \r
- * @author Tuukka Lehtonen\r
- * \r
- * @see AbstractEditorAdapter\r
- * @see AbstractResourceEditorAdapter\r
- * @see SimpleEditorAdapter\r
- * @see IEditorRegistry the front-end interface for handling these classes\r
- * @see EditorRegistry an Eclipse extension point implementation of\r
- *      IResourceEditorRegistry\r
- * @see Prioritized\r
- */\r
-public interface EditorAdapter {\r
-\r
-    /**\r
-     * @return\r
-     */\r
-    String getName();\r
-\r
-    /**\r
-     * @param r\r
-     * @return\r
-     */\r
-    ImageDescriptor getIcon();\r
-\r
-    /**\r
-     * @return\r
-     */\r
-    int getPriority();\r
-\r
-    /**\r
-     * @param input the input of the editor\r
-     * @return <code>true</code> if this adapter can open an editor for the\r
-     *         specified input object\r
-     */\r
-    boolean canHandle(ReadGraph g, Object input) throws DatabaseException;\r
-\r
-    /**\r
-     * @param input the input object for the editor to be opened\r
-     * @throws Exception PartInitException, or anything else that may happen\r
-     *         while performing the action may be thrown\r
-     */\r
-    void openEditor(Object input) throws Exception;\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * 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:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.ui.workbench.editor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.exception.DatabaseException;
+
+/**
+ * The purpose of an {@link EditorAdapter} is two-fold:
+ * <ol>
+ * <li>Checking whether an action can be performed on an input object (see
+ * {@link #canHandle(ReadGraph, Object)}</li>
+ * <li>Performing the action on that input object (see
+ * {@link #openEditor(Object)}</li>
+ * </ol>
+ * An action can be anything, but for the purposes this interface is intended
+ * for, the action is most often <em>opening an editor</em>.
+ * {@link #canHandle(ReadGraph, Object)} is performed within a graph database
+ * read transaction to make data model based decision making easier.
+ * 
+ * <p>
+ * #openEditor(Object) shall be called only if
+ * {@link #canHandle(ReadGraph, Object)} returns true for the same input. It is
+ * possible that the data model has changed between invocations of
+ * {@link #canHandle(ReadGraph, Object)} and {@link #openEditor(Object)} so
+ * {@link #openEditor(Object)} implementations should always check the input
+ * throughly instead of assuming that the data model state in
+ * {@link #canHandle(ReadGraph, Object)} still holds.
+ * 
+ * Clients should extend at least {@link AbstractEditorAdapter} instead of
+ * implementing this interface. This allows the extension point handler to set
+ * the priority of the adapter according to what is described in extensions. The
+ * only things that really need to be implemented are
+ * {@link #canHandle(ReadGraph, Object)} and {@link #openEditor(Object)}.
+ * 
+ * <p>
+ * These classes are instantiated by {@link EditorRegistry} from Eclipse
+ * extensions so make sure that your implementations have a default constructor
+ * available, or no constructors at all.
+ * </p>
+ * 
+ * @author Tuukka Lehtonen
+ * 
+ * @see AbstractEditorAdapter
+ * @see AbstractResourceEditorAdapter
+ * @see SimpleEditorAdapter
+ * @see IEditorRegistry the front-end interface for handling these classes
+ * @see EditorRegistry an Eclipse extension point implementation of
+ *      IResourceEditorRegistry
+ * @see Prioritized
+ */
+public interface EditorAdapter {
+
+    /**
+     * @return
+     */
+    String getName();
+
+    /**
+     * @param r
+     * @return
+     */
+    ImageDescriptor getIcon();
+
+    /**
+     * @return
+     */
+    int getPriority();
+
+    /**
+     * @param input the input of the editor
+     * @return <code>true</code> if this adapter can open an editor for the
+     *         specified input object
+     */
+    boolean canHandle(ReadGraph g, Object input) throws DatabaseException;
+
+    /**
+     * @param input the input object for the editor to be opened
+     * @throws Exception PartInitException, or anything else that may happen
+     *         while performing the action may be thrown
+     */
+    void openEditor(Object input) throws Exception;
+
+}