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-2006 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:
042: package org.netbeans.modules.mobility.licensing;
043:
044: import java.io.IOException;
045: import java.net.URL;
046: import java.util.ResourceBundle;
047:
048: import org.openide.util.NbBundle;
049:
050: /**
051: * This class displays license during first start of IDE.
052: *
053: * @author Marek Slama
054: */
055:
056: final class LicensePanel extends javax.swing.JPanel {
057:
058: /** Creates new form LicensePanel */
059: public LicensePanel(URL url) {
060: this .url = url;
061: initComponents();
062: initAccessibility();
063: try {
064: jEditorPane1.setPage(url);
065: } catch (IOException exc) {
066: //Problem with locating file
067: System.err.println("Exception: " + exc.getMessage()); //NOI18N
068: exc.printStackTrace();
069: }
070: }
071:
072: private void initAccessibility() {
073: this .getAccessibleContext().setAccessibleName(
074: bundle.getString("ACSN_LicensePanel")); //NOI18N
075: this .getAccessibleContext().setAccessibleDescription(
076: bundle.getString("ACSD_LicensePanel")); //NOI18N
077:
078: jEditorPane1.getAccessibleContext().setAccessibleName(
079: bundle.getString("ACSN_EditorPane")); //NOI18N
080: jEditorPane1.getAccessibleContext().setAccessibleDescription(
081: bundle.getString("ACSD_EditorPane")); //NOI18N
082: }
083:
084: /** This method is called from within the constructor to
085: * initialize the form.
086: * WARNING: Do NOT modify this code. The content of this method is
087: * always regenerated by the Form Editor.
088: */
089: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
090: private void initComponents() {
091: jTextAreaTop = new javax.swing.JTextArea();
092: jScrollPane1 = new javax.swing.JScrollPane();
093: jEditorPane1 = new javax.swing.JEditorPane();
094: jTextAreaBottom = new javax.swing.JTextArea();
095:
096: setLayout(new javax.swing.BoxLayout(this ,
097: javax.swing.BoxLayout.Y_AXIS));
098:
099: setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12,
100: 0, 11));
101: jTextAreaTop.setBackground(getBackground());
102: jTextAreaTop.setColumns(20);
103: jTextAreaTop.setEditable(false);
104: jTextAreaTop.setFont(new java.awt.Font("Dialog", 1, 12));
105: jTextAreaTop.setLineWrap(true);
106: jTextAreaTop.setRows(1);
107: jTextAreaTop
108: .setText(bundle.getString("MSG_LicenseDlgLabelTop"));
109: jTextAreaTop.setWrapStyleWord(true);
110: jTextAreaTop.setFocusable(false);
111: jTextAreaTop.setMargin(new java.awt.Insets(0, 0, 2, 0));
112: jTextAreaTop.setRequestFocusEnabled(false);
113: add(jTextAreaTop);
114:
115: jEditorPane1.setEditable(false);
116: jEditorPane1.setPreferredSize(new java.awt.Dimension(500, 500));
117: jScrollPane1.setViewportView(jEditorPane1);
118:
119: add(jScrollPane1);
120:
121: jTextAreaBottom.setBackground(getBackground());
122: jTextAreaBottom.setColumns(20);
123: jTextAreaBottom.setEditable(false);
124: jTextAreaBottom.setFont(new java.awt.Font("Dialog", 1, 12));
125: jTextAreaBottom.setLineWrap(true);
126: jTextAreaBottom.setRows(2);
127: jTextAreaBottom.setText(bundle
128: .getString("MSG_LicenseDlgLabelBottom"));
129: jTextAreaBottom.setWrapStyleWord(true);
130: jTextAreaBottom.setFocusable(false);
131: jTextAreaBottom.setRequestFocusEnabled(false);
132: add(jTextAreaBottom);
133:
134: }// </editor-fold>//GEN-END:initComponents
135:
136: // Variables declaration - do not modify//GEN-BEGIN:variables
137: private javax.swing.JEditorPane jEditorPane1;
138: private javax.swing.JScrollPane jScrollPane1;
139: private javax.swing.JTextArea jTextAreaBottom;
140: private javax.swing.JTextArea jTextAreaTop;
141: // End of variables declaration//GEN-END:variables
142: private URL url;
143: private static final ResourceBundle bundle = NbBundle
144: .getBundle(LicensePanel.class);
145: }
|