| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
| <html> |
| <head> |
| <!-- |
| |
| /****************************************************************************** |
| * Copyright (c) 2005 IBM Corporation and others. |
| * 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: |
| * IBM Corporation - initial API and implementation |
| ****************************************************************************/ |
| |
| --> |
| </head> |
| <body> |
| |
| <P>Provides an editor service for manipulating {@link |
| org.eclipse.ui.IEditorPart Eclipse Editors}, including an operation to open an |
| editor from an {@link org.eclipse.ui.IEditorInput org.eclipse.ui.IEditorInput}. |
| The Editor Service also includes methods to get registered editors and to |
| register and unregister editors.</P> |
| |
| <h2>Using this Package</h2> |
| |
| <P>The {@link org.eclipse.gmf.runtime.common.ui.services.editor.EditorService |
| Editor Service} implements {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.IEditorProvider |
| org.eclipse.gmf.runtime.common.ui.services.editor.IEditorProvider}. |
| The interface contains only one method, {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.IEditorProvider#openEditor(org.eclipse.ui.IEditorInput) |
| openEditor(IEditorInput)}, which takes the editor input for the editor to be |
| opened.</P> |
| |
| <P>Providers may subclass {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.AbstractEditorProvider |
| AbstractEditorProvider}, which implements the required |
| {@link org.eclipse.gmf.runtime.common.ui.services.editor.IEditorProvider |
| IEditorProvider}. The only operation executed by the service is |
| {@link org.eclipse.gmf.runtime.common.ui.services.editor.OpenEditorOperation |
| OpenEditorOperation}, whose {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.OpenEditorOperation#OpenEditorOperation(org.eclipse.ui.IEditorInput) |
| constructor} takes the same parameters as the interface's method.</P> |
| |
| <h3>The Editor Service</h3> |
| |
| <P>In addition to the openEditor method, the EditorService contains methods |
| to keep track of editors and other methods that should be called when the editor |
| is initialized and disposed. The static instance of the EditorService class |
| is obtained using the {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.EditorService#getInstance() |
| getInstance()} method.</P> |
| |
| <P>The {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.EditorService#registerEditor(org.eclipse.ui.IEditorPart |
| org.eclipse.ui.IEditorPart) registerEditor(IEditorPart)} method should be called |
| when the editor is initialized, and the {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.EditorService#unregisterEditor(org.eclipse.ui.IEditorPart |
| org.eclipse.ui.IEditorPart) unregisterEditor(IEditorPart)} method should be called |
| when the editor is disposed. Calling these methods will ensure the map of |
| editors is updated. This is important to obtain the expected results when |
| either {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.EditorService#getRegisteredEditors(java.lang.String) |
| getRegisteredEditors(String)} or {@link |
| org.eclipse.gmf.runtime.common.ui.services.editor.EditorService#getRegisteredEditorParts() |
| getRegisteredEditorParts()} is called. These methods return the registered |
| editors matching the editor's {@link org.eclipse.ui.IWorkbenchPartSite#getId() |
| ID from the editor site} and all the editors, respectively.</P> |
| |
| <h2>Package Specification</h2> |
| |
| <P>For more information on Eclipse editors, please see |
| {@link org.eclipse.ui.IEditorPart org.eclipse.ui.IEditorPart}</P> |
| <P>For more information on the Service Infrastructure, please see |
| {@link org.eclipse.gmf.runtime.common.core.service.Service |
| org.eclipse.gmf.runtime.common.core.service.Service}</P> |
| |
| @canBeSeenBy %partners |
| </body> |
| </html> |