Extension SDK 10.1.2

oracle.ide.addin
Class ViewSelectionEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byoracle.ide.addin.ViewSelectionEvent
All Implemented Interfaces:
java.io.Serializable

public final class ViewSelectionEvent
extends java.util.EventObject

The ViewSelectionEvent is used to indicate that the selection held by the a View has been modified. Interested parties are granted access to: the View upon which the event occured, the complete selection held by the View at the time of the event and optionally the delta Elements which were added or removed from the selection (as indicated by the result of getID()).

See Also:
Serialized Form

Field Summary
static Element[] EMPTY_SELECTION
           
static int SELECTION_ADDED
          Constant indicating that an item has been added to the selection.
static int SELECTION_CHANGED
          Constant indicating that the current selection has been replaced with new items.
static int SELECTION_REMOVED
          Constant indicating that an item has been removed from the selection.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ViewSelectionEvent(View view)
          Constructor.
ViewSelectionEvent(View view, int id)
          Constructor.
ViewSelectionEvent(View view, int id, Element[] delta)
          Constructor.
 
Method Summary
 Element[] getDelta()
          Get the delta to the selection of the View as it was at the time of the creation of this event.
 int getID()
          Determine what type of change occurred.
 Element[] getSelection()
          Get the selection of the View as it was at the time of the creation of this event.
 View getView()
          Get the View whose selection has changed.
 
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

EMPTY_SELECTION

public static final Element[] EMPTY_SELECTION

SELECTION_ADDED

public static final int SELECTION_ADDED
Constant indicating that an item has been added to the selection.

See Also:
Constant Field Values

SELECTION_REMOVED

public static final int SELECTION_REMOVED
Constant indicating that an item has been removed from the selection.

See Also:
Constant Field Values

SELECTION_CHANGED

public static final int SELECTION_CHANGED
Constant indicating that the current selection has been replaced with new items.

See Also:
Constant Field Values
Constructor Detail

ViewSelectionEvent

public ViewSelectionEvent(View view)
Constructor. By default sets the type of change as SELECTION_CHANGED.

Parameters:
view - the View whose selection has changed.

ViewSelectionEvent

public ViewSelectionEvent(View view,
                          int id)
Constructor.

Parameters:
view - the View whose selection has changed.
id - indication of what type of change has occured. The id value can be one of the following constants: SELECTION_ADDED, SELECTION_REMOVED, or SELECTION_CHANGED.
Throws:
java.lang.IllegalArgumentException - if the id parameter is not one of the predefined constants.

ViewSelectionEvent

public ViewSelectionEvent(View view,
                          int id,
                          Element[] delta)
Constructor.

Parameters:
view - the View whose selection has changed.
id - indication of what type of change has occured.
delta - the actual Elements that were added/removed.
Method Detail

getID

public int getID()
Determine what type of change occurred.

Returns:
one of SELECTION_ADDED, SELECTION_REMOVED or SELECTION_CHANGED.

getView

public View getView()
Get the View whose selection has changed. This is functionally equivalent to casting the result of getSource() to a View object.

Returns:
the View whose selection has changed.

getSelection

public Element[] getSelection()
Get the selection of the View as it was at the time of the creation of this event.

Returns:
an array of selected Elements.

getDelta

public Element[] getDelta()
Get the delta to the selection of the View as it was at the time of the creation of this event.

Returns:
an array of Elements that were added or removed as indicated by the result of getID().

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.