com.l2fprod.common.application.selection
Class DefaultSelection

java.lang.Object
  extended by com.l2fprod.common.application.selection.DefaultSelection
All Implemented Interfaces:
Selection

public class DefaultSelection
extends java.lang.Object
implements Selection

DefaultSelection.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.l2fprod.common.application.selection.Selection
Selection.Helper
 
Constructor Summary
DefaultSelection(javax.swing.JList list)
           
DefaultSelection(javax.swing.JTree tree)
           
DefaultSelection(javax.swing.JTree tree, boolean onlyLastPathComponent)
           
DefaultSelection(java.lang.Object[] objects)
           
DefaultSelection(javax.swing.tree.TreeSelectionModel tree, boolean onlyLastPathComponent)
           
 
Method Summary
static Selection findSelection(java.awt.Component component)
          Find the selection out of a Component.
 java.lang.Object[] getSelection()
          Returns an array of the selected objects
 boolean isEmpty()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultSelection

public DefaultSelection(javax.swing.JList list)

DefaultSelection

public DefaultSelection(javax.swing.JTree tree)

DefaultSelection

public DefaultSelection(javax.swing.JTree tree,
                        boolean onlyLastPathComponent)

DefaultSelection

public DefaultSelection(javax.swing.tree.TreeSelectionModel tree,
                        boolean onlyLastPathComponent)

DefaultSelection

public DefaultSelection(java.lang.Object[] objects)
Method Detail

getSelection

public java.lang.Object[] getSelection()
Description copied from interface: Selection
Returns an array of the selected objects

Specified by:
getSelection in interface Selection
Returns:
the selected objects

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Selection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

findSelection

public static Selection findSelection(java.awt.Component component)
Find the selection out of a Component. Return an empty selection if there are not selected objects.

Parameters:
component -
Returns:
the selection for the given component