001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019: package org.netbeans.modules.bpel.properties.editors;
020:
021: import javax.swing.JPanel;
022:
023: /**
024: * This panel is responsible for creation of standatr button bar with the following buttons:
025: * Up, Down, Add, Edit, Delete.
026: * Button variables have public access, so they can be easy hidden or renamed if necessaty.
027: * @author nk160297
028: */
029: public class StandardButtonBar extends JPanel {
030:
031: static final long serialVersionUID = 1L;
032:
033: public StandardButtonBar() {
034: super ();
035: }
036:
037: public void createContent() {
038: initComponents();
039: }
040:
041: /** This method is called from within the constructor to
042: * initialize the form.
043: * WARNING: Do NOT modify this code. The content of this method is
044: * always regenerated by the Form Editor.
045: */
046: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
047: private void initComponents() {
048: java.awt.GridBagConstraints gridBagConstraints;
049:
050: btnAdd = new javax.swing.JButton();
051: btnEdit = new javax.swing.JButton();
052: btnDelete = new javax.swing.JButton();
053: jPanel2 = new javax.swing.JPanel();
054: btnUp = new javax.swing.JButton();
055: btnDown = new javax.swing.JButton();
056:
057: setLayout(new java.awt.GridBagLayout());
058:
059: btnAdd.setText(org.openide.util.NbBundle.getMessage(
060: FormBundle.class, "BTN_Add"));
061: btnAdd.setMargin(new java.awt.Insets(2, 5, 2, 5));
062: gridBagConstraints = new java.awt.GridBagConstraints();
063: gridBagConstraints.gridx = 4;
064: gridBagConstraints.gridy = 0;
065: gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
066: add(btnAdd, gridBagConstraints);
067: btnAdd.getAccessibleContext().setAccessibleName(
068: org.openide.util.NbBundle.getMessage(FormBundle.class,
069: "ACSN_BTN_Add"));
070: btnAdd.getAccessibleContext().setAccessibleDescription(
071: org.openide.util.NbBundle.getMessage(FormBundle.class,
072: "ACSD_BTN_Add"));
073:
074: btnEdit.setText(org.openide.util.NbBundle.getMessage(
075: FormBundle.class, "BTN_Edit"));
076: btnEdit.setMargin(new java.awt.Insets(2, 5, 2, 5));
077: gridBagConstraints = new java.awt.GridBagConstraints();
078: gridBagConstraints.gridx = 5;
079: gridBagConstraints.gridy = 0;
080: gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
081: add(btnEdit, gridBagConstraints);
082: btnEdit.getAccessibleContext().setAccessibleName(
083: org.openide.util.NbBundle.getMessage(FormBundle.class,
084: "ACSN_BTN_Edit"));
085: btnEdit.getAccessibleContext().setAccessibleDescription(
086: org.openide.util.NbBundle.getMessage(FormBundle.class,
087: "ACSD_BTN_Edit"));
088:
089: btnDelete.setText(org.openide.util.NbBundle.getMessage(
090: FormBundle.class, "BTN_Remove"));
091: btnDelete.setMargin(new java.awt.Insets(2, 5, 2, 5));
092: gridBagConstraints = new java.awt.GridBagConstraints();
093: gridBagConstraints.gridx = 6;
094: gridBagConstraints.gridy = 0;
095: gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
096: add(btnDelete, gridBagConstraints);
097: btnDelete.getAccessibleContext().setAccessibleName(
098: org.openide.util.NbBundle.getMessage(FormBundle.class,
099: "ACSN_BTN_Remove"));
100: btnDelete.getAccessibleContext().setAccessibleDescription(
101: org.openide.util.NbBundle.getMessage(FormBundle.class,
102: "ACSD_BTN_Remove"));
103:
104: org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(
105: jPanel2);
106: jPanel2.setLayout(jPanel2Layout);
107: jPanel2Layout.setHorizontalGroup(jPanel2Layout
108: .createParallelGroup(
109: org.jdesktop.layout.GroupLayout.LEADING).add(0,
110: 0, Short.MAX_VALUE));
111: jPanel2Layout.setVerticalGroup(jPanel2Layout
112: .createParallelGroup(
113: org.jdesktop.layout.GroupLayout.LEADING).add(0,
114: 0, Short.MAX_VALUE));
115: gridBagConstraints = new java.awt.GridBagConstraints();
116: gridBagConstraints.gridx = 1;
117: gridBagConstraints.gridy = 0;
118: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
119: gridBagConstraints.weightx = 1.0;
120: add(jPanel2, gridBagConstraints);
121:
122: btnUp.setText(org.openide.util.NbBundle.getMessage(
123: FormBundle.class, "BTN_Up"));
124: btnUp.setMargin(new java.awt.Insets(2, 5, 2, 5));
125: gridBagConstraints = new java.awt.GridBagConstraints();
126: gridBagConstraints.gridx = 2;
127: gridBagConstraints.gridy = 0;
128: gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
129: add(btnUp, gridBagConstraints);
130: btnUp.getAccessibleContext().setAccessibleName(
131: org.openide.util.NbBundle.getMessage(FormBundle.class,
132: "ACSN_BTN_Up"));
133: btnUp.getAccessibleContext().setAccessibleDescription(
134: org.openide.util.NbBundle.getMessage(FormBundle.class,
135: "ACSD_BTN_Up"));
136:
137: btnDown.setText(org.openide.util.NbBundle.getMessage(
138: FormBundle.class, "BTN_Down"));
139: btnDown.setMargin(new java.awt.Insets(2, 5, 2, 5));
140: gridBagConstraints = new java.awt.GridBagConstraints();
141: gridBagConstraints.gridx = 3;
142: gridBagConstraints.gridy = 0;
143: gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 6);
144: add(btnDown, gridBagConstraints);
145: btnDown.getAccessibleContext().setAccessibleName(
146: org.openide.util.NbBundle.getMessage(FormBundle.class,
147: "ACSN_BTN_Down"));
148: btnDown.getAccessibleContext().setAccessibleDescription(
149: org.openide.util.NbBundle.getMessage(FormBundle.class,
150: "ACSD_BTN_Down"));
151:
152: }// </editor-fold>//GEN-END:initComponents
153:
154: // Variables declaration - do not modify//GEN-BEGIN:variables
155: public javax.swing.JButton btnAdd;
156: public javax.swing.JButton btnDelete;
157: public javax.swing.JButton btnDown;
158: public javax.swing.JButton btnEdit;
159: public javax.swing.JButton btnUp;
160: private javax.swing.JPanel jPanel2;
161: // End of variables declaration//GEN-END:variables
162: }
|