1 26 27 package org.objectweb.util.browser.plugin.java.reflect; 28 29 import org.objectweb.util.browser.api.MenuItem; 30 import org.objectweb.util.browser.api.MenuItemTreeView; 31 import org.objectweb.util.browser.api.TreeView; 32 import org.objectweb.util.browser.gui.api.DialogAction; 33 import org.objectweb.util.browser.gui.api.DialogBox; 34 import org.objectweb.util.browser.gui.lib.DefaultDialogBox; 35 36 44 public class ClassVisibilityConfigAction 45 implements MenuItem, DialogAction { 46 47 53 protected Class class_; 54 55 protected ClassVisibilityBox classVisibilityConfig_; 56 57 63 69 75 public int getStatus(TreeView treeView) { 76 return MenuItem.ENABLED_STATUS; 77 } 78 79 public void actionPerformed(MenuItemTreeView treeView) 80 throws Exception { 81 82 class_ = (Class )treeView.getSelectedObject(); 83 84 ClassVisibilityConfig config = (ClassVisibilityConfig)ClassVisibility.config_.get(class_.getName()); 85 if(config == null) 86 config = ClassVisibility.createNewDefaultConfig(); 87 88 classVisibilityConfig_ = new ClassVisibilityBox(config); 89 90 DialogBox dialog = new DefaultDialogBox("Class visibility"); 91 dialog.addElementBox(classVisibilityConfig_); 92 dialog.setValidateAction(this); 93 dialog.show(); 94 95 } 96 97 103 public void executeAction() throws Exception { 104 ClassVisibility.config_.put(class_.getName(), classVisibilityConfig_.getConfig()); 105 } 106 107 } | Popular Tags |