1 26 27 package org.objectweb.util.browser.gui.lib; 28 29 import java.awt.Component ; 30 import java.util.Iterator ; 31 import java.util.List ; 32 import java.util.Vector ; 33 34 import org.objectweb.util.browser.gui.api.DialogBox; 35 import org.objectweb.util.browser.core.common.DynamicTree; 36 37 44 public class ExtendedTreeChooserBox 45 extends TreeChooserBox { 46 47 53 54 protected DialogBox dialog_; 55 56 57 protected List treeChooserBoxes_; 58 59 65 70 public ExtendedTreeChooserBox(String label, DynamicTree tree, DialogBox dialog) { 71 super(label, tree, false); 72 treeChooserBoxes_ = new Vector (); 73 treeChooserBoxes_.add(this); 74 browseButton_.setAction(new ExtendedBrowseAction(this)); 75 dialog_ = dialog; 76 } 77 78 84 90 public Object [] getObjects(){ 91 List l = new Vector (); 92 Iterator it = treeChooserBoxes_.iterator(); 93 while (it.hasNext()) { 94 TreeChooserBox element = (TreeChooserBox) it.next(); 95 Object o = element.getObject(); 96 if(o!=null) 97 l.add(element.getObject()); 98 } 99 return (Object [])l.toArray(new Object [0]); 100 } 101 102 108 protected class ExtendedBrowseAction extends BrowseAction{ 109 110 protected ExtendedBrowseAction(Component parent) { 111 super(parent); 112 } 113 114 public void actionPerformed(java.awt.event.ActionEvent ae) { 115 super.actionPerformed(ae); 116 if(object_!=null){ 118 TreeChooserBox interfaceBox = new ExtendedTreeChooserBox("Interface Type",tree_, ExtendedTreeChooserBox.this.dialog_); 119 ExtendedTreeChooserBox.this.treeChooserBoxes_.add(interfaceBox); 120 ExtendedTreeChooserBox.this.dialog_.addElementBox(interfaceBox); 121 ExtendedTreeChooserBox.this.dialog_.show(); 122 } 123 } 124 } 125 126 } | Popular Tags |