Ignore:
Timestamp:
Apr 16, 2010, 5:55:54 PM (14 years ago)
Author:
tobias
Message:

javadoc added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java

    r862 r864  
    1414import de.dass_it.www.vanhelsing.VanHelsingStub.*;
    1515
    16 /*
    17  * List all Bacula configuration components by name
     16/**
     17 * List all Bacula configuration components by name.
    1818 */
    1919public class ConfigurationBean extends TreeNavigation {
     
    2626                init();
    2727        }
     28       
     29        /**
     30         * init() builds the data tree of the configuration view. The heading nodes are read from the properties file.
     31         * the web service will be queried for each heading node(e.g. client).
     32         */
    2833        private void init(){
    2934                DefaultMutableTreeNode root = new DefaultMutableTreeNode();
     
    3641                ResourceInfo[] ri;
    3742                SimpleResource sr;
    38                 // ((ClientItem)selectedObject).setName("ClientNameTest");
    3943
    4044                Client c = new Client();
    41                 /*String[] nodes = { "Director", "Storage", "Autochanger",
    42                                 "Client", "FileSet", "FDClient", "Schedule", "SDStorage",
    43                                 "Console", "Catalog", "SDDevice", "Job", "JobDefs", "Messages",
    44                                 "Pool" }; */
    45                 // String[] nodes = {"Client"};
    4645                setTree(super.createTree(root, BeanUtil.getProperty("nodes").split(","), "Configuration"));
    4746
    48                 // \forall header wird eine ResourceList[] angefragt
    4947               
    5048                for (int i = 0; i < tree.getChildCount(root); i++) {
     
    5957                                continue;
    6058                        for (int j = 0; j < ri.length; j++) {
    61                                 // myNode = null;
    6259                                myNode = addNode(header, type, ri[j]);
    63                                 // Node mit Daten befüllen
    6460                                grt = new GetResourceType();
    6561                                grt.setDirector(lrt.getDirector());
     
    7268                        }
    7369                }
    74                 /*
    75                  * for (int i = 0; i < tree.getChildCount(root); i++){ header =
    76                  * (DefaultMutableTreeNode)tree.getChild(root, i);
    77                  *
    78                  * for (int j = 0; j < tree.getChildCount(header); j++){ leaf =
    79                  * (DefaultMutableTreeNode)tree.getChild(header, j); type =
    80                  * ((UserObjectItemType
    81                  * )leaf.getUserObject()).getUserObject().getResType(); grt = new
    82                  * GetResourceType(); grt.setDirector("bacula-dir");
    83                  * grt.setResId(((ItemType
    84                  * )(((UserObjectItemType)leaf.getUserObject()).getUserObject
    85                  * ())).getResId()); sr = c.getSimpleResource(grt);
    86                  * sr.getResourceAttributeType(); myNode = addNode(leaf, type,
    87                  * sr.getResourceAttributeType()); if (myNode != null){
    88                  * leaf.add(myNode); }
    89                  *
    90                  * } }
    91                  */
    92 
    93         }
    94 
    95 
     70        }
     71
     72        /**
     73         * transfers the selected (by attribute resId) dataobject (resource) into an ArrayList of ViewItems.<br/>
     74         * Each ViewItem contain the key value pair and the rendering type. If the attribute is rendered as a
     75         * selectOneMenu, the values for the selectOneMenu will be read from the data tree.
     76         *
     77         * @param ae    ActionEvent which contains relevant information about the component tree. the variable is not used.
     78         */
    9679        public void userObjectItemNodeSelected(ActionEvent ae) {
    9780                DefaultMutableTreeNode node;
     
    11295                String classType = "de.dass_it.vanhelsing.gui.items." + type + "Item";
    11396                String accessType = BeanUtil.getAccessType(type.toLowerCase());
    114                 // Daten aus dem UserObjectItem extrahieren
    11597                try {
    11698                        UserObjectItem item = ((UserObjectItemType) (node.getUserObject()))
     
    163145                }
    164146        }
     147        /**
     148         * return an array of nodes of a given resource type
     149         *
     150         * @param tree2         copy of the data tree
     151         * @param key           name of the requested resource type
     152         * @return dmtn         array of nodes of a given resource type
     153         * @return null         null object there are no nodes of the requested type
     154         */
    165155        private DefaultMutableTreeNode[] getChildNodes(DefaultTreeModel tree2, String key) {
    166156                DefaultMutableTreeNode[] dmtn;
     
    179169                return null;
    180170        }
     171        /**
     172         *
     173         * @param ae
     174         */
    181175        public void newResourceButtonListener(ActionEvent ae){
    182176                DefaultMutableTreeNode node;
     
    215209                                                                si[i] = new SelectItem((String)o.invoke(nodeObject, (Object[])null),
    216210                                                                                (String)o.invoke(nodeObject, (Object[])null));
    217                                                                 //System.err.println("si[i]"+si[i].getLabel());
    218211                                                               
    219212                                                        }
     
    231224               
    232225        }
     226        /**
     227         * **EXPERIMENTAL** returns type of the selected resource.
     228         * The method is used for an evaluation about dynamic navigation.
     229         * @param ae    ActionEvent contains relevant information about the jsf component tree.
     230         * @return viewName     name of the resource type of the selected data tree node       
     231         */
     232        public String newResourceListener(ActionEvent ae){
     233                if (selectedObject != null && selectedObject.size() > 0){
     234                        String resType = selectedObject.get(0).getResType();
     235                        String viewName = BeanUtil.getAccessType(resType);
     236                        return viewName;
     237                }
     238                return "";
     239        }
     240       
    233241        public void userObjectItemOptionSelected(ValueChangeEvent vce){
    234242               
    235243        }
    236        
     244        /**
     245         * repeat the entire construction process of the data tree
     246         * @param ae
     247         */
    237248        public void reloadResourceButtonListener(ActionEvent ae){
    238249                init();
     
    241252                BeanUtil.setInfoMessage(null, "Diese Methode ist noch nicht implementiert.");
    242253        }
    243        
     254        /**
     255         * **EXPERIMENTAL** writes the selected resource to the data tree of the web service.
     256         *
     257         * @param ae    ActionEvent contains relevant information
     258         */
    244259        public void saveButtonListener(ActionEvent ae) {
    245260                if (selectedObject == null){
     
    280295                }
    281296        }
    282 
     297        /**
     298         * Setter method for the tree attribute
     299         * @param tree  tree contains the DefaultTreeModel for the data tree
     300         */
    283301        public void setTree(DefaultTreeModel tree) {
    284302                this.tree = tree;
    285303        }
    286 
     304        /**
     305         * getter method for the tree attribute
     306         * @return tree         tree contains the DefaultTreeModel for the data tree
     307         */
    287308        public DefaultTreeModel getTree() {
    288309                return tree;
    289310        }
    290 
     311       
     312        /**
     313         * gettter method for the selectedObject attribute
     314         * @return selectedObject       selectedObject contains the data object of the selected leaf node.
     315         */
    291316        public ArrayList<ViewItem> getSelectedObject() {
    292317                return selectedObject;
    293318        }
    294 
     319       
     320        /**
     321         * setter method for the selectedObject attribute
     322         * @param selectedObject        selectedObject contains the data object of the selected leaf node
     323         */
    295324        public void setSelectedObject(ArrayList<ViewItem> selectedObject) {
    296325                this.selectedObject = selectedObject;
    297326        }
     327       
     328        /**
     329         * getter method for the resId attribute of the selectedObject i.e. the selected leaf node of the data tree
     330         * @return id   resId attribute of the selected object
     331         */
    298332        public int getSelectedId(){
    299333                if (selectedObject != null){
Note: See TracChangeset for help on using the changeset viewer.