KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tasklist > usertasks > translators > XslTemplatesPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.tasklist.usertasks.translators;
21
22 import javax.swing.DefaultComboBoxModel JavaDoc;
23
24 /**
25  * Panel for choosing a XSL template
26  */

27 public class XslTemplatesPanel extends javax.swing.JPanel JavaDoc {
28     private static final long serialVersionUID = 1;
29
30     /**
31      * Creates new form XSLTemplatesPanel
32      */

33     public XslTemplatesPanel() {
34         initComponents();
35     }
36
37     /** This method is called from within the constructor to
38      * initialize the form.
39      * WARNING: Do NOT modify this code. The content of this method is
40      * always regenerated by the Form Editor.
41      */

42     private void initComponents() {//GEN-BEGIN:initComponents
43
java.awt.GridBagConstraints JavaDoc gridBagConstraints;
44
45         jLabel1 = new javax.swing.JLabel JavaDoc();
46         jComboBoxLayout = new javax.swing.JComboBox JavaDoc();
47         jCheckBoxOpen = new javax.swing.JCheckBox JavaDoc();
48
49         setLayout(new java.awt.GridBagLayout JavaDoc());
50
51         setName(org.openide.util.NbBundle.getBundle(XslTemplatesPanel.class).getString("ChooseHtmlLayout"));
52         jLabel1.setLabelFor(jComboBoxLayout);
53         org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(XslTemplatesPanel.class, "Layout"));
54         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
55         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
56         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 11, 12);
57         add(jLabel1, gridBagConstraints);
58
59         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
60         gridBagConstraints.ipadx = 100;
61         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
62         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 11, 0);
63         add(jComboBoxLayout, gridBagConstraints);
64
65         org.openide.awt.Mnemonics.setLocalizedText(jCheckBoxOpen, org.openide.util.NbBundle.getBundle(XslTemplatesPanel.class).getString("ViewExportedHTML"));
66         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
67         gridBagConstraints.gridx = 0;
68         gridBagConstraints.gridy = 1;
69         gridBagConstraints.gridwidth = 2;
70         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
71         add(jCheckBoxOpen, gridBagConstraints);
72
73     }//GEN-END:initComponents
74

75     
76     // Variables declaration - do not modify//GEN-BEGIN:variables
77
private javax.swing.JCheckBox JavaDoc jCheckBoxOpen;
78     private javax.swing.JComboBox JavaDoc jComboBoxLayout;
79     private javax.swing.JLabel JavaDoc jLabel1;
80     // End of variables declaration//GEN-END:variables
81

82     /**
83      * Sets available layouts
84      *
85      * @param l names of available layouts
86      */

87     public void setAvailableLayouts(String JavaDoc[] l) {
88         jComboBoxLayout.setModel(new DefaultComboBoxModel JavaDoc(l));
89     }
90     
91     /**
92      * Selects the specified layout
93      *
94      * @param index index of the selected layout
95      */

96     public void setLayoutIndex(int index) {
97         jComboBoxLayout.setSelectedIndex(index);
98     }
99     
100     /**
101      * Toggles the checkbox "Open the file in browser"
102      *
103      * @param b true = open
104      */

105     public void setOpenFile(boolean b) {
106         jCheckBoxOpen.setSelected(b);
107     }
108
109     /**
110      * Returns the state of the checkbox "Open the file in browser"
111      *
112      * @return true = open
113      */

114     public boolean getOpenFile() {
115         return jCheckBoxOpen.isSelected();
116     }
117     
118     /**
119      * Returns the index of the selected layout
120      *
121      * @return index of the selected layout
122      */

123     public int getLayoutIndex() {
124         return jComboBoxLayout.getSelectedIndex();
125     }
126 }
127
Popular Tags