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: /*
042: * ComponentLibDetailPanel.java
043: *
044: * Created on April 15, 2005, 1:35 PM
045: */
046:
047: package org.netbeans.modules.visualweb.complib.ui;
048:
049: import java.io.File;
050: import java.util.List;
051:
052: import org.openide.util.NbBundle;
053:
054: import org.netbeans.modules.visualweb.complib.IdeUtil;
055:
056: /**
057: * Component library manager general purpose detail panel to show paths
058: *
059: * @author jhoff
060: * @author Edwin Goei
061: */
062: public class PathDetailPanel extends javax.swing.JPanel {
063:
064: /**
065: * Parameters should be resource bundle keys.
066: *
067: * @param path
068: * File[] of path elements
069: * @param labelKey
070: * @param descriptionKey
071: * @param mnemonicKey
072: */
073: public PathDetailPanel(List<File> path, String labelKey,
074: String descriptionKey, String mnemonicKey) {
075: initComponents();
076:
077: try {
078: String str = NbBundle.getMessage(PathDetailPanel.class,
079: labelKey);
080: lblLibDesignTime.setText(str);
081:
082: str = NbBundle.getMessage(PathDetailPanel.class,
083: descriptionKey);
084: tpnlDescription.setText(str);
085:
086: str = NbBundle.getMessage(PathDetailPanel.class,
087: mnemonicKey);
088: lblLibDesignTime.setDisplayedMnemonic(str.charAt(0));
089: } catch (Exception e) {
090: IdeUtil.logWarning(e);
091: }
092:
093: PathListModel pathListModel = new PathListModel(path);
094: lstDesignTime.setModel(pathListModel);
095: }
096:
097: /**
098: * This method is called from within the constructor to initialize the form.
099: * WARNING: Do NOT modify this code. The content of this method is always
100: * regenerated by the Form Editor.
101: */
102: // <editor-fold defaultstate="collapsed" desc=" Generated Code
103: // <editor-fold defaultstate="collapsed" desc=" Generated Code
104: // ">//GEN-BEGIN:initComponents
105: private void initComponents() {
106: java.awt.GridBagConstraints gridBagConstraints;
107:
108: lblLibDesignTime = new javax.swing.JLabel();
109: scrollDesignTime = new javax.swing.JScrollPane();
110: lstDesignTime = new javax.swing.JList();
111: tpnlDescription = new javax.swing.JTextPane();
112:
113: setLayout(new java.awt.GridBagLayout());
114:
115: lblLibDesignTime.setLabelFor(lstDesignTime);
116: lblLibDesignTime.setText("Design Time Libraries:");
117: gridBagConstraints = new java.awt.GridBagConstraints();
118: gridBagConstraints.gridx = 0;
119: gridBagConstraints.gridy = 0;
120: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
121: gridBagConstraints.insets = new java.awt.Insets(10, 10, 0, 0);
122: add(lblLibDesignTime, gridBagConstraints);
123:
124: scrollDesignTime.setViewportView(lstDesignTime);
125:
126: gridBagConstraints = new java.awt.GridBagConstraints();
127: gridBagConstraints.gridx = 0;
128: gridBagConstraints.gridy = 2;
129: gridBagConstraints.gridheight = 2;
130: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
131: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
132: gridBagConstraints.weightx = 1.0;
133: gridBagConstraints.weighty = 1.0;
134: gridBagConstraints.insets = new java.awt.Insets(6, 10, 10, 11);
135: add(scrollDesignTime, gridBagConstraints);
136:
137: tpnlDescription.setBackground(javax.swing.UIManager
138: .getDefaults().getColor("Button.background"));
139: tpnlDescription.setEditable(false);
140: tpnlDescription
141: .setText("JAR files used for design-time support of the components in the IDE. They are not deployed to the application server.");
142: gridBagConstraints = new java.awt.GridBagConstraints();
143: gridBagConstraints.gridx = 0;
144: gridBagConstraints.gridy = 1;
145: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
146: gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
147: add(tpnlDescription, gridBagConstraints);
148:
149: }
150:
151: // </editor-fold>//GEN-END:initComponents
152:
153: // Variables declaration - do not modify//GEN-BEGIN:variables
154: private javax.swing.JLabel lblLibDesignTime;
155:
156: private javax.swing.JList lstDesignTime;
157:
158: private javax.swing.JScrollPane scrollDesignTime;
159:
160: private javax.swing.JTextPane tpnlDescription;
161: // End of variables declaration//GEN-END:variables
162:
163: }
|