Preferences Editor

de.jppietsch.prefedit
Class Subtree

java.lang.Object
  extended byde.jppietsch.prefedit.AbstractTransferable
      extended byde.jppietsch.prefedit.Subtree
All Implemented Interfaces:
Transferable

public class Subtree
extends AbstractTransferable

An immutable preferences tree which may be placed in the clipboard.

Version:
$Revision: 1.1 $
Author:
Jan-Peter Pietsch

Field Summary
private  String key
          Name of this subtrees root.
private  Preferences node
          Preferences node.
private  ArrayList prefs
          List of Preference representing the keys with their values.
private  ArrayList subtrees
          List of Subtree representing the subnodes.
 
Constructor Summary
Subtree(Preferences somePreferences)
          Constructs this Preference from the given preferences node.
 
Method Summary
 void cut()
          Copies this preferences subtree to the system clipboard and removes it.
protected  void doPaste(Preferences somePreferences)
          Adds this transferable to the given preferences.
protected  String humanPresentableClassName()
          Returns a human presentable name for this class.
 String toString()
          Returns a string representation of this object.
private  StringBuffer toString(StringBuffer aBuffy, String anIndent)
          Recursive helper for toString().
 
Methods inherited from class de.jppietsch.prefedit.AbstractTransferable
copy, flavor, getTransferData, getTransferDataFlavors, isDataFlavorSupported, paste
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

node

private Preferences node
Preferences node.


key

private final String key
Name of this subtrees root.


subtrees

private final ArrayList subtrees
List of Subtree representing the subnodes.


prefs

private final ArrayList prefs
List of Preference representing the keys with their values.

Constructor Detail

Subtree

public Subtree(Preferences somePreferences)
        throws BackingStoreException
Constructs this Preference from the given preferences node.

Parameters:
somePreferences - the preferences node.
Method Detail

toString

public String toString()
Returns a string representation of this object.

Returns:
A string representation of this object.

cut

public void cut()
Copies this preferences subtree to the system clipboard and removes it.

Overrides:
cut in class AbstractTransferable

humanPresentableClassName

protected String humanPresentableClassName()
Returns a human presentable name for this class.

Specified by:
humanPresentableClassName in class AbstractTransferable
Returns:
A human presentable name for the concrete class.

doPaste

protected void doPaste(Preferences somePreferences)
Adds this transferable to the given preferences.

Specified by:
doPaste in class AbstractTransferable
Parameters:
somePreferences - to which this is added.

toString

private StringBuffer toString(StringBuffer aBuffy,
                              String anIndent)
Recursive helper for toString().

Parameters:
aBuffy - receives a string representation of this object.
anIndent - is preceded before any line.
Returns:
The given buffer filled with the requested string.

Preferences Editor