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.web.wizards;
043:
044: import java.awt.GridBagConstraints;
045: import java.awt.Insets;
046:
047: import javax.swing.JLabel;
048: import javax.swing.JPanel;
049:
050: import org.openide.util.NbBundle;
051: import org.openide.util.HelpCtx;
052:
053: /* Wizard panel that collects additional info for Filters
054: *
055: * @author Ana von Klopp
056: */
057:
058: class DeployDataExtraPanel extends BaseWizardPanel {
059:
060: private ServletData deployData;
061: private JLabel jLinstruction;
062: private InitParamPanel paramPanel;
063:
064: private static final long serialVersionUID = -2720213209076965116L;
065:
066: DeployDataExtraPanel(TargetEvaluator evaluator) {
067:
068: deployData = (ServletData) (evaluator.getDeployData());
069: setName(NbBundle.getMessage(DeployDataExtraPanel.class,
070: "TITLE_ddpanel_filter_2"));
071: getAccessibleContext().setAccessibleDescription(
072: NbBundle.getMessage(DeployDataExtraPanel.class,
073: "ACSD_deployment_2"));
074: initComponents();
075: fireChangeEvent();
076: }
077:
078: private void initComponents() {
079:
080: // Layout description
081: setLayout(new java.awt.GridBagLayout());
082: setPreferredSize(new java.awt.Dimension(450, 250));
083:
084: // Entity covers entire row
085: GridBagConstraints fullRowC = new GridBagConstraints();
086: fullRowC.gridx = 0;
087: fullRowC.gridy = GridBagConstraints.RELATIVE;
088: fullRowC.gridwidth = 10;
089: fullRowC.weightx = 1.0;
090: fullRowC.anchor = GridBagConstraints.WEST;
091: fullRowC.fill = GridBagConstraints.HORIZONTAL;
092: fullRowC.insets = new Insets(4, 0, 4, 60);
093:
094: // Table panel
095: GridBagConstraints tablePanelC = new GridBagConstraints();
096: tablePanelC.gridx = 0;
097: tablePanelC.gridy = GridBagConstraints.RELATIVE;
098: tablePanelC.gridheight = 5;
099: tablePanelC.gridwidth = 10;
100: tablePanelC.fill = GridBagConstraints.BOTH;
101: tablePanelC.weightx = 1.0;
102: //tablePanelC.weighty = 1.0;
103: tablePanelC.anchor = GridBagConstraints.WEST;
104: tablePanelC.insets = new Insets(4, 0, 4, 0);
105:
106: // Filler
107: GridBagConstraints fillerC = new GridBagConstraints();
108: fillerC.gridx = 0;
109: fillerC.weighty = 1.0;
110: fillerC.gridy = GridBagConstraints.RELATIVE;
111: fillerC.fill = GridBagConstraints.HORIZONTAL;
112:
113: // Component Initialization by row
114: // 1. Instruction
115: jLinstruction = new JLabel(NbBundle.getMessage(
116: DeployDataExtraPanel.class, "LBL_dd_filter_2"));
117: this .add(jLinstruction, fullRowC);
118:
119: // 2. Init param table
120: paramPanel = new InitParamPanel(deployData, this );
121: this .add(paramPanel, tablePanelC);
122:
123: // 3. Add vertical filler at the bottom
124: JPanel filler2 = new JPanel();
125: this .add(filler2, fillerC);
126: }
127:
128: public void setData() {
129: jLinstruction.setEnabled(deployData.makeEntry());
130: paramPanel.setEnabled(deployData.makeEntry());
131: }
132:
133: public void log(String s) {
134: System.out.println("DeployDataExtraPanel" + s); //NOI18N
135: }
136:
137: public HelpCtx getHelp() {
138: return new HelpCtx(DeployDataExtraPanel.class);
139: }
140: }
|