001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.visualweb.errorhandler;
042:
043: import javax.swing.SwingUtilities;
044:
045: /*
046: * DebugServerTestWindow
047: * Created on January 6, 2004, 1:21 PM
048: */
049:
050: /**
051: * @author Winston Prakash
052: */
053: public class DebugServerTestWindow extends javax.swing.JDialog {
054:
055: private static DebugServerTestWindow debugServerTestWindow = null;
056:
057: /** Creates new form ServerWindow */
058: public DebugServerTestWindow() {
059: initComponents();
060: }
061:
062: public static DebugServerTestWindow getDefault() {
063: if (debugServerTestWindow == null)
064: debugServerTestWindow = new DebugServerTestWindow();
065: return debugServerTestWindow;
066: }
067:
068: /** This method is called from within the constructor to
069: * initialize the form.
070: * WARNING: Do NOT modify this code. The content of this method is
071: * always regenerated by the Form Editor.
072: */
073: private void initComponents() {//GEN-BEGIN:initComponents
074: jPanel1 = new javax.swing.JPanel();
075: mainPanel = new javax.swing.JPanel();
076: scrollPane = new javax.swing.JScrollPane();
077: textArea = new javax.swing.JTextArea();
078: buttonPanel = new javax.swing.JPanel();
079: exitButton = new javax.swing.JButton();
080:
081: setTitle("Error Handler Server Window");
082: setResizable(false);
083: addWindowListener(new java.awt.event.WindowAdapter() {
084: public void windowClosing(java.awt.event.WindowEvent evt) {
085: exitForm(evt);
086: }
087: });
088:
089: mainPanel.setLayout(new java.awt.BorderLayout());
090:
091: textArea.setColumns(35);
092: textArea.setEditable(false);
093: textArea.setLineWrap(true);
094: textArea.setRows(15);
095: textArea.setWrapStyleWord(true);
096: scrollPane.setViewportView(textArea);
097:
098: mainPanel.add(scrollPane, java.awt.BorderLayout.CENTER);
099:
100: getContentPane().add(mainPanel, java.awt.BorderLayout.CENTER);
101:
102: buttonPanel.setLayout(new java.awt.GridBagLayout());
103:
104: buttonPanel.setBorder(new javax.swing.border.EmptyBorder(
105: new java.awt.Insets(5, 1, 1, 1)));
106: exitButton.setText("Close");
107: exitButton
108: .addActionListener(new java.awt.event.ActionListener() {
109: public void actionPerformed(
110: java.awt.event.ActionEvent evt) {
111: exitButtonActionPerformed(evt);
112: }
113: });
114:
115: buttonPanel.add(exitButton, new java.awt.GridBagConstraints());
116:
117: getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);
118:
119: setBounds(100, 100, 400, 300);
120: }//GEN-END:initComponents
121:
122: private void exitButtonActionPerformed(
123: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed
124: hide();
125: }//GEN-LAST:event_exitButtonActionPerformed
126:
127: public static void displayMessage(String msg) {
128: getDefault();
129: if (!debugServerTestWindow.isVisible())
130: debugServerTestWindow.show();
131: debugServerTestWindow.displayText(msg);
132: }
133:
134: public void displayText(final String msg) {
135: SwingUtilities.invokeLater(new Runnable() {
136: public void run() {
137: textArea.append(msg + "\n");
138: }
139: });
140: }
141:
142: /** Exit the Application */
143: private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
144: hide();
145: }//GEN-LAST:event_exitForm
146:
147: // Variables declaration - do not modify//GEN-BEGIN:variables
148: private javax.swing.JPanel buttonPanel;
149: private javax.swing.JButton exitButton;
150: private javax.swing.JPanel jPanel1;
151: private javax.swing.JPanel mainPanel;
152: private javax.swing.JScrollPane scrollPane;
153: private javax.swing.JTextArea textArea;
154: // End of variables declaration//GEN-END:variables
155:
156: }
|