[Mc4j-cvs] mc4j/src/org/mc4j/console/bean/operation/execution ExecutionNode.java,1.9,1.10
Brought to you by:
ghinkl
From: Greg H. <gh...@us...> - 2006-04-12 19:14:23
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/bean/operation/execution In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/bean/operation/execution Modified Files: ExecutionNode.java Log Message: Merging EMS into head for the 2.0 release work Index: ExecutionNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/bean/operation/execution/ExecutionNode.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ExecutionNode.java 5 Oct 2004 05:15:56 -0000 1.9 --- ExecutionNode.java 12 Apr 2006 19:14:15 -0000 1.10 *************** *** 17,39 **** package org.mc4j.console.bean.operation.execution; ! import java.util.HashMap; ! import java.util.Map; ! ! import javax.management.MBeanOperationInfo; ! import javax.management.MBeanParameterInfo; ! import org.openide.ErrorManager; import org.openide.actions.PropertiesAction; import org.openide.actions.ToolsAction; ! import org.openide.nodes.AbstractNode; ! import org.openide.nodes.Children; ! import org.openide.nodes.Node; ! import org.openide.nodes.PropertySupport; ! import org.openide.nodes.Sheet; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.SystemAction; ! import org.mc4j.console.bean.MBeanNode; /** --- 17,34 ---- package org.mc4j.console.bean.operation.execution; ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.ems.connection.bean.operation.EmsOperation; ! import org.mc4j.ems.connection.bean.parameter.EmsParameter; import org.openide.ErrorManager; import org.openide.actions.PropertiesAction; import org.openide.actions.ToolsAction; ! import org.openide.nodes.*; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.SystemAction; ! import java.util.HashMap; ! import java.util.List; ! import java.util.Map; /** *************** *** 45,70 **** public class ExecutionNode extends AbstractNode { ! private MBeanOperationInfo operationInfo; private Map parameterValues; ! public ExecutionNode(MBeanOperationInfo operationInfo) { super(Children.LEAF); ! this.operationInfo = operationInfo; this.parameterValues = new HashMap(); setIconBase("org/mc4j/console/bean/operation/execution/ExecutionNodeIcon"); // Set FeatureDescriptor stuff: ! setName(this.operationInfo.getName()); // or, super.setName if needed setDisplayName(NbBundle.getMessage(ExecutionNode.class, "LBL_node")); setShortDescription(NbBundle.getMessage(ExecutionNode.class, "HINT_node")); - // Add cookies, e.g.: - /* - getCookieSet().add(new OpenCookie() { - public void open() { - // Open something useful... - } - }); - */ } --- 40,57 ---- public class ExecutionNode extends AbstractNode { ! private EmsOperation operation; private Map parameterValues; ! public ExecutionNode(EmsOperation operation) { super(Children.LEAF); ! this.operation = operation; this.parameterValues = new HashMap(); setIconBase("org/mc4j/console/bean/operation/execution/ExecutionNodeIcon"); // Set FeatureDescriptor stuff: ! setName(this.operation.getName()); // or, super.setName if needed setDisplayName(NbBundle.getMessage(ExecutionNode.class, "LBL_node")); setShortDescription(NbBundle.getMessage(ExecutionNode.class, "HINT_node")); } *************** *** 72,85 **** protected SystemAction[] createActions() { return new SystemAction[] { - // SystemAction.get(MyFavoriteAction.class), - // null, // separator - /* according to what it can do: - SystemAction.get(CutAction.class), - SystemAction.get(CopyAction.class), - null, - SystemAction.get(DeleteAction.class), - SystemAction.get(RenameAction.class), - null, - */ SystemAction.get(ToolsAction.class), null, --- 59,62 ---- *************** *** 90,106 **** public HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; - // When you have help, change to: - // return new HelpCtx(ExecutionNode.class); } - // RECOMMENDED - handle cloning specially (so as not to invoke the overhead of FilterNode): - /* - public Node cloneNode() { - // Try to pass in similar constructor params to what you originally got: - return new ExecutionNode(); - } - */ - - // Create a property sheet: //protected Sheet createSheet() { --- 67,72 ---- *************** *** 111,123 **** //sheet.put(props); return new Node.PropertySet[] { props }; - // - // - // sheet.get(Sheet.PROPERTIES); // get by name, not display name - // if (props == null) { - // props = Sheet.createPropertiesSet(); - // sheet.put(props); - // } - // props.put(new MyProp(someParams)); - // return sheet; } --- 77,80 ---- *************** *** 130,160 **** //org.openide.windows.IOProvider.getDefault().getStdOut().println("Building params for: " + this.operationInfo.getName()); ! MBeanParameterInfo[] params = this.operationInfo.getSignature(); ! for (int i = 0; i < params.length; i++) { ! final MBeanParameterInfo parameterInfo = params[i]; - Class type = null; ! try { ! type = MBeanNode.findType( ! parameterInfo.getType()); ! } catch (Exception e) { ! ErrorManager.getDefault().notify(e); } final Class type2 = type; ! //org.openide.windows.IOProvider.getDefault().getStdOut().println("\t type is: " + type); props.put( new PropertySupport.ReadWrite( ! parameterInfo.getName(), type, ! parameterInfo.getName(), ! parameterInfo.getDescription()) { public Object getValue() { ! ! Object value = parameterValues.get(parameterInfo.getName()); // Specially handle booleans by defualting them to null if ((type2.equals(Boolean.TYPE)) --- 87,115 ---- //org.openide.windows.IOProvider.getDefault().getStdOut().println("Building params for: " + this.operationInfo.getName()); ! List<EmsParameter> params = this.operation.getParameters(); ! for (final EmsParameter parameter : params) { Class type = null; ! try { ! type = MBeanNode.findType( ! parameter.getType()); ! } catch (Exception e) { ! ErrorManager.getDefault().notify(e); } final Class type2 = type; ! //org.openide.windows.IOProvider.getDefault().getStdOut().println("\t type is: " + type); props.put( new PropertySupport.ReadWrite( ! parameter.getName(), type, ! parameter.getName(), ! parameter.getDescription()) { public Object getValue() { ! ! Object value = parameterValues.get(parameter.getName()); // Specially handle booleans by defualting them to null if ((type2.equals(Boolean.TYPE)) *************** *** 166,170 **** public void setValue(Object value) { ! parameterValues.put(parameterInfo.getName(), value); } }); --- 121,125 ---- public void setValue(Object value) { ! parameterValues.put(parameter.getName(), value); } }); |