Package com.iizigo.editor
Class PartExtensionIZ
java.lang.Object
com.iizigo.editor.PartExtensionIZ
- All Implemented Interfaces:
IPartExtensionIZ
,IPartListener
,IWindowListener
public class PartExtensionIZ extends Object implements IPartExtensionIZ, IPartListener, IWindowListener
Extensions framework for part in IZ.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorDescriptionThe constructor.PartExtensionIZ
(IViewPart part, IWorkbenchPartIZ izPart) The constructor.Method Summary
Modifier and TypeMethodDescriptionvoid
addPartListener
(IPartListener listener) Adds a part listener.void
createActivationListener
(Composite mainComposite, IActivationListener activationListener, MultiSelectionProvider multiSelectionProvider) Creates the part and window activation listeners.void
dispose()
Disposes of all part listeners.Gets the action bars (different for View and Editor).Gets the part listeners.Gets the workbench part.boolean
Checks if the part is disposed of.void
Called when the UI has been initialized fully to verify if the part is active, and if so triggers an extra activation in Async SWT.void
void
void
void
void
static void
queueUpdateActionBars
(IActionBars actionBars) Adds an action bar for updates later.void
removePartListener
(IPartListener listener) Removes a part listener.boolean
Restores the last focus.static void
updateActionBars
(IActionBars actionBars) Updates an action bar now, removing it from the queue of action bars to update.void
windowActivated
(IWorkbenchWindow window) void
windowClosed
(IWorkbenchWindow window) void
windowDeactivated
(IWorkbenchWindow window) void
windowOpened
(IWorkbenchWindow window)
Constructor Details
PartExtensionIZ
The constructor.- Parameters:
part
- An editor part who's part is implementing IWorkenchPartIZ.
PartExtensionIZ
The constructor.- Parameters:
part
- A view part who's part is implementing IWorkenchPartIZ.izPart
- The view part (same as "part") who's part is implementing IWorkenchPartIZ.
Method Details
queueUpdateActionBars
Adds an action bar for updates later.updateActionBars
Updates an action bar now, removing it from the queue of action bars to update.getWorkbenchPart
Gets the workbench part.- Specified by:
getWorkbenchPart
in interfaceIPartExtensionIZ
getActionBars
Gets the action bars (different for View and Editor).- Specified by:
getActionBars
in interfaceIPartExtensionIZ
isDisposed
public boolean isDisposed()Checks if the part is disposed of.- Specified by:
isDisposed
in interfaceIPartExtensionIZ
dispose
public void dispose()Disposes of all part listeners.addPartListener
Adds a part listener. Part that added as listeners in this method are called with the dispose method if they are instances of:- RetargetAction
- Specified by:
addPartListener
in interfaceIPartExtensionIZ
getPartListeners
Gets the part listeners. The return value is cached and very efficient in terms of memory allocation.- Specified by:
getPartListeners
in interfaceIPartExtensionIZ
removePartListener
Removes a part listener.- Specified by:
removePartListener
in interfaceIPartExtensionIZ
onInitializedUI
public void onInitializedUI()Called when the UI has been initialized fully to verify if the part is active, and if so triggers an extra activation in Async SWT.createActivationListener
public void createActivationListener(Composite mainComposite, IActivationListener activationListener, MultiSelectionProvider multiSelectionProvider) Creates the part and window activation listeners. This method can be called twice, one without the mainComposte (i.e. null) and a second time when the composite is defined.- Parameters:
mainComposite
- The parts main composite.activationListener
- The part listener.multiSelectionProvider
- The multi-selection listener, can be null.
partActivated
- Specified by:
partActivated
in interfaceIPartListener
partBroughtToTop
- Specified by:
partBroughtToTop
in interfaceIPartListener
partClosed
- Specified by:
partClosed
in interfaceIPartListener
partDeactivated
- Specified by:
partDeactivated
in interfaceIPartListener
partOpened
- Specified by:
partOpened
in interfaceIPartListener
windowActivated
- Specified by:
windowActivated
in interfaceIWindowListener
windowDeactivated
- Specified by:
windowDeactivated
in interfaceIWindowListener
windowClosed
- Specified by:
windowClosed
in interfaceIWindowListener
windowOpened
- Specified by:
windowOpened
in interfaceIWindowListener
restoreLastFocus
public boolean restoreLastFocus()Restores the last focus.- Returns:
- false if it failed, control is "no longer" or none is ever focused, true for success.