Class CompareEditor
- All Implemented Interfaces:
- EventListener,- IAdaptable,- IExecutableExtension,- IPropertyChangeListener,- IEditorPart,- IReusableEditor,- ISaveablePart,- ISaveablesLifecycleListener,- ISaveablesSource,- IWorkbenchPart,- IWorkbenchPart2,- IWorkbenchPart3,- IWorkbenchPartOrientation
- 
Field SummaryFieldsFields inherited from interface org.eclipse.ui.IEditorPartPROP_DIRTY, PROP_INPUTFields inherited from interface org.eclipse.ui.IWorkbenchPartPROP_TITLE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcreatePartControl(Composite parent) Creates the SWT controls for this workbench part.voiddispose()TheWorkbenchPartimplementation of thisIWorkbenchPartmethod disposes the title image loaded bysetInitializationData.voiddoSave(IProgressMonitor progressMonitor) Saves the contents of this part.voiddoSaveAs()Saves the contents of this part to another object.Saveable[]Returns the saveables currently active in the workbench part.<T> TgetAdapter(Class<T> key) Returns an object which is an instance of the given class associated with this object.Saveable[]Returns the saveables presented by the workbench part.voidHandle the given event.voidinit(IEditorSite site, IEditorInput input) Initializes this editor with the given editor site and input.protected voidinitializeInBackground(CompareEditorInput cei, boolean hadPreviousInput) booleanisDirty()Returns whether the contents of this part have changed since the last save operation.booleanReturns whether the "Save As" operation is supported by this part.voidNotification that a property has changed.voidvoidsetFocus()Asks this part to take focus within the workbench.voidsetInput(IEditorInput input) Sets the input to this editor.Methods inherited from class org.eclipse.ui.part.EditorPartcheckSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPartaddPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IEditorPartgetEditorInput, getEditorSiteMethods inherited from interface org.eclipse.ui.ISaveablePartisSaveOnCloseNeededMethods inherited from interface org.eclipse.ui.IWorkbenchPartaddPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
- 
Field Details- 
CONFIRM_SAVE_PROPERTY- See Also:
 
 
- 
- 
Constructor Details- 
CompareEditorpublic CompareEditor()No-argument constructor required for extension points.
 
- 
- 
Method Details- 
getAdapterDescription copied from class:WorkbenchPartReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.Clients may implement this method but should generally call Adapters.adapt(Object, Class, boolean)rather than invoking it directly. Subclasses may override this method (however, if they do so, they should invoke the method on their superclass to ensure that the Platform's adapter manager is consulted).- Specified by:
- getAdapterin interface- IAdaptable
- Overrides:
- getAdapterin class- WorkbenchPart
- Type Parameters:
- T- the class type
- Parameters:
- key- the adapter class to look up
- Returns:
- a object of the given class, or nullif this object does not have an adapter for the given class
 
- 
initDescription copied from interface:IEditorPartInitializes 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.disposemethod 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:
- initin interface- IEditorPart
- Specified by:
- initin class- EditorPart
- Parameters:
- site- the editor site
- input- the editor input
- Throws:
- PartInitException- if this editor was not initialized successfully
 
- 
setInputDescription copied from class:EditorPartSets the input to this editor. This method simply updates the internal member variable.Unlike most of the other set methods on this class, this method does not fire a property change. Clients that call this method from a subclass must ensure that they fire an IWorkbenchPartConstants.PROP_INPUT property change after calling this method but before leaving whatever public method they are in. Clients that expose this method as public API must fire the property change within their implementation of setInput. Note that firing a property change may cause listeners to immediately reach back and call methods on this editor. Care should be taken not to fire the property change until the editor has fully updated its internal state to reflect the new input. - Specified by:
- setInputin interface- IReusableEditor
- Overrides:
- setInputin class- EditorPart
- Parameters:
- input- the editor input
- See Also:
 
- 
refreshActionBarsContributorpublic void refreshActionBarsContributor()
- 
initializeInBackground
- 
getActionBars
- 
createPartControlDescription copied from interface:IWorkbenchPartCreates 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:
- createPartControlin interface- IWorkbenchPart
- Specified by:
- createPartControlin class- WorkbenchPart
- Parameters:
- parent- the parent control
 
- 
disposepublic void dispose()Description copied from class:WorkbenchPartTheWorkbenchPartimplementation of thisIWorkbenchPartmethod disposes the title image loaded bysetInitializationData. Subclasses may extend.- Specified by:
- disposein interface- IWorkbenchPart
- Overrides:
- disposein class- WorkbenchPart
 
- 
setFocuspublic void setFocus()Description copied from interface:IWorkbenchPartAsks 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:
- setFocusin interface- IWorkbenchPart
- Specified by:
- setFocusin class- WorkbenchPart
 
- 
isSaveAsAllowedpublic boolean isSaveAsAllowed()Description copied from interface:ISaveablePartReturns whether the "Save As" operation is supported by this part.- Specified by:
- isSaveAsAllowedin interface- ISaveablePart
- Specified by:
- isSaveAsAllowedin class- EditorPart
- Returns:
- trueif "Save As" is supported, and- falseif not supported
 
- 
doSaveAspublic void doSaveAs()Description copied from interface:ISaveablePartSaves 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 IProgressMonitorshould be used to indicate progress.If the save is successful, the part fires a property changed event reflecting the new dirty state ( PROP_DIRTYproperty).- Specified by:
- doSaveAsin interface- ISaveablePart
- Specified by:
- doSaveAsin class- EditorPart
 
- 
doSaveDescription copied from interface:ISaveablePartSaves the contents of this part.If the save is successful, the part should fire a property changed event reflecting the new dirty state ( PROP_DIRTYproperty).If the save is cancelled through user action, or for any other reason, the part should invoke setCancelledon theIProgressMonitorto inform the caller.This method is long-running; progress and cancellation are provided by the given progress monitor. - Specified by:
- doSavein interface- ISaveablePart
- Specified by:
- doSavein class- EditorPart
- Parameters:
- progressMonitor- the progress monitor
 
- 
isDirtypublic boolean isDirty()Description copied from interface:ISaveablePartReturns 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:
- isDirtyin interface- ISaveablePart
- Specified by:
- isDirtyin class- EditorPart
- Returns:
- trueif the contents have been modified and need saving, and- falseif they have not changed since the last save
 
- 
propertyChangeDescription copied from interface:IPropertyChangeListenerNotification that a property has changed.This method gets called when the observed object fires a property change event. - Specified by:
- propertyChangein interface- IPropertyChangeListener
- Parameters:
- event- the property change event object describing which property changed and how
 
- 
getSaveablesDescription copied from interface:ISaveablesSourceReturns the saveables presented by the workbench part. If the return value of this method changes during the lifetime of this part (i.e. after initialization and control creation but before disposal) the part must notify an implicit listener usingISaveablesLifecycleListener.handleLifecycleEvent(SaveablesLifecycleEvent).Additions of saveables to the list of saveables of this part are announced using an event of type SaveablesLifecycleEvent.POST_OPEN. Removals are announced in a two-stage process, first using an event of typeSaveablesLifecycleEvent.PRE_CLOSEfollowed by an event of typeSaveablesLifecycleEvent.POST_CLOSE. Since firing thePRE_CLOSEevent may trigger prompts to save dirty saveables, the cancellation status of the event must be checked by the part after the notification. When removing only non-dirty saveables,POST_CLOSEnotification is sufficient.The listener is obtained from the part site by calling partSite.getService(ISaveablesLifecycleListener.class).The part must not notify from its initialization methods (e.g. initorcreatePartControl), or from its dispose method. Parts that implementIReusableEditormust notify when their input is changed throughIReusableEditor.setInput(IEditorInput).- Specified by:
- getSaveablesin interface- ISaveablesSource
- Returns:
- the saveables presented by the workbench part
- See Also:
 
- 
getActiveSaveablesDescription copied from interface:ISaveablesSourceReturns the saveables currently active in the workbench part.Certain workbench actions, such as Save, target only the active saveables in the active part. For example, the active saveables could be determined based on the current selection in the part. - Specified by:
- getActiveSaveablesin interface- ISaveablesSource
- Returns:
- the saveables currently active in the workbench part
 
- 
handleLifecycleEventDescription copied from interface:ISaveablesLifecycleListenerHandle the given event. This method must be called on the UI thread.- Specified by:
- handleLifecycleEventin interface- ISaveablesLifecycleListener
- Parameters:
- event- the event
 
 
-