public class ServerConfigView extends ViewPart implements IWorkbenchPartIZ, ISaveablePart2, IActivationListener
Modifier and Type | Field and Description |
---|---|
static String |
ID
The View Part ID.
|
PROP_TITLE
CANCEL, DEFAULT, NO, YES
PROP_DIRTY
Constructor and Description |
---|
ServerConfigView()
Creates the folder view.
|
Modifier and Type | Method and Description |
---|---|
void |
createPartControl(Composite parent)
Creates the view part.
|
void |
dispose()
Disposes of this workbench part.
|
void |
doSave(IProgressMonitor monitor)
Saves the contents of this part.
|
void |
doSaveAs()
Saves the contents of this part to another object.
|
IPartExtensionIZ |
getExtension()
Gets the extensions framework.
|
SelectionEnabler |
getSelectionEnabler()
Gets the selection enabler instance.
|
IPropUndoRedo |
getUndoRedo()
Gets the undo/redo instance.
|
void |
init(IViewSite site,
IMemento memento)
Initializes this view with the given view site.
|
boolean |
isDirty()
Returns whether the contents of this part have changed since the last save
operation.
|
boolean |
isDisposed()
Checks if the part is disposed of.
|
boolean |
isSaveAsAllowed()
Returns whether the "Save As" operation is supported by this part.
|
boolean |
isSaveOnCloseNeeded()
Returns whether the contents of this part should be saved when the part
is closed.
|
void |
onActivated(boolean on)
Called when activator or deactivated.
|
void |
onClose()
Called when about to close, but SWT is still there.
|
static ServerConfigView |
openFile(String fileName,
boolean doUpdateHistory)
Open a view for a Server configuration file, or focuses an existing view for the file.
|
int |
promptToSaveOnClose()
Prompts the user for input on what to do with unsaved data.
|
void |
saveState(IMemento memento)
Saves the state.
|
void |
setFocus()
Focus to best component, where the framework takes care of
it normally.
|
void |
updateStates()
Called when states needs to be updated.
|
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onComponentFocused
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
getAdapter
public static final String ID
public static ServerConfigView openFile(String fileName, boolean doUpdateHistory)
fileName
- The file name.doUpdateHistory
- Flag to update history for last recently used file.public void init(IViewSite site, IMemento memento) throws PartInitException
This implementation will ignore the memento and initialize the view in a fresh state.
init
in interface IViewPart
init
in class ViewPart
PartInitException
public void saveState(IMemento memento)
public void createPartControl(Composite parent)
createPartControl
in interface IWorkbenchPart
createPartControl
in class WorkbenchPart
public void dispose()
This is the last method called on the IWorkbenchPart. At this point the part controls (if they were ever created) have been disposed as part of an SWT composite. There is no guarantee that createPartControl() has been called, so the part controls may never has been created.
Within this method a part may release any resources, fonts, images, etc. held by this part. It is also very important to de-register all listeners from the workbench.
dispose
in interface IWorkbenchPart
dispose
in class WorkbenchPart
public void setFocus()
setFocus
in interface IWorkbenchPart
setFocus
in class WorkbenchPart
public IPartExtensionIZ getExtension()
getExtension
in interface IWorkbenchPartIZ
public IPropUndoRedo getUndoRedo()
getUndoRedo
in interface IWorkbenchPartIZ
public boolean isDisposed()
isDisposed
in interface IActivationListener
isDisposed
in interface IWorkbenchPartIZ
public SelectionEnabler getSelectionEnabler()
getSelectionEnabler
in interface IWorkbenchPartIZ
public int promptToSaveOnClose()
promptToSaveOnClose
in interface ISaveablePart2
YES
,
NO
, CANCEL
or DEFAULT
.public void doSave(IProgressMonitor monitor)
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 the IProgressMonitor
to inform the caller.
This method is long-running; progress and cancellation are provided by the given progress monitor.
doSave
in interface ISaveablePart
monitor
- the progress monitorpublic void doSaveAs()
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).
doSaveAs
in interface ISaveablePart
public boolean isDirty()
PROP_DIRTY
.
Note: this method is called often on a part open or part activation switch, for example by actions to determine their enabled status.
isDirty
in interface ISaveablePart
true
if the contents have been modified and need
saving, and false
if they have not changed since the last
savepublic boolean isSaveAsAllowed()
isSaveAsAllowed
in interface ISaveablePart
true
if "Save As" is supported, and false
if not supportedpublic boolean isSaveOnCloseNeeded()
isSaveOnCloseNeeded
in interface ISaveablePart
true
if the contents of the part should be saved on
close, and false
if the contents are expendablepublic void updateStates()
updateStates
in interface IActivationListener
public void onActivated(boolean on)
onActivated
in interface IActivationListener
public void onClose()
onClose
in interface IActivationListener
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.