[opencoe-cvs] coekernel/src/UAM/src/UAM/java/org/opencoe/coe/uam UAM_EditGroup.java,1.3,1.4 UAM_Edit
Status: Alpha
Brought to you by:
rbroberg
Update of /cvsroot/opencoe/coekernel/src/UAM/src/UAM/java/org/opencoe/coe/uam In directory sc8-pr-cvs1:/tmp/cvs-serv23787/UAM/java/org/opencoe/coe/uam Modified Files: UAM_EditGroup.java UAM_EditProfile.java UAM_EditUser.java UAM_Manager.java _UAM_ManagerModel.java _UAM_ManagerTree.java Log Message: 20031022:rb:828634 - Change title for UAManager JavaStyle refactor Index: UAM_EditGroup.java =================================================================== RCS file: /cvsroot/opencoe/coekernel/src/UAM/src/UAM/java/org/opencoe/coe/uam/UAM_EditGroup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UAM_EditGroup.java 21 Jun 2002 22:43:57 -0000 1.3 --- UAM_EditGroup.java 23 Oct 2003 02:32:05 -0000 1.4 *************** *** 1,31 **** /** ! * Copyright (C) 2002, Federal Linux Systems ! * ! * The project home for this software is http://www.opencoe.org ! * ! * This segment is free software; you can redistribute it and/or ! * modify it under the terms of the GNU Lesser General Public ! * License as published by the Free Software Foundation; either ! * version 2.1 of the License, or (at your option) any later version. ! * ! * This segment is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! * Lesser General Public License for more details. ! * ! * You should have received a copy of the GNU Lesser General Public * License along with this segment; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! **/ ! ! /* ! * UAM_EditGroup.java ! * ! * Created on March 25, 2001, 6:03 PM */ ! ! package org.opencoe.coe.uam; import org.opencoe.coe.kernel.util.*; --- 1,17 ---- /** ! * Copyright (C) 2002, Federal Linux Systems The project home for this software ! * is http://www.opencoe.org This segment is free software; you can ! * redistribute it and/or modify it under the terms of the GNU Lesser General ! * Public License as published by the Free Software Foundation; either version ! * 2.1 of the License, or (at your option) any later version. This segment is ! * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; ! * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A ! * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more ! * details. You should have received a copy of the GNU Lesser General Public * License along with this segment; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! package org.opencoe.coe.uam; import org.opencoe.coe.kernel.util.*; *************** *** 33,336 **** /** * ! * @author rbroberg ! * @version */ - public class UAM_EditGroup extends javax.swing.JDialog implements java.awt.event.ActionListener { ! /** Creates new form UAM_EditGroup */ ! public UAM_EditGroup(String m, String n, String s) { ! setTitle("Edit Group"); ! setModal(true); ! editmode=m; ! groupscope=s; ! groupname=n; ! initComponents (editmode, groupname, groupscope); ! pack (); ! } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the FormEditor. - */ - private void initComponents (String mode, String gname, String gscope) { - jPanel1 = new javax.swing.JPanel (); - grpnameLabel = new javax.swing.JLabel (); - grpnameTF = new javax.swing.JTextField (); - gidLabel = new javax.swing.JLabel (); - gidTF = new javax.swing.JTextField (); - scopeLabel = new javax.swing.JLabel (); - scopeCB = new javax.swing.JComboBox (); - jPanel2 = new javax.swing.JPanel (); - applyButton = new javax.swing.JButton (); - deleteButton = new javax.swing.JButton (); - editButton = new javax.swing.JButton (); - quitButton = new javax.swing.JButton (); - helpApplyButton = new javax.swing.JButton (); - helpEditButton = new javax.swing.JButton (); - helpDeleteButton = new javax.swing.JButton (); ! jPanel1.setLayout (new java.awt.GridLayout (3, 2)); ! jPanel1.setBorder (new javax.swing.border.EmptyBorder(new java.awt.Insets(10, 10, 10, 10))); ! grpnameLabel.setText ("Group Name"); ! jPanel1.add (grpnameLabel); ! jPanel1.add (grpnameTF); ! gidLabel.setText ("GID"); ! jPanel1.add (gidLabel); ! jPanel1.add (gidTF); ! scopeLabel.setText ("Scope"); ! jPanel1.add (scopeLabel); ! scopeCB.setMaximumRowCount(2); ! jPanel1.add (scopeCB); ! scopeCB.addItem ("local"); ! scopeCB.addItem ("global"); ! scopeCB.setSelectedItem(gscope); ! ! getContentPane ().add (jPanel1, java.awt.BorderLayout.CENTER); ! if (editmode.equals("--edit")) { ! setTitle("Edit Group"); ! editButton.setText ("Apply"); ! jPanel2.add (editButton); ! editButton.addActionListener(this); ! ! quitButton.setText ("Quit"); ! jPanel2.add (quitButton); ! quitButton.addActionListener(this); ! ! helpEditButton.setText ("Help"); ! jPanel2.add (helpEditButton); ! helpEditButton.addActionListener(this); ! ! grpnameTF.setText(gname); ! gidTF.setText(getGID(gname)); ! } else if (editmode.equals("--delete")) { ! setTitle("Delete Group"); ! deleteButton.setText ("Delete"); ! jPanel2.add (deleteButton); ! deleteButton.addActionListener(this); ! ! quitButton.setText ("Quit"); ! jPanel2.add (quitButton); ! quitButton.addActionListener(this); ! ! helpDeleteButton.setText ("Help"); ! jPanel2.add (helpDeleteButton); ! helpDeleteButton.addActionListener(this); ! grpnameTF.setText(gname); ! System.out.println(gname); ! gidTF.setText(getGID(gname)); ! } else { ! setTitle("New Group"); ! applyButton.setText ("Create"); ! jPanel2.add (applyButton); ! applyButton.addActionListener(this); ! ! quitButton.setText ("Quit"); ! jPanel2.add (quitButton); ! quitButton.addActionListener(this); ! ! helpApplyButton.setText ("Help"); ! jPanel2.add (helpApplyButton); ! helpApplyButton.addActionListener(this); - grpnameTF.setText(""); - gidTF.setText(getNextGID()); } - - getContentPane ().add (jPanel2, java.awt.BorderLayout.SOUTH); ! } ! public void actionPerformed (java.awt.event.ActionEvent evt) { ! Object source = evt.getSource(); ! java.util.StringTokenizer stok; ! if (source == applyButton) { ! System.out.println("Add group"); ! addGroup(grpnameTF.getText(), gidTF.getText()); ! WindowEvent e = ! new WindowEvent (this, WindowEvent.WINDOW_CLOSING); ! dispatchEvent(e); ! } else if (source == deleteButton) { ! System.out.println("Delete group"); ! deleteGroup(grpnameTF.getText()); ! WindowEvent e = ! new WindowEvent (this, WindowEvent.WINDOW_CLOSING); ! dispatchEvent(e); ! } else if (source == editButton) { ! System.out.println("Edit group"); ! deleteGroup(groupname); ! groupname=grpnameTF.getText(); ! addGroup(grpnameTF.getText(), gidTF.getText()); ! } else if (source == quitButton) { ! System.out.println("Quit"); ! WindowEvent e = ! new WindowEvent (this, WindowEvent.WINDOW_CLOSING); ! dispatchEvent(e); ! ! } else if (source == helpApplyButton) { ! System.out.println("Help! Apply"); ! } else if (source == helpDeleteButton) { ! System.out.println("Help! Delete"); ! } else if (source == helpEditButton) { ! System.out.println("Help! Edit"); } - } - private void addGroup(String name, String id) { - /* add the group */ - java.util.StringTokenizer stok; - String[] cmdstr = new String[5]; - cmdstr[0]="COE_COMP/OS/bin/OS_add_group"; - cmdstr[1]="-g"; - cmdstr[2]=id; - cmdstr[3]="-n"; - cmdstr[4]=name; ! System.out.println("UAM_EditGroups::addGroup: "+ ! cmdstr[0]+" "+ ! cmdstr[1]+" "+ ! cmdstr[2]+" "+ ! cmdstr[3]+" "+ ! cmdstr[4]+" "); ! _OpenCOECmdExec OS_add_group = ! new _OpenCOECmdExec(cmdstr); ! } ! private void deleteGroup(String name) { ! /* delete the group */ ! java.util.StringTokenizer stok; ! String[] cmdstr = new String[2]; ! cmdstr[0]="COE_COMP/OS/bin/OS_delete_group"; ! cmdstr[1]=name; - System.out.println("UAM_EditGroups::deleteGroup: "+ - cmdstr[0]+" "+ - cmdstr[1]+" "); ! _OpenCOECmdExec OS_delete_group = ! new _OpenCOECmdExec(cmdstr); ! } ! private String getGID(String name) { ! /* get the gid matching this groupname */ ! java.util.StringTokenizer stok; ! String[] cmdstr = new String[3]; ! cmdstr[0]="COE_COMP/OS/bin/OS_get_group_data"; ! cmdstr[1]="-n"; ! cmdstr[2]=name; ! System.out.println("UAM_EditGroups::getGID: "+ ! cmdstr[0]+" "+ ! cmdstr[1]+" "+ ! cmdstr[2]+" "); - _OpenCOECmdExec OS_get_group_data = - new _OpenCOECmdExec(cmdstr); - tmp=OS_get_group_data.getOutput(); ! str=(String)tmp.get(0); ! stok = new java.util.StringTokenizer(str, ":"); ! stok.nextToken(); //gname ! stok.nextToken(); //null ! str=stok.nextToken(); //gid ! return str; ! } ! private String getNextGID() { ! /* get the next gid */ ! java.util.StringTokenizer stok; ! String[] cmdstr = new String[1]; ! cmdstr[0]="COE_COMP/OS/bin/OS_get_next_gid"; ! System.out.println("UAM_EditGroups::getNextGID: "+ ! cmdstr[0]+" "); ! _OpenCOECmdExec OS_get_group_data = ! new _OpenCOECmdExec(cmdstr); ! tmp=OS_get_group_data.getOutput(); ! return (String)tmp.get(0); ! } - /** Exit the Application */ - private void exitForm(java.awt.event.WindowEvent evt) { - System.exit (0); - } ! /** ! * @param args the command line arguments ! */ ! public static void main (String args[]) { ! String m, n, s; ! //validate arguments ! if (args.length == 3 ) { ! m = args[0]; ! n = args[1]; ! s = args[2]; ! if (m.compareTo("--edit")!= 0 && m.compareTo("--delete")!= 0 ) { ! m="--new"; ! n="dummy"; ! s="local"; ! } ! } else { ! m="--new"; ! n="dummy"; ! s="local"; ! } ! javax.swing.JDialog frame = new UAM_EditGroup(m,n,s); ! frame.addWindowListener(new WindowAdapter() { ! public void windowClosing(WindowEvent e) {System.exit(0);} ! }); ! frame.setSize(325, 200); ! frame.pack(); ! frame.setVisible(true); - } - // Variables declaration - do not modify - private javax.swing.JPanel jPanel1; - private javax.swing.JLabel grpnameLabel; - private javax.swing.JTextField grpnameTF; - private javax.swing.JLabel gidLabel; - private javax.swing.JTextField gidTF; - private javax.swing.JLabel scopeLabel; - private javax.swing.JComboBox scopeCB; - private javax.swing.JPanel jPanel2; - private javax.swing.JButton applyButton; - private javax.swing.JButton deleteButton; - private javax.swing.JButton editButton; - private javax.swing.JButton quitButton; - private javax.swing.JButton helpApplyButton; - private javax.swing.JButton helpDeleteButton; - private javax.swing.JButton helpEditButton; - // End of variables declaration ! /* command exec variables */ ! private String cmd; ! private String str; ! private String groupname; ! private String groupscope; ! private String groupgid; ! private String editmode; ! private java.util.ArrayList tmp; } --- 19,388 ---- /** + * UAM_EditGroup.java * ! *@author rbroberg ! *@created March 25, 2001, 6:03 PM ! *@history 20031022:rb:828634 - Change title for UAManager */ public class UAM_EditGroup extends javax.swing.JDialog implements java.awt.event.ActionListener { ! /** ! * Creates new form UAM_EditGroup ! * ! *@param m Description of the Parameter ! *@param n Description of the Parameter ! *@param s Description of the Parameter ! */ ! public UAM_EditGroup(String m, String n, String s) { ! setTitle("Edit Group"); ! setModal(true); ! editmode = m; ! groupscope = s; ! groupname = n; ! initComponents(editmode, groupname, groupscope); ! pack(); ! } ! /** ! * This method is called from within the constructor to initialize the form. ! * WARNING: Do NOT modify this code. The content of this method is always ! * regenerated by the FormEditor. ! * ! *@param mode Description of the Parameter ! *@param gname Description of the Parameter ! *@param gscope Description of the Parameter ! */ ! private void initComponents(String mode, String gname, String gscope) { ! jPanel1 = new javax.swing.JPanel(); ! grpnameLabel = new javax.swing.JLabel(); ! grpnameTF = new javax.swing.JTextField(); ! gidLabel = new javax.swing.JLabel(); ! gidTF = new javax.swing.JTextField(); ! scopeLabel = new javax.swing.JLabel(); ! scopeCB = new javax.swing.JComboBox(); ! jPanel2 = new javax.swing.JPanel(); ! applyButton = new javax.swing.JButton(); ! deleteButton = new javax.swing.JButton(); ! editButton = new javax.swing.JButton(); ! quitButton = new javax.swing.JButton(); ! helpApplyButton = new javax.swing.JButton(); ! helpEditButton = new javax.swing.JButton(); ! helpDeleteButton = new javax.swing.JButton(); ! jPanel1.setLayout(new java.awt.GridLayout(3, 2)); ! jPanel1.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(10, 10, 10, 10))); ! grpnameLabel.setText("Group Name"); ! jPanel1.add(grpnameLabel); ! jPanel1.add(grpnameTF); ! gidLabel.setText("GID"); ! jPanel1.add(gidLabel); ! jPanel1.add(gidTF); ! scopeLabel.setText("Scope"); ! jPanel1.add(scopeLabel); ! scopeCB.setMaximumRowCount(2); ! jPanel1.add(scopeCB); ! scopeCB.addItem("local"); ! scopeCB.addItem("global"); ! scopeCB.setSelectedItem(gscope); ! getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); ! if (editmode.equals("--edit")) { ! setTitle("Edit Group"); ! editButton.setText("Apply"); ! jPanel2.add(editButton); ! editButton.addActionListener(this); ! quitButton.setText("Quit"); ! jPanel2.add(quitButton); ! quitButton.addActionListener(this); ! helpEditButton.setText("Help"); ! jPanel2.add(helpEditButton); ! helpEditButton.addActionListener(this); ! grpnameTF.setText(gname); ! gidTF.setText(getGID(gname)); ! } else if (editmode.equals("--delete")) { ! setTitle("Delete Group"); ! ! deleteButton.setText("Delete"); ! jPanel2.add(deleteButton); ! deleteButton.addActionListener(this); ! ! quitButton.setText("Quit"); ! jPanel2.add(quitButton); ! quitButton.addActionListener(this); ! ! helpDeleteButton.setText("Help"); ! jPanel2.add(helpDeleteButton); ! helpDeleteButton.addActionListener(this); ! ! grpnameTF.setText(gname); ! System.out.println(gname); ! gidTF.setText(getGID(gname)); ! ! } else { ! setTitle("New Group"); ! ! applyButton.setText("Create"); ! jPanel2.add(applyButton); ! applyButton.addActionListener(this); ! ! quitButton.setText("Quit"); ! jPanel2.add(quitButton); ! quitButton.addActionListener(this); ! ! helpApplyButton.setText("Help"); ! jPanel2.add(helpApplyButton); ! helpApplyButton.addActionListener(this); ! ! grpnameTF.setText(""); ! gidTF.setText(getNextGID()); ! } ! ! getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH); } ! /** ! * Description of the Method ! * ! *@param evt Description of the Parameter ! */ ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! Object source = evt.getSource(); ! java.util.StringTokenizer stok; ! if (source == applyButton) { ! System.out.println("Add group"); ! addGroup(grpnameTF.getText(), gidTF.getText()); ! WindowEvent e = ! new WindowEvent(this, WindowEvent.WINDOW_CLOSING); ! dispatchEvent(e); ! } else if (source == deleteButton) { ! System.out.println("Delete group"); ! deleteGroup(grpnameTF.getText()); ! WindowEvent e = ! new WindowEvent(this, WindowEvent.WINDOW_CLOSING); ! dispatchEvent(e); ! } else if (source == editButton) { ! System.out.println("Edit group"); ! deleteGroup(groupname); ! groupname = grpnameTF.getText(); ! addGroup(grpnameTF.getText(), gidTF.getText()); ! } else if (source == quitButton) { ! System.out.println("Quit"); ! WindowEvent e = ! new WindowEvent(this, WindowEvent.WINDOW_CLOSING); ! dispatchEvent(e); ! } else if (source == helpApplyButton) { ! System.out.println("Help! Apply"); ! } else if (source == helpDeleteButton) { ! System.out.println("Help! Delete"); ! } else if (source == helpEditButton) { ! System.out.println("Help! Edit"); ! } } ! /** ! * Adds a feature to the Group attribute of the UAM_EditGroup object ! * ! *@param name The feature to be added to the Group attribute ! *@param id The feature to be added to the Group attribute ! */ ! private void addGroup(String name, String id) { ! /* ! * add the group ! */ ! java.util.StringTokenizer stok; ! String[] cmdstr = new String[5]; ! cmdstr[0] = "COE_COMP/OS/bin/OS_add_group"; ! cmdstr[1] = "-g"; ! cmdstr[2] = id; ! cmdstr[3] = "-n"; ! cmdstr[4] = name; ! System.out.println("UAM_EditGroups::addGroup: " + ! cmdstr[0] + " " + ! cmdstr[1] + " " + ! cmdstr[2] + " " + ! cmdstr[3] + " " + ! cmdstr[4] + " "); ! _OpenCOECmdExec OS_add_group = ! new _OpenCOECmdExec(cmdstr); ! } ! /** ! * Description of the Method ! * ! *@param name Description of the Parameter ! */ ! private void deleteGroup(String name) { ! /* ! * delete the group ! */ ! java.util.StringTokenizer stok; ! String[] cmdstr = new String[2]; ! cmdstr[0] = "COE_COMP/OS/bin/OS_delete_group"; ! cmdstr[1] = name; ! System.out.println("UAM_EditGroups::deleteGroup: " + ! cmdstr[0] + " " + ! cmdstr[1] + " "); ! _OpenCOECmdExec OS_delete_group = ! new _OpenCOECmdExec(cmdstr); ! } ! /** ! * Gets the gID attribute of the UAM_EditGroup object ! * ! *@param name Description of the Parameter ! *@return The gID value ! */ ! private String getGID(String name) { ! /* ! * get the gid matching this groupname ! */ ! java.util.StringTokenizer stok; ! String[] cmdstr = new String[3]; ! cmdstr[0] = "COE_COMP/OS/bin/OS_get_group_data"; ! cmdstr[1] = "-n"; ! cmdstr[2] = name; ! System.out.println("UAM_EditGroups::getGID: " + ! cmdstr[0] + " " + ! cmdstr[1] + " " + ! cmdstr[2] + " "); ! _OpenCOECmdExec OS_get_group_data = ! new _OpenCOECmdExec(cmdstr); ! tmp = OS_get_group_data.getOutput(); ! str = (String) tmp.get(0); ! stok = new java.util.StringTokenizer(str, ":"); ! stok.nextToken(); ! //gname ! stok.nextToken(); ! //null ! str = stok.nextToken(); ! //gid ! return str; ! } ! /** ! * Gets the nextGID attribute of the UAM_EditGroup object ! * ! *@return The nextGID value ! */ ! private String getNextGID() { ! /* ! * get the next gid ! */ ! java.util.StringTokenizer stok; ! String[] cmdstr = new String[1]; ! cmdstr[0] = "COE_COMP/OS/bin/OS_get_next_gid"; ! System.out.println("UAM_EditGroups::getNextGID: " + ! cmdstr[0] + " "); ! _OpenCOECmdExec OS_get_group_data = ! new _OpenCOECmdExec(cmdstr); ! tmp = OS_get_group_data.getOutput(); ! return (String) tmp.get(0); ! } + /** + * Exit the Application + * + *@param evt Description of the Parameter + */ + private void exitForm(java.awt.event.WindowEvent evt) { + System.exit(0); + } ! /** ! *@param args the command line arguments ! */ ! public static void main(String args[]) { ! String m; ! String n; ! String s; ! //validate arguments ! if (args.length == 3) { ! m = args[0]; ! n = args[1]; ! s = args[2]; ! if (m.compareTo("--edit") != 0 && m.compareTo("--delete") != 0) { ! m = "--new"; ! n = "dummy"; ! s = "local"; ! } ! } else { ! m = "--new"; ! n = "dummy"; ! s = "local"; ! } ! javax.swing.JDialog frame = new UAM_EditGroup(m, n, s); ! ! frame.addWindowListener( ! new WindowAdapter() { ! public void windowClosing(WindowEvent e) { ! System.exit(0); ! } ! }); ! ! frame.setSize(325, 200); ! frame.pack(); ! frame.setVisible(true); ! ! } ! ! ! // Variables declaration - do not modify ! private javax.swing.JPanel jPanel1; ! private javax.swing.JLabel grpnameLabel; ! private javax.swing.JTextField grpnameTF; ! private javax.swing.JLabel gidLabel; ! private javax.swing.JTextField gidTF; ! private javax.swing.JLabel scopeLabel; ! private javax.swing.JComboBox scopeCB; ! private javax.swing.JPanel jPanel2; ! private javax.swing.JButton applyButton; ! private javax.swing.JButton deleteButton; ! private javax.swing.JButton editButton; ! private javax.swing.JButton quitButton; ! private javax.swing.JButton helpApplyButton; ! private javax.swing.JButton helpDeleteButton; ! private javax.swing.JButton helpEditButton; ! // End of variables declaration + /* + * command exec variables + */ + private String cmd; + private String str; + private String groupname; + private String groupscope; + private String groupgid; + private String editmode; + private java.util.ArrayList tmp; } + Index: UAM_EditProfile.java =================================================================== RCS file: /cvsroot/opencoe/coekernel/src/UAM/src/UAM/java/org/opencoe/coe/uam/UAM_EditProfile.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UAM_EditProfile.java 21 Jun 2002 22:43:57 -0000 1.4 --- UAM_EditProfile.java 23 Oct 2003 02:32:05 -0000 1.5 *************** *** 1,36 **** /** ! * Copyright (C) 2002, Federal Linux Systems ! * ! * The project home for this software is http://www.opencoe.org ! * ! * This segment is free software; you can redistribute it and/or ! * modify it under the terms of the GNU Lesser General Public ! * License as published by the Free Software Foundation; either ! * version 2.1 of the License, or (at your option) any later version. ! * [...1152 lines suppressed...] ! private javax.swing.JButton helpDeleteButton; ! private javax.swing.JButton helpEditButton; ! // End of variables declaration ! /* ! * command exec variables ! */ ! private String cmd; private String str; private java.util.ArrayList tmp; ! /* ! * user info for text entry ! */ ! private String profname = new String(); ! private String acctgrp = new String(); ! private String profscope = new String(); ! private String proflock = new String(); } Index: UAM_EditUser.java =================================================================== RCS file: /cvsroot/opencoe/coekernel/src/UAM/src/UAM/java/org/opencoe/coe/uam/UAM_EditUser.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UAM_EditUser.java 18 Oct 2003 03:53:12 -0000 1.5 --- UAM_EditUser.java 23 Oct 2003 02:32:05 -0000 1.6 *************** *** 13,23 **** */ - /** - * UAM_EditUser.java - * - * Created on March 25, 2001, 5:05 PM - * 20031017:rb:821278 Parent/Default Profile assigned to user - */ - package org.opencoe.coe.uam; import org.opencoe.coe.kernel.util.*; --- 13,16 ---- *************** *** 27,33 **** /** *@author rbroberg ! *@created October 17, 2003 ! *@version */ --- 20,29 ---- /** + * UAM_EditUser.java Parent/Default Profile assigned to user + * *@author rbroberg ! *@created March 25, 2001, 5:05 PM ! *@history 20031022:rb:828634 - Change title for UAManager ! *@history 20031017:rb:821278 - Parent/Default Profile assigned to user */ *************** *** 125,128 **** --- 121,131 ---- */ if (mode.equals("--edit") || mode.equals("--delete")) { + //20031022:rb:828634 - Change title for UAManager + if (mode.equals("--edit")) { + setTitle("Edit User"); + } else { + setTitle("Delete User"); + } + cmd = "COE_HOME/bin/COE_get_user_data -n " + uname + " -s " + uscope; _OpenCOECmdExec COE_get_user_data = new _OpenCOECmdExec(cmd); *************** *** 147,150 **** --- 150,155 ---- } else { + //20031022:rb:828634 - Change title for UAManager + setTitle("New User"); uid = ""; useruid = ""; Index: UAM_Manager.java =================================================================== RCS file: /cvsroot/opencoe/coekernel/src/UAM/src/UAM/java/org/opencoe/coe/uam/UAM_Manager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UAM_Manager.java 21 Jun 2002 22:43:57 -0000 1.3 --- UAM_Manager.java 23 Oct 2003 02:32:05 -0000 1.4 *************** *** 1,772 **** /** ! * Copyright (C) 2002, Federal Linux Systems ! * ! * The project home for this software is http://www.opencoe.org ! * ! * This segment is free software; you can redistribute it and/or ! * modify it under the terms of the GNU Lesser General Public ! * License as published by the Free Software Foundation; either ! * version 2.1 of the License, or (at your option) any later version. ! * [...1682 lines suppressed...] ! private javax.swing.JMenuItem AttributeViewMenuItem; ! private javax.swing.JMenuItem TableViewMenuItem; ! private javax.swing.JMenu helpMenu; ! private javax.swing.JMenuItem aboutHelpMenuItem; ! private javax.swing.JMenuItem helpHelpMenuItem; ! private javax.swing.JSplitPane uamSplitPanel; ! private javax.swing.JScrollPane uamTreeScrollPane; ! //private javax.swing.JTree uamTree; ! private _UAM_ManagerTree uamTree; ! private javax.swing.JPanel uamPanel; ! private javax.swing.JScrollPane uamDispScrollPane; ! private javax.swing.JTable uamTable; ! private javax.swing.table.DefaultTableModel uamTableModel; ! private org.opencoe.coe.uam.UAM_EditUser uameu; ! private org.opencoe.coe.uam.UAM_EditProfile uamep; ! private org.opencoe.coe.uam.UAM_EditGroup uameg; ! // End of variables declaration } + Index: _UAM_ManagerModel.java =================================================================== RCS file: /cvsroot/opencoe/coekernel/src/UAM/src/UAM/java/org/opencoe/coe/uam/_UAM_ManagerModel.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** _UAM_ManagerModel.java 19 Apr 2002 15:18:00 -0000 1.1.1.1 --- _UAM_ManagerModel.java 23 Oct 2003 02:32:05 -0000 1.2 *************** *** 1,24 **** /** ! * Copyright (C) 2002, Federal Linux Systems ! * ! * The project home for this software is http://www.opencoe.org ! * ! * This segment is free software; you can redistribute it and/or ! * modify it under the terms of the GNU Lesser General Public ! * License as published by the Free Software Foundation; either ! * version 2.1 of the License, or (at your option) any later version. ! * ! * This segment is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! * Lesser General Public License for more details. ! * ! * You should have received a copy of the GNU Lesser General Public * License along with this segment; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! **/ ! package org.opencoe.coe.uam; import org.opencoe.coe.kernel.util.*; import javax.swing.event.*; --- 1,17 ---- /** ! * Copyright (C) 2002, Federal Linux Systems The project home for this software ! * is http://www.opencoe.org This segment is free software; you can ! * redistribute it and/or modify it under the terms of the GNU Lesser General ! * Public License as published by the Free Software Foundation; either version ! * 2.1 of the License, or (at your option) any later version. This segment is ! * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; ! * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A ! * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more ! * details. You should have received a copy of the GNU Lesser General Public * License along with this segment; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! package org.opencoe.coe.uam; import org.opencoe.coe.kernel.util.*; import javax.swing.event.*; *************** *** 26,111 **** import java.util.Vector; public class _UAM_ManagerModel implements TreeModel { ! private boolean showAncestors; ! private Vector treeModelListeners = new Vector(); ! private _OpenCOETable rootTable; - public _UAM_ManagerModel(_OpenCOETable root) { - showAncestors = false; - rootTable = root; - } //////////////// TreeModel interface implementation /////////////////////// ! /** ! * Adds a listener for the TreeModelEvent posted after the tree changes. ! */ ! public void addTreeModelListener(TreeModelListener l) { ! treeModelListeners.addElement(l); ! } - /** - * Returns the child of parent at index in the parent's child array. - */ - public Object getChild(Object parent, int index) { - _OpenCOETable p = (_OpenCOETable)parent; - //return p.getCombined(index); - return p.getTables(index); - } ! /** ! * Returns the number of children of parent. ! */ ! public int getChildCount(Object parent) { ! _OpenCOETable p = (_OpenCOETable)parent; ! //return p.getCombinedCount(); ! //System.out.println (p.getName()+": has children #: "+p.getTableCount()); ! return p.getTableCount(); ! } - /** - * Returns the index of child in parent. - */ - public int getIndexOfChild(Object parent, Object child) { - _OpenCOETable p = (_OpenCOETable)parent; - //return p.getIndexOfCombined(child); - //System.out.println (p.getName()+": has child at index: "+p.getIndexOfTable((_OpenCOETable)child)); - return p.getIndexOfTable((_OpenCOETable)child); - } ! /** ! * Returns the root of the tree. ! */ ! public Object getRoot() { ! return rootTable; ! } ! /** ! * Returns true if node is a leaf. ! */ ! public boolean isLeaf(Object node) { ! String nodename = node.getClass().getName(); ! if (nodename.equals("org.opencoe.coe.kernel.util._OpenCOETable")){ ! return false; ! } else { ! return true; } - } ! /** ! * Removes a listener previously added with addTreeModelListener(). ! */ ! public void removeTreeModelListener(TreeModelListener l) { ! treeModelListeners.removeElement(l); ! } ! /** ! * Messaged when the user has altered the value for the item ! * identified by path to newValue. Not used by this model. ! */ ! public void valueForPathChanged(TreePath path, Object newValue) { ! //System.out.println("*** valueForPathChanged : " ! // + path + " --> " + newValue); ! } } --- 19,149 ---- import java.util.Vector; + /** + * Description of the Class + * + *@author rbroberg + *@created October 22, 2003 + *@history 20031022:rb:828634 - Change title for UAManager + */ public class _UAM_ManagerModel implements TreeModel { ! private boolean showAncestors; ! private Vector treeModelListeners = new Vector(); ! private _OpenCOETable rootTable; ! ! ! /** ! * Constructor for the _UAM_ManagerModel object ! * ! *@param root Description of the Parameter ! */ ! public _UAM_ManagerModel(_OpenCOETable root) { ! showAncestors = false; ! rootTable = root; ! } //////////////// TreeModel interface implementation /////////////////////// ! /** ! * Adds a listener for the TreeModelEvent posted after the tree changes. ! * ! *@param l The feature to be added to the TreeModelListener attribute ! */ ! public void addTreeModelListener(TreeModelListener l) { ! treeModelListeners.addElement(l); ! } ! /** ! * Returns the child of parent at index in the parent's child array. ! * ! *@param parent Description of the Parameter ! *@param index Description of the Parameter ! *@return The child value ! */ ! public Object getChild(Object parent, int index) { ! _OpenCOETable p = (_OpenCOETable) parent; ! //return p.getCombined(index); ! return p.getTables(index); ! } ! /** ! * Returns the number of children of parent. ! * ! *@param parent Description of the Parameter ! *@return The childCount value ! */ ! public int getChildCount(Object parent) { ! _OpenCOETable p = (_OpenCOETable) parent; ! //return p.getCombinedCount(); ! //System.out.println (p.getName()+": has children #: "+p.getTableCount()); ! return p.getTableCount(); ! } ! ! /** ! * Returns the index of child in parent. ! * ! *@param parent Description of the Parameter ! *@param child Description of the Parameter ! *@return The indexOfChild value ! */ ! public int getIndexOfChild(Object parent, Object child) { ! _OpenCOETable p = (_OpenCOETable) parent; ! //return p.getIndexOfCombined(child); ! //System.out.println (p.getName()+": has child at index: "+p.getIndexOfTable((_OpenCOETable)child)); ! return p.getIndexOfTable((_OpenCOETable) child); } ! /** ! * Returns the root of the tree. ! * ! *@return The root value ! */ ! public Object getRoot() { ! return rootTable; ! } ! ! /** ! * Returns true if node is a leaf. ! * ! *@param node Description of the Parameter ! *@return The leaf value ! */ ! public boolean isLeaf(Object node) { ! String nodename = node.getClass().getName(); ! if (nodename.equals("org.opencoe.coe.kernel.util._OpenCOETable")) { ! return false; ! } else { ! return true; ! } ! ! } ! ! ! /** ! * Removes a listener previously added with addTreeModelListener(). ! * ! *@param l Description of the Parameter ! */ ! public void removeTreeModelListener(TreeModelListener l) { ! treeModelListeners.removeElement(l); ! } ! ! ! /** ! * Messaged when the user has altered the value for the item identified by ! * path to newValue. Not used by this model. ! * ! *@param path Description of the Parameter ! *@param newValue Description of the Parameter ! */ ! public void valueForPathChanged(TreePath path, Object newValue) { ! //System.out.println("*** valueForPathChanged : " ! // + path + " --> " + newValue); ! } } + Index: _UAM_ManagerTree.java =================================================================== RCS file: /cvsroot/opencoe/coekernel/src/UAM/src/UAM/java/org/opencoe/coe/uam/_UAM_ManagerTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _UAM_ManagerTree.java 21 Jun 2002 22:43:57 -0000 1.2 --- _UAM_ManagerTree.java 23 Oct 2003 02:32:05 -0000 1.3 *************** *** 1,24 **** /** ! * Copyright (C) 2002, Federal Linux Systems ! * ! * The project home for this software is http://www.opencoe.org ! * ! * This segment is free software; you can redistribute it and/or ! * modify it under the terms of the GNU Lesser General Public ! * License as published by the Free Software Foundation; either ! * version 2.1 of the License, or (at your option) any later version. ! * ! * This segment is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! * Lesser General Public License for more details. ! * ! * You should have received a copy of the GNU Lesser General Public * License along with this segment; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! **/ ! package org.opencoe.coe.uam; import org.opencoe.coe.kernel.util.*; import javax.swing.*; --- 1,17 ---- /** ! * Copyright (C) 2002, Federal Linux Systems The project home for this software ! * is http://www.opencoe.org This segment is free software; you can ! * redistribute it and/or modify it under the terms of the GNU Lesser General ! * Public License as published by the Free Software Foundation; either version ! * 2.1 of the License, or (at your option) any later version. This segment is ! * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; ! * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A ! * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more ! * details. You should have received a copy of the GNU Lesser General Public * License along with this segment; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! package org.opencoe.coe.uam; import org.opencoe.coe.kernel.util.*; import javax.swing.*; *************** *** 26,68 **** import javax.swing.event.*; public class _UAM_ManagerTree extends JTree { ! _UAM_ManagerModel model; - public _UAM_ManagerTree(_OpenCOETable graphNode) { - super(new _UAM_ManagerModel(graphNode)); - getSelectionModel().setSelectionMode( - TreeSelectionModel.SINGLE_TREE_SELECTION); - //DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer(); - //Icon appIcon = new ImageIcon("COE_HOME/data/Icons/gnome-run.png"); - //Icon profIcon = new ImageIcon("COE_HOME/data/Icons/gnome-folder.png"); - //renderer.setLeafIcon(appIcon); - //renderer.setClosedIcon(profIcon); - //renderer.setOpenIcon(profIcon); - //setCellRenderer(renderer); ! //Listen for when the selection changes. ! addTreeSelectionListener(new TreeSelectionListener() { ! public void valueChanged(TreeSelectionEvent e) { ! //DefaultMutableTreeNode node = (DefaultMutableTreeNode) ! //getLastSelectedPathComponent(); ! Object node = (Object) ! getLastSelectedPathComponent(); ! ! if (node == null) return; ! ! // Object nodeInfo = node.getUserObject(); ! //if (_UAM_ManagerModel.isLeaf(node)) { ! String nodename = node.getClass().getName(); ! if (nodename.equals("org.opencoe.coe.kernel.util._OpenCOEAttr")){ ! _OpenCOEAttr n = (_OpenCOEAttr)node; ! //String c = n.getExecPath(); ! //System.out.println("Attr node: "+n.getAttr()+" : "+n.getValue()); ! //_OpenCOECmdExec launch_app = new _OpenCOECmdExec(c, true); ! } else { ! //System.out.println("Table node:"); ! } ! } ! }); ! } } --- 19,78 ---- import javax.swing.event.*; + /** + * Description of the Class + * + *@author rbroberg + *@created October 22, 2003 + *@history 20031022:rb:828634 - Change title for UAManager + */ public class _UAM_ManagerTree extends JTree { ! _UAM_ManagerModel model; ! /** ! * Constructor for the _UAM_ManagerTree object ! * ! *@param graphNode Description of the Parameter ! */ ! public _UAM_ManagerTree(_OpenCOETable graphNode) { ! super(new _UAM_ManagerModel(graphNode)); ! getSelectionModel().setSelectionMode( ! TreeSelectionModel.SINGLE_TREE_SELECTION); ! //DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer(); ! //Icon appIcon = new ImageIcon("COE_HOME/data/Icons/gnome-run.png"); ! //Icon profIcon = new ImageIcon("COE_HOME/data/Icons/gnome-folder.png"); ! //renderer.setLeafIcon(appIcon); ! //renderer.setClosedIcon(profIcon); ! //renderer.setOpenIcon(profIcon); ! //setCellRenderer(renderer); ! //Listen for when the selection changes. ! addTreeSelectionListener( ! new TreeSelectionListener() { ! ! public void valueChanged(TreeSelectionEvent e) { ! //DefaultMutableTreeNode node = (DefaultMutableTreeNode) ! //getLastSelectedPathComponent(); ! Object node = (Object) ! getLastSelectedPathComponent(); ! ! if (node == null) { ! return; ! } ! ! // Object nodeInfo = node.getUserObject(); ! //if (_UAM_ManagerModel.isLeaf(node)) { ! String nodename = node.getClass().getName(); ! if (nodename.equals("org.opencoe.coe.kernel.util._OpenCOEAttr")) { ! _OpenCOEAttr n = (_OpenCOEAttr) node; ! //String c = n.getExecPath(); ! //System.out.println("Attr node: "+n.getAttr()+" : "+n.getValue()); ! //_OpenCOECmdExec launch_app = new _OpenCOECmdExec(c, true); ! } else { ! //System.out.println("Table node:"); ! } ! } ! }); ! } } + |