Class ErrorEditorPart
- All Implemented Interfaces:
IAdaptable
,IExecutableExtension
,IEditorPart
,ISaveablePart
,IWorkbenchPart
,IWorkbenchPart2
,IWorkbenchPart3
,IWorkbenchPartOrientation
- Since:
- 3.3
-
Field Summary
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
Constructor Summary
ConstructorDescriptionCreates instance of the classErrorEditorPart
(IStatus error) Creates instance of the class -
Method Summary
Modifier and TypeMethodDescriptionvoid
createPartControl
(Composite parent) Creates the SWT controls for this workbench part.void
dispose()
TheWorkbenchPart
implementation of thisIWorkbenchPart
method disposes the title image loaded bysetInitializationData
.void
doSave
(IProgressMonitor monitor) Saves the contents of this part.void
doSaveAs()
Saves the contents of this part to another object.getError()
void
init
(IEditorSite site, IEditorInput input) Initializes this editor with the given editor site and input.boolean
isDirty()
Returns whether the contents of this part have changed since the last save operation.boolean
Returns whether the "Save As" operation is supported by this part.void
setFocus()
Asks this part to take focus within the workbench.void
setPartName
(String newName) Sets the name of this part.Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
-
Constructor Details
-
ErrorEditorPart
public ErrorEditorPart()Creates instance of the class -
ErrorEditorPart
Creates instance of the class- Parameters:
error
- the status
-
-
Method Details
-
doSave
Description copied from interface:ISaveablePart
Saves the contents of this part.If the save is successful, the part should fire a property changed event reflecting the new dirty state (
PROP_DIRTY
property).If the save is cancelled through user action, or for any other reason, the part should invoke
setCancelled
on theIProgressMonitor
to inform the caller.This method is long-running; progress and cancellation are provided by the given progress monitor.
- Specified by:
doSave
in interfaceISaveablePart
- Specified by:
doSave
in classEditorPart
- Parameters:
monitor
- the progress monitor
-
doSaveAs
public void doSaveAs()Description copied from interface:ISaveablePart
Saves the contents of this part to another object.Implementors are expected to open a "Save As" dialog where the user will be able to select a new name for the contents. After the selection is made, the contents should be saved to that new name. During this operation a
IProgressMonitor
should be used to indicate progress.If the save is successful, the part fires a property changed event reflecting the new dirty state (
PROP_DIRTY
property).- Specified by:
doSaveAs
in interfaceISaveablePart
- Specified by:
doSaveAs
in classEditorPart
-
createPartControl
Description copied from interface:IWorkbenchPart
Creates the SWT controls for this workbench part.Clients should not call this method (the workbench calls this method when it needs to, which may be never).
For implementors this is a multi-step process:
- Create one or more controls within the parent.
- Set the parent layout as needed.
- Register any global actions with the site's
IActionBars
. - Register any context menus with the site.
- Register a selection provider with the site, to make it available to the
workbench's
ISelectionService
(optional).
- Specified by:
createPartControl
in interfaceIWorkbenchPart
- Specified by:
createPartControl
in classWorkbenchPart
- Parameters:
parent
- the parent control
-
init
Description copied from interface:IEditorPart
Initializes this editor with the given editor site and input.This method is automatically called shortly after the part is instantiated. It marks the start of the part's lifecycle. The
IWorkbenchPart.dispose
method will be called automically at the end of the lifecycle. Clients must not call this method.Implementors of this method must examine the editor input object type to determine if it is understood. If not, the implementor must throw a
PartInitException
- Specified by:
init
in interfaceIEditorPart
- Specified by:
init
in classEditorPart
- Parameters:
site
- the editor siteinput
- the editor input
-
isDirty
public boolean isDirty()Description copied from interface:ISaveablePart
Returns whether the contents of this part have changed since the last save operation. If this value changes the part must fire a property listener event withPROP_DIRTY
.Note: this method is called often on a part open or part activation switch, for example by actions to determine their enabled status.
- Specified by:
isDirty
in interfaceISaveablePart
- Specified by:
isDirty
in classEditorPart
- Returns:
true
if the contents have been modified and need saving, andfalse
if they have not changed since the last save
-
isSaveAsAllowed
public boolean isSaveAsAllowed()Description copied from interface:ISaveablePart
Returns whether the "Save As" operation is supported by this part.- Specified by:
isSaveAsAllowed
in interfaceISaveablePart
- Specified by:
isSaveAsAllowed
in classEditorPart
- Returns:
true
if "Save As" is supported, andfalse
if not supported
-
setFocus
public void setFocus()Description copied from interface:IWorkbenchPart
Asks this part to take focus within the workbench. Parts must assign focus to one of the controls contained in the part's parent composite.Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use
IWorkbenchPage.activate(IWorkbenchPart) instead
.- Specified by:
setFocus
in interfaceIWorkbenchPart
- Specified by:
setFocus
in classWorkbenchPart
-
setPartName
Description copied from class:WorkbenchPart
Sets the name of this part. The name will be shown in the tab area for the part. Clients should call this method instead of overriding getPartName. Setting this to the empty string will cause a default part name to be used.setPartName and setContentDescription are intended to replace setTitle. This may change a value that was previously set using setTitle.
- Overrides:
setPartName
in classEditorPart
- Parameters:
newName
- the part name, as it should be displayed in tabs.
-
dispose
public void dispose()Description copied from class:WorkbenchPart
TheWorkbenchPart
implementation of thisIWorkbenchPart
method disposes the title image loaded bysetInitializationData
. Subclasses may extend.- Specified by:
dispose
in interfaceIWorkbenchPart
- Overrides:
dispose
in classWorkbenchPart
-
getError
- Returns:
- Returns the error status or
null
if part was created without an explicit error status.
-