001package gwt.material.design.addins.client.tree.base; 002 003/* 004 * #%L 005 * GwtMaterial 006 * %% 007 * Copyright (C) 2015 GwtMaterialDesign 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023import gwt.material.design.addins.client.tree.MaterialTree; 024import gwt.material.design.addins.client.tree.MaterialTreeItem; 025 026import java.util.List; 027 028/** 029 * @author kevzlou7979 030 */ 031public interface HasTreeItems { 032 033 /** 034 * Initialize the tree item component 035 */ 036 void initTreeItem(); 037 038 /** 039 * Set the parent tree item 040 * @param parentTree 041 */ 042 void setParentTree(MaterialTreeItem parentTree); 043 044 /** 045 * Get the parent tree item 046 * @return 047 */ 048 MaterialTreeItem getParentTree(); 049 050 /** 051 * Set the tree for initialization of tree handlers (open , close , selection etc.) 052 * @param parentTree 053 */ 054 void setTree(MaterialTree parentTree); 055 056 /** 057 * Get the tree component 058 * @return 059 */ 060 MaterialTree getTree(); 061 062 /** 063 * Set the tree items of the current item 064 * @param treeItems 065 */ 066 void setTreeItems(List<MaterialTreeItem> treeItems); 067 068 /** 069 * Get all the tree items of the current item 070 * @return 071 */ 072 List<MaterialTreeItem> getTreeItems(); 073 074 /** 075 * Set tbe object data for tree item 076 * @param object 077 */ 078 void setObject(Object object); 079 080 /** 081 * Get the object data 082 * @return 083 */ 084 Object getObject(); 085 086 /** 087 * Expand the tree item's content 088 */ 089 void expand(); 090 091 /** 092 * Collapse the tree item's content 093 */ 094 void collapse(); 095 096 /** 097 * Set the value of hide variable (boolean) 098 * @param hide 099 */ 100 void setHide(boolean hide); 101 102 /** 103 * Gets the value of hide variable (boolean) 104 * @return 105 */ 106 boolean isHide(); 107 108 /** 109 * Adds item into it's parent tree item. 110 * @param item 111 */ 112 void addItem(MaterialTreeItem item); 113 114 /** 115 * Removes a given material tree item. 116 * @param item 117 */ 118 void removeItem(MaterialTreeItem item); 119 120 /** 121 * Remmoves a given material item with given index 122 * @param index 123 */ 124 void removeItem(int index); 125 126 /** 127 * Inserts an item with given index 128 * @param item 129 * @param index 130 */ 131 void insertItem(MaterialTreeItem item, int index); 132 133 /** 134 * Removes this tree item to it's parent tree node 135 */ 136 void removeFromTree(); 137}