/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* 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
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright(c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*
* Command Log implementation
*/
public pmLogDisplay() {
}
theTop = t;
helpTag = h;
// top panel
p.setLayout(new BorderLayout());
theContents = new String();
theList.setLineWrap(false);
theList.setEditable(false);
public void actionPerformed(ActionEvent e) {
copyPressed();
}},
public void actionPerformed(ActionEvent e) {
copyPressed();
}},
p = new JPanel();
clearButton = new pmButton(
p.add(clearButton);
helpButton = new pmButton(
p.add(helpButton);
}
});
}
this.pack();
this.addWindowListener(new WindowAdapter() {
pmLogDisplay.this.setVisible(false);
}
});
okPressed();
}
});
pmLogDisplay.this.clear();
}
});
// handle Esc as dismiss in any case
public void actionPerformed(ActionEvent e) {
okPressed();
}},
// getRootPane().setDefaultButton(okButton);
}
protected void copyPressed() {
}
protected void okPressed() {
pmLogDisplay.this.setVisible(false);
}
public int getValue() {
// Debug.message("getValue");
return returnValue;
}
// i.e. a solid line, or spaces, or...
public void addSeparator() {
}
// tricky: s may have embedded newlines...
theContents = theContents + s;
/*
* StringTokenizer st = new StringTokenizer(s, "\n\r", false);
* try {
* while(st.hasMoreTokens()) {
* String ss = st.nextToken();
* theContents.addElement(ss);
* }
* } catch(Exception 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.
}
public void clear() {
theContents = null;
theContents = new String();
}
public void disableText(boolean d) {
// theText.setEnabled(!d);
}
f.addWindowListener(new WindowAdapter() {
}
});
f.setVisible(true);
pmLogDisplay d = new pmLogDisplay();
d.addText("A\nB\nC\nD\nE\nF\nG\nH\nI\nJ");
d.setVisible(true);
}
}