Package com.iizigo.prop
Class TreeItemNavigatorPresentation
java.lang.Object
com.iizigo.prop.TreeItemNavigatorPresentation
- All Implemented Interfaces:
- INavigatorPresentation,- Cloneable
- Direct Known Subclasses:
- MemberTreeItemNavigatorPresentation
public class TreeItemNavigatorPresentation extends Object implements INavigatorPresentation, Cloneable
Class wrapping an item for the filtered common viewer.
- Author:
- Christopher Mindus
- Field SummaryFields- Fields inherited from interface com.iizigo.navigator.INavigatorPresentation- CN_PREFERENCE_FLAGS_NAME, DEFAULT_COMPARATOR, EMPTY_ARRAY, FLAG_ADD_FILE_ITEM_PACKAGE_LOCATION, FLAG_ADD_FILE_ITEM_PROJECT, FLAG_ADD_FOLDER_PACKAGE_LOCATION, FLAG_ADD_FOLDER_PROJECT, FLAG_CUSTOM_1, FLAG_CUSTOM_2, FLAG_CUSTOM_3, FLAG_JAVA_SUPPORT, FLAG_PACKAGE_VIEW, FLAG_SHOW_DESIGNER_PROPERTIES, FLAG_SHOW_EMPTY_MODULE_FOLDERS, FLAG_SHOW_EMPTY_PACKAGES, FLAG_SHOW_FILE_ITEMS, FLAG_SHOW_SUBPROPERTIES, FLAGS_NORMAL, FLAGS_ONLY_FOLDERS
- Constructor SummaryConstructorsConstructorDescriptionConstructs the viewer wrapper.- TreeItemNavigatorPresentation- (String text, Object parent) Constructs the viewer wrapper.- TreeItemNavigatorPresentation- (String text, Image image) Constructs the viewer wrapper.- TreeItemNavigatorPresentation- (String text, Image image, Object parent) Constructs the viewer wrapper.
- Method SummaryModifier and TypeMethodDescription- voidAdds a child.- clone()Clones the instance.- booleanChecks if a child is present.- intGets the category of this Common Navigator object, used for sorting.- Object[]- getCNChildren- (int flags) Gets the children of this container for Common Navigator.Get the- Comparatorobject to sort the children for the Common Navigator when presented visually in the tree.- getCNDescription- (int flags) Provide a description for the status bar view, if available.- getCNImage- (int flags) Gets the image for the Common Navigator.- getCNImage- (int columnIndex, int flags) Gets the image for the Common Tree Viewer showing column contents.- getCNParent- (int flags) Gets the parent for Common Navigator.- getCNStyledText- (int flags) Gets the label text for the Common Navigator.- getCNText- (int flags) Gets the label text for the Common Navigator.- getCNText- (int columnIndex, int flags) Gets the label text for the Common Navigator.- getText()Gets the text.- boolean- hasCNChildren- (int level) Returns whether the given element has children for the Common Navigator.- voidRemoves all children.- boolean- removeChild- (Object child) Removes a child.- void- setAdditionalText- (String text) Sets an additional text to display.- voidSets the parent.- void- sortChildren- (boolean recursive, Collator collator) Sorts this nodes children of type INavigatorPresentation according to their text.
- Field Details- attachment
 
- Constructor Details- TreeItemNavigatorPresentationConstructs the viewer wrapper.
- TreeItemNavigatorPresentationConstructs the viewer wrapper.
- TreeItemNavigatorPresentationConstructs the viewer wrapper.
- TreeItemNavigatorPresentationConstructs the viewer wrapper.
 
- Method Details- cloneClones the instance.
- setParentSets the parent.
- addChildAdds a child.
- removeChildRemoves a child.- Returns:
- true for removed, false for not found.
 
- containsChecks if a child is present.
- removeAllChildrenpublic void removeAllChildren()Removes all children.
- getTextGets the text.
- setAdditionalTextSets an additional text to display.
- getCNParentGets the parent for Common Navigator.- Specified by:
- getCNParentin interface- INavigatorPresentation
- Parameters:
- flags- The flag that apply is FLAG_PACKAGE_VIEW.
- Returns:
- The parent object: IProject or DesignerProp, or null if no parent exists (property is not added to a container).
 
- getCNCategorypublic int getCNCategory()Gets the category of this Common Navigator object, used for sorting. Subclasses can override this method, in order to get the sorting in the viewer to be done within a category.- Specified by:
- getCNCategoryin interface- INavigatorPresentation
- Returns:
- This method returns 1000 integer value, i.e. "last" in sort order.
 
- getCNComparatorGet the- Comparatorobject to sort the children for the Common Navigator when presented visually in the tree.- Subclasses are invited to override this method for other sorting schemes. - Specified by:
- getCNComparatorin interface- INavigatorPresentation
- Returns:
- The default comparator. Subclasses can inhibit sorting by returning null.
 
- hasCNChildrenpublic boolean hasCNChildren- (int level) Returns whether the given element has children for the Common Navigator.- Specified by:
- hasCNChildrenin interface- INavigatorPresentation
- Parameters:
- level- The flags: FLAG_PACKAGE_VIEW, FLAG_SHOW_EMPTY_MAIN_FOLDER, FLAG_SHOW_EMPTY_PACKAGES, FLAG_SHOW_FILE_ITEMS, FLAG_SHOW_DESIGNER_PROPERTIES and FLAG_SHOW_SUBPROPERTIES are relevant.
- Returns:
- trueif the node has children, and- falseif it has no children.
 
- getCNChildrenDescription copied from interface:- INavigatorPresentationGets the children of this container for Common Navigator.- Specified by:
- getCNChildrenin interface- INavigatorPresentation
- Parameters:
- flags- The flags: FLAG_PACKAGE_VIEW, FLAG_SHOW_EMPTY_MAIN_FOLDER, FLAG_SHOW_EMPTY_PACKAGES, FLAG_SHOW_FILE_ITEMS, FLAG_SHOW_DESIGNER_PROPERTIES and FLAG_SHOW_SUBPROPERTIES are relevant.
- Returns:
- An array of children objects or EMPTY_ARRAY for none.
 
- getCNImageGets the image for the Common Navigator.- Specified by:
- getCNImagein interface- INavigatorPresentation
- Parameters:
- flags- The flags for the image, see FLAG_IMAGE_*.
- Returns:
- Image or nullif there is no image.
 
- getCNImageGets the image for the Common Tree Viewer showing column contents.- Specified by:
- getCNImagein interface- INavigatorPresentation
- Parameters:
- columnIndex- The zero-based index for the column (zero is never used, the method getCNImage() is called instead.
- flags- The flags for the image, see FLAG_IMAGE_*.
- Returns:
- Image or nullif there is no image for the given object at columnIndex.
 
- getCNTextGets the label text for the Common Navigator.- Specified by:
- getCNTextin interface- INavigatorPresentation
- Returns:
- String or or nullif there is no text.
 
- getCNTextGets the label text for the Common Navigator.- Specified by:
- getCNTextin interface- INavigatorPresentation
- Parameters:
- columnIndex- The zero-based index for the column (zero is never used, the method getCNText() is called instead.
- Returns:
- String or or nullif there is no text for the given object at columnIndex.
 
- getCNStyledTextGets the label text for the Common Navigator.- Specified by:
- getCNStyledTextin interface- INavigatorPresentation
- Parameters:
- flags- The flags that apply are FLAG_ADD_FOLDER_PACKAGE_LOCATION, FLAG_ADD_FILE_ITEM_PACKAGE_LOCATION, FLAG_ADD_FOLDER_PROJECT and FLAG_ADD_FILE_ITEM_PROJECT.
 
- getCNDescriptionProvide a description for the status bar view, if available. A default string of the form "(x) items selected" will be used if this method choose to return null.- The empty string ("") will be respected as a valid value if returned. Return null if the extension defers to the default method of supplying status bar descriptions. - Specified by:
- getCNDescriptionin interface- INavigatorPresentation
- Returns:
- A description for the status bar view, or null if not available.
 
- sortChildrenSorts this nodes children of type INavigatorPresentation according to their text.- Parameters:
- recursive- Flag for recurse or not.
- collator- The collator, null for default.