Package com.iizigo.prop
Class MementoPropAdapter
java.lang.Object
com.iizigo.prop.MementoPropAdapter
- All Implemented Interfaces:
- IMemento
"Adapter" class that converts a property container to the Eclipse 
org.eclipse.ui.IMemento.- Author:
- Christopher Mindus
- Field Summary
- Constructor SummaryConstructorsConstructorDescriptionCreates a wrapper around a property container.
- Method SummaryModifier and TypeMethodDescription- createChild- (String type) Creates a new child of this memento with the given type.- createChild- (String type, String id) Creates a new child of this memento with the given type and id.- String[]Returns an array of all the attribute keys of the memento.- getBoolean- (String key) Returns the boolean value of the given key.Returns the first child with the given type id.- IMemento[]Returns all children of this node.- IMemento[]- getChildren- (String type) Returns all children with the given type id.Returns the floating point value of the given key.- getID()Returns the id for this memento.- getInteger- (String key) Returns the integer value of the given key.Returns the string value of the given key.Returns the data of the Text node of the memento.- getType()Returns the type for this memento.- void- putBoolean- (String key, boolean value) Sets the value of the given key to the given boolean value.- voidSets the value of the given key to the given floating point number.- void- putInteger- (String key, int value) Sets the value of the given key to the given integer.- void- putMemento- (IMemento memento) Copy the attributes and children from- mementoto the receiver.- voidSets the value of the given key to the given string.- void- putTextData- (String data) Sets the memento's Text node to contain the given data.
- Constructor Details- MementoPropAdapterCreates a wrapper around a property container.
 
- Method Details- createChildCreates a new child of this memento with the given type.- The - getChildand- getChildrenmethods are used to retrieve children of a given type.- Specified by:
- createChildin interface- IMemento
- Parameters:
- type- The type.
- Returns:
- A new child memento.
- See Also:
 
- createChildCreates a new child of this memento with the given type and id. The id is stored in the child memento (using a special reserved key,- TAG_ID) and can be retrieved using- getId.- The - getChildand- getChildrenmethods are used to retrieve children of a given type.- Specified by:
- createChildin interface- IMemento
- Parameters:
- type- The type.
- id- The child id.
- Returns:
- A new child memento with the given type and id.
- See Also:
 
- getChildReturns the first child with the given type id.
- getChildrenReturns all children of this node.- Specified by:
- getChildrenin interface- IMemento
- Returns:
- An array of children of this node. This will not be null. If there are no children, an array of length zero will be returned.
 
- getChildrenReturns all children with the given type id.- Specified by:
- getChildrenin interface- IMemento
- Parameters:
- type- The type id.
- Returns:
- an array of children with the given type. This will not be null. If there are no keys, an array of length zero will be returned.
 
- getFloatReturns the floating point value of the given key.
- getTypeReturns the type for this memento.
- getIDReturns the id for this memento.
- getIntegerReturns the integer value of the given key.- Specified by:
- getIntegerin interface- IMemento
- Parameters:
- key- The key.
- Returns:
- The value, or nullif the key was not found or was found but was not an integer.
 
- getStringReturns the string value of the given key.
- getBooleanReturns the boolean value of the given key.- Specified by:
- getBooleanin interface- IMemento
- Parameters:
- key- The key.
- Returns:
- The value, or nullif the key was not found.
 
- getTextDataReturns the data of the Text node of the memento. Each memento is allowed only one Text node.- Specified by:
- getTextDatain interface- IMemento
- Returns:
- The data of the Text node of the memento, or nullif the memento has no Text node.
 
- getAttributeKeysReturns an array of all the attribute keys of the memento. This will not be- null. If there are no keys, an array of length zero will be returned.- Specified by:
- getAttributeKeysin interface- IMemento
- Returns:
- An array with all the attribute keys of the memento.
 
- putFloatSets the value of the given key to the given floating point number.
- putIntegerSets the value of the given key to the given integer.- Specified by:
- putIntegerin interface- IMemento
- Parameters:
- key- The key.
- value- The value.
 
- putMementoCopy the attributes and children from- mementoto the receiver.- Specified by:
- putMementoin interface- IMemento
- Parameters:
- memento- The IzMemento to be copied.
 
- putStringSets the value of the given key to the given string.
- putBooleanSets the value of the given key to the given boolean value.- Specified by:
- putBooleanin interface- IMemento
- Parameters:
- key- The key.
- value- The value.
 
- putTextDataSets the memento's Text node to contain the given data. Creates the Text node if none exists. If a Text node does exist, it's current contents are replaced. Each memento is allowed only one text node.- Specified by:
- putTextDatain interface- IMemento
- Parameters:
- data- The data to be placed on the Text node.