| java.lang.Object org.eclipse.ui.internal.EditorManager
EditorManager | public class EditorManager implements IExtensionChangeHandler(Code) | | Manage a group of element editors. Prevent the creation of two editors on the
same element.
06/12/00 - DS - Given the ambiguous editor input type, the manager delegates
a number of responsibilities to the editor itself.
- The editor should determine its own title.
- The editor should listen to resource deltas and close itself if the
input is deleted. It may also choose to stay open if the editor has dirty
state.
- The editor should persist its own state plus editor input.
|
Method Summary | |
public void | addExtension(IExtensionTracker tracker, IExtension extension) | void | checkCreateEditorPropListener() | void | checkCreatePinEditorShortcutKeyHandler() Check to determine if the handler for the pin editor keyboard shortcut
should be created. | void | checkDeleteEditorResources() | public boolean | containsEditor(IEditorReference ref) Returns whether the manager contains an editor. | IEditorPart | createPart(EditorDescriptor desc) | EditorSite | createSite(IEditorReference ref, IEditorPart part, EditorDescriptor desc, IEditorInput input) | void | disposeEditorActionBars(EditorActionBars actionBars) | public IEditorPart | findEditor(IEditorInput input) Returns an open editor matching the given editor input. | public IEditorPart | findEditor(String editorId, IEditorInput input, int matchFlags) Returns an open editor matching the given editor input and/or editor id,
as specified by matchFlags. | public IEditorReference[] | findEditors(IEditorInput input, String editorId, int matchFlags) Returns the open editor references matching the given editor input and/or
editor id, as specified by matchFlags. | ImageDescriptor | findImage(EditorDescriptor desc, IPath path) | public IEditorPart[] | getDirtyEditors() | public int | getEditorCount() Answer the number of editors. | ImageDescriptor | getEditorPinImageDesc() | public IEditorReference[] | getEditors() | public IMemento | getMemento(IEditorReference e) | public IEditorPart | getVisibleEditor() | public boolean | isSaveAllNeeded() Answer true if save is needed in any one of the editors. | public IEditorReference | openEditor(String editorId, IEditorInput input, boolean setVisible, IMemento editorState) Parameters: editorId - the editor part id Parameters: input - the input Parameters: setVisible - if this is to be created visible ... | public IEditorReference | openEditorFromDescriptor(EditorDescriptor desc, IEditorInput input, IMemento editorState) | IEditorReference | openEmptyTab() | IEditorReference[] | openMultiEditor(IEditorReference ref, MultiEditor part, MultiEditorInput input) Create the part and reference for each inner editor. | public void | removeExtension(IExtension source, Object[] objects) | public void | restoreEditorState(IMemento editorMem, ArrayList visibleEditors, IEditorReference[] activeEditor, MultiStatus result) | public IStatus | restoreState(IMemento memento) | public boolean | saveAll(boolean confirm, boolean closing, boolean addNonPartSources) Save all of the editors in the workbench. | public static boolean | saveAll(List dirtyParts, boolean confirm, boolean closing, boolean addNonPartSources, IWorkbenchWindow window) Saves the given dirty editors and views, optionally prompting the user. | public static boolean | saveAll(List dirtyParts, boolean confirm, boolean closing, boolean addNonPartSources, IRunnableContext runnableContext, IShellProvider shellProvider) Saves the given dirty editors and views, optionally prompting the user. | protected void | saveEditorState(IMemento mem, IEditorReference ed, MultiStatus res) | public boolean | savePart(ISaveablePart saveable, IWorkbenchPart part, boolean confirm) | public IStatus | saveState(IMemento memento) | public boolean | setVisibleEditor(IEditorReference newEd, boolean setFocus) Shows an editor. | public static boolean | useIPersistableEditor() |
RESOURCES_TO_SAVE_MESSAGE | final static String RESOURCES_TO_SAVE_MESSAGE(Code) | | |
SAVE_RESOURCES_TITLE | final static String SAVE_RESOURCES_TITLE(Code) | | |
addExtension | public void addExtension(IExtensionTracker tracker, IExtension extension)(Code) | | |
checkCreateEditorPropListener | void checkCreateEditorPropListener()(Code) | | Check to determine if the property change listener for editors should be
created
|
checkCreatePinEditorShortcutKeyHandler | void checkCreatePinEditorShortcutKeyHandler()(Code) | | Check to determine if the handler for the pin editor keyboard shortcut
should be created.
|
checkDeleteEditorResources | void checkDeleteEditorResources()(Code) | | Check to determine if the editor resources are no longer needed removes
property change listener for editors removes pin editor keyboard shortcut
handler disposes cached images and clears the cached images hash table
|
containsEditor | public boolean containsEditor(IEditorReference ref)(Code) | | Returns whether the manager contains an editor.
|
findEditor | public IEditorPart findEditor(IEditorInput input)(Code) | | Returns an open editor matching the given editor input. If none match,
returns null .
Parameters: input - the editor input the matching editor, or null if no match fond |
findEditor | public IEditorPart findEditor(String editorId, IEditorInput input, int matchFlags)(Code) | | Returns an open editor matching the given editor input and/or editor id,
as specified by matchFlags. If none match, returns null .
Parameters: editorId - the editor id Parameters: input - the editor input Parameters: matchFlags - flags specifying which aspects to match the matching editor, or null if no match fond since: 3.1 |
findEditors | public IEditorReference[] findEditors(IEditorInput input, String editorId, int matchFlags)(Code) | | Returns the open editor references matching the given editor input and/or
editor id, as specified by matchFlags. If none match, returns an empty
array.
Parameters: editorId - the editor id Parameters: input - the editor input Parameters: matchFlags - flags specifying which aspects to match the matching editor, or null if no match fond since: 3.1 |
getEditorCount | public int getEditorCount()(Code) | | Answer the number of editors.
|
getEditorPinImageDesc | ImageDescriptor getEditorPinImageDesc()(Code) | | Method to create the editor's pin ImageDescriptor
the single image descriptor for the editor's pin icon |
isSaveAllNeeded | public boolean isSaveAllNeeded()(Code) | | Answer true if save is needed in any one of the editors.
|
removeExtension | public void removeExtension(IExtension source, Object[] objects)(Code) | | |
saveAll | public boolean saveAll(boolean confirm, boolean closing, boolean addNonPartSources)(Code) | | Save all of the editors in the workbench. Return true if successful.
Return false if the user has canceled the command.
Parameters: confirm - true if the user should be prompted before the save Parameters: closing - true if the page is being closed Parameters: addNonPartSources - true if saveables from non-part sources should be saved too. false if the user canceled or an error occurred while saving |
saveAll | public static boolean saveAll(List dirtyParts, boolean confirm, boolean closing, boolean addNonPartSources, IWorkbenchWindow window)(Code) | | Saves the given dirty editors and views, optionally prompting the user.
Parameters: dirtyParts - the dirty views and editors Parameters: confirm - true to prompt whether to save, false to save without prompting Parameters: closing - true if the parts are being closed,false if just being saved without closing Parameters: addNonPartSources - true if non-part sources should be saved too Parameters: window - the window to use as the parent for the dialog that prompts tosave multiple dirty editors and views true on success, false if the usercanceled the save or an error occurred while saving |
saveAll | public static boolean saveAll(List dirtyParts, boolean confirm, boolean closing, boolean addNonPartSources, IRunnableContext runnableContext, IShellProvider shellProvider)(Code) | | Saves the given dirty editors and views, optionally prompting the user.
Parameters: dirtyParts - the dirty views and editors Parameters: confirm - true to prompt whether to save,false to save without prompting Parameters: closing - true if the parts are being closed,false if just being saved without closing Parameters: addNonPartSources - true if non-part sources should be saved too Parameters: runnableContext - the context in which to run long-running operations Parameters: shellProvider - providing the shell to use as the parent for the dialog thatprompts to save multiple dirty editors and views true on success, false if the usercanceled the save |
saveState | public IStatus saveState(IMemento memento)(Code) | | See Also: IPersistablePart |
setVisibleEditor | public boolean setVisibleEditor(IEditorReference newEd, boolean setFocus)(Code) | | Shows an editor. If setFocus == true then give it focus,
too.
true if the active editor was changed, false if not. |
useIPersistableEditor | public static boolean useIPersistableEditor()(Code) | | |
|
|