MTree

Description

A MTree is Monoi Tree widget to display multiple items in a format of tree .

Examples

Example 1

 1        //A MTree
 2        MTree  personTree = new MTree(container, "p2", "getChildren", null, null, false);
 3        personTree.fillSpace();
 4        personTree.setShowRemoveMenu(true);
 5        personTree.setImageShow(true);
 6        personTree.setDisplayDataPath("surname");
 7
 8        IBusinessAddRemoveLogic ibarL = new IBusinessAddRemoveLogic() {
 9
10            public void addChild(Object parentObject, Object ChildObject) {
11                //Define your function
12                ......
13            }
14
15            public void removeChild(Object parentObject, Object ChildObject) {
16                //Define your function
17                ......
18            }
19        };
20        personTree.setAddRemoveLogic(ibarL);

Example 2

1        //A MTree
2        MTree  personTree = new MTree(container, "p2", "getChildren", null, null,false);
3        personTree.fillSpace();
4        personTree.setShowRemoveMenu(true);
5        personTree.setDisplayDataPath("surname");

API

  • Constructors
public MTree(MonoiContainer parentContainer, String businessDataCollectionPath, String getChildrenMethodName,String getParentMethodName, String hasChildrenMethod, boolean showDefaultRemoveMenu) Constructs a new instance of this class given its parent, DataCollection's Path, name of getChildrenMethod, name of getChildrenMethod, name of hasChildrenMethod and showDefaultRemoveMenu
public MTree(MonoiContainer parentContainer, String businessDataCollectionPath, IDataRelationshipManager relationshipManager) Constructs a new instance of this class given its parent,DataCollection's Path and relationshipManager
public MTree(MonoiContainer parentContainer, String businessDataCollectionPath) Constructs a new instance of this class given its parent,DataCollection's Path
public MTree(MonoiContainer parentContainer) Constructs a new instance of this class given its parent
  • Methods
void addAll(Collection collectionElements) Adds a collection as the children
void addAll(Object[] collectionElements) Adds a collection as the children
void addDataAction(DataAction dataAction) Adds a DataAction
void addNewElement(IMTreeNode treeNode) Adds a tree's node
void addNewElement(Object businessData) Adds a new data no-recognized
void addNewElement(Object parent, Object newData) Adds a new data into the specific parent
MTreeActionSet getActions() Gets a MTree's action
IBusinessAddRemoveLogic getAddRemoveLogic() Gets a business's logic(add or remove)
int getChildrenCount(Object data) Gets the number of children
String getDisplayDataPath() Gets a path for display
String getGetChildrenMethodName() Gets the name of GetChildrenMethod
String getGetParentMethodName() Gets the name of GetParenMethod
String getHasChildrenMethod() Gets the name of HasChildrenMethod
Object getLastSelectedData() Gets a data selected in the last time
IDataRelationshipManager getRelationshipManager() Gets a RelationshipManager
Object getRoot() Gets the root of tree
Object getSelectedData() Gets a selected data
Control getTargetControl() Gets the target's control
boolean isImageShow() If true, show the image
boolean isShowRemoveMenu() If true, show the menu for remove
void refresh() Refreshes a tree
void refresh(Object o, boolean updateLabels) Refreshes a tree with a object given
boolean remove(Object parentObject, Object childObjetToRemove) Removes a child from a parent
void removeAll() Removes all the children
boolean removeSelecteNode( Removes a selected node
boolean select(Object businessData) Selects a node
void setAddRemoveLogic(IBusinessAddRemoveLogic addRemoveLogic) Sets the tAddRemoveLogic
void setDisplayDataPath(String displayDataPath Sets a path for display
void setDisplayProvider(ITreeDisplayProvider displayProvider) Sets a DisplayProvider
void setGetChildrenMethod(String getChildrenMethodName) Sets a GetChildrenMethod
void setGetChildrenMethodName(String getChildrenMethodName) Sets the name of GetChildrenMethod
void setGetParentMethodName(String getParentMethodName) Sets the name of GetParentMethod
void setHasChildrenMethod(String hasChildrenMethod) Sets a HasChildrenMetho
void setImageShow(boolean imageShow) Sets the Image's showing
void setRelationshipManager(IDataRelationshipManager relationshipManager) Sets a DataRelationshipManager
void setRoot(Object rootName Sets a root for a tree
void setShowRemoveMenu(boolean showRemoveMenu) Sets the RemoveMenu's showing
void setSize(int width, int height) Sets a size
void show(Object data) Sets the data's showing
Object[] toDataArray() Changes a data to a dataArray
  • See also superclasses
    • MonoiComponent, MonoiDataComponent and MonoiCollectionComponent

MTree1.jpg (36.6 kB) Frédéric ESNAULT, 02/27/2012 12:43 pm

MTree2.jpg (28.3 kB) Frédéric ESNAULT, 02/27/2012 12:43 pm