From: Jan S. <st...@us...> - 2002-05-16 12:14:29
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv30990 Modified Files: AttachPanel.java AttachAction.java Log Message: Attach panel generalized for both attach and listen connectors. Index: AttachPanel.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/AttachPanel.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** AttachPanel.java 14 Oct 2001 22:17:11 -0000 1.1.1.1 --- AttachPanel.java 16 May 2002 12:14:26 -0000 1.2 *************** *** 48,58 **** /** Collection of JTextFields. */ private LinkedList fields=new LinkedList(); /** * Creates new <code>AttachPanel</code>. */ ! AttachPanel() { transportCombo=new JComboBox(); ! List cons=Bootstrap.virtualMachineManager().connectors(Connector.ATTACHING_CONNECTOR); Iterator iter=cons.iterator(); while (iter.hasNext()) { --- 48,64 ---- /** Collection of JTextFields. */ private LinkedList fields=new LinkedList(); + /** Connector mask */ + private int mask; /** * Creates new <code>AttachPanel</code>. + * + * @param mask mask determining connectors that should be shown + * in the panel. */ ! AttachPanel(int mask) { ! this.mask=mask; transportCombo=new JComboBox(); ! List cons=Bootstrap.virtualMachineManager().connectors(mask); Iterator iter=cons.iterator(); while (iter.hasNext()) { *************** *** 154,157 **** --- 160,184 ---- return new Session(vm, true, name.deleteCharAt(name.length()-1).toString()); } + + /** + * Returns name based on the entered values. + * + * @return name based on the entered values. + */ + public String name() { + Connector connector=(Connector)connectors.get(transportCombo.getSelectedIndex()); + Map args=connector.defaultArguments(); + List keys=new ArrayList(args.keySet()); + Iterator values=fields.iterator(); + StringBuffer name=new StringBuffer(); + for (int i=0; i<keys.size(); i++) { + Object key=keys.get(i); + Connector.Argument arg=(Connector.Argument)args.get(key); + JTextField field=(JTextField)values.next(); + String text=field.getText(); + name.append(text).append(":"); + } + return name.deleteCharAt(name.length()-1).toString(); + } } *************** *** 159,162 **** --- 186,192 ---- /* * $Log$ + * Revision 1.2 2002/05/16 12:14:26 stolis + * Attach panel generalized for both attach and listen connectors. + * * Revision 1.1.1.1 2001/10/14 22:17:11 stolis * The very first version of profiler module. Index: AttachAction.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/AttachAction.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** AttachAction.java 14 Oct 2001 22:15:29 -0000 1.1.1.1 --- AttachAction.java 16 May 2002 12:14:26 -0000 1.2 *************** *** 52,56 **** */ public void performAction() { ! panel=new AttachPanel(); DialogDescriptor descr = new DialogDescriptor ( panel, --- 52,56 ---- */ public void performAction() { ! panel=new AttachPanel(Connector.ATTACHING_CONNECTOR); DialogDescriptor descr = new DialogDescriptor ( panel, *************** *** 106,109 **** --- 106,112 ---- /* * $Log$ + * Revision 1.2 2002/05/16 12:14:26 stolis + * Attach panel generalized for both attach and listen connectors. + * * Revision 1.1.1.1 2001/10/14 22:15:29 stolis * The very first version of profiler module. |