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.xslt.project.wizard.element;
042:
043: import java.awt.GridBagConstraints;
044: import java.awt.GridBagLayout;
045: import java.awt.Insets;
046:
047: import javax.swing.ButtonGroup;
048: import javax.swing.JPanel;
049: import javax.swing.JRadioButton;
050:
051: import javax.swing.JTextArea;
052: import org.netbeans.api.project.Project;
053: import static org.netbeans.modules.soa.ui.util.UI.*;
054:
055: /**
056: * @author Vladimir Yaroslavskiy
057: * @version 2006.12.25
058: */
059: final class PanelStartup<T> extends Panel<T> {
060:
061: PanelStartup(Project project, Panel<T> parent) {
062: super (project, parent);
063: myTransformationPanel = new PanelWSDL<T>(getProject(), this );
064: myProxyPanel = new PanelWSDLs<T>(getProject(), this );
065: }
066:
067: @Override
068: protected String getComponentName() {
069: return NAME_TYPE;
070: }
071:
072: @Override
073: protected Panel<T> getNext() {
074: if (myTransformation != null && myTransformation.isSelected()) {
075: return myTransformationPanel;
076: } else {
077: return myProxyPanel;
078: }
079: }
080:
081: @Override
082: protected void createPanel(JPanel mainPanel, GridBagConstraints cc) {
083: JPanel panel = new JPanel(new GridBagLayout());
084: GridBagConstraints c = new GridBagConstraints();
085: ButtonGroup group = new ButtonGroup();
086: c.anchor = GridBagConstraints.NORTHWEST;
087: c.weightx = 1.0;
088: c.weighty = 1.0;
089:
090: // (o) Request-Reply Service
091: c.gridy++;
092: c.insets = new Insets(SMALL_INSET, 0, 0, 0);
093: myTransformation = createRadioButton(i18n("LBL_Service"),
094: i18n("TLT_Service")); // NOI18N
095: myTransformation.getAccessibleContext()
096: .setAccessibleDescription(i18n("ACSD_LBL_Service"));
097: panel.add(myTransformation, c);
098: group.add(myTransformation);
099:
100: // text
101: c.gridy++;
102: c.insets = new Insets(SMALL_INSET, MEDIUM_INSET + SMALL_INSET
103: + TINY_INSET, TINY_INSET, 0);
104: JTextArea serviceText = createTextArea(TEXT_WIDTH,
105: i18n("LBL_Service_Text"));
106: a11y(serviceText, "ACSN_LBL_Service_Text",
107: "ACSD_LBL_Service_Text");
108: panel.add(serviceText, c);//NOI18N
109:
110: // (o) Proxy Service
111: c.gridy++;
112: c.insets = new Insets(SMALL_INSET, 0, 0, 0);
113: myProxy = createRadioButton(i18n("LBL_Bridge"),
114: i18n("TLT_Bridge")); // NOI18N
115: myProxy.getAccessibleContext().setAccessibleDescription(
116: i18n("ACSD_LBL_Bridge"));
117: panel.add(myProxy, c);
118: group.add(myProxy);
119:
120: myTransformation.setSelected(true);
121:
122: // text
123: c.gridy++;
124: c.insets = new Insets(SMALL_INSET, MEDIUM_INSET + SMALL_INSET
125: + TINY_INSET, TINY_INSET, 0);
126: JTextArea bridgeText = createTextArea(TEXT_WIDTH,
127: i18n("LBL_Bridge_Text"));
128: a11y(bridgeText, "ACSN_LBL_Bridge_Text", "ACSD_LBL_Bridge_Text");
129: panel.add(bridgeText, c); // NOI18N
130:
131: // panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.blue));
132: mainPanel.add(panel, cc);
133: mainPanel.getAccessibleContext().setAccessibleDescription(
134: i18n("ACSD_LBL_NewXsltService"));
135: }
136:
137: private Panel<T> myTransformationPanel;
138: private JRadioButton myTransformation;
139: private Panel<T> myProxyPanel;
140: private JRadioButton myProxy;
141: private static final int TEXT_WIDTH = 40;
142: }
|