de.grogra.pf.ui.edit
Class SelectionBase

java.lang.Object
  extended by de.grogra.pf.ui.edit.SelectionBase
All Implemented Interfaces:
Selection, Described
Direct Known Subclasses:
FieldSelection, GraphSelectionImpl, MapSource, OptionsSelection

public abstract class SelectionBase
extends java.lang.Object
implements Selection


Field Summary
protected  Context context
           
 
Fields inherited from interface de.grogra.pf.ui.edit.Selection
DELETABLE, HIERARCHICAL, TRANSFERABLE
 
Fields inherited from interface de.grogra.util.Described
ACCELERATOR_KEY, ICON, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, TITLE
 
Constructor Summary
SelectionBase(Context context)
           
 
Method Summary
 ComponentWrapper createPropertyEditorComponent()
          Returns an editor component for the GUI.
 ComponentWrapper createPropertyEditorMenu()
          Returns an editor menu component for the GUI.
protected  PropertyEditorTree.Node createPropertyNodes(PropertyEditorTree tree, Property p, Item item)
           
protected abstract  PropertyEditorTree.Node createPropertyNodes(PropertyEditorTree tree, Property p, UITree sourceTree, java.lang.Object sourceNode)
           
protected abstract  PropertyEditorTree.Node createPropertyNodesInGroup(PropertyEditorTree tree, Property p, UITree sourceTree, java.lang.Object sourceGroup)
           
protected abstract  PropertyEditorTree createTree()
           
 void delete(boolean includeChildren)
          Deletes this selection.
 int getCapabilities()
          Returns the capabilities of this selection.
 Context getContext()
           
protected  PropertyEditor getEditorFor(Property p, Item item)
           
protected abstract  UITree getHierarchySource()
           
protected abstract  java.lang.Object getHierarchySourceRoot(UITree source)
           
protected abstract  java.lang.String getLabelFor(Property p)
           
protected abstract  java.util.List getProperties(PropertyEditorTree tree)
           
 void remove()
           
 java.awt.datatransfer.Transferable toTransferable(boolean includeChildren)
          Converts this selection into Transferable for the clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.grogra.util.Described
getDescription
 

Field Detail

context

protected final Context context
Constructor Detail

SelectionBase

public SelectionBase(Context context)
Method Detail

createPropertyEditorComponent

public ComponentWrapper createPropertyEditorComponent()
Description copied from interface: Selection
Returns an editor component for the GUI. The component is used in in the GUI to edit the properties of this selection.

Specified by:
createPropertyEditorComponent in interface Selection
Returns:
a component responsible for editing this selection

createPropertyEditorMenu

public ComponentWrapper createPropertyEditorMenu()
Description copied from interface: Selection
Returns an editor menu component for the GUI. The component is used in in the GUI to edit the properties of this selection as part of a menu.

Specified by:
createPropertyEditorMenu in interface Selection
Returns:
a menu component responsible for editing this selection

createPropertyNodes

protected PropertyEditorTree.Node createPropertyNodes(PropertyEditorTree tree,
                                                      Property p,
                                                      Item item)

createPropertyNodes

protected abstract PropertyEditorTree.Node createPropertyNodes(PropertyEditorTree tree,
                                                               Property p,
                                                               UITree sourceTree,
                                                               java.lang.Object sourceNode)

createPropertyNodesInGroup

protected abstract PropertyEditorTree.Node createPropertyNodesInGroup(PropertyEditorTree tree,
                                                                      Property p,
                                                                      UITree sourceTree,
                                                                      java.lang.Object sourceGroup)

createTree

protected abstract PropertyEditorTree createTree()

delete

public void delete(boolean includeChildren)
Description copied from interface: Selection
Deletes this selection. The precise semantics of deletion depends on the selection. This method is only invoked if this selection has the capability Selection.DELETABLE.

Specified by:
delete in interface Selection
Parameters:
includeChildren - true iff children in the hierarchy shall be included

getCapabilities

public int getCapabilities()
Description copied from interface: Selection
Returns the capabilities of this selection. The returned value is a combination of the flags Selection.TRANSFERABLE, Selection.DELETABLE, Selection.HIERARCHICAL.

Specified by:
getCapabilities in interface Selection
Returns:
this selection's capabilities

getContext

public Context getContext()
Specified by:
getContext in interface Selection

getEditorFor

protected PropertyEditor getEditorFor(Property p,
                                      Item item)

getHierarchySource

protected abstract UITree getHierarchySource()

getHierarchySourceRoot

protected abstract java.lang.Object getHierarchySourceRoot(UITree source)

getLabelFor

protected abstract java.lang.String getLabelFor(Property p)

getProperties

protected abstract java.util.List getProperties(PropertyEditorTree tree)

remove

public void remove()

toTransferable

public java.awt.datatransfer.Transferable toTransferable(boolean includeChildren)
Description copied from interface: Selection
Converts this selection into Transferable for the clipboard. This method is only invoked if this selection has the capability Selection.TRANSFERABLE.

Specified by:
toTransferable in interface Selection
Parameters:
includeChildren - true iff children in the hierarchy shall be included
Returns:
a transferable object representing the data of this selection