[Mc4j-cvs] mc4j/src/org/mc4j/console/bean MBeanNode.java,1.22,1.23
Brought to you by:
ghinkl
From: Greg H. <gh...@us...> - 2004-04-02 03:39:58
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/bean In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16558/src/org/mc4j/console/bean Modified Files: MBeanNode.java Log Message: Moving to a single attribute property sheet supported by the attribute node. Index: MBeanNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/bean/MBeanNode.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** MBeanNode.java 24 Feb 2004 03:59:24 -0000 1.22 --- MBeanNode.java 2 Apr 2004 03:27:55 -0000 1.23 *************** *** 23,26 **** --- 23,28 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import java.beans.PropertyChangeEvent; + import java.beans.PropertyChangeListener; import java.beans.PropertyEditor; import java.beans.PropertyEditorManager; *************** *** 76,79 **** --- 78,82 ---- import org.mc4j.console.bean.operation.OperationSetNode; import org.mc4j.console.connection.ConnectionNode; + import org.mc4j.console.install.ExplorerUtil; import org.mc4j.console.swing.editor.ObjectNameEditor; import org.mc4j.console.swing.editor.calendar.CalendarDateEditor; *************** *** 353,357 **** // Refresh them all in one connection if (this.attributesNode != null) { ! this.attributesNode.refresh(); } --- 356,365 ---- // Refresh them all in one connection if (this.attributesNode != null) { ! if (ExplorerUtil.isSelected(this)) { ! retrieveData(); ! } else if (ExplorerUtil.isExpanded(this)) { ! // The child attribute node may be selected ! this.attributesNode.refresh(); ! } } *************** *** 377,381 **** protected SystemAction[] createActions() { return new SystemAction[] { - null, NodeAction.get(RefreshAction.class), --- 385,388 ---- *************** *** 495,499 **** } ! protected org.openide.nodes.Sheet.Set buildAttributes() { org.openide.nodes.Sheet.Set props = Sheet.createPropertiesSet(); props.setName("Attributes"); --- 502,537 ---- } ! ! protected Sheet.Set buildAttributes() { ! org.openide.nodes.Sheet.Set props = Sheet.createPropertiesSet(); ! props.setName("Attributes"); ! props.setDisplayName("Attributes"); ! props.setShortDescription("These properties are the attributes of the Management Bean"); ! ! Map attributeNodeMap = getAttributeNodeMap(); ! ! ! for(Iterator iter = attributeNodeMap.entrySet().iterator(); iter.hasNext(); ) { ! Map.Entry entry = (Map.Entry) iter.next(); ! ! String key = (String)entry.getKey(); ! final AttributeNode attributeNode = (AttributeNode)entry.getValue(); ! ! Property attributeProperty = attributeNode.getValueProperty(); ! ! // Forward changes on the AttributeNode to the parent MBeanNode since the parent also uses the child ! // attribute in the property display ! attributeNode.addPropertyChangeListener(new PropertyChangeListener() { ! public void propertyChange(PropertyChangeEvent evt) { ! MBeanNode.this.firePropertyChange(attributeNode.getName(), evt.getOldValue(), evt.getNewValue()); ! } ! }); ! props.put(attributeProperty); ! } ! ! return props; ! } ! ! protected org.openide.nodes.Sheet.Set buildAttributes2() { org.openide.nodes.Sheet.Set props = Sheet.createPropertiesSet(); props.setName("Attributes"); *************** *** 518,521 **** --- 556,561 ---- // findType(attributeInfo.getType())+ ")"); + + if (attributeInfo.isReadable() && attributeInfo.isWritable()) { props.put( *************** *** 654,660 **** } ! /** Getter for property attributeNodeMap. * @return Value of property attributeNodeMap. - * */ public Map getAttributeNodeMap() { --- 694,700 ---- } ! /** ! * Gets a map of the attribute names to their respective nodes. * @return Value of property attributeNodeMap. */ public Map getAttributeNodeMap() { *************** *** 719,721 **** --- 759,765 ---- */ + public AttributeSetNode getAttributesNode() { + return attributesNode; + } + } |