diff options
Diffstat (limited to 'usr/src')
48 files changed, 898 insertions, 1047 deletions
diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/BST.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/BST.java index ee8014dc1a..5bdd31d333 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/BST.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/BST.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -25,7 +24,7 @@ * * Copyright (c) 1999 by Sun Microsystems, Inc. * All rights reserved. - * + * * BST.java * Simple binary search tree implementation for help articles * @@ -39,7 +38,7 @@ import com.sun.admin.pm.server.*; public class BST extends Object { - + // these should be protected... public BST left = null; public BST right = null; @@ -54,7 +53,7 @@ public class BST extends Object { left = right = null; data = theItem; } - + public BST() { this(new BSTItem("", null)); @@ -72,7 +71,7 @@ public class BST extends Object { BST node = null; if (comp == 0) { - Debug.info("HELP: Duplicate insert: " + + Debug.info("HELP: Duplicate insert: " + theItem.toString()); } else if (comp > 0) { if (left != null) @@ -84,12 +83,12 @@ public class BST extends Object { right.insert(theItem); else right = node = new BST(theItem); - } + } return node; } - + public BST find_tree(String newKey) { return find_tree(newKey, true); } @@ -101,13 +100,13 @@ public class BST extends Object { public BST find_tree(String newKey, boolean exactMatch) { /* - Debug.info("HELP: Finding " +(exactMatch ? "exact " : "partial ") + - newKey); - */ + * Debug.info("HELP: Finding " +(exactMatch ? "exact " : "partial ") + + * newKey); + */ BST rv = null; int comp = data.compare(newKey, exactMatch); - + ++comparisons; if (comp > 0) { @@ -119,7 +118,7 @@ public class BST extends Object { } else { rv = this; // Debug.info("HELP: Found " + newKey + " in " + data); - } + } return rv; } @@ -130,7 +129,7 @@ public class BST extends Object { BSTItem rv = null; int comp = data.compare(newKey, exactMatch); - + ++comparisons; if (comp > 0) { @@ -142,12 +141,12 @@ public class BST extends Object { } else { Debug.info("HELP: Found " + newKey + " in " + data); rv = this.data; - } + } return rv; } - + public void traverse() { if (left != null) @@ -163,7 +162,7 @@ public class BST extends Object { right.traverse(); } - + public void traverse_find(String key) { if (left != null) left.traverse_find(key); @@ -177,7 +176,7 @@ public class BST extends Object { // empty search string is a wildcard... public void traverse_find_vector(Vector v, String key) { /* - * Debug.info("HELP: traverse_find_vector: node " + + * Debug.info("HELP: traverse_find_vector: node " + * data.key + "[" +(left!=null?left.data.key:"null") + "]" + * "[" +(right!=null ?right.data.key:"null") + "]" + * " seeking " + key); @@ -186,12 +185,12 @@ public class BST extends Object { if (key.length() > 0) c = data.compare(key, false); - + /* - * Debug.info("HELP: traverse_find_vector: compare " + + * Debug.info("HELP: traverse_find_vector: compare " + * data.key + " to "+ key + " = " + c); */ - + if (c >= 0 && left != null) left.traverse_find_vector(v, key); @@ -199,14 +198,14 @@ public class BST extends Object { // Debug.info("HELP: traverse_find_vector: adding " + data.key); v.addElement(data.data); } - + if (c <= 0) { if (right != null) right.traverse_find_vector(v, key); } } - + public void dump() { Debug.info("HELP: \nDump: this = " + data.key); @@ -249,27 +248,27 @@ public class BST extends Object { BST.comparisons = 0; bst.insert(a); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); BST.comparisons = 0; bst.insert(x); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); BST.comparisons = 0; bst.insert(e); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); BST.comparisons = 0; bst.insert(c); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); BST.comparisons = 0; bst.insert(b); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); BST.comparisons = 0; bst.insert(d); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); bst.insert(aa); @@ -285,19 +284,19 @@ public class BST extends Object { BST.comparisons = 0; bst.find("Echo"); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); BST.comparisons = 0; bst.find("Xray"); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); BST.comparisons = 0; bst.find("Delta"); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); BST.comparisons = 0; bst.find("Root"); - System.out.println(BST.comparisons + + System.out.println(BST.comparisons + " comparisons\n"); bst.find("Alpha"); @@ -326,10 +325,3 @@ public class BST extends Object { } } } - - - - - - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/BSTItem.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/BSTItem.java index 35099d7b2e..0ad3b5f8fe 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/BSTItem.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/BSTItem.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -39,7 +38,7 @@ public class BSTItem extends Object { public String key; public Object data; public int handle = UNINITIALIZED; - + static int serial = 0; static final int UNINITIALIZED = -1; @@ -58,7 +57,7 @@ public class BSTItem extends Object { } public int compare(BSTItem otherItem, boolean exact) { - + return compare(otherItem.key, exact); } @@ -86,9 +85,9 @@ public class BSTItem extends Object { key.compareTo(otherKey) : compareSub(otherKey.toLowerCase()); - /* + /* * System.out.println( - * "Compare: " + key + " to " + otherKey + " -> " + rv); + * "Compare: " + key + " to " + otherKey + " -> " + rv); */ return rv; @@ -97,7 +96,7 @@ public class BSTItem extends Object { public int compareSub(String s) { Debug.info("HELP: compareSub: " + key + " to " + s); - + int rv = 0; try { rv = key.substring(0, s.length()).compareTo(s); @@ -108,17 +107,3 @@ public class BSTItem extends Object { return rv; } } - - - - - - - - - - - - - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/Constants.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/Constants.java index f6c8278db3..12ffe37f5d 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/Constants.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/Constants.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -52,12 +51,12 @@ public interface Constants int ADD = 6; int DELETE = 7; - // Printer type to add/modify - int ADDLOCAL = 1; + // Printer type to add/modify + int ADDLOCAL = 1; int ADDNETWORK = 2; - int MODIFYATTACHED = 3; - int MODIFYREMOTE = 4; - int MODIFYNETWORK = 5; + int MODIFYATTACHED = 3; + int MODIFYREMOTE = 4; + int MODIFYNETWORK = 5; // Printer connection types int ATTACHED = 1; @@ -66,7 +65,7 @@ public interface Constants // Useful Constants int MAXPNAMELEN = 20; - // Combo Listener + // Combo Listener int PORT = 1; int TYPE = 2; int MAKE = 3; diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAccess.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAccess.java index 9af2db46ee..3cde36854a 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAccess.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAccess.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -61,18 +60,18 @@ public class pmAccess extends pmButtonScreen { pmTop mytop; String printer = null; String server = null; - + String cmdLog = null; String errorLog = null; String warnLog = null; - + final static int OK = 1; final static int APPLY = 2; final static int RESET = 3; final static int CANCEL = 4; final static int HELP = 5; - + public pmAccess(pmTop mytop) { // ensure that pmButton hashtable gets cleaned up @@ -81,20 +80,20 @@ public class pmAccess extends pmButtonScreen { setLayout(new BorderLayout()); this.mytop = mytop; - + // Build the Frame centerPanel(); southPanel(); - + /* - * let's try doing this in Show... - * - * // default button is always OK, for now... - * frame.getRootPane().setDefaultButton(okButton); - * - * okButton.setAsDefaultButton(); - */ - + * let's try doing this in Show... + * + * // default button is always OK, for now... + * frame.getRootPane().setDefaultButton(okButton); + * + * okButton.setAsDefaultButton(); + */ + // handle Esc as cancel this.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -103,10 +102,10 @@ public class pmAccess extends pmButtonScreen { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + // enable the pmFrame to set focus to our default comp on activation frame.setDefaultComponent(pnameText); - + // following is test code, I think... Component glass = frame.getGlassPane(); @@ -122,7 +121,7 @@ public class pmAccess extends pmButtonScreen { Debug.info("Glass: " + k); } }); - + } public void centerPanel() { @@ -351,7 +350,7 @@ public class pmAccess extends pmButtonScreen { "Continue.creating.access.for.this.printer?")); d.setVisible(true); if (d.getValue() != JOptionPane.OK_OPTION) { - pmMessageDialog m = new pmMessageDialog(frame, + pmMessageDialog m = new pmMessageDialog(frame, pmUtility.getResource("Warning"), pmUtility.getResource("Operation.Cancelled")); m.setVisible(true); @@ -378,10 +377,10 @@ public class pmAccess extends pmButtonScreen { // returns true if success, false otherwise boolean doAction() { boolean rv = false; - + try { createAccess(); - rv = true; // only if it didn't throw! + rv = true; // only if it didn't throw! } catch (pmIncompleteFormException ix) { Debug.warning( "CLNT:pmAccess:incomplete form " + ix.getMessage()); @@ -449,7 +448,7 @@ public class pmAccess extends pmButtonScreen { return rv; } - + public void pmScreendispose() { frame.dispose(); } @@ -475,13 +474,13 @@ public class pmAccess extends pmButtonScreen { Debug.message("CLNT:pmAccess:actionapplyButton()"); if (doAction() == true) { - mytop.pmsetdefaultpLabel(); + mytop.pmsetdefaultpLabel(); mytop.scrollPane.revalidate(); mytop.scrollPane.repaint(); } } - + public void actionresetButton() { Debug.message("CLNT:pmAccess:actionresetButton()"); diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAddAccessFailedException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAddAccessFailedException.java index 377d70fb61..40899aaf91 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAddAccessFailedException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAddAccessFailedException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * All rights reserved. * * pmAddAccessFailedException.java - * + * */ package com.sun.admin.pm.client; @@ -42,5 +41,3 @@ class pmAddAccessFailedException extends pmGuiException { super(); } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAddPrinterFailedException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAddPrinterFailedException.java index 08fccef1c0..c952484b08 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAddPrinterFailedException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAddPrinterFailedException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * All rights reserved. * * pmAddPrinterFailedException.java - * + * */ package com.sun.admin.pm.client; @@ -39,5 +38,3 @@ class pmAddPrinterFailedException extends pmGuiException { super(s); } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAuthOptions.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAuthOptions.java index 2bcfcba9bf..456fd87850 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAuthOptions.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmAuthOptions.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -28,7 +27,7 @@ * * pmAuthOptions.java * Prompt for root password from printmgr. - * This a helper for printmgr which echoes YES, NO, or CANCEL to stdout. + * This a helper for printmgr which echoes YES, NO, or CANCEL to stdout. */ package com.sun.admin.pm.client; @@ -68,8 +67,8 @@ public class pmAuthOptions { } while (!done) { - pmAuthLogin d = new pmAuthLogin(null, - pmUtility.getResource("Root.authentication"), + pmAuthLogin d = new pmAuthLogin(null, + pmUtility.getResource("Root.authentication"), pmUtility.getResource("Enter.root.password")); d.setVisible(true); if (d.getValue() != JOptionPane.OK_OPTION) @@ -84,11 +83,11 @@ public class pmAuthOptions { } if (!ok) { - pmOKCancelDialog m = new pmOKCancelDialog(null, - pmUtility.getResource("Error"), + pmOKCancelDialog m = new pmOKCancelDialog(null, + pmUtility.getResource("Error"), pmUtility.getResource("Invalid.password")); m.setVisible(true); - if (m.getValue() != JOptionPane.OK_OPTION) + if (m.getValue() != JOptionPane.OK_OPTION) done = true; } else { done = true; @@ -101,13 +100,9 @@ public class pmAuthOptions { System.exit(0); } - + } - - - - - + /* */ @@ -117,10 +112,10 @@ class pmAuthLogin extends pmDialog { protected pmButton okButton = null; protected pmButton cancelButton = null; - + public pmAuthLogin(JFrame f, String title, String msg) { - super(f, title, true); // modal + super(f, title, true); // modal JLabel l; JPanel p; @@ -137,13 +132,13 @@ class pmAuthLogin extends pmDialog { // top panel contains the desired message p = new JPanel(); p.setLayout(new GridBagLayout()); - + l = new JLabel(msg, SwingConstants.CENTER); p.add(l, c); this.getContentPane().add(p, "North"); - - // middle panel contains username and password + + // middle panel contains username and password p = new JPanel(); p.setLayout(new GridBagLayout()); @@ -189,7 +184,7 @@ class pmAuthLogin extends pmDialog { p.add(passwordField, c); passwordField.setEchoChar('*'); - + this.getContentPane().add(p, "Center"); // bottom panel contains buttons @@ -241,14 +236,14 @@ class pmAuthLogin extends pmDialog { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + // lay out the dialog this.pack(); // set focus and defaults after packing... // this.getRootPane().setDefaultButton(okButton); okButton.setAsDefaultButton(); - + passwordField.requestFocus(); } @@ -280,13 +275,8 @@ class pmAuthLogin extends pmDialog { public JPasswordField passwordField = null; protected int returnValue = JOptionPane.CANCEL_OPTION; - + } - - - - - class pmAuthMessage extends pmDialog { @@ -298,7 +288,7 @@ class pmAuthMessage extends pmDialog { public pmAuthMessage(JFrame f, String title, String msg) { - super(f, title, true); // modal + super(f, title, true); // modal JPanel p; @@ -314,7 +304,7 @@ class pmAuthMessage extends pmDialog { // top panel contains the desired message p = new JPanel(); p.setLayout(new GridBagLayout()); - + JList l = new JList() { public boolean isFocusable() { @@ -331,7 +321,7 @@ class pmAuthMessage extends pmDialog { if (msg != null) { StringTokenizer st = new StringTokenizer(msg, "\n", false); try { - while (st.hasMoreTokens()) + while (st.hasMoreTokens()) v.addElement(st.nextToken()); } catch (Exception x) { } @@ -341,7 +331,7 @@ class pmAuthMessage extends pmDialog { p.add(l, c); this.getContentPane().add(p, "North"); - + // bottom panel contains buttons c.gridx = 0; @@ -398,13 +388,13 @@ class pmAuthMessage extends pmDialog { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + // lay out the dialog this.pack(); // set focus and defaults after packing... authButton.setAsDefaultButton(); - + } public int getValue() { @@ -429,5 +419,5 @@ class pmAuthMessage extends pmDialog { } protected int returnValue = JOptionPane.CANCEL_OPTION; - + } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmButton.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmButton.java index e520679b6b..1c14c5642e 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmButton.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmButton.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * All rights reserved. * * pmButton.java - * + * */ package com.sun.admin.pm.client; @@ -39,13 +38,13 @@ import javax.swing.*; import com.sun.admin.pm.server.*; -/* +/* * strategy: * Keep a hashtable of root panes and their associated default buttons. * Note that there is at present no way to remove a root pane entry * from the table... * - * Ideally there should be an interface to allow objects to + * Ideally there should be an interface to allow objects to * remove themselves before disappearing. */ @@ -67,7 +66,7 @@ public class pmButton extends JButton { boolean makeDefaultButton() { return makeDefaultButton(this); } - + /* * make b the default on this root pane * returns true if success, false otherwise @@ -86,8 +85,8 @@ public class pmButton extends JButton { /* * Debug.info("\nBUTTON: makeDefaultButton " + - * (b == null ? "null" : b.getText()) + - * " on " + r + "\n"); + * (b == null ? "null" : b.getText()) + + * " on " + r + "\n"); */ if (b != null && b.isDefaultCapable() == false) { @@ -102,16 +101,16 @@ public class pmButton extends JButton { } /* - * Debug.info("\nBUTTON: makeDefaultButton: old button was " + - * (oldb == null ? "null" : oldb.getText()) + "\n"); + * Debug.info("\nBUTTON: makeDefaultButton: old button was " + + * (oldb == null ? "null" : oldb.getText()) + "\n"); */ - + r.setDefaultButton(b); return true; } - + public pmButton(String s) { super(s); @@ -122,7 +121,7 @@ public class pmButton extends JButton { if (e.isTemporary()) { /* * Debug.info("BUTTON: " + getText() + - * " gained temp - ignoring"); + * " gained temp - ignoring"); */ return; } @@ -131,7 +130,7 @@ public class pmButton extends JButton { if (makeDefaultButton()) setFocusPainted(true); - + } // upon losing focus: make 'true' default the default @@ -139,7 +138,7 @@ public class pmButton extends JButton { if (e.isTemporary()) { /* * Debug.info("BUTTON: " + getText() + - * " lost temp - ignoring"); + * " lost temp - ignoring"); */ return; } @@ -151,11 +150,11 @@ public class pmButton extends JButton { * next focusable comp, but what if focus is being * lost as the result of a mouse click?? */ - + makeDefaultButton((JButton) map.get(getRootPane())); // setFocusPainted(false); } - + }); } @@ -163,22 +162,22 @@ public class pmButton extends JButton { void setAsDefaultButton() { setAsDefaultButton(this); } - + // make b the true default for this root pane void setAsDefaultButton(JButton b) { JRootPane r = getRootPane(); /* * Debug.message("BUTTON: setAsDefaultButton " + - * (b == null ? "null" : b.getText()) + - * " root = " + r); + * (b == null ? "null" : b.getText()) + + * " root = " + r); */ // setting default to null removes state if (b == null) map.remove(r); else - map.put(r, b); // creates a new entry if needed + map.put(r, b); // creates a new entry if needed makeDefaultButton(b); } @@ -188,16 +187,16 @@ public class pmButton extends JButton { JRootPane r = getRootPane(); map.remove(r); } - + public static void unreference(JComponent c) { JRootPane r = c.getRootPane(); map.remove(r); } - + public static void unreference(JRootPane r) { map.remove(r); } - + static boolean enableMnemonics = false; @@ -206,7 +205,7 @@ public class pmButton extends JButton { } public void setMnemonic(int mnemonic) { - setMnemonic((char)mnemonic); + setMnemonic((char)mnemonic); } public void setMnemonic(char mnemonic) { @@ -215,7 +214,3 @@ public class pmButton extends JButton { } } - - - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmButtonScreen.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmButtonScreen.java index 25eb756842..de18335be2 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmButtonScreen.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmButtonScreen.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -77,7 +76,7 @@ public class pmButtonScreen extends JPanel { pmUtility.getResource("OK")); okButton.setMnemonic( pmUtility.getIntResource("OK.mnemonic")); - + applyButton = new pmButton( pmUtility.getResource("Apply")); applyButton.setMnemonic( @@ -174,6 +173,3 @@ public class pmButtonScreen extends JPanel { } - - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmCalls.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmCalls.java index 72a8124dd5..5503d90a97 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmCalls.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmCalls.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -62,19 +61,19 @@ public class pmCalls { Debug.info("CLNT: printer " + p.getPrinterName()); } - + if (p.getPrintServer() != null) Debug.info("CLNT: server " + p.getPrintServer()); - + if (p.getPrinterType() != null) Debug.info("CLNT: printer type " + p.getPrinterType()); - + if (p.getComment() != null) Debug.info("CLNT: Comment " + p.getComment()); - + if (p.getDevice() != null) Debug.info("CLNT: Device " + p.getDevice()); @@ -103,20 +102,20 @@ public class pmCalls { if (p.getBanner() != null) Debug.info("CLNT: Banner " + p.getBanner()); - + if (p.getProtocol() != null) Debug.info("CLNT: Protocol " + p.getProtocol()); - + if (p.getDestination() != null) Debug.info("CLNT: Destination " + p.getDestination()); - + if (p.getFileContents() != null) { - + String filedata[] = p.getFileContents(); String filecontents = new String(); - + Debug.info("CLNT: File Contents: "); if (filedata != null) { @@ -129,7 +128,7 @@ public class pmCalls { if (p.getNotify() != null) { Debug.info("CLNT: Fault Notification: " + p.getNotify()); } - + String ua[] = p.getUserAllowList(); Debug.info("CLNT: UserAllowList "); if (ua != null) { @@ -137,9 +136,9 @@ public class pmCalls { Debug.info(" " + ua[i]); } } - + Debug.info("CLNT: getIsDefaultPrinter is " + p.getIsDefaultPrinter()); - + } public static void debugshowPrinterList(NameService ns) { diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmDelete.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmDelete.java index eb35e916e0..4e138209b8 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmDelete.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmDelete.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -41,10 +40,10 @@ import com.sun.admin.pm.server.*; /* - * Window for Edit -> Delete + * Window for Edit -> Delete */ -//public class pmDelete extends JPanel { +// public class pmDelete extends JPanel { public class pmDelete { Printer newpr = null; @@ -64,9 +63,9 @@ public class pmDelete { } pmOKCancelDialog d = new pmOKCancelDialog( - mytop.parentFrame, + mytop.parentFrame, pmUtility.getResource("SPM:Delete.Printer"), - pmUtility.getResource("Please.confirm.deletion.of.printer") + + pmUtility.getResource("Please.confirm.deletion.of.printer") + mytop.selectedPrinter, false); d.setVisible(true); @@ -95,7 +94,7 @@ public class pmDelete { } } - + public void actionokButton() throws pmGuiException { int ret; String cmd = null; @@ -135,7 +134,7 @@ public class pmDelete { } catch (Exception e) { Debug.warning("CLNT: pmDelete:deletePrinter exception " + e); failed = true; - } + } cmd = newpr.getCmdLog(); warn = newpr.getWarnLog(); @@ -151,10 +150,10 @@ public class pmDelete { pmUtility.getResource("Error"), ((err == null) ? pmUtility.getResource( - "Printer.delete.operation.failed.") : + "Printer.delete.operation.failed.") : err), mytop, - "DeletePrinterFailed"); + "DeletePrinterFailed"); m.setVisible(true); } else { @@ -175,8 +174,8 @@ public class pmDelete { mytop.setLogData(cmd, err, warn); mytop.showLogData(pmUtility.getResource("Delete.Printer")); } - - + + public void actioncancelButton() { Debug.message("CLNT: pmDelete: actioncancelButton()"); } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmDeleteFailedException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmDeleteFailedException.java index 9edd59d063..88237fd948 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmDeleteFailedException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmDeleteFailedException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * All rights reserved. * * pmDeleteFailedException.java - * + * */ package com.sun.admin.pm.client; @@ -42,5 +41,3 @@ class pmDeleteFailedException extends pmGuiException { super(); } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmFindFrame.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmFindFrame.java index 9c0ce1fe43..ad54f0a6b8 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmFindFrame.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmFindFrame.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -41,16 +40,16 @@ import com.sun.admin.pm.server.*; public class pmFindFrame extends pmFrame { - + JLabel statusText = null; pmButton okButton = null; pmButton cancelButton = null; pmButton helpButton = null; pmTop theTop = null; - + String label = pmUtility.getResource("Enter.name.of.printer.to.find"); String helpTag = "ToFindPrinter"; - + public pmFindFrame(pmTop t) { super(pmUtility.getResource("SPM:Find.Printer")); @@ -59,7 +58,7 @@ public class pmFindFrame extends pmFrame { theTop = t; - + JLabel l; JPanel p; @@ -73,11 +72,11 @@ public class pmFindFrame extends pmFrame { c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; - + // top panel contains the message p = new JPanel(); p.setLayout(new GridBagLayout()); - + l = new JLabel(label, SwingConstants.LEFT); p.add(l, c); @@ -91,7 +90,7 @@ public class pmFindFrame extends pmFrame { printerName.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okPressed(); - } + } }); l.setLabelFor(printerName); @@ -112,7 +111,7 @@ public class pmFindFrame extends pmFrame { c.insets = new Insets(5, 10, 5, 10); p.add(statusText, c); - + getContentPane().add(p, "Center"); // bottom panel contains buttons @@ -136,7 +135,7 @@ public class pmFindFrame extends pmFrame { } }); thePanel.add(okButton, c); - + cancelButton = new pmButton( pmUtility.getResource("Dismiss")); cancelButton.setMnemonic( @@ -155,7 +154,7 @@ public class pmFindFrame extends pmFrame { helpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { theTop.showHelpItem(helpTag); - } + } }); thePanel.add(helpButton, c); @@ -172,24 +171,24 @@ public class pmFindFrame extends pmFrame { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + // set focus to initial field, depending on which action is tbd // this seems to work best after pack() - - /** - frame.setVisible(true); - frame.repaint(); - */ + + /* + * frame.setVisible(true); + * frame.repaint(); + */ // getRootPane().setDefaultButton (okButton); okButton.setAsDefaultButton(); - + printerName.requestFocus(); - + // enable improved focus handling setDefaultComponent(printerName); - + } @@ -204,9 +203,9 @@ public class pmFindFrame extends pmFrame { pmUtility.getResource("Unable.to.find.printer") + name)); else statusText.setText(" "); - + // pmFindPanel.this.frame.setVisible (false); - + } public void cancelPressed() { @@ -218,12 +217,5 @@ public class pmFindFrame extends pmFrame { } public pmTextField printerName = null; - -} - - - - - - +} diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmFrame.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmFrame.java index 97ac7eecae..ec37480473 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmFrame.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmFrame.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -46,7 +45,7 @@ class pmFrame extends JFrame { // file path of icon; this does not provide for localization private static final String iconName = "images/appicon.gif"; - + // if true, clean up pmButton state on frame close private boolean clearButtonsOnClose; @@ -132,5 +131,3 @@ class pmFrame extends JFrame { } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmGuiException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmGuiException.java index 53824adee1..f4dfccae58 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmGuiException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmGuiException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * Use is subject to license terms. * * pmGuiException.java - * + * */ package com.sun.admin.pm.client; @@ -37,12 +36,12 @@ import java.lang.*; public class pmGuiException extends Exception { String s = null; - + public pmGuiException(String s) { super(s); } - + public pmGuiException() { super(); diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpContent.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpContent.java index 1cd729028a..27919cbde5 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpContent.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpContent.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -34,7 +33,7 @@ package com.sun.admin.pm.client; class pmHelpContent extends Object { private String text; - + public pmHelpContent(String content) { text = content; } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpController.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpController.java index 8824a0e7aa..320d470254 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpController.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpController.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -45,7 +44,7 @@ import com.sun.admin.pm.server.*; class pmHelpController { public pmHelpFrame frame = null; - + /* * request presentation of the specified help item. */ @@ -66,7 +65,7 @@ class pmHelpController { pmHelpDetailPanel viewPanel; pmHelpIndexPanel indexPanel; pmHelpSearchPanel searchPanel; - + Vector history; public JTabbedPane getTopPane() { @@ -76,31 +75,27 @@ class pmHelpController { public pmHelpController(pmHelpFrame f) { frame = f; - + outerPanel = new JTabbedPane(); - + viewPanel = new pmHelpDetailPanel(this); indexPanel = new pmHelpIndexPanel(this); searchPanel = new pmHelpSearchPanel(this); - + outerPanel.add(pmUtility.getResource("View"), viewPanel); outerPanel.add(pmUtility.getResource("Index"), indexPanel); outerPanel.add(pmUtility.getResource("Search"), searchPanel); - + pmHelpRepository.populateHelpItemDB(); pmHelpRepository.populateHelpKeywordDB(); pmHelpRepository.populateHelpTitleDB(); - indexPanel.queryPanel.handleText(""); // prime it... ugly. - + indexPanel.queryPanel.handleText(""); // prime it... ugly. + history = new Vector(); frame.setDefaultComponent(outerPanel); - } + } } - - - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpDetailPanel.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpDetailPanel.java index 46640f42b4..434670f508 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpDetailPanel.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpDetailPanel.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -73,9 +72,9 @@ public class pmHelpDetailPanel extends JPanel { int historyLast; static final int MAX_HISTORY_ITEMS = 101; - + public pmHelpDetailPanel(pmHelpController ctrl) { - + controller = ctrl; // build subpanels @@ -105,13 +104,13 @@ public class pmHelpDetailPanel extends JPanel { c.gridheight = 0; c.weighty = 0.0; c.weightx = 1.0; - c.fill = GridBagConstraints.BOTH; + c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.WEST; c.insets = new Insets(0, 5, 5, 5); this.add(seeAlsoPanel, c); this.setBorder(BorderFactory.createEtchedBorder()); - + history = new pmHelpLoc[MAX_HISTORY_ITEMS]; historyIndex = 0; historyLast = 0; @@ -123,12 +122,12 @@ public class pmHelpDetailPanel extends JPanel { Debug.info("HELP: Tab event!"); if (!(tp.getSelectedComponent() instanceof com.sun.admin.pm.client.pmHelpDetailPanel)) { - Debug.info("HELP: Tab event: resetting default"); + Debug.info("HELP: Tab event: resetting default"); /* - controller.frame.getRootPane(). - setDefaultButton( - controller.frame.dismiss); - */ + * controller.frame.getRootPane(). + * setDefaultButton( + * controller.frame.dismiss); + */ if (controller.frame.dismiss != null) controller.frame.dismiss. setAsDefaultButton(); @@ -138,11 +137,11 @@ public class pmHelpDetailPanel extends JPanel { addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { - Debug.info("HELP: detailPanel gained focus"); + Debug.info("HELP: detailPanel gained focus"); if (controller.frame.dismiss != null) controller.frame.dismiss. setAsDefaultButton(); - + } }); } @@ -163,7 +162,7 @@ public class pmHelpDetailPanel extends JPanel { history[historyIndex].pos = viewPanel.getPos(); Debug.info("back: pos is " + history[historyIndex].pos); - + if (historyIndex > 1) { pmHelpLoc l = history [--historyIndex]; pmHelpItem item = l.item; @@ -183,7 +182,7 @@ public class pmHelpDetailPanel extends JPanel { history[historyIndex].pos = viewPanel.getPos(); Debug.info("HELP: fwd: pos is " + history[historyIndex].pos); - + if (historyIndex < historyLast) { pmHelpLoc l = history [++historyIndex]; pmHelpItem item = l.item; @@ -201,7 +200,7 @@ public class pmHelpDetailPanel extends JPanel { protected pmHelpItem loadItem(pmHelpItem item) { return loadItem(item, new Point(0, 0)); } - + protected pmHelpItem loadItem(pmHelpItem item, Point pos) { Debug.message("HELP: View: loadItem " + item.tag); seeAlsoPanel.setItems(item.seealso); @@ -213,16 +212,16 @@ public class pmHelpDetailPanel extends JPanel { return item; } - + /* * load the help item corresponding to the specified tag * external - called from helpController - * note that this is how see-also items are loadedes + * note that this is how see-also items are loadedes */ public pmHelpItem loadItemForTag(String tag) { pmHelpItem item; - + if (tag == null || (item = pmHelpRepository.helpItemForTag(tag)) == null) { Debug.warning("HELP: View: item not found"); @@ -236,7 +235,7 @@ public class pmHelpDetailPanel extends JPanel { // if there's already an item visible, preserve its position if (historyIndex != 0 && historyLast != 0) history[historyIndex].pos = viewPanel.getPos(); - + loadItem(item); Debug.info("HELP: loadItemForTag: index = " + historyIndex + @@ -248,7 +247,7 @@ public class pmHelpDetailPanel extends JPanel { * if the history length is maxed out, the new item * will replace the item that's currently last. */ - + if (historyIndex < history.length - 1) { // init pos to 0,0 history [++historyIndex] = new pmHelpLoc(item); @@ -264,7 +263,7 @@ public class pmHelpDetailPanel extends JPanel { ", last = " + historyLast); return item; } - + private void loadEmptyItem(String itm) { String msg = new String( pmUtility.getResource("Item.not.found:") + itm); @@ -285,10 +284,10 @@ class pmHelpSeeAlsoPanel extends JPanel { pmButton selectButton = null; private void layoutBox() { - + JPanel p = new JPanel(); p.setLayout(new BorderLayout(5, 0)); - + p.add(new JPanel(), "North"); p.add(new JPanel(), "South"); @@ -309,30 +308,30 @@ class pmHelpSeeAlsoPanel extends JPanel { new Dimension(300, theComboBox.getPreferredSize().height)); theComboBox.setEnabled(false); - /* - theComboBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - JComboBox src = (JComboBox) e.getSource(); - System.out.println("Combo: action = " + - e.getActionCommand()); - System.out.println("Combo: mod = " + - e.getModifiers()); - System.out.println("Combo: param = " + - e.paramString()); - System.out.println("Combo: item = " + - src.getSelectedItem()); - } - }); - */ + /* + * theComboBox.addActionListener(new ActionListener() { + * public void actionPerformed(ActionEvent e) { + * JComboBox src = (JComboBox) e.getSource(); + * System.out.println("Combo: action = " + + * e.getActionCommand()); + * System.out.println("Combo: mod = " + + * e.getModifiers()); + * System.out.println("Combo: param = " + + * e.paramString()); + * System.out.println("Combo: item = " + + * src.getSelectedItem()); + * } + * }); + */ p.add(theComboBox, "Center"); selectButton = new pmButton( pmUtility.getResource("Show")); selectButton.setMnemonic( - pmUtility.getIntResource("Show.mnemonic")); + pmUtility.getIntResource("Show.mnemonic")); selectButton.setEnabled(false); - + p.add(selectButton, "East"); selectButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -359,7 +358,7 @@ class pmHelpSeeAlsoPanel extends JPanel { parentPanel = p; layoutBox(); this.setBorder(BorderFactory.createEtchedBorder()); - } + } /* @@ -375,7 +374,7 @@ class pmHelpSeeAlsoPanel extends JPanel { Enumeration e = tags.elements(); while (e.hasMoreElements()) { pmHelpItem i = - pmHelpRepository.helpItemForTag((String) e.nextElement()); + pmHelpRepository.helpItemForTag((String) e.nextElement()); if (i != null) theComboBox.addItem(i); } @@ -387,7 +386,7 @@ class pmHelpSeeAlsoPanel extends JPanel { // repaint(); } - + public void clearItems() { if (theComboBox.getItemCount() > 0) theComboBox.removeAllItems(); @@ -451,7 +450,7 @@ class pmHelpViewPanel extends JPanel { this.add(scrollPane, c); this.setBorder(BorderFactory.createEtchedBorder()); - + /* */ try { @@ -476,7 +475,7 @@ class pmHelpViewPanel extends JPanel { backButton = new pmButton( pmUtility.getResource("Back")); backButton.setMnemonic( - pmUtility.getIntResource("Back.mnemonic")); + pmUtility.getIntResource("Back.mnemonic")); p.add(backButton, pc); backButton.setEnabled(false); backButton.setDefaultCapable(false); @@ -493,7 +492,7 @@ class pmHelpViewPanel extends JPanel { forwardButton = new pmButton( pmUtility.getResource("Forward")); forwardButton.setMnemonic( - pmUtility.getIntResource("Forward.mnemonic")); + pmUtility.getIntResource("Forward.mnemonic")); p.add(forwardButton, pc); forwardButton.setEnabled(false); forwardButton.setDefaultCapable(false); @@ -508,7 +507,7 @@ class pmHelpViewPanel extends JPanel { c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1.0; // c.weighty = 1.0; - c.weighty = 0.05; // NEW + c.weighty = 0.05; // NEW c.fill = GridBagConstraints.BOTH; c.insets = new Insets(0, 10, 5, 10); @@ -518,9 +517,9 @@ class pmHelpViewPanel extends JPanel { add(p, c); - } + } + - public void setItem(String title, pmHelpContent content) { helpView.setText(content.getText()); // scrollPane.getViewport().setViewPosition(new Point(0, 0)); @@ -530,15 +529,15 @@ class pmHelpViewPanel extends JPanel { public void setPos(Point p) { scrollPane.getViewport().setViewPosition(p); } - + public Point getPos() { return scrollPane.getViewport().getViewPosition(); } - + public void setNavButtons(int index, int last) { Debug.message("HELP: NavButtons " + index + " " + last); - if (last > index) + if (last > index) forwardButton.setEnabled(true); else forwardButton.setEnabled(false); @@ -561,7 +560,7 @@ class pmJTextField extends JTextField { class pmHelpHelpOnPanel extends JPanel { pmJTextField helpTopic; - + public pmHelpHelpOnPanel() { helpTopic = new pmJTextField(); @@ -580,11 +579,11 @@ class pmHelpHelpOnPanel extends JPanel { pmUtility.getResource("Help.on:")), "West"); p.add(helpTopic, "Center"); - + JPanel pp = new JPanel(); pp.setLayout(new BorderLayout(0, 0)); pp.add(p, "Center"); - + // this.add(Box.createHorizontalStrut(5)); this.add(pp); // this.add(Box.createHorizontalStrut(5)); @@ -596,26 +595,3 @@ class pmHelpHelpOnPanel extends JPanel { } } - - - - - - - - - - - - - - - - - - - - - - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpFrame.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpFrame.java index 7ee794b6da..094782a99f 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpFrame.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpFrame.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -44,16 +43,16 @@ import com.sun.admin.pm.server.*; public class pmHelpFrame extends pmFrame { - + protected pmHelpController theController = null; public pmButton dismiss = null; // expose for default button hacks - + public pmHelpFrame() { super(pmUtility.getResource("SPM:Help")); theController = new pmHelpController(this); getContentPane().add("Center", theController.getTopPane()); - + dismiss = new pmButton( pmUtility.getResource("Dismiss")); dismiss.setMnemonic( @@ -68,7 +67,7 @@ public class pmHelpFrame extends pmFrame { p.add(dismiss); getContentPane().add("South", p); - + this.pack(); this.setVisible(false); this.repaint(); @@ -76,7 +75,7 @@ public class pmHelpFrame extends pmFrame { // default button is dismiss // getRootPane().setDefaultButton(dismiss); dismiss.setAsDefaultButton(); - + // handle Esc as dismiss getRootPane().registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -92,12 +91,11 @@ public class pmHelpFrame extends pmFrame { this.setVisible(false); } - + public void showHelp(String tag) { theController.showHelpItem(tag); this.setVisible(true); this.repaint(); } - -} +} diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpIndexPanel.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpIndexPanel.java index fa145bcbb9..f97728cc7a 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpIndexPanel.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpIndexPanel.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -49,34 +48,34 @@ public class pmHelpIndexPanel extends JPanel { pmHelpIndexQueryPanel queryPanel; pmHelpIndexResultPanel resultPanel; JLabel textPanels[]; - + public pmHelpIndexPanel(pmHelpController ctrl) { controller = ctrl; // build subpanels queryPanel = new pmHelpIndexQueryPanel(this); resultPanel = new pmHelpIndexResultPanel(this); - + textPanels = new JLabel[4]; textPanels[0] = new JLabel( pmUtility.getResource("To.search.the.index...")); textPanels[1] = new JLabel( pmUtility.getResource("type.your.query.below...")); - + // lay out top panel this.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.insets = new Insets(5, 5, 5, 5); c.gridwidth = GridBagConstraints.REMAINDER; - + c.gridx = 0; c.gridy = 0; - + c.gridheight = 1; // GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.BOTH; c.weightx = 1.0; c.weighty = 0.0; - + JPanel p = new JPanel(); p.setLayout(new GridBagLayout()); GridBagConstraints pc = new GridBagConstraints(); @@ -91,9 +90,9 @@ public class pmHelpIndexPanel extends JPanel { pc.insets = new Insets(0, 5, 5, 5); p.add(textPanels[1], pc); // p.add(textPanels[2]); - + this.add(p, c); - + p = new JPanel(); p.setLayout(new BorderLayout()); p.add(queryPanel, "North"); @@ -104,7 +103,7 @@ public class pmHelpIndexPanel extends JPanel { c.gridheight = 0; c.weighty = 1.0; c.weightx = 0.0; - c.fill = GridBagConstraints.BOTH; + c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.EAST; this.add(p, c); @@ -119,20 +118,20 @@ public class pmHelpIndexPanel extends JPanel { Debug.info("HELP: Tab event!"); if (!(tp.getSelectedComponent() instanceof com.sun.admin.pm.client.pmHelpIndexPanel)) { - Debug.info("HELP: Tab event: resetting default"); - /* - controller.frame.getRootPane(). - setDefaultButton( - controller.frame.dismiss); - */ + Debug.info("HELP: Tab event: resetting default"); + /* + * controller.frame.getRootPane(). + * setDefaultButton( + * controller.frame.dismiss); + */ } else { // allow tab to retain focus // queryPanel.query.requestFocus(); } } }); - - + + } @@ -160,7 +159,7 @@ public class pmHelpIndexPanel extends JPanel { class pmHelpIndexResultPanel extends JPanel { - + JList resultList = null; pmButton selectButton = null; pmHelpIndexPanel parentPanel = null; @@ -168,7 +167,7 @@ class pmHelpIndexResultPanel extends JPanel { public pmHelpIndexResultPanel(pmHelpIndexPanel p) { - + parentPanel = p; this.setLayout(new GridBagLayout()); @@ -180,7 +179,7 @@ class pmHelpIndexResultPanel extends JPanel { c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.NORTHWEST; - + JLabel promptLabel = new JLabel( pmUtility.getResource("Matching.entries:")); /* @@ -188,9 +187,9 @@ class pmHelpIndexResultPanel extends JPanel { * promptLabel.setDisplayedMnemonic( * pmUtility.getIntResource("Matching.entries:.mnemonic")); */ - + this.add(promptLabel, c); - + c.gridy = 1; c.anchor = GridBagConstraints.WEST; @@ -198,18 +197,18 @@ class pmHelpIndexResultPanel extends JPanel { pmUtility.getResource("Show")); selectButton.setMnemonic( pmUtility.getIntResource("Show.mnemonic")); - + selectButton.setEnabled(false); - + this.add(selectButton, c); - + selectButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { pmHelpItem selectedItem = (pmHelpItem) resultList.getSelectedValue(); Debug.message("Selected " + selectedItem); parentPanel.controller.showHelpItem(selectedItem); - } + } }); Vector resultItems = null; @@ -229,15 +228,15 @@ class pmHelpIndexResultPanel extends JPanel { resultList.setVisibleRowCount(8); promptLabel.setLabelFor(resultList); - + resultList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!listEmpty) { selectButton.setEnabled(true); - /* - parentPanel.controller.frame. - getRootPane().setDefaultButton(selectButton); - */ + /* + * parentPanel.controller.frame. + * getRootPane().setDefaultButton(selectButton); + */ selectButton.setAsDefaultButton(); } @@ -265,9 +264,9 @@ class pmHelpIndexResultPanel extends JPanel { c.weightx = c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.EAST; - + this.add(scrollPane, c); - + } void setResultList(Vector v) { @@ -280,10 +279,10 @@ class pmHelpIndexResultPanel extends JPanel { void setListEmpty(boolean e) { listEmpty = e; selectButton.setEnabled(false); - /* - parentPanel.controller.frame.getRootPane(). - setDefaultButton(parentPanel.controller.frame.dismiss); - */ + /* + * parentPanel.controller.frame.getRootPane(). + * setDefaultButton(parentPanel.controller.frame.dismiss); + */ if (parentPanel.controller.frame.dismiss != null) parentPanel.controller.frame.dismiss. setAsDefaultButton(); @@ -308,21 +307,21 @@ class pmHelpIndexQueryPanel extends JPanel { c.fill = GridBagConstraints.NONE; c.weightx = c.weighty = 0.0; c.anchor = GridBagConstraints.WEST; - + c.gridx = 0; c.gridy = 0; c.gridwidth = 1; c.gridheight = 1; c.insets = new Insets(10, 10, 10, 10); - + JLabel promptLabel = new JLabel(pmUtility.getResource("Search.help.index.for:")); /* * MNEMONIC - * promptLabel.setDisplayedMnemonic( - * pmUtility.getIntResource("Search.help.index.for:.mnemonic")); - */ - + * promptLabel.setDisplayedMnemonic( + * pmUtility.getIntResource("Search.help.index.for:.mnemonic")); + */ + this.add(promptLabel, c); query = new JTextField(); @@ -335,7 +334,7 @@ class pmHelpIndexQueryPanel extends JPanel { public void actionPerformed(ActionEvent e) { Debug.info("HELP: Action!"); parentPanel.resultPanel.selectButton.doClick(); - } + } }); c.gridwidth = GridBagConstraints.REMAINDER; @@ -343,14 +342,14 @@ class pmHelpIndexQueryPanel extends JPanel { c.weightx = 1.0; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.EAST; - + this.add(query, c); - + DocumentListener d = new DocumentListener() { public void changedUpdate(DocumentEvent e) { // ignore } - + public void insertUpdate(DocumentEvent e) { handleText(query.getText()); } @@ -359,7 +358,7 @@ class pmHelpIndexQueryPanel extends JPanel { handleText(query.getText()); } }; - + query.getDocument().addDocumentListener(d); } @@ -382,10 +381,3 @@ class pmHelpIndexQueryPanel extends JPanel { // belongs in controller? // static pmHelpRepository helpDB = new pmHelpRepository(); } - - - - - - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpItem.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpItem.java index 5aad616907..94dab47210 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpItem.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpItem.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -55,16 +54,16 @@ class pmHelpItem extends Object { public String toString() { /* - String s = new String("Item: " + tag + "\n"); - s += ("\ttitle: " + title + "\n"); - s += ("\tkeywords: " + keywords + "\n"); - s += ("\tseealso: " + seealso + "\n"); - s += ("\tcontent: " + content + "\n"); - */ + * String s = new String("Item: " + tag + "\n"); + * s += ("\ttitle: " + title + "\n"); + * s += ("\tkeywords: " + keywords + "\n"); + * s += ("\tseealso: " + seealso + "\n"); + * s += ("\tcontent: " + content + "\n"); + */ return title; } - + public void setTag(String s) { if (tag != null) tag = new String(s); @@ -91,5 +90,3 @@ class pmHelpItem extends Object { } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpRepository.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpRepository.java index 99919179fa..45698ff0d5 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpRepository.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpRepository.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -46,7 +45,7 @@ import com.sun.admin.pm.server.*; * helpItemDB: String tag -> pmHelpItem * Returns a pmHelpItem given its unique tag. * Used to resolve a reference from the app. - * + * * helpKeywordDB: String -> Vector(of pmHelpItems) * Returns a Vector containing all pmHelpItems whose `keywords' * property contains the specifed keyword. @@ -75,15 +74,15 @@ final class pmHelpRepository { if (helpItemDB == null) return; - /* - * Strategy: - * for each item - * for each keyword - * if kw not in db - * add ititem.tag - * add item to keyword entry - */ - + /* + * Strategy: + * for each item + * for each keyword + * if kw not in db + * add ititem.tag + * add item to keyword entry + */ + helpKeywordDB = new Hashtable(); Vector v = null; @@ -93,8 +92,8 @@ final class pmHelpRepository { Enumeration keywords = item.keywords.elements(); while (keywords.hasMoreElements()) { String keyword = (String) keywords.nextElement(); - v = (Vector) helpKeywordDB.get(keyword); - if (v == null) + v = (Vector) helpKeywordDB.get(keyword); + if (v == null) helpKeywordDB.put(keyword, v = new Vector()); v.addElement(item); } @@ -108,14 +107,14 @@ final class pmHelpRepository { static void populateHelpTitleDB() { if (helpItemDB == null) return; - - /* - * strategy: - * assume itemDB is loaded - * for each item in itemDB - * create an entry in titleDB - */ - + + /* + * strategy: + * assume itemDB is loaded + * for each item in itemDB + * create an entry in titleDB + */ + helpTitleDB = new BST(); Enumeration items = helpItemDB.elements(); @@ -124,8 +123,8 @@ final class pmHelpRepository { helpTitleDB.insert(item.title, item); } } - - + + static public pmHelpItem helpItemForTag(String tag) { if (helpItemDB == null || tag == null) return null; @@ -147,7 +146,7 @@ final class pmHelpRepository { if (helpTitleDB == null) return new Vector(); - + Vector v = new Vector(); helpTitleDB.traverse_find_vector(v, partialTitle); @@ -194,16 +193,16 @@ final class pmHelpRepository { // Debug.setDebugLevel(new pmHelpRepository(), Debug.ALL); - /* - * strategy: - * for each tag name (from pmHelpTagNameEnumerator): - * get the property values from the resource bundle - */ + /* + * strategy: + * for each tag name (from pmHelpTagNameEnumerator): + * get the property values from the resource bundle + */ Debug.message("HELP: Starting help item load"); - + ResourceBundle bundle = null; - + try { bundle = ResourceBundle.getBundle( "com.sun.admin.pm.client.pmHelpResources"); @@ -211,7 +210,7 @@ final class pmHelpRepository { Debug.fatal("HELP: Could not load pmHelpResources file"); return; } - Enumeration e = bundle.getKeys(); + Enumeration e = bundle.getKeys(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.endsWith(".tag")) { @@ -221,7 +220,7 @@ final class pmHelpRepository { } catch (MissingResourceException x) { Debug.warning("HELP: Unable to find tag for " + key); continue; - } + } Debug.message("HELP: Making new item " + tagName); @@ -240,7 +239,7 @@ final class pmHelpRepository { if (s != null) { v = new Vector(); st = new StringTokenizer(s); - while (st.hasMoreTokens()) + while (st.hasMoreTokens()) v.addElement(st.nextToken()); item.setSeeAlso(v); } @@ -254,13 +253,13 @@ final class pmHelpRepository { String quotelessWord = word.replace('\"', ' '); v.addElement(quotelessWord.trim()); } - } else + } else Debug.warning("HELP: Item " + tagName + " keywords is empty"); // insert item's title words into its keywords - st = new StringTokenizer(theTitle); + st = new StringTokenizer(theTitle); while (st.hasMoreTokens()) { String word = (st.nextToken()).toLowerCase(); @@ -268,7 +267,7 @@ final class pmHelpRepository { if (ignoreKeyTitleWords.indexOf(word) != -1) { Debug.message("HELP: ignoring " + word + " from " + theTitle); - continue; + continue; } Debug.message("HELP: adding " + word + @@ -279,7 +278,7 @@ final class pmHelpRepository { item.setKeywords(v); - + Debug.message("HELP: New item: " + item); helpItemDB.put(item.tag, item); @@ -289,7 +288,7 @@ final class pmHelpRepository { // these words are not to be treated as keywords when they appear in title - static final private String + static final private String /* JSTYLED */ ignoreKeyTitleWords = pmUtility.getResource("help.ignore.words"); } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpSearchPanel.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpSearchPanel.java index bfec055329..03c0aefeba 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpSearchPanel.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmHelpSearchPanel.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -49,14 +48,14 @@ public class pmHelpSearchPanel extends JPanel { pmHelpSearchQueryPanel queryPanel; pmHelpSearchResultPanel resultPanel; JLabel textPanels[]; - + public pmHelpSearchPanel(pmHelpController ctrl) { controller = ctrl; // build subpanels queryPanel = new pmHelpSearchQueryPanel(this); resultPanel = new pmHelpSearchResultPanel(this); - + textPanels = new JLabel[4]; textPanels[0] = new JLabel( pmUtility.getResource("To.find.help.articles...")); @@ -100,20 +99,20 @@ public class pmHelpSearchPanel extends JPanel { resultPanel.setBorder(BorderFactory.createEtchedBorder()); p.add(resultPanel, "Center"); // p.setBorder(BorderFactory.createEtchedBorder()); - + c.gridy = 1; // new stuff c.gridy = GridBagConstraints.RELATIVE; c.gridheight = 0; c.weighty = 1.0; c.weightx = 0.0; - c.fill = GridBagConstraints.BOTH; + c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.EAST; // end new stuff this.add(p, c); this.setBorder(BorderFactory.createEtchedBorder()); - + // figure out when we are tabbed or un-tabbed controller.outerPanel.addChangeListener(new ChangeListener() { @@ -122,18 +121,18 @@ public class pmHelpSearchPanel extends JPanel { Debug.info("HELP: Tab event!"); if (!(tp.getSelectedComponent() instanceof com.sun.admin.pm.client.pmHelpSearchPanel)) { - Debug.info("HELP: Tab event: resetting default"); - /* - controller.frame.getRootPane(). - setDefaultButton( - controller.frame.dismiss); - */ - /* - System.out.println(controller); - System.out.println(controller.frame); - System.out.println(controller.frame.dismiss); - */ - + Debug.info("HELP: Tab event: resetting default"); + /* + * controller.frame.getRootPane(). + * setDefaultButton( + * controller.frame.dismiss); + */ + /* + * System.out.println(controller); + * System.out.println(controller.frame); + * System.out.println(controller.frame.dismiss); + */ + if (controller.frame.dismiss != null) controller.frame.dismiss. setAsDefaultButton(); @@ -143,10 +142,10 @@ public class pmHelpSearchPanel extends JPanel { } } }); - + } - + // place item titles in search result panel public void setSearchResults(Vector items) { Vector v = new Vector(); @@ -197,9 +196,9 @@ class pmHelpSearchResultPanel extends JPanel { * promptLabel.setDisplayedMnemonic( * pmUtility.getIntResource("Search.Results:.mnemonic")); */ - + this.add(promptLabel, c); - + selectButton = new pmButton( pmUtility.getResource("Show")); selectButton.setMnemonic( @@ -221,7 +220,7 @@ class pmHelpSearchResultPanel extends JPanel { c.gridy = 1; c.anchor = GridBagConstraints.SOUTHWEST; this.add(selectButton, c); - + Vector resultItems = new Vector(); @@ -231,15 +230,15 @@ class pmHelpSearchResultPanel extends JPanel { resultList.setVisibleRowCount(8); promptLabel.setLabelFor(resultList); - + resultList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!listEmpty) { selectButton.setEnabled(true); - /* - parentPanel.controller.frame. - getRootPane().setDefaultButton(selectButton); - */ + /* + * parentPanel.controller.frame. + * getRootPane().setDefaultButton(selectButton); + */ selectButton.setAsDefaultButton(); } @@ -269,9 +268,9 @@ class pmHelpSearchResultPanel extends JPanel { c.weightx = c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.WEST; - + this.add(scrollPane, c); - + } public void setResultList(Vector v) { @@ -283,10 +282,10 @@ class pmHelpSearchResultPanel extends JPanel { void setListEmpty(boolean e) { listEmpty = e; selectButton.setEnabled(false); - /* - parentPanel.controller.frame.getRootPane(). - setDefaultButton(parentPanel.controller.frame.dismiss); - */ + /* + * parentPanel.controller.frame.getRootPane(). + * setDefaultButton(parentPanel.controller.frame.dismiss); + */ parentPanel.controller.frame.dismiss.setAsDefaultButton(); } @@ -325,7 +324,7 @@ class pmHelpSearchQueryPanel extends JPanel { * promptLabel.setDisplayedMnemonic( * pmUtility.getIntResource("Keywords:.mnemonic")); */ - + this.add(promptLabel, c); search = new pmButton( @@ -342,7 +341,7 @@ class pmHelpSearchQueryPanel extends JPanel { if (s != null) { v = new Vector(); st = new StringTokenizer(s); - while (st.hasMoreTokens()) + while (st.hasMoreTokens()) v.addElement(st.nextToken()); v = getItemsForKeywords(v); parentPanel.setSearchResults(v); @@ -354,13 +353,13 @@ class pmHelpSearchQueryPanel extends JPanel { Debug.info("HELP: search vector empty"); } } - + } }); - + c.fill = GridBagConstraints.NONE; c.gridx = 2; - c.gridy = 0; // GridBagConstraints.RELATIVE; + c.gridy = 0; // GridBagConstraints.RELATIVE; this.add(search, c); query = new JTextField(); @@ -373,36 +372,36 @@ class pmHelpSearchQueryPanel extends JPanel { public void actionPerformed(ActionEvent e) { Debug.info("HELP: Action!"); pmHelpSearchQueryPanel.this.search.doClick(); - } + } }); query.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { // ignore } - + public void insertUpdate(DocumentEvent e) { // make search the default button Debug.info("HELP: search doc inserted update"); pmHelpSearchQueryPanel.this.search.setEnabled(true); - /* - parentPanel.controller.frame. - getRootPane().setDefaultButton( - pmHelpSearchQueryPanel.this.search); - */ + /* + * parentPanel.controller.frame. + * getRootPane().setDefaultButton( + * pmHelpSearchQueryPanel.this.search); + */ if (pmHelpSearchQueryPanel.this.search != null) pmHelpSearchQueryPanel.this.search. setAsDefaultButton(); - } + } public void removeUpdate(DocumentEvent e) { Debug.info("HELP: search doc removed update"); // restore the default button if (query.getText().length() == 0) { /* - parentPanel.controller.frame. - getRootPane().setDefaultButton( - parentPanel.controller.frame.dismiss); + * parentPanel.controller.frame. + * getRootPane().setDefaultButton( + * parentPanel.controller.frame.dismiss); */ if (parentPanel.controller.frame.dismiss != null) parentPanel.controller.frame.dismiss. @@ -410,20 +409,20 @@ class pmHelpSearchQueryPanel extends JPanel { } } }); - - - c.gridwidth = 1; // GridBagConstraints.REMAINDER; + + + c.gridwidth = 1; // GridBagConstraints.REMAINDER; c.gridx = 1; c.weightx = 1.0; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.EAST; - + this.add(query, c); } - + Vector getItemsForKeywords(Vector keywords) { Vector result = new Vector(); @@ -434,14 +433,14 @@ class pmHelpSearchQueryPanel extends JPanel { String s = (String) words.nextElement(); Vector newItems = pmHelpRepository.helpItemsForKeyword(s); Debug.info("HELP: getItemsForKeywords new items: " + newItems); - + if (newItems != null) { Enumeration items = newItems.elements(); while (items.hasMoreElements()) { pmHelpItem i = (pmHelpItem) items.nextElement(); Debug.info("HELP: getItemsForKeywords result: " + result); Debug.info("HELP: getItemsForKeywords item: " + i); - + if (!result.contains(i)) result.addElement(i); } @@ -450,4 +449,3 @@ class pmHelpSearchQueryPanel extends JPanel { return result; } } - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmIncompleteFormException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmIncompleteFormException.java index f242c95ec7..48926b44e8 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmIncompleteFormException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmIncompleteFormException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * All rights reserved. * * pmIncompleteFormException.java - * + * */ package com.sun.admin.pm.client; @@ -42,5 +41,3 @@ class pmIncompleteFormException extends pmGuiException { super(); } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmInstallPrinter.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmInstallPrinter.java index ab50b4ab75..bf834be71b 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmInstallPrinter.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmInstallPrinter.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -88,17 +87,17 @@ public class pmInstallPrinter extends pmInstallScreen { String actionName = null; - // where to place initial focus + // where to place initial focus Component defaultComponent = null; boolean usePPD; boolean useLocalhost; - + public pmInstallPrinter(pmTop myTop, int action) throws pmGuiException { boolean failed = false; boolean cacheerr = false; boolean ppdincacheerr = false; - + this.myTop = myTop; this.action = action; workingPrinter = new Printer(myTop.ns); @@ -121,7 +120,7 @@ public class pmInstallPrinter extends pmInstallScreen { actionName = pmUtility.getResource("New.Attached.Printer"); break; - + case Constants.ADDNETWORK: Debug.message("CLNT:pmInstPr: ADD NETWORK"); @@ -188,17 +187,17 @@ public class pmInstallPrinter extends pmInstallScreen { // error popup? // throw something? } - + pmCalls.debugShowPrinter(workingPrinter); dumpLogs("ModifyAttached()"); - + if (workingPrinter.getPPD() != null) helpTag = "ModifyPPD"; else helpTag = "Modify"; // helpTag = "ModifyAttached"; - + actionName = pmUtility.getResource("Modify.Printer.Properties"); break; @@ -217,7 +216,7 @@ public class pmInstallPrinter extends pmInstallScreen { } catch (Exception e) { failed = true; Debug.message("CLNT:pmInstPr:ModifyNetwork caught " + e); - } + } gatherLogs(workingPrinter); @@ -225,7 +224,7 @@ public class pmInstallPrinter extends pmInstallScreen { // error popup? // throw new pmGuiException(); } - + pmCalls.debugShowPrinter(workingPrinter); dumpLogs("ModifyNetwork()"); @@ -236,7 +235,7 @@ public class pmInstallPrinter extends pmInstallScreen { // helpTag = "ModifyNetwork"; actionName = pmUtility.getResource("Modify.Printer.Properties"); - + break; case Constants.MODIFYREMOTE: @@ -259,7 +258,7 @@ public class pmInstallPrinter extends pmInstallScreen { // error popup? // throw something? } - + if (workingPrinter.getPPD() != null) helpTag = "ModifyPPD"; @@ -269,9 +268,9 @@ public class pmInstallPrinter extends pmInstallScreen { actionName = pmUtility.getResource("Modify.Printer.Properties"); break; - + } - + // ensure that pmButton hashtable gets cleaned up frame.setClearButtonsOnClose(true); @@ -297,11 +296,11 @@ public class pmInstallPrinter extends pmInstallScreen { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + if (action == Constants.ADDLOCAL || action == Constants.ADDNETWORK) { defaultComponent = pnameText; } else { - defaultComponent = descText; + defaultComponent = descText; } frame.setDefaultComponent(defaultComponent); @@ -326,12 +325,12 @@ public class pmInstallPrinter extends pmInstallScreen { public accessListModel() { numColumns = getColumnCount(); } - + public void addaccessList(String data[]) { for (int i = 0; i < data.length; i++) { access.addElement(data[i]); - + } } @@ -398,19 +397,19 @@ public class pmInstallPrinter extends pmInstallScreen { public void centerPanel() { JPanel center = new JPanel(); - + accessModel = new accessListModel(); accessList = new JList(accessModel); accessList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - + center.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); ListSelectionModel rowSelectModel = accessList.getSelectionModel(); rowSelectModel.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { - ListSelectionModel accessSM = + ListSelectionModel accessSM = (ListSelectionModel)e.getSource(); } }); @@ -443,8 +442,8 @@ public class pmInstallPrinter extends pmInstallScreen { center.add(ascrollPane, c); // Create Textfield - c.gridx = 1; - c.gridy = 1; + c.gridx = 1; + c.gridy = 1; c.ipadx = 15; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.WEST; @@ -457,7 +456,7 @@ public class pmInstallPrinter extends pmInstallScreen { c.gridy = 2; adButtons(c); - + c.gridwidth = 1; center.add(addButton, c); @@ -474,7 +473,7 @@ public class pmInstallPrinter extends pmInstallScreen { GridBagConstraints c = new GridBagConstraints(); northPanelConstraints(c); - + // Define the constraints and create the labels // All Add/Modify @@ -557,7 +556,7 @@ public class pmInstallPrinter extends pmInstallScreen { c.gridy = 0; // Printer Name and Server Name - if ((action == Constants.ADDLOCAL) || + if ((action == Constants.ADDLOCAL) || (action == Constants.ADDNETWORK)) { TextFieldConstraints(c); @@ -585,7 +584,7 @@ public class pmInstallPrinter extends pmInstallScreen { // Description TextFieldConstraints(c); descriptionField(north, c); - if (action == Constants.MODIFYATTACHED || + if (action == Constants.MODIFYATTACHED || action == Constants.MODIFYNETWORK || action == Constants.MODIFYREMOTE) { if (workingPrinter.getComment() != null) @@ -689,7 +688,7 @@ public class pmInstallPrinter extends pmInstallScreen { defaultp.doClick(); } } - + add("North", north); } @@ -697,7 +696,7 @@ public class pmInstallPrinter extends pmInstallScreen { String p = workingPrinter.getProtocol(); if (p != null) { - if (p.equals("bsd")) + if (p.equals("bsd")) protocolCombo.setSelectedItem("BSD"); else if (p.equals("tcp")) protocolCombo.setSelectedItem("TCP"); @@ -730,7 +729,7 @@ public class pmInstallPrinter extends pmInstallScreen { public void setFault() { String fault = workingPrinter.getNotify(); - if (fault == null || fault == "none") + if (fault == null || fault == "none") faultCombo.setSelectedItem( pmUtility.getResource("None")); @@ -783,7 +782,7 @@ public class pmInstallPrinter extends pmInstallScreen { filecontents = filecontents.concat(filedata[i]); } - Debug.message("CLNT:pmInstPr:setType: filecontents = " + + Debug.message("CLNT:pmInstPr:setType: filecontents = " + filecontents); if (filecontents.equals("postscript")) { @@ -820,7 +819,7 @@ public class pmInstallPrinter extends pmInstallScreen { if (type == null) return; - + if (type.equals("PS")) { typeCombo.setSelectedItem("PostScript"); } else if (type.equals("hplaser")) { @@ -905,12 +904,12 @@ public class pmInstallPrinter extends pmInstallScreen { Debug.warning( "CLNT:pmInstPr:getLocalHostName exception " + e); } - + Debug.message( "CLNT:pmInstPr:getPrinterServer(): printer is: " + printer); Debug.message( "CLNT:pmInstPr:getPrinterServer(): server is: " + server); - + } public void getPort() throws pmGuiException { @@ -974,7 +973,7 @@ public class pmInstallPrinter extends pmInstallScreen { } public void getUserAccess() { - + if (accessModel.getRowCount() != 0) { useraccesslist = new String[accessModel.getRowCount()]; accessModel.accesstoArray(useraccesslist); @@ -1066,7 +1065,7 @@ public class pmInstallPrinter extends pmInstallScreen { lp = new String("mail"); else if (n.equals(pmUtility.getResource("None"))) lp = new String("none"); - + } else { Debug.message( "CLNT:pmInstPr:gui2lpfaultn():input faultnotify null"); @@ -1150,10 +1149,10 @@ public class pmInstallPrinter extends pmInstallScreen { a[0] = new String("none"); workingPrinter.setUserAllowList(a); } - + if (defaultp != null) workingPrinter.setIsDefaultPrinter(defaultp.isSelected()); - + if (banner != null) workingPrinter.setBanner(gui2lpbanner(banner)); @@ -1177,7 +1176,7 @@ public class pmInstallPrinter extends pmInstallScreen { Debug.message(who + " warnings: " + warnLog); Debug.message(who + " errors: " + errorLog); } - + public void doAddLocal() throws pmGuiException { @@ -1208,7 +1207,7 @@ public class pmInstallPrinter extends pmInstallScreen { exist = PrinterUtil.exists(printer, myTop.ns); } catch (Exception e) { throw new pmGuiException(); - } + } if (exist) { throw new pmPrinterExistsException(); @@ -1228,7 +1227,7 @@ public class pmInstallPrinter extends pmInstallScreen { } - + public void doAddNetwork() throws pmGuiException { try { getPrinterServer(); @@ -1248,7 +1247,7 @@ public class pmInstallPrinter extends pmInstallScreen { } boolean exist = false; - + try { exist = PrinterUtil.exists(printer, myTop.ns); } catch (Exception e) { @@ -1277,7 +1276,7 @@ public class pmInstallPrinter extends pmInstallScreen { } } - + public void doModifyLocalAttached() throws pmGuiException { getDescription(); getFault(); @@ -1357,15 +1356,15 @@ public class pmInstallPrinter extends pmInstallScreen { } - + public void doClearFields() { if (pnameText != null) - pnameText.setText(""); + pnameText.setText(""); if (snameText != null) - snameText.setText(""); + snameText.setText(""); if (descText != null) - descText.setText(""); + descText.setText(""); if (portCombo != null) portCombo.setSelectedIndex(0); if (makeCombo != null) @@ -1381,7 +1380,7 @@ public class pmInstallPrinter extends pmInstallScreen { if (protocolCombo != null) protocolCombo.setSelectedIndex(0); if (destText != null) - destText.setText(""); + destText.setText(""); if (defaultp.isSelected()) defaultp.doClick(); @@ -1433,7 +1432,7 @@ public class pmInstallPrinter extends pmInstallScreen { if (action == Constants.MODIFYNETWORK) setNetworkInfo(); - + try { accessModel.removeListEntries(); accessModel.addaccessList( @@ -1455,10 +1454,10 @@ public class pmInstallPrinter extends pmInstallScreen { } // selected and printer object out of sync - if ((defaultp.isSelected() && + if ((defaultp.isSelected() && !workingPrinter.getIsDefaultPrinter()) || - (!defaultp.isSelected() && + (!defaultp.isSelected() && workingPrinter.getIsDefaultPrinter())) defaultp.doClick(); @@ -1490,7 +1489,7 @@ public class pmInstallPrinter extends pmInstallScreen { } // as a side effect, the OK button will regain default status - if (defaultComponent != null) + if (defaultComponent != null) defaultComponent.requestFocus(); } @@ -1555,7 +1554,7 @@ public class pmInstallPrinter extends pmInstallScreen { workingPrinter.getPrinterDetails(); Debug.message( "CLNT:pmInstPr:Printer Details: server is " + - workingPrinter.getPrintServer()); + workingPrinter.getPrintServer()); doModifyLocalAttached(); break; case Constants.MODIFYNETWORK: @@ -1580,14 +1579,14 @@ public class pmInstallPrinter extends pmInstallScreen { throw new pmIncompleteFormException(); } catch (pmPrinterExistsException ee) { pmMessageDialog m = new pmMessageDialog( - frame, + frame, pmUtility.getResource("Error"), pmUtility.getResource( "The.specified.printer.already.exists.")); m.setVisible(true); } catch (pmNullSelectedPrinterException ne) { pmMessageDialog m = new pmMessageDialog( - frame, + frame, pmUtility.getResource("Error"), pmUtility.getResource( "The.selected.printer.does.not.exist.")); @@ -1596,43 +1595,43 @@ public class pmInstallPrinter extends pmInstallScreen { // frame.dispose(); } catch (pmAddPrinterFailedException ae) { pmMessageDialog m = new pmMessageDialog( - frame, + frame, pmUtility.getResource("Error"), ae.getMessage(), myTop, - "AddPrinterFailed"); + "AddPrinterFailed"); m.setVisible(true); - + } catch (pmModifyPrinterFailedException me) { pmMessageDialog m = new pmMessageDialog( - frame, + frame, pmUtility.getResource("Error"), me.getMessage(), myTop, - "ModifyFailed"); + "ModifyFailed"); m.setVisible(true); } catch (pmGuiException ge) { pmMessageDialog m = new pmMessageDialog( - frame, + frame, pmUtility.getResource("Application.Error"), ge.toString()); m.setVisible(true); } catch (pmCmdFailedException cfe) { String msg = cfe.getMessage(); - if (msg == null || msg.length() == 0) + if (msg == null || msg.length() == 0) msg = pmUtility.getResource( "error.message.command-failed"); - + pmMessageDialog m = new pmMessageDialog( - frame, + frame, pmUtility.getResource("Command.Failed.Error"), msg); m.setVisible(true); } catch (Exception e) { pmMessageDialog m = new pmMessageDialog( - frame, + frame, pmUtility.getResource("Unknown.Application.Error"), e.toString()); m.setVisible(true); @@ -1684,7 +1683,7 @@ public class pmInstallPrinter extends pmInstallScreen { o.setVisible(true); if (o.getValue() == JOptionPane.OK_OPTION) { port = o.deviceName.getText(); - int idx = portCombo.getItemCount(); + int idx = portCombo.getItemCount(); try { if (!port.equals("") && Valid.device(port)) { portCombo.insertItemAt( @@ -1743,7 +1742,7 @@ public class pmInstallPrinter extends pmInstallScreen { Debug.message( "CLNT: makemodel[1] = " + makemodel[1]); - if (idx != -1) + if (idx != -1) tmake = new String(makemodel[0].substring(0, idx)); else tmake = new String(makemodel[0]); @@ -1804,14 +1803,14 @@ public class pmInstallPrinter extends pmInstallScreen { // Make to front of model if (!havemodel) { for (i = 0; i < models.length; i++) { - if (models[i].equalsIgnoreCase( - tmake.trim() + + if (models[i].equalsIgnoreCase( + tmake.trim() + " " + makemodel[1].trim())) { havemodel = true; addmake = true; - - } - } + + } + } } if (havemodel) { @@ -1824,15 +1823,15 @@ public class pmInstallPrinter extends pmInstallScreen { modelCombo.setSelectedItem(tmake.trim() + " " + makemodel[1]); Debug.message("CLNT:pmInstPr:model is " + - tmake.trim() + " " + makemodel[1]); + tmake.trim() + " " + makemodel[1]); } - + } } } } } - } + } } } @@ -1861,7 +1860,7 @@ public class pmInstallPrinter extends pmInstallScreen { pmMessageDialog m = new pmMessageDialog( frame, pmUtility.getResource("Error"), - pmUtility.getResource( + pmUtility.getResource( "Invalid.printer.type."), myTop, "PrinterType"); @@ -2016,12 +2015,12 @@ public class pmInstallPrinter extends pmInstallScreen { m.setVisible(true); } else { - if (accessModel.getRowCount() > 0 && + if (accessModel.getRowCount() > 0 && (accessModel.getElementAt(0).equals("all") || - accessModel.getElementAt(0).equals("none"))) + accessModel.getElementAt(0).equals("none"))) accessModel.removeRow(0); - if (trimtmp.equals("all") || + if (trimtmp.equals("all") || trimtmp.equals("none")) { accessModel.removeListEntries(); } @@ -2090,7 +2089,7 @@ public class pmInstallPrinter extends pmInstallScreen { Debug.message("CLNT:pmInstPr:actionokButton()"); boolean incomplete = false; - try { + try { doAction(); } catch (pmLoginFailedException le) { // User already notified @@ -2103,9 +2102,9 @@ public class pmInstallPrinter extends pmInstallScreen { } if (!incomplete) { - cleanup(); - myTop.pmsetdefaultpLabel(); - Debug.message("CLNT:pmInstPr:actionokbutton(): work done"); + cleanup(); + myTop.pmsetdefaultpLabel(); + Debug.message("CLNT:pmInstPr:actionokbutton(): work done"); pmCalls.debugShowPrinter(workingPrinter); frame.setVisible(false); frame.repaint(); @@ -2114,12 +2113,12 @@ public class pmInstallPrinter extends pmInstallScreen { myTop.scrollPane.repaint(); } } - + public void actionapplyButton() { Debug.message("CLNT:pmInstPr:actionapplyButton()"); - try { + try { doAction(); } catch (pmLoginFailedException le) { // User already notified @@ -2134,8 +2133,8 @@ public class pmInstallPrinter extends pmInstallScreen { myTop.scrollPane.revalidate(); myTop.scrollPane.repaint(); } - - + + public void actionresetButton() { Debug.message("CLNT:pmInstPr:actionresetButton()"); doReset(); @@ -2148,8 +2147,8 @@ public class pmInstallPrinter extends pmInstallScreen { frame.setVisible(false); frame.repaint(); // frame.dispose(); - } - + } + public void actionhelpButton() { Debug.message("CLNT:pmInstPr:actionhelpButton()"); myTop.showHelpItem(helpTag); diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmInstallScreen.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmInstallScreen.java index a52fdfc4d5..5527d4913b 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmInstallScreen.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmInstallScreen.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -121,7 +120,7 @@ public class pmInstallScreen extends pmButtonScreen { String devices[]; int i; - try { + try { devices = PrinterUtil.getDeviceList(); } catch (Exception e) { Debug.warning("CLNT: pmAccess:getDeviceList caught " + e); @@ -136,7 +135,7 @@ public class pmInstallScreen extends pmButtonScreen { portCombo.addActionListener(new ComboListener(Constants.PORT)); north.add(portCombo, c); - + } public void printertypeLabel(JPanel north, GridBagConstraints c) { north.add(new JLabel @@ -235,7 +234,7 @@ public class pmInstallScreen extends pmButtonScreen { } public void faultnotField(JPanel north, GridBagConstraints c) { faultCombo = new JComboBox(); - + faultCombo.addItem(pmUtility.getResource("Write.to.Superuser")); faultCombo.addItem(pmUtility.getResource("Mail.to.Superuser")); faultCombo.addItem(pmUtility.getResource("None")); @@ -281,10 +280,10 @@ public class pmInstallScreen extends pmButtonScreen { public void optionsFields(JPanel north, GridBagConstraints c) { defaultp = new JCheckBox( pmUtility.getResource("Default.Printer")); - + north.add(defaultp, c); - - c.gridy++; + + c.gridy++; bannerCombo = new JComboBox(); bannerCombo.addItem(pmUtility.getResource ("Always.Print.Banner")); @@ -292,14 +291,14 @@ public class pmInstallScreen extends pmButtonScreen { ("User.Selectable.Default.On")); bannerCombo.addItem(pmUtility.getResource ("Never.Print.Banner")); - + north.add(bannerCombo, c); } public void defaultoptionField(JPanel north, GridBagConstraints c) { defaultp = new JCheckBox( pmUtility.getResource("Default.Printer")); - + north.add(defaultp, c); } @@ -345,7 +344,7 @@ public class pmInstallScreen extends pmButtonScreen { } public void actionPerformed(ActionEvent e) { - + switch (activeCombo) { case Constants.PORT: @@ -392,7 +391,7 @@ public class pmInstallScreen extends pmButtonScreen { } public void actionPerformed(ActionEvent e) { - + switch (activeButton) { case Constants.ADD: @@ -428,14 +427,14 @@ public class pmInstallScreen extends pmButtonScreen { } public void xxcenterPanel() { - + JPanel center = new JPanel(); center.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); - + c.insets = new Insets(15, 15, 15, 15); c.anchor = GridBagConstraints.WEST; - + // Create the label c.gridx = 0; c.gridy = 0; @@ -444,18 +443,18 @@ public class pmInstallScreen extends pmButtonScreen { c.anchor = GridBagConstraints.NORTHWEST; center.add(new JLabel (pmUtility.getResource("User.Access.List:")), c); - + // Create the User Access List as JList userList = new JList(); JScrollPane scrollPane = new JScrollPane(); scrollPane.getViewport().setView(userList); - + c.gridwidth = 2; c.gridx = 1; c.weightx = c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; center.add(scrollPane, c); - + // Create the text field for adding users c.gridx = 1; c.gridy = 1; @@ -466,7 +465,7 @@ public class pmInstallScreen extends pmButtonScreen { userText = new pmTextField(25); center.add(userText, c); - + // Create the add/delete buttons c.gridx = 1; c.gridy = 2; @@ -481,7 +480,7 @@ public class pmInstallScreen extends pmButtonScreen { deleteButton.addActionListener( new adddelButtonListener(Constants.DELETE)); - + c.gridwidth = 1; center.add(addButton, c); @@ -489,7 +488,7 @@ public class pmInstallScreen extends pmButtonScreen { center.add(deleteButton, c); add("Center", center); - + } } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLoad.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLoad.java index dd4b81909d..f9b0ecdd96 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLoad.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLoad.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -56,12 +55,12 @@ public class pmLoad extends JPanel { JComboBox nameserviceCombo = new JComboBox(); pmTop mytop = null; int resetIndex; - + pmButton okButton = null; pmButton cancelButton = null; pmButton resetButton = null; pmButton helpButton = null; - + public pmLoad(pmTop mytop) { this.mytop = mytop; @@ -73,7 +72,7 @@ public class pmLoad extends JPanel { northPanel(); southPanel(); - + } public void northPanel() { @@ -98,13 +97,13 @@ public class pmLoad extends JPanel { nameserviceCombo.addItem("files"); - if (mytop.nisns != null) + if (mytop.nisns != null) nameserviceCombo.addItem("NIS"); - if (mytop.nisplusns != null) + if (mytop.nisplusns != null) nameserviceCombo.addItem("NIS+"); - if (mytop.ldapns != null) + if (mytop.ldapns != null) nameserviceCombo.addItem("LDAP"); nameserviceCombo.setSelectedIndex(mytop.actionindex); @@ -112,7 +111,7 @@ public class pmLoad extends JPanel { nameserviceCombo.addActionListener(new nsListener()); nameserviceCombo.addItemListener(mytop.new topnsListener()); - + add("North", north); } @@ -148,12 +147,12 @@ public class pmLoad extends JPanel { c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(15, 15, 15, 15); c.gridy = 0; - + okButton = new pmButton( pmUtility.getResource("OK")); okButton.setMnemonic( pmUtility.getIntResource("OK.mnemonic")); - + resetButton = new pmButton( pmUtility.getResource("Reset")); resetButton.setMnemonic( @@ -168,12 +167,12 @@ public class pmLoad extends JPanel { pmUtility.getResource("Help")); helpButton.setMnemonic( pmUtility.getIntResource("Help.mnemonic")); - + okButton.addActionListener(new ButtonListener(OK)); resetButton.addActionListener(new ButtonListener(RESET)); cancelButton.addActionListener(new ButtonListener(CANCEL)); helpButton.addActionListener(new ButtonListener(HELP)); - + c.gridx = 0; south.add(okButton, c); c.gridx = 1; @@ -182,7 +181,7 @@ public class pmLoad extends JPanel { south.add(cancelButton, c); c.gridx = 3; south.add(helpButton, c); - + add("South", south); } @@ -196,12 +195,12 @@ public class pmLoad extends JPanel { } // Select Active Button and call routine - + public void actionPerformed(ActionEvent e) { switch (activeButton) { - case OK: + case OK: actionokButton(); break; case RESET: @@ -214,14 +213,14 @@ public class pmLoad extends JPanel { actionhelpButton(); break; } - + } } public void pmScreendispose() { frame.dispose(); } - + // Action for buttons public void actionokButton() { @@ -268,14 +267,14 @@ public class pmLoad extends JPanel { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + // default button is always OK, for now... okButton.setAsDefaultButton(); frame.setDefaultComponent(nameserviceCombo); - + nameserviceCombo.requestFocus(); - + frame.setVisible(true); frame.repaint(); diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLogDisplay.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLogDisplay.java index 93976a72ee..fc23e6a8c0 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLogDisplay.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLogDisplay.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -48,7 +47,7 @@ public class pmLogDisplay extends pmFrame { pmTop theTop = null; String helpTag = null; JTextArea theList = null; - String theContents = null; + String theContents = null; public pmLogDisplay() { this(null, null); @@ -57,18 +56,18 @@ public class pmLogDisplay extends pmFrame { public pmLogDisplay(pmTop t, String h) { super(pmUtility.getResource("SPM:Command-Line.Console")); - + theTop = t; helpTag = h; - - setLocation(150, 200); // relative to parent frame - + + setLocation(150, 200); // relative to parent frame + // top panel JPanel p = new JPanel(); p.setLayout(new BorderLayout()); theContents = new String(); - theList = new JTextArea(12, 36); + theList = new JTextArea(12, 36); theList.setLineWrap(false); theList.setEditable(false); @@ -78,22 +77,22 @@ public class pmLogDisplay extends pmFrame { }}, KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, Event.CTRL_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); - + theList.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { copyPressed(); }}, KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); - + JScrollPane scroll = new JScrollPane(); scroll.getViewport().setView(theList); p.add(scroll, "Center"); - + this.getContentPane().add(p, "Center"); - + p = new JPanel(); okButton = new pmButton( @@ -118,14 +117,14 @@ public class pmLogDisplay extends pmFrame { public void actionPerformed(ActionEvent evt) { Debug.message("Help button event"); theTop.showHelpItem(helpTag); - } + } }); } - + this.getContentPane().add(p, "South"); this.pack(); - + this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { returnValue = JOptionPane.CLOSED_OPTION; @@ -134,7 +133,7 @@ public class pmLogDisplay extends pmFrame { pmLogDisplay.this.theTop.setLogOption(false); } }); - + okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { okPressed(); @@ -155,7 +154,7 @@ public class pmLogDisplay extends pmFrame { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + // getRootPane().setDefaultButton(okButton); okButton.setAsDefaultButton(); @@ -167,7 +166,7 @@ public class pmLogDisplay extends pmFrame { theList.copy(); } - + protected void okPressed() { returnValue = JOptionPane.OK_OPTION; pmLogDisplay.this.setVisible(false); @@ -180,7 +179,7 @@ public class pmLogDisplay extends pmFrame { return returnValue; } - // i.e. a solid line, or spaces, or... + // i.e. a solid line, or spaces, or... public void addSeparator() { theContents = theContents + "\n\r"; theList.setText(theContents); @@ -194,39 +193,39 @@ public class pmLogDisplay extends pmFrame { * StringTokenizer st = new StringTokenizer(s, "\n\r", false); * try { * while(st.hasMoreTokens()) { - * String ss = st.nextToken(); - * theContents.addElement(ss); - * } + * String ss = st.nextToken(); + * theContents.addElement(ss); + * } * } catch(Exception x) { - * Debug.warning("CLNT: Log addText caught: " + x); + * Debug.warning("CLNT: Log addText caught: " + x); * } - */ + */ /* * Debug.message("Log contents len = " + theContents.size()); * for (int i = 0; i < theContents.size(); ++i) * Debug.message("\t" + i + ": " + theContents.elementAt(i)); */ - + // conveniently, this forces the last line to be scrolled to. theList.setText(theContents); - - } - public void clear() { + } + + public void clear() { theContents = null; theContents = new String(); theList.setText(theContents); } - + public void disableText(boolean d) { // theText.setEnabled(!d); } - + public static void main(String[] args) { JFrame f = new JFrame("Test Dialog"); f.setSize(300, 100); - + f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { System.exit(0); @@ -243,5 +242,3 @@ public class pmLogDisplay extends pmFrame { protected int returnValue = JOptionPane.CLOSED_OPTION; } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLogin.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLogin.java index fbb50a69b2..97f3dca8b8 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLogin.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLogin.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -52,11 +51,11 @@ public class pmLogin extends pmDialog { protected pmButton okButton = null; protected pmButton cancelButton = null; protected pmButton helpButton = null; - + public pmLogin(JFrame f, String title, String msg) { this(f, title, msg, null, null); } - + public pmLogin(JFrame f, String title, String msg, pmTop t, String h) { super(f, title, true); // modal @@ -64,7 +63,7 @@ public class pmLogin extends pmDialog { theTop = t; theTag = h; theFrame = f; - + JLabel l; JPanel p; @@ -80,13 +79,13 @@ public class pmLogin extends pmDialog { // top panel contains the desired message p = new JPanel(); p.setLayout(new GridBagLayout()); - + l = new JLabel(msg, SwingConstants.CENTER); p.add(l, c); this.getContentPane().add(p, "North"); - // NIS middle panel - // contains username and password + // NIS middle panel + // contains username and password if (t.ns.getNameService().equals("nis")) { p = new JPanel(); @@ -99,7 +98,7 @@ public class pmLogin extends pmDialog { l = new JLabel(pmUtility.getResource("Username:"), SwingConstants.RIGHT); p.add(l, c); - + l = new JLabel(pmUtility.getResource("Password:"), SwingConstants.RIGHT); p.add(l, c); @@ -141,28 +140,28 @@ public class pmLogin extends pmDialog { p.add(passwordField, c); passwordField.setEchoChar('*'); - + this.getContentPane().add(p, "Center"); } else if (t.ns.getNameService().equals("ldap")) { - + // middle panel contains LDAP server name, distinguished name, // and password p = new JPanel(); p.setLayout(new GridBagLayout()); - + // LDAP Server Name l = new JLabel(pmUtility.getResource("LDAP.Server:"), SwingConstants.RIGHT); p.add(l, c); - + serverField = new pmTextField(25); serverField.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okPressed(); } }); - + String ldapMaster; try { ldapMaster = theTop.host.getLDAPMaster(); @@ -170,26 +169,26 @@ public class pmLogin extends pmDialog { ldapMaster = new String(""); Debug.warning( "pmLdap: getLDAPMaster() returns exception: " + e); - } - + } + serverField.setText(ldapMaster); c.gridx = 1; p.add(serverField, c); - - + + // Distinguished Name c.gridx = 0; l = new JLabel(pmUtility.getResource("Distinguished.Name:"), SwingConstants.RIGHT); p.add(l, c); - + dnField = new pmTextField(25); dnField.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okPressed(); } }); - + String defaultDN; try { defaultDN = theTop.host.getDefaultAdminDN(); @@ -197,18 +196,18 @@ public class pmLogin extends pmDialog { defaultDN = new String(""); Debug.warning( "pmLdap: getDefaultAdminDN() returns exception: " + e); - } - + } + dnField.setText(defaultDN); c.gridx = 1; p.add(dnField, c); - - // Password + + // Password c.gridx = 0; l = new JLabel(pmUtility.getResource("Password:"), SwingConstants.RIGHT); p.add(l, c); - + passwordField = new JPasswordField(12); passwordField.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -218,18 +217,18 @@ public class pmLogin extends pmDialog { l.setLabelFor(passwordField); // for consistency, don't implement this until all are... // l.setDisplayedMnemonic( - // pmUtility.getIntResource("Password.mnemonic")); - + // pmUtility.getIntResource("Password.mnemonic")); + c.gridx = 1; c.weightx = 1.0; - + c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.CENTER; c.gridy = GridBagConstraints.RELATIVE; - + p.add(passwordField, c); passwordField.setEchoChar('*'); - + this.getContentPane().add(p, "Center"); } @@ -277,7 +276,7 @@ public class pmLogin extends pmDialog { helpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { helpPressed(); - } + } }); thePanel.add(helpButton, c); } @@ -299,14 +298,14 @@ public class pmLogin extends pmDialog { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + // lay out the dialog this.pack(); // set focus and defaults after packing... // this.getRootPane().setDefaultButton(okButton); okButton.setAsDefaultButton(); - + passwordField.requestFocus(); } @@ -352,7 +351,7 @@ public class pmLogin extends pmDialog { public void okPressed() { - // For LDAP, Check Server, Distinguished Name and Password + // For LDAP, Check Server, Distinguished Name and Password boolean complete = true; if (theTop.ns.getNameService().equals("ldap")) { @@ -376,7 +375,7 @@ public class pmLogin extends pmDialog { pmLogin.this.setVisible(false); } } - + public void cancelPressed() { @@ -393,7 +392,7 @@ public class pmLogin extends pmDialog { public void helpPressed() { theTop.showHelpItem(theTag); } - + public static void main(String[] args) { JFrame f = new JFrame("Password test"); @@ -420,5 +419,5 @@ public class pmLogin extends pmDialog { public pmTextField dnField = null; protected int returnValue = JOptionPane.CLOSED_OPTION; - + } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLoginFailedException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLoginFailedException.java index 513322d4e6..2c769eeb37 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLoginFailedException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmLoginFailedException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * All rights reserved. * * pmLoginFailedException.java - * + * */ package com.sun.admin.pm.client; @@ -42,5 +41,3 @@ class pmLoginFailedException extends pmGuiException { super(); } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmMessageDialog.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmMessageDialog.java index 32fd19a3b2..8f46a3f3e8 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmMessageDialog.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmMessageDialog.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -50,22 +49,22 @@ public class pmMessageDialog extends pmDialog { public pmMessageDialog(String title, String msg) { this(null, title, msg, null, null); } - + public pmMessageDialog(Frame f, String title, String msg) { this(f, title, msg, null, null); } - - public pmMessageDialog(Frame f, - String title, - String msg, - pmTop top, + + public pmMessageDialog(Frame f, + String title, + String msg, + pmTop top, String h) { - super(f, title, true); // modal + super(f, title, true); // modal theTop = top; helpTag = h; - + // initialize constraints GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; @@ -90,11 +89,11 @@ public class pmMessageDialog extends pmDialog { Vector v = new Vector(); Debug.message("CLNT: MessageDialog: " + title + " , " + msg); - + if (msg != null) { StringTokenizer st = new StringTokenizer(msg, "\n", false); try { - while (st.hasMoreTokens()) + while (st.hasMoreTokens()) v.addElement(st.nextToken()); } catch (Exception x) { Debug.warning("CLNT: pmMessageDialog caught " + x); @@ -103,12 +102,12 @@ public class pmMessageDialog extends pmDialog { } theText.setBackground(p.getBackground()); - + // p.add(theText, "Center"); p.add(theText, c); - + this.getContentPane().add(p, "Center"); - + okButton = new pmButton( pmUtility.getResource("Dismiss")); okButton.setMnemonic( @@ -130,7 +129,7 @@ public class pmMessageDialog extends pmDialog { p = new JPanel(); p.add(okButton); - + if (theTop != null && helpTag != null) { helpButton = new pmButton( pmUtility.getResource("Help")); @@ -140,10 +139,10 @@ public class pmMessageDialog extends pmDialog { helpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { theTop.showHelpItem(helpTag); - } + } }); } - + this.getContentPane().add(p, "South"); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { @@ -155,13 +154,13 @@ public class pmMessageDialog extends pmDialog { // this.getRootPane().setDefaultButton(okButton); okButton.setAsDefaultButton(); - + // okButton.requestFocus(); okButton.grabFocus(); } - + protected void actionOKButton() { returnValue = JOptionPane.OK_OPTION; pmMessageDialog.this.setVisible(false); @@ -176,7 +175,7 @@ public class pmMessageDialog extends pmDialog { public static void main(String[] args) { JFrame f = new JFrame("Test Dialog"); f.setSize(300, 100); - + f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { System.exit(0); @@ -189,15 +188,15 @@ public class pmMessageDialog extends pmDialog { System.out.println("creating a new dialog instance..."); pmMessageDialog d = new pmMessageDialog(null, - "Dialog Test", - "Dumb test message.", - null, - null); + "Dialog Test", + "Dumb test message.", + null, + null); d.setVisible(true); System.out.println("Dialog returns " + d.getValue()); d.dispose(); - + } } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmModifyPrinterFailedException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmModifyPrinterFailedException.java index 0de6d10bad..007c10e77d 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmModifyPrinterFailedException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmModifyPrinterFailedException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * All rights reserved. * * pmModifyPrinterFailedException.java - * + * */ package com.sun.admin.pm.client; @@ -39,5 +38,3 @@ class pmModifyPrinterFailedException extends pmGuiException { super(s); } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmMustBeRemoteServerException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmMustBeRemoteServerException.java index 9153523d7d..670e3df4b8 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmMustBeRemoteServerException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmMustBeRemoteServerException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * All rights reserved. * * pmDeleteFailedException.java - * + * */ package com.sun.admin.pm.client; @@ -42,5 +41,3 @@ class pmMustBeRemoteServerException extends pmGuiException { super(); } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmOKCancelDialog.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmOKCancelDialog.java index 9d2e8ff3ea..4bffb3733a 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmOKCancelDialog.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmOKCancelDialog.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -42,20 +41,20 @@ public class pmOKCancelDialog extends pmDialog { private pmTop theTop; private String theTag; protected boolean defaultIsOK = true; - + public pmOKCancelDialog(Frame f, String title, String msg) { this(f, title, msg, null, null, true); } public pmOKCancelDialog(Frame f, String title, String msg, boolean ok) { this(f, title, msg, null, null, ok); - } + } public pmOKCancelDialog(Frame f, String title, String msg, pmTop t, String h) { this(f, title, msg, t, h, true); } - + public pmOKCancelDialog(Frame f, String title, String msg, pmTop t, String h, boolean ok) { super(f, title, true); // modal @@ -63,7 +62,7 @@ public class pmOKCancelDialog extends pmDialog { theTop = t; theTag = h; defaultIsOK = ok; - + // initialize constraints GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; @@ -81,13 +80,13 @@ public class pmOKCancelDialog extends pmDialog { p.add(label, c); this.getContentPane().add(p, "Center"); - + this.getContentPane().add( buttonPanel(defaultIsOK, theTop != null && theTag != null), "South"); this.pack(); - + this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { returnValue = JOptionPane.CLOSED_OPTION; @@ -129,7 +128,7 @@ public class pmOKCancelDialog extends pmDialog { c.gridy = 0; - if (okDefault) + if (okDefault) c.gridx = 0; else c.gridx = 1; @@ -139,7 +138,7 @@ public class pmOKCancelDialog extends pmDialog { okButton.setMnemonic( pmUtility.getIntResource("OK.mnemonic")); - if (okDefault) + if (okDefault) c.gridx = 1; else c.gridx = 0; @@ -150,7 +149,7 @@ public class pmOKCancelDialog extends pmDialog { pmUtility.getIntResource("Cancel.mnemonic")); helpButton = null; - + if (useHelp) { c.gridx = 2; helpButton = new pmButton( @@ -175,7 +174,7 @@ public class pmOKCancelDialog extends pmDialog { helpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { theTop.showHelpItem(theTag); - } + } }); } @@ -201,8 +200,8 @@ public class pmOKCancelDialog extends pmDialog { pmOKCancelDialog.this.setVisible(false); } - - + + public int getValue() { return returnValue; } @@ -211,7 +210,7 @@ public class pmOKCancelDialog extends pmDialog { public static void main(String[] args) { JFrame f = new JFrame("Test Dialog"); f.setSize(300, 100); - + f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { System.exit(0); @@ -229,7 +228,7 @@ public class pmOKCancelDialog extends pmDialog { System.out.println("Dialog returns " + d.getValue()); d.dispose(); - + } } @@ -238,6 +237,6 @@ public class pmOKCancelDialog extends pmDialog { pmButton helpButton = null; pmButton okButton = null; pmButton cancelButton = null; - + protected int returnValue = JOptionPane.CLOSED_OPTION; } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmOther.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmOther.java index d37ce9fa7b..230e398a04 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmOther.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmOther.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ * Use is subject to license terms. * * pmOther.java - * + * */ package com.sun.admin.pm.client; @@ -51,24 +50,24 @@ public class pmOther extends pmDialog { pmButton okButton = null; pmButton cancelButton = null; pmButton helpButton = null; - + public pmOther(JFrame f, String title, String msg) { this(f, title, msg, null, null); } public pmOther(JFrame f, String title, String msg, pmTop t, String h) { - super(f, title, true); // modal - + super(f, title, true); // modal + theTop = t; theTag = h; - + JLabel l; pmButton b; JPanel p; Debug.message("CLNT:pmOther()"); - + // initialize constraints GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; @@ -79,15 +78,15 @@ public class pmOther extends pmDialog { c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; - + // top panel contains the message p = new JPanel(); p.setLayout(new GridBagLayout()); - + l = new JLabel(msg, SwingConstants.LEFT); p.add(l, c); this.getContentPane().add(p, "North"); - + c.insets = new Insets(5, 10, 5, 10); // middle panel contains "other" text field @@ -99,7 +98,7 @@ public class pmOther extends pmDialog { okPressed(); } }); - + l.setLabelFor(deviceName); c.gridx = 1; @@ -111,7 +110,7 @@ public class pmOther extends pmDialog { p.add(deviceName, c); c.gridy = GridBagConstraints.RELATIVE; - + this.getContentPane().add(p, "Center"); // bottom panel contains buttons @@ -174,7 +173,7 @@ public class pmOther extends pmDialog { // this.getRootPane().setDefaultButton(okButton); okButton.setAsDefaultButton(); - + // handle Esc as cancel in any case this.getRootPane().registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -185,7 +184,7 @@ public class pmOther extends pmDialog { JComponent.WHEN_IN_FOCUSED_WINDOW); deviceName.requestFocus(); - + } public int getValue() { @@ -204,7 +203,7 @@ public class pmOther extends pmDialog { pmOther.this.dispose(); } - + public static void main(String[] args) { JFrame f = new JFrame("Other test"); @@ -229,5 +228,5 @@ public class pmOther extends pmDialog { public pmTextField deviceName = new pmTextField(30); protected int returnValue = JOptionPane.CLOSED_OPTION; - + } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmResources.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmResources.java index 1c1f242eee..a54db73e76 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmResources.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmResources.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -41,12 +40,12 @@ import java.util.*; * two strings: * string 1 is the key used by the app -- DO NOT LOCALIZE * string 2 is the string to be localized - * + * * For example, in the tuple * {"info_name", "Solaris Print Manager"} * - * "info_name" is the resource key that must - * not be modified in any way + * "info_name" is the resource key that must + * not be modified in any way * * "Solaris Print Manager" is the corresponding * text to be localized @@ -55,7 +54,7 @@ import java.util.*; public class pmResources extends ListResourceBundle { static final Object[][] pmBundlecontents = { - /* + /* * Descriptive strings used in the 'About' dialog */ {"info_name", "Solaris Print Manager"}, @@ -190,36 +189,36 @@ public class pmResources extends ListResourceBundle { /* - * 'Add Access to Printer' dialog title - */ + * 'Add Access to Printer' dialog title + */ {"SPM:Add.Access.To.Printer", "Solaris Print Manager: Add Access to Printer"}, /* - * 'Add Attached Printer' dialog title - */ + * 'Add Attached Printer' dialog title + */ {"SPM:New.Attached.Printer", "Solaris Print Manager: New Attached Printer"}, /* - * 'Add Network Printer' dialog title - */ + * 'Add Network Printer' dialog title + */ {"SPM:New.Network.Printer", "Solaris Print Manager: New Network Printer"}, /* - * 'Modify Printer Properties' dialog title - */ + * 'Modify Printer Properties' dialog title + */ {"SPM:Modify.Printer.Properties", "Solaris Print Manager: Modify Printer Properties"}, /* - * 'Find Printer' dialog title - */ + * 'Find Printer' dialog title + */ {"SPM:Find.Printer", "Solaris Print Manager: Find Printer"}, @@ -238,14 +237,14 @@ public class pmResources extends ListResourceBundle { /* * 'User Input of Printer Port' dialog title */ - {"SPM:Specify.Printer.Port", + {"SPM:Specify.Printer.Port", "Solaris Print Manager: Specify Printer Port"}, /* * 'User Input of Printer Type' dialog title */ - {"SPM:Specify.Printer.Type", + {"SPM:Specify.Printer.Type", "Solaris Print Manager: Specify Printer Type"}, @@ -311,7 +310,7 @@ public class pmResources extends ListResourceBundle { /* * Actions performed by the application - * as displayed in the Command-Line Console + * as displayed in the Command-Line Console */ {"New.Attached.Printer", "New Attached Printer"}, {"New.Network.Printer", "New Network Printer"}, @@ -323,9 +322,9 @@ public class pmResources extends ListResourceBundle { /* * Prompts: messages to user describing required input. */ - {"Enter.name.of.printer.to.find", + {"Enter.name.of.printer.to.find", "Enter the name of a printer to find:"}, - {"Please.confirm.deletion.of.printer", + {"Please.confirm.deletion.of.printer", "Please confirm deletion of printer "}, {"Enter.printer.type:", "Enter printer type:"}, {"Enter.printer.port.or.file", "Enter printer port or file:"}, @@ -345,11 +344,11 @@ public class pmResources extends ListResourceBundle { {"Help.on:", "Help on:"}, {"See.also:", "See also:"}, - {"Matching.entries:", "Matching entries:"}, - {"Matching.entries:.mnemonic", "M"}, + {"Matching.entries:", "Matching entries:"}, + {"Matching.entries:.mnemonic", "M"}, - {"Search.help.index.for:", "Search help index for: "}, - {"Search.help.index.for:.mnemonic", "S"}, + {"Search.help.index.for:", "Search help index for: "}, + {"Search.help.index.for:.mnemonic", "S"}, {"Search.Results:", "Search Results:"}, {"Search.Results:.mnemonic", "R"}, @@ -357,24 +356,24 @@ public class pmResources extends ListResourceBundle { {"Keywords:", "Keywords: "}, {"Keywords:.mnemonic", "K"}, - + /* * 'Help' dialog descriptive messages to provide - * assistance in using the features. + * assistance in using the features. */ /* - * The following two labels create one message, displayed on - * two adjacent lines. + * The following two labels create one message, displayed on + * two adjacent lines. */ {"To.search.the.index...", "To search the index of help articles alphabetically,"}, {"type.your.query.below...", - "type your query below then select the desired article."}, + "type your query below then select the desired article."}, /* - * The following two labels create one message, displayed on - * two adjacent lines. + * The following two labels create one message, displayed on + * two adjacent lines. */ {"To.find.help.articles...", "To find help articles about a particular topic,"}, @@ -409,7 +408,7 @@ public class pmResources extends ListResourceBundle { /* * Combo item allowing custom 'Printer Port' selection - * See "Printer.Port:" above. + * See "Printer.Port:" above. */ {"Other...", "Other..."}, @@ -435,7 +434,7 @@ public class pmResources extends ListResourceBundle { /* * Labels for checkboxes used in 'Install Printer' and - * 'Modify Printer' dialogs + * 'Modify Printer' dialogs */ {"Default.Printer", "Default Printer"}, {"Always.Print.Banner", "Always Print Banner"}, @@ -444,7 +443,7 @@ public class pmResources extends ListResourceBundle { /* - * Prompt for 'Select Naming Service' combo + * Prompt for 'Select Naming Service' combo */ {"Naming.Service:", "Naming Service:"}, @@ -496,10 +495,10 @@ public class pmResources extends ListResourceBundle { {"Item.not.found:", "Item not found: "}, {"No.information.available.", "No information available."}, {"Unable.to.find.printer", "Unable to find printer "}, - {"Printer.delete.operation.failed.", + {"Printer.delete.operation.failed.", "Printer delete operation failed."}, {"Invalid.printer.type.", "Invalid printer type."}, - {"Device.missing.or.not.writeable.", + {"Device.missing.or.not.writeable.", "Device missing or not writeable."}, {"Printer.name.required.", "Printer name required."}, {"Printer.Port.Selection.required", "Printer Port Selection required."}, @@ -528,7 +527,7 @@ public class pmResources extends ListResourceBundle { {"Required.login.failed.", "Required login failed."}, {"Invalid.printer.type.", "Invalid printer type."}, {"Invalid.username", "Invalid username"}, - {"Device.missing.or.not.writeable.", + {"Device.missing.or.not.writeable.", "Device missing or not writeable."}, {"User.cancelled.login.", "User cancelled login."}, {"Nothing.matched.", "Nothing matched."}, @@ -558,52 +557,52 @@ public class pmResources extends ListResourceBundle { /* - * The help subsystem builds a database of searchable + * The help subsystem builds a database of searchable * keywords based in part on the title of each help * article. In order to avoid excessive false hits, the - * following words are ignored when adding title words + * following words are ignored when adding title words * to the searchable keyword list. - * - * If this list is left empty, all the words in the title of - * each help article will be added to the keywords database. + * + * If this list is left empty, all the words in the title of + * each help article will be added to the keywords database. */ {"help.ignore.words", "to an a of if the and or"}, - - /* - * Title for the authorization dialog which is invoked by + + /* + * Title for the authorization dialog which is invoked by * the printmgr executable. - */ + */ {"Authentication.required", "Authentication Required"}, - /* - * Prompt for the printmgr authorization dialog. + /* + * Prompt for the printmgr authorization dialog. * This is displayed with line breaks. */ /* JSTYLED */ {"Root.access.is.required", "Root access is required for full functionality.\nYou may authenticate as root or continue\nwith limited functionality."}, - /* + /* * Buttons for the authorization dialog. */ {"Authenticate", "Authenticate"}, {"Authenticate.mnemonic", "A"}, - - {"Continue", "Continue"}, + + {"Continue", "Continue"}, {"Continue.mnemonic", "N"}, - /* + /* * Title for the root password request dialog invoked by printmgr. */ - {"Root.authentication", "Root Authentication"}, + {"Root.authentication", "Root Authentication"}, - /* + /* * Prompt for the root password request dialog. */ {"Enter.root.password", "Enter root password"}, - /* + /* * Prompt for the root password request dialog. */ {"Invalid.password", "Invalid password entered. Retry?"}, diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmTextField.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmTextField.java index 93a9b3e228..a02778c907 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmTextField.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmTextField.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -55,7 +54,7 @@ public class pmTextField extends JTextField { } /* - * This doc implementation will disallow insertion of a + * This doc implementation will disallow insertion of a * string containing any characters which are non-8-bit-ascii. */ private class pmFilterDoc extends PlainDocument { @@ -85,4 +84,3 @@ public class pmTextField extends JTextField { } } - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmTop.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmTop.java index b24b4aa77f..f2c77c08ab 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmTop.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmTop.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -116,12 +115,12 @@ public class pmTop extends JPanel { pmFrame frame; - - public pmTop(JFrame parent) { + + public pmTop(JFrame parent) { parentFrame = parent; setLayout(new BorderLayout()); pmTopInit(); - + } public void pmTopInit() { @@ -200,7 +199,7 @@ public class pmTop extends JPanel { pmUtility.getResource("Printer.Name"), pmUtility.getResource("Printer.Server"), pmUtility.getResource("Description") - + }; // Initialize for JTable calls from SWING classes @@ -222,7 +221,7 @@ public class pmTop extends JPanel { for (int i = 0; i < rowDataList.length; i = i + 3) { rowData = new Vector(3, 1); for (j = 0; j < 3; j++) { - rowData.addElement( + rowData.addElement( rowDataList[i + j]); } data.addElement(rowData); @@ -236,7 +235,7 @@ public class pmTop extends JPanel { public int getRowCount() { return data.size(); } - + public int getColumnCount() { return columnNames.length; } @@ -244,12 +243,12 @@ public class pmTop extends JPanel { public String getColumnName(int col) { return columnNames[col]; } - + public Object getValueAt(int row, int col) { Vector rowVector = (Vector)data.elementAt(row); return rowVector.elementAt(col); } - + public void setValueAt(String value, int row, int col) { Vector rowVector = (Vector)data.elementAt(row); rowVector.setElementAt(value, col); @@ -286,16 +285,16 @@ public class pmTop extends JPanel { selectedPrinter = (String) listTable.getModel().getValueAt(selectedRow, 0); - selprinterServer = + selprinterServer = (String)listTable.getModel().getValueAt(selectedRow, 1); Debug.message("CLNT: selectedPrinter is " + selectedPrinter); - + doModify(); } - - // Create printer list in center panel + + // Create printer list in center panel public void centerPanel() { center = new JPanel(); @@ -317,7 +316,7 @@ public class pmTop extends JPanel { }}, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW); - + listTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { @@ -341,7 +340,7 @@ public class pmTop extends JPanel { } }); - // Add selection listener + // Add selection listener ListSelectionModel rowSelectModel = listTable.getSelectionModel(); rowSelectModel.addListSelectionListener(new ListSelectionListener() { @@ -358,7 +357,7 @@ public class pmTop extends JPanel { selectedRow = listSM.getMinSelectionIndex(); Debug.message( "CLNT: list element selected" + selectedRow); - selectedPrinter = + selectedPrinter = (String)listTable.getModel().getValueAt(selectedRow, 0); selprinterServer = (String)listTable.getModel().getValueAt(selectedRow, 1); @@ -389,7 +388,7 @@ public class pmTop extends JPanel { m.setVisible(true); System.exit(-1); } - + scrollPane = new JScrollPane(); scrollPane.setViewportView(listTable); @@ -419,7 +418,7 @@ public class pmTop extends JPanel { c.weightx = c.weighty = 1.0; try { - defaultpLabel = + defaultpLabel = new JLabel(pmUtility.getResource("Default.Printer:") + " " + PrinterUtil.getDefaultPrinter(ns)); @@ -431,7 +430,7 @@ public class pmTop extends JPanel { south.add(defaultpLabel, c); - + if (newNS.startsWith("files")) { try { domainhostLabel = new JLabel(pmUtility.getResource( @@ -448,7 +447,7 @@ public class pmTop extends JPanel { nameserviceLabel.setText( pmUtility.getResource("Naming.Service:") + " " + newNS); domainhostLabel = new JLabel( - pmUtility.getResource("Domain:") + " " + + pmUtility.getResource("Domain:") + " " + host.getDomainName()); } catch (Exception e) { Debug.warning("CLNT: pmTop:getDomainName caught " + e); @@ -484,9 +483,9 @@ public class pmTop extends JPanel { }); JMenuItem load = new JMenuItem( - pmUtility.getResource("Select.Naming.Service"), + pmUtility.getResource("Select.Naming.Service"), pmUtility.getIntResource("Select.Naming.Service.mnemonic")); - + load.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -537,12 +536,12 @@ public class pmTop extends JPanel { usePPD = new JCheckBoxMenuItem( pmUtility.getResource("Use.PPD.files"), true); - usePPD.setMnemonic(pmUtility.getIntResource("Use.PPD.files.mnemonic")); + usePPD.setMnemonic(pmUtility.getIntResource("Use.PPD.files.mnemonic")); useLocalhost = new JCheckBoxMenuItem( pmUtility.getResource("Use.localhost"), true); useLocalhost.setMnemonic( - pmUtility.getIntResource("Use.localhost.mnemonic")); + pmUtility.getIntResource("Use.localhost.mnemonic")); if (!runningAuth) { @@ -553,7 +552,7 @@ public class pmTop extends JPanel { appMenu.add(useLocalhost); appMenu.addSeparator(); - + JMenuItem exit = new JMenuItem( pmUtility.getResource("Exit"), pmUtility.getIntResource("Exit.mnemonic")); @@ -565,7 +564,7 @@ public class pmTop extends JPanel { System.exit(0); }; }); - + exit.setEnabled(true); appMenu.add(exit); @@ -596,9 +595,9 @@ public class pmTop extends JPanel { new ActionListener() { public void actionPerformed(ActionEvent e) { Debug.message("CLNT: call from access action"); - if (accessView != null) + if (accessView != null) accessView.setVisible(true); - else + else accessView = new pmAccess(myTop); accessView.Show(); }; @@ -609,11 +608,11 @@ public class pmTop extends JPanel { objectMenu.add(access); objectMenu.addSeparator(); - + local = new JMenuItem( pmUtility.getResource("New.Attached.Printer..."), pmUtility.getIntResource("New.Attached.Printer.mnemonic")); - + local.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -636,7 +635,7 @@ public class pmTop extends JPanel { local.setEnabled(false); objectMenu.add(local); - + network = new JMenuItem( pmUtility.getResource("New.Network.Printer..."), pmUtility.getIntResource("New.Network.Printer.mnemonic")); @@ -649,7 +648,7 @@ public class pmTop extends JPanel { networkinstallView.setVisible(true); else { try { - networkinstallView = new + networkinstallView = new pmInstallPrinter(myTop, Constants.ADDNETWORK); } catch (Exception ex) { Debug.message("CLNT:pmTop:caught exception" + ex); @@ -665,7 +664,7 @@ public class pmTop extends JPanel { objectMenu.add(network); objectMenu.addSeparator(); - + modifyMenuItem = new JMenuItem( pmUtility.getResource("Modify.Printer.Properties..."), pmUtility.getIntResource("Modify.Printer.Properties.mnemonic")); @@ -680,7 +679,7 @@ public class pmTop extends JPanel { doModify(); }; }); - + modifyMenuItem.setEnabled(false); objectMenu.add(modifyMenuItem); @@ -723,13 +722,13 @@ public class pmTop extends JPanel { listTable.clearSelection(); listTable.setRowSelectionInterval(row, row); listTable.scrollRectToVisible(listTable.getCellRect(row, 0, true)); - listTable.revalidate(); + listTable.revalidate(); scrollPane.revalidate(); scrollPane.repaint(); } return row != -1; } - + public JMenu toolsMenu() { // find printer... @@ -737,7 +736,7 @@ public class pmTop extends JPanel { pmUtility.getResource("Tools")); toolsMenu.setMnemonic( pmUtility.getIntResource("Tools.mnemonic")); - + JMenuItem find = new JMenuItem( pmUtility.getResource("Find.Printer"), pmUtility.getIntResource("Find.Printer.mnemonic")); @@ -787,8 +786,8 @@ public class pmTop extends JPanel { pmUtility.getIntResource("About.Print.Manager.mnemonic")); about.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - Debug.message("CLNT: call from about help action"); - aboutBox.setVisible(true); + Debug.message("CLNT: call from about help action"); + aboutBox.setVisible(true); }; }); @@ -820,7 +819,7 @@ public class pmTop extends JPanel { try { if (selectedPrinter == null || selprinterServer == null) { - + } else { if ((host.getLocalHostName()).equals(selprinterServer) || @@ -828,12 +827,12 @@ public class pmTop extends JPanel { if (isNetwork()) { - modifyView = new + modifyView = new pmInstallPrinter( myTop, Constants.MODIFYNETWORK); } else { - modifyView = new + modifyView = new pmInstallPrinter( myTop, Constants.MODIFYATTACHED); } @@ -859,8 +858,8 @@ public class pmTop extends JPanel { public boolean isNetwork() { - - Printer newpr = new Printer(myTop.ns); + + Printer newpr = new Printer(myTop.ns); newpr.setPrinterName(selectedPrinter); try { @@ -875,11 +874,11 @@ public class pmTop extends JPanel { Debug.message("CLNT: isNetwork:getDestination " + newpr.getDestination()); return true; - } else { + } else { Debug.message("CLNT: isNetwork:getDestination is null"); - return false; + return false; } - } + } // Set the new namespace public void pmsetNS() { @@ -915,7 +914,7 @@ public class pmTop extends JPanel { } else ns = systemns; } - + // This tool is read-only unless the user is root on the // print server. Thus, don't check for namespace authorization @@ -925,8 +924,8 @@ public class pmTop extends JPanel { // Check if user is authorized with this nameservice if (ns.isAuth()) { runningAuth = true; - } else { - // nis/ldap is a special case + } else { + // nis/ldap is a special case // need to login to nis/ldap server if (ns.getNameService().equals("nis") == true || ns.getNameService().equals("ldap") == true) { @@ -965,7 +964,7 @@ public class pmTop extends JPanel { "LoginFailed"); m.setVisible(true); } - } else { + } else { try { ns.checkAuth(); runningAuth = true; @@ -1028,12 +1027,12 @@ public class pmTop extends JPanel { class topnsListener implements ItemListener { public topnsListener() {} - + public void itemStateChanged(ItemEvent e) { Debug.message("CLNT: hello from topnsListener" + e.getItem()); if (e.getStateChange() == ItemEvent.SELECTED) { newNS = (String)e.getItem(); - } + } } } @@ -1044,9 +1043,9 @@ public class pmTop extends JPanel { " " + PrinterUtil.getDefaultPrinter(ns)); Debug.message( - "CLNT: pmTop:pmsetdefaultpLabel(): default printer: " + + "CLNT: pmTop:pmsetdefaultpLabel(): default printer: " + PrinterUtil.getDefaultPrinter(ns)); - + } catch (Exception e) { Debug.warning("CLNT: pmTop:getDefaultPrinter() caught " + e); } @@ -1130,7 +1129,7 @@ public class pmTop extends JPanel { // Debug.info("CLNT: showLogData():actionName: " + actionName); // Debug.info("CLNT: showLogData():cmdLog: " + cmdLog); - if (cmdLog == null) + if (cmdLog == null) return; addToCommandLog(actionName + "\n"); @@ -1161,11 +1160,11 @@ public class pmTop extends JPanel { addToCommandLog("***\n"); } - - private void addToCommandLog(String s) { + + private void addToCommandLog(String s) { commandLog.addText(s); } - + public void showHelpItem(String tag) { if (helpFrame != null) helpFrame.showHelp(tag); @@ -1207,7 +1206,7 @@ public class pmTop extends JPanel { } } } - + // Update the list of printers // Printer list will change if nameservice changes and when user // adds/deletes/changes printers @@ -1234,7 +1233,7 @@ public class pmTop extends JPanel { // returns -1 if error, 0 otherwise protected static int parseArgs(String[] args) { int rv = 0; - + for (int i = 0; i < args.length; ++i) { if (args[i].compareTo("-debugall") == 0) Debug.setDebugLevel(Debug.ALL); @@ -1251,10 +1250,10 @@ public class pmTop extends JPanel { else if (args[i].compareTo("-debuginfo") == 0) Debug.setDebugLevel(Debug.INFO); } - + return rv; } - + public static void main(String[] args) { if (parseArgs(args) < 0) @@ -1262,7 +1261,7 @@ public class pmTop extends JPanel { // use pmFrame to get app icon pmFrame frame = new pmFrame(pmUtility.getResource("info_name")); - + myTop = new pmTop(frame); frame.addWindowListener(new WindowAdapter() { @@ -1276,9 +1275,9 @@ public class pmTop extends JPanel { frame.setVisible(true); frame.repaint(); - pmLoad firstload = new pmLoad(myTop); + pmLoad firstload = new pmLoad(myTop); myTop.loadView = firstload; - firstload.Show(); + firstload.Show(); aboutBox = new pmAboutBox(); commandLog = new pmLogDisplay(myTop, "ShowCommandConsole"); @@ -1291,7 +1290,7 @@ public class pmTop extends JPanel { * takes a long time for the help frame to load. */ helpFrame = new pmHelpFrame(); - + } // disable Enter action **for all JTextFields** diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmUserCancelledException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmUserCancelledException.java index a6ccb9dd68..15ff9fb61c 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmUserCancelledException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmUserCancelledException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -22,12 +21,12 @@ /* * * ident "%Z%%M% %I% %E% SMI" - * + * * Copyright (c) 1999 by Sun Microsystems, Inc. * All rights reserved. * * pmUserCancelledException .java - * + * */ package com.sun.admin.pm.client; @@ -42,5 +41,3 @@ class pmUserCancelledException extends pmGuiException { super(); } } - - diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmUtility.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmUtility.java index 09a34ab396..dc10376dc5 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmUtility.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/client/pmUtility.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -100,22 +99,22 @@ public class pmUtility { int keyvalue = 0; String s = null; ResourceBundle bundle = null; - + try { bundle = ResourceBundle.getBundle( "com.sun.admin.pm.client.pmResources"); } catch (MissingResourceException e) { Debug.fatal("Could not load pmResources file"); } - + try { s = bundle.getString(key); } catch (MissingResourceException e) { Debug.error("Missing: " + key); } - + Debug.message("Resource: " + key + " Value: " + s); - + if (s != null) { try { keyvalue = s.charAt(0); @@ -123,7 +122,7 @@ public class pmUtility { Debug.error("Resource: " + key + " threw: " + x); } } - + return keyvalue; } @@ -133,7 +132,7 @@ public class pmUtility { pmLogin l; if (mytop.ns.getNameService().equals("nis") || - mytop.ns.getNameService().equals("ldap")) { + mytop.ns.getNameService().equals("ldap")) { if (mytop.ns.getNameService().equals("nis")) { @@ -189,9 +188,9 @@ public class pmUtility { } try { - mytop.ns.checkAuth(); + mytop.ns.checkAuth(); Debug.message("doLogin():checkauth() OK"); - } catch (Exception e) { + } catch (Exception e) { Debug.warning("doLogin:checkAuth()exception " + e); throw new pmGuiException("Login.Authorization.Failed"); } @@ -200,7 +199,7 @@ public class pmUtility { // User has not put in printer or server } else { - pmMessageDialog m = + pmMessageDialog m = new pmMessageDialog( frame, pmUtility.getResource("Login.Failure"), @@ -210,7 +209,7 @@ public class pmUtility { m.setVisible(true); throw new pmGuiException("pmAccess: Cannot create Login screen"); } - + } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Debug.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Debug.java index ed216885fe..dc0147b093 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Debug.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Debug.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -35,7 +34,7 @@ import java.util.*; /** * A simple configurable debug logging class. * <p> - * + * * Calling member classes <b>message()</b>, <b>warning()</b>, * <b>error()</b>, and <b>fatal()</b> causes a log entry to be * generated if the current verbosity level is greater than or equal @@ -168,7 +167,7 @@ public class Debug { static public void setDebugLevel(int lvl) { if (lvl < ALL || lvl > NONE) return; - + globalDebugLevel = lvl; } @@ -179,19 +178,19 @@ public class Debug { static public void setDebugLevel(Object o, int lvl) { if (lvl < ALL || lvl > NONE) return; - + classDB.put(o.getClass(), new Integer(lvl)); - /* - System.out.println("Debug: class " + o.getClass().getName() + - " level = " + classDB.get(o.getClass())); - */ + /* + * System.out.println("Debug: class " + o.getClass().getName() + + * " level = " + classDB.get(o.getClass())); + */ } - + static public void setDebugLevel(String classname, int lvl) { if (lvl < ALL || lvl > NONE) return; - + try { classDB.put(Class.forName(classname), new Integer(lvl)); } catch (Exception x) { @@ -212,7 +211,7 @@ public class Debug { debugPrint(s); } - + /* * get debug level for o's class, if already there * otherwise create an entry for o and set it to the global level @@ -225,24 +224,24 @@ public class Debug { else classDB.put(o.getClass(), new Integer(lvl)); - /* - System.out.println("Debug: getLevelForClass " + - o.getClass().getName() + - " = " + lvl); - */ + /* + * System.out.println("Debug: getLevelForClass " + + * o.getClass().getName() + + * " = " + lvl); + */ return lvl; } // here is where we could hide syslog or file destination... private static void debugPrint(String s) { - System.out.println(s); // for now + System.out.println(s); // for now } - + Object theInstance = null; public Debug(Object o) { - theInstance = o; + theInstance = o; } public void SetDebugLevel(int lvl) { @@ -270,7 +269,7 @@ public class Debug { public void Info(String s) { info(theInstance, s); } - + /* * Verbosity level to suppress all messages. */ @@ -308,7 +307,7 @@ public class Debug { * Verbosity level to log all messages. */ static public final int ALL = 0; - + private static int globalDebugLevel = FATAL; private static Hashtable classDB = new Hashtable(); diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterAdd.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterAdd.java index 3aeaa1600d..287b0a328b 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterAdd.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterAdd.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -179,7 +178,7 @@ public class DoPrinterAdd { } - if (destination != null) + if (destination != null) cmd = cmd.concat(" -o dest=" + destination); if (protocol != null) cmd = cmd.concat(" -o protocol=" + protocol); @@ -322,7 +321,7 @@ public class DoPrinterAdd { Debug.message("SVR:" + e2.getMessage()); } p.clearLogs(); - throw(e); + throw (e); } } return; diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterMod.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterMod.java index 71668890ca..b7cadaa1cb 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterMod.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterMod.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -22,7 +21,7 @@ /* * ident "%Z%%M% %I% %E% SMI" * - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * * DoPrinterMod class @@ -174,7 +173,7 @@ public class DoPrinterMod { comment = ""; } } - if (!strings_equal(curr.getDevice(), p.getDevice())) + if (!strings_equal(curr.getDevice(), p.getDevice())) device = p.getDevice(); if (!strings_equal(curr.getNotify(), p.getNotify())) @@ -195,7 +194,7 @@ public class DoPrinterMod { Debug.message( "SVR:DoPrinterMod:curr.getProtocol(): " + curr.getProtocol()); Debug.message("SVR:DoPrinterMod:p.getProtocol(): " + p.getProtocol()); - + if (!strings_equal(curr.getDestination(), p.getDestination())) destination = p.getDestination(); @@ -258,7 +257,7 @@ public class DoPrinterMod { allow_changed = false; } } - } + } } if (!arrays_equal(curr.getUserDenyList(), p.getUserDenyList())) { allow_changed = true; @@ -387,7 +386,7 @@ public class DoPrinterMod { // properties of the queue if (isURI) { - if (destination != null) + if (destination != null) device = destination; else device = curr.getDestination(); @@ -420,7 +419,9 @@ public class DoPrinterMod { // Network printer if (isURI) { cmd = cmd.concat(" -m uri"); - } else { + + } else if (protocol != null) { + if (curr.getPPD() != null) cmd = cmd.concat(" -m netstandard_foomatic"); else @@ -668,7 +669,7 @@ public class DoPrinterMod { // // If this is only a default printer change then set modhints - // + // if ((printserver == null) && (extensions == null) && (comment == null)) { diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterUtil.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterUtil.java index 3b5e192a59..6d8790a55c 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterUtil.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/DoPrinterUtil.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -313,7 +312,7 @@ public class DoPrinterUtil { } - public static String[] getProbe(String device) + public static String[] getProbe(String device) { int i; String pmake = null; @@ -375,7 +374,7 @@ public class DoPrinterUtil { public static boolean isMakeModel( String make, - String model) + String model) { int exitvalue; diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Host.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Host.java index 58338600ac..dcbd401c0e 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Host.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Host.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -256,7 +255,7 @@ public class Host catch (Exception e) { Debug.message("SVR: ldapsearch for NSDS failed. Continuing"); } - + cmd = "/usr/bin/ldaplist -d printers"; syscmd = new SysCommand(); syscmd.exec(cmd); diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/SysCommand.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/SysCommand.java index 2a5ddb9bb3..cd8afb1364 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/SysCommand.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/SysCommand.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -55,7 +54,7 @@ public class SysCommand o = syscmd.getOutput(); System.out.println(o); } - + /* * Execute a system command. * @param String cmd The command to be executed. @@ -238,7 +237,7 @@ public class SysCommand clean = clean.concat(cmd.substring(i, cmd.length())); Debug.message("SVR: " + clean); - + } else { Debug.message("SVR: " + cmd); } diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Valid.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Valid.java index 4b1d1284cf..a3d46f921d 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Valid.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Valid.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -343,7 +342,7 @@ public class Valid { return (true); } - // + // // User // public static boolean user(String u) diff --git a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/pmException.java b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/pmException.java index cbb247e550..081c27e79e 100644 --- a/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/pmException.java +++ b/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/pmException.java @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -26,7 +25,7 @@ * All rights reserved. * * pmException class - * General print manager exceptions + * General print manager exceptions */ package com.sun.admin.pm.server; |