Package org.eclipse.ui
Class SaveablesLifecycleEvent
java.lang.Object
java.util.EventObject
org.eclipse.ui.SaveablesLifecycleEvent
- All Implemented Interfaces:
Serializable
Event object describing a change to a set of Saveable objects.
- Since:
- 3.2
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Event type constant specifying that the dirty state of the given saveables has changed.static final int
Event type constant specifying that the given saveables have been closed.static final int
Event type constant specifying that the given saveables have been opened.static final int
Event type constant specifying that the given saveables are about to be closed.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionSaveablesLifecycleEvent
(Object source, int eventType, Saveable[] saveables, boolean force) Creates a new SaveablesLifecycleEvent. -
Method Summary
Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
POST_OPEN
public static final int POST_OPENEvent type constant specifying that the given saveables have been opened.- See Also:
-
PRE_CLOSE
public static final int PRE_CLOSEEvent type constant specifying that the given saveables are about to be closed. Listeners may veto the closing if isForce() is false.- See Also:
-
POST_CLOSE
public static final int POST_CLOSEEvent type constant specifying that the given saveables have been closed.- See Also:
-
DIRTY_CHANGED
public static final int DIRTY_CHANGEDEvent type constant specifying that the dirty state of the given saveables has changed.- See Also:
-
-
Constructor Details
-
SaveablesLifecycleEvent
Creates a new SaveablesLifecycleEvent.- Parameters:
source
- The source of the event. If an ISaveablesSource notifies about changes to the saveables returned byISaveablesSource.getSaveables()
, the source must be the ISaveablesSource object.eventType
- the event type, currently one of POST_OPEN, PRE_CLOSE, POST_CLOSE, DIRTY_CHANGEDsaveables
- The affected saveablesforce
- true if the event type is PRE_CLOSE and this is a closed force that cannot be canceled.
-
-
Method Details
-
getEventType
public int getEventType()Returns the eventType, currently one of POST_OPEN, PRE_CLOSE, POST_CLOSE, DIRTY_CHANGED. Listeners should silently ignore unknown event types since new event types might be added in the future.- Returns:
- the eventType
-
getSaveables
Returns the affected saveables.- Returns:
- the saveables
-
isVeto
public boolean isVeto()Returns the veto. This value is ignored for POST_OPEN,POST_CLOSE, and DIRTY_CHANGED.- Returns:
- Returns the veto.
-
setVeto
public void setVeto(boolean veto) - Parameters:
veto
- The veto to set.
-
isForce
public boolean isForce()Sets the force flag. This value is ignored for POST_OPEN, POST_CLOSE, and DIRTY_CHANGED.- Returns:
- Returns the force.
-