Eclipse Platform
Release 3.2

org.eclipse.ui
Class ModelLifecycleEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byorg.eclipse.ui.ModelLifecycleEvent
All Implemented Interfaces:
Serializable

public class ModelLifecycleEvent
extends EventObject

Event object describing a change to a set of ISaveableModel objects.

Since:
3.2
See Also:
Serialized Form

Field Summary
static int DIRTY_CHANGED
          Event type constant specifying that the dirty state of the given models has changed.
static int POST_CLOSE
          Event type constant specifying that the given models have been closed.
static int POST_OPEN
          Event type constant specifying that the given models have been opened.
static int PRE_CLOSE
          Event type constant specifying that the given models are about to be closed.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ModelLifecycleEvent(Object source, int eventType, ISaveableModel[] models, boolean force)
          Creates a new ModelLifecycleEvent.
 
Method Summary
 int getEventType()
          Returns the eventType, currently one of POST_OPEN, PRE_CLOSE, POST_CLOSE, DIRTY_CHANGED.
 ISaveableModel[] getModels()
          Returns the affected models.
 boolean isForce()
          Sets the veto.
 boolean isVeto()
          Returns the veto.
 void setVeto(boolean veto)
           
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POST_OPEN

public static final int POST_OPEN
Event type constant specifying that the given models have been opened.

See Also:
Constant Field Values

PRE_CLOSE

public static final int PRE_CLOSE
Event type constant specifying that the given models are about to be closed. Listeners may veto the closing if isForce() is false.

See Also:
Constant Field Values

POST_CLOSE

public static final int POST_CLOSE
Event type constant specifying that the given models have been closed.

See Also:
Constant Field Values

DIRTY_CHANGED

public static final int DIRTY_CHANGED
Event type constant specifying that the dirty state of the given models has changed.

See Also:
Constant Field Values
Constructor Detail

ModelLifecycleEvent

public ModelLifecycleEvent(Object source,
                           int eventType,
                           ISaveableModel[] models,
                           boolean force)
Creates a new ModelLifecycleEvent.

Parameters:
source - The source of the event. If an ISaveableModelSource notifies about changes to the models returned by ISaveableModelSource.getModels(), the source must be the ISaveableModelSource object.
eventType - the event type, currently one of POST_OPEN, PRE_CLOSE, POST_CLOSE, DIRTY_CHANGED
models - The affected models
force - true if the event type is PRE_CLOSE and this is a closed force that cannot be canceled.
Method Detail

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

getModels

public ISaveableModel[] getModels()
Returns the affected models.

Returns:
the models

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 veto. This value is ignored for POST_OPEN, POST_CLOSE, and DIRTY_CHANGED.

Returns:
Returns the force.

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.