1 26 27 package org.objectweb.util.explorer.plugin.java.reflect; 28 29 import org.objectweb.util.explorer.api.MenuItem; 30 import org.objectweb.util.explorer.api.MenuItemTreeView; 31 import org.objectweb.util.explorer.api.TreeView; 32 import org.objectweb.util.explorer.swing.gui.api.DialogAction; 33 import org.objectweb.util.explorer.swing.gui.api.DialogBox; 34 import org.objectweb.util.explorer.swing.gui.lib.DefaultDialogBox; 35 36 37 45 public class GlobalClassVisibilityConfigAction 46 implements MenuItem, DialogAction 47 { 48 49 55 protected Class class_; 56 57 protected ClassVisibilityBox classVisibilityConfig_; 58 59 65 71 77 80 public int getStatus(TreeView treeView) { 81 return MenuItem.ENABLED_STATUS; 82 } 83 84 87 public void actionPerformed(MenuItemTreeView treeView) 88 throws Exception { 89 90 class_ = (Class )treeView.getSelectedObject(); 91 92 ClassVisibilityConfig config = (ClassVisibilityConfig)ClassVisibility.config_.get(ClassVisibility.DEFAULT_CONFIG); 93 if(config == null) 94 config = ClassVisibility.createNewDefaultConfig(); 95 96 classVisibilityConfig_ = new ClassVisibilityBox(config); 97 98 DialogBox dialog = new DefaultDialogBox("Class visibility"); 99 dialog.addElementBox(classVisibilityConfig_); 100 dialog.setValidateAction(this); 101 dialog.show(); 102 103 } 104 105 111 114 public void executeAction() throws Exception { 115 ClassVisibility.config_.put(ClassVisibility.DEFAULT_CONFIG, classVisibilityConfig_.getConfig()); 116 } 117 118 } | Popular Tags |