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: package org.netbeans.modules.compapp.projects.jbi.ui.customizer;
043:
044: import java.awt.Dialog;
045: import java.awt.event.ActionListener;
046: import javax.swing.JPanel;
047: import org.openide.util.HelpCtx;
048: import org.openide.util.NbBundle;
049:
050: /**
051: * Customizer for WAR packaging.
052: */
053: public class CustomizerJarContent extends JPanel implements
054: JbiJarCustomizer.Panel, HelpCtx.Provider {
055:
056: private Dialog dialog;
057: JbiProjectProperties jbiProperties;
058: private VisualPropertySupport vps;
059: private VisualArchiveIncludesSupport vas;
060: private ActionListener actionListener;
061:
062: /** Creates new form CustomizerCompile */
063: public CustomizerJarContent(JbiProjectProperties jbiProperties) {
064: initComponents();
065: this .getAccessibleContext().setAccessibleDescription(
066: NbBundle.getMessage(CustomizerJarContent.class,
067: "ACS_CustomizeWAR_A11YDesc")); // NOI18N
068:
069: this .jbiProperties = jbiProperties;
070: vps = new VisualPropertySupport(jbiProperties);
071: vas = new VisualArchiveIncludesSupport(jbiProperties,
072: jTableTargetComponents, jTableDeploymentArtifacts,
073: jButtonCheckServer, jButtonAddProject,
074: jButtonRemoveProject);
075: }
076:
077: public void initValues() {
078: //vps.register(jTextFieldFileName, JbiProjectProperties.DIST_JAR);
079: jTextFieldBuildArtifactName
080: .setDocument(jbiProperties.DIST_JAR_MODEL);
081: vas.initTableValues();
082: vps.register(vas, JbiProjectProperties.JBI_CONTENT_ADDITIONAL);
083: }
084:
085: /** This method is called from within the constructor to
086: * initialize the form.
087: * WARNING: Do NOT modify this code. The content of this method is
088: * always regenerated by the Form Editor.
089: */
090: // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
091: private void initComponents() {
092:
093: jLabelBuildArtifactName = new javax.swing.JLabel();
094: jTextFieldBuildArtifactName = new javax.swing.JTextField();
095: jLabelTargetComponents = new javax.swing.JLabel();
096: jScrollPaneTargetComponents = new javax.swing.JScrollPane();
097: jTableTargetComponents = new javax.swing.JTable();
098: jButtonCheckServer = new javax.swing.JButton();
099: jLabelDeploymentArtifacts = new javax.swing.JLabel();
100: jScrollPaneDeploymentArtifacts = new javax.swing.JScrollPane();
101: jTableDeploymentArtifacts = new javax.swing.JTable();
102: jButtonAddProject = new javax.swing.JButton();
103: jButtonRemoveProject = new javax.swing.JButton();
104:
105: setBorder(javax.swing.BorderFactory.createEtchedBorder());
106:
107: jLabelBuildArtifactName
108: .setLabelFor(jTextFieldBuildArtifactName);
109: org.openide.awt.Mnemonics.setLocalizedText(
110: jLabelBuildArtifactName, org.openide.util.NbBundle
111: .getMessage(CustomizerJarContent.class,
112: "LBL_CustomizeWAR_FileName_JLabel")); // NOI18N
113:
114: jTextFieldBuildArtifactName.setEditable(false);
115:
116: jLabelTargetComponents.setLabelFor(jTableTargetComponents);
117: org.openide.awt.Mnemonics.setLocalizedText(
118: jLabelTargetComponents, org.openide.util.NbBundle
119: .getMessage(CustomizerJarContent.class,
120: "LBL_CustomizeWAR_Content_JLabel")); // NOI18N
121:
122: jTableTargetComponents
123: .setModel(new javax.swing.table.DefaultTableModel(
124: new Object[][] {
125: { "engine", "BPEL Service Engine" },
126: { "binding",
127: "HTTP SOAP Binding Component" } },
128: new String[] { "Type", "Component ID" }) {
129: Class[] types = new Class[] {
130: java.lang.String.class,
131: java.lang.String.class };
132: boolean[] canEdit = new boolean[] { false, false };
133:
134: public Class getColumnClass(int columnIndex) {
135: return types[columnIndex];
136: }
137:
138: public boolean isCellEditable(int rowIndex,
139: int columnIndex) {
140: return canEdit[columnIndex];
141: }
142: });
143: jScrollPaneTargetComponents
144: .setViewportView(jTableTargetComponents);
145:
146: org.openide.awt.Mnemonics
147: .setLocalizedText(
148: jButtonCheckServer,
149: org.openide.util.NbBundle
150: .getMessage(CustomizerJarContent.class,
151: "LBL_CustomizeWAR_CheckComponentsOnTargetServer_JButton")); // NOI18N
152:
153: jLabelDeploymentArtifacts
154: .setLabelFor(jTableDeploymentArtifacts);
155: org.openide.awt.Mnemonics.setLocalizedText(
156: jLabelDeploymentArtifacts, org.openide.util.NbBundle
157: .getMessage(CustomizerJarContent.class,
158: "LBL_CustomizeWAR_AddContent_JLabel")); // NOI18N
159:
160: jTableDeploymentArtifacts
161: .setModel(new javax.swing.table.DefaultTableModel(
162: new Object[][] {
163:
164: }, new String[] {
165:
166: }));
167: jScrollPaneDeploymentArtifacts
168: .setViewportView(jTableDeploymentArtifacts);
169: jTableDeploymentArtifacts.getAccessibleContext()
170: .setAccessibleDescription(
171: org.openide.util.NbBundle.getMessage(
172: CustomizerJarContent.class,
173: "LBL_AACH_ProjectJarFiles_JLabel")); // NOI18N
174:
175: org.openide.awt.Mnemonics.setLocalizedText(jButtonAddProject,
176: org.openide.util.NbBundle.getMessage(
177: CustomizerJarContent.class,
178: "LBL_CustomizeWAR_AddProject_JButton")); // NOI18N
179:
180: org.openide.awt.Mnemonics.setLocalizedText(
181: jButtonRemoveProject, org.openide.util.NbBundle
182: .getMessage(CustomizerJarContent.class,
183: "LBL_CustomizeWAR_Remove_JButton")); // NOI18N
184:
185: org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
186: this );
187: this .setLayout(layout);
188: layout
189: .setHorizontalGroup(layout
190: .createParallelGroup(
191: org.jdesktop.layout.GroupLayout.LEADING)
192: .add(
193: layout
194: .createSequentialGroup()
195: .addContainerGap()
196: .add(
197: layout
198: .createParallelGroup(
199: org.jdesktop.layout.GroupLayout.LEADING)
200: .add(
201: jLabelDeploymentArtifacts,
202: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
203: 567,
204: Short.MAX_VALUE)
205: .add(
206: org.jdesktop.layout.GroupLayout.TRAILING,
207: layout
208: .createSequentialGroup()
209: .add(
210: layout
211: .createParallelGroup(
212: org.jdesktop.layout.GroupLayout.LEADING)
213: .add(
214: jScrollPaneTargetComponents,
215: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
216: 460,
217: Short.MAX_VALUE)
218: .add(
219: org.jdesktop.layout.GroupLayout.TRAILING,
220: jScrollPaneDeploymentArtifacts,
221: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
222: 460,
223: Short.MAX_VALUE))
224: .addPreferredGap(
225: org.jdesktop.layout.LayoutStyle.RELATED)
226: .add(
227: layout
228: .createParallelGroup(
229: org.jdesktop.layout.GroupLayout.LEADING)
230: .add(
231: layout
232: .createParallelGroup(
233: org.jdesktop.layout.GroupLayout.TRAILING)
234: .add(
235: jButtonAddProject)
236: .add(
237: jButtonRemoveProject))
238: .add(
239: jButtonCheckServer)))
240: .add(
241: layout
242: .createSequentialGroup()
243: .add(
244: jLabelBuildArtifactName)
245: .addPreferredGap(
246: org.jdesktop.layout.LayoutStyle.RELATED)
247: .add(
248: jTextFieldBuildArtifactName,
249: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
250: 412,
251: Short.MAX_VALUE))
252: .add(
253: jLabelTargetComponents))
254: .addContainerGap()));
255:
256: layout.linkSize(new java.awt.Component[] { jButtonAddProject,
257: jButtonCheckServer, jButtonRemoveProject },
258: org.jdesktop.layout.GroupLayout.HORIZONTAL);
259:
260: layout
261: .setVerticalGroup(layout
262: .createParallelGroup(
263: org.jdesktop.layout.GroupLayout.LEADING)
264: .add(
265: layout
266: .createSequentialGroup()
267: .addContainerGap()
268: .add(
269: layout
270: .createParallelGroup(
271: org.jdesktop.layout.GroupLayout.BASELINE)
272: .add(
273: jLabelBuildArtifactName)
274: .add(
275: jTextFieldBuildArtifactName,
276: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
277: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
278: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
279: .add(11, 11, 11)
280: .add(jLabelTargetComponents)
281: .addPreferredGap(
282: org.jdesktop.layout.LayoutStyle.RELATED)
283: .add(
284: layout
285: .createParallelGroup(
286: org.jdesktop.layout.GroupLayout.LEADING)
287: .add(
288: jButtonCheckServer)
289: .add(
290: jScrollPaneTargetComponents,
291: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
292: 213,
293: Short.MAX_VALUE))
294: .add(11, 11, 11)
295: .add(jLabelDeploymentArtifacts)
296: .addPreferredGap(
297: org.jdesktop.layout.LayoutStyle.RELATED)
298: .add(
299: layout
300: .createParallelGroup(
301: org.jdesktop.layout.GroupLayout.LEADING)
302: .add(
303: jScrollPaneDeploymentArtifacts,
304: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
305: 251,
306: Short.MAX_VALUE)
307: .add(
308: layout
309: .createSequentialGroup()
310: .add(
311: jButtonAddProject)
312: .addPreferredGap(
313: org.jdesktop.layout.LayoutStyle.RELATED)
314: .add(
315: jButtonRemoveProject)))
316: .addContainerGap()));
317:
318: jLabelBuildArtifactName.getAccessibleContext()
319: .setAccessibleDescription(
320: org.openide.util.NbBundle.getMessage(
321: CustomizerJarContent.class,
322: "ACS_SERVICE_ASSEMBLY_BUILD_ARTIFACT")); // NOI18N
323: jTextFieldBuildArtifactName.getAccessibleContext()
324: .setAccessibleDescription(
325: org.openide.util.NbBundle.getBundle(
326: CustomizerJarContent.class).getString(
327: "ACS_CustomizeWAR_FileName_A11YDesc")); // NOI18N
328: jLabelTargetComponents.getAccessibleContext()
329: .setAccessibleDescription(
330: "List of Target JBI Components");
331: jButtonCheckServer.getAccessibleContext()
332: .setAccessibleDescription(
333: org.openide.util.NbBundle.getMessage(
334: CustomizerJarContent.class,
335: "ACS_CustomizeWAR_AddFilter_A11YDesc")); // NOI18N
336: jButtonAddProject
337: .getAccessibleContext()
338: .setAccessibleDescription(
339: org.openide.util.NbBundle.getMessage(
340: CustomizerJarContent.class,
341: "ACS_CustomizeWAR_AddProject_A11YDesc")); // NOI18N
342: jButtonRemoveProject
343: .getAccessibleContext()
344: .setAccessibleDescription(
345: org.openide.util.NbBundle
346: .getMessage(CustomizerJarContent.class,
347: "ACS_CustomizeWAR_AdditionalRemove_A11YDesc")); // NOI18N
348: }// </editor-fold>//GEN-END:initComponents
349:
350: // Variables declaration - do not modify//GEN-BEGIN:variables
351: private javax.swing.JButton jButtonAddProject;
352: private javax.swing.JButton jButtonCheckServer;
353: private javax.swing.JButton jButtonRemoveProject;
354: private javax.swing.JLabel jLabelBuildArtifactName;
355: private javax.swing.JLabel jLabelDeploymentArtifacts;
356: private javax.swing.JLabel jLabelTargetComponents;
357: private javax.swing.JScrollPane jScrollPaneDeploymentArtifacts;
358: private javax.swing.JScrollPane jScrollPaneTargetComponents;
359: private javax.swing.JTable jTableDeploymentArtifacts;
360: private javax.swing.JTable jTableTargetComponents;
361: private javax.swing.JTextField jTextFieldBuildArtifactName;
362:
363: // End of variables declaration//GEN-END:variables
364:
365: /** Help context where to find more about the paste type action.
366: * @return the help context for this action
367: */
368: public HelpCtx getHelpCtx() {
369: return new HelpCtx(CustomizerJarContent.class);
370: }
371: }
|