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