1 16 17 package org.mc4j.console.cluster; 18 19 import org.mc4j.console.connection.ConnectionNode; 20 import org.mc4j.ems.connection.settings.ConnectionSettings; 21 import org.openide.nodes.Node; 22 import org.openide.util.actions.SystemAction; 23 24 import java.util.ArrayList ; 25 import java.util.Iterator ; 26 import java.util.List ; 27 28 33 public class ClusterConnection extends ConnectionNode { 34 35 List connectionNodes = new ArrayList (); 36 37 private static final String CONNECTIONS_NODE = "servers"; 38 39 40 public ClusterConnection() { 41 super(new ConnectionSettings()); 42 43 setIconBase("org/mc4j/console/connection/DisconnectedConnectionNodeIcon"); 44 setName("loading"); 46 } 47 48 public void connect() throws Exception { 49 50 } 51 52 protected SystemAction[] createActions() { 53 return super.createActions(); 54 } 55 56 public void disconnect() throws Exception { 57 58 } 59 60 public void addConnection(ConnectionNode node) { 61 this.connectionNodes.add(node); 62 this.getChildren().findChild(CONNECTIONS_NODE).getChildren().add(new Node[] { node }); 63 } 64 65 public void initialize(ConnectionSettings settings) { 66 } 67 68 69 public Node.PropertySet[] getPropertySets() { 70 return super.getPropertySets(); 71 } 72 73 protected void loadConnectionNodeChildren() throws Exception { 74 Iterator iter = this.connectionNodes.iterator(); 75 while (iter.hasNext()) { 76 ConnectionNode connection = (ConnectionNode)iter.next(); 77 connection.refresh(); 79 81 } 82 } 83 84 85 } 86 | Popular Tags |