001: /*
002: * ProjectActionsOptionsPanel.java
003: *
004: * Created on 14 Ð?оÑ?брь 2007 г., 14:43
005: */
006:
007: package org.netbeans.modules.php.project.options;
008:
009: import javax.swing.event.DocumentEvent;
010: import javax.swing.event.DocumentListener;
011:
012: /**
013: *
014: * @author avk
015: */
016: public class ProjectActionsOptionsPanel extends javax.swing.JPanel {
017:
018: /** Creates new form ProjectActionsOptionsPanel */
019: ProjectActionsOptionsPanel(
020: ProjectActionsOptions.Controller controller) {
021: myController = controller;
022: initComponents();
023: }
024:
025: @Override
026: public void addNotify() {
027: super .addNotify();
028: //myListener = new PanelListener();
029: // add listener
030: }
031:
032: @Override
033: public void removeNotify() {
034: // remove listener
035: super .removeNotify();
036: }
037:
038: void cancel() {
039: // do nothing
040: }
041:
042: void load() {
043: // load
044: myRunInClBrowser.setSelected(ProjectActionsPreferences
045: .getInstance().getCommandLineRunOpenInBrowser());
046: myRunInClOutput.setSelected(ProjectActionsPreferences
047: .getInstance().getCommandLineRunPrintToOutput());
048: }
049:
050: void store() {
051: ProjectActionsPreferences.getInstance()
052: .setCommandLineRunOpenInBrowser(
053: myRunInClBrowser.isSelected());
054: ProjectActionsPreferences.getInstance()
055: .setCommandLineRunPrintToOutput(
056: myRunInClOutput.isSelected());
057: }
058:
059: /** This method is called from within the constructor to
060: * initialize the form.
061: * WARNING: Do NOT modify this code. The content of this method is
062: * always regenerated by the Form Editor.
063: */
064: // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
065: private void initComponents() {
066:
067: jSeparator1 = new javax.swing.JSeparator();
068: myRunInClLbl = new javax.swing.JLabel();
069: myRunInClBrowser = new javax.swing.JCheckBox();
070: myRunInClOutput = new javax.swing.JCheckBox();
071:
072: myRunInClLbl.setText(org.openide.util.NbBundle.getMessage(
073: ProjectActionsOptionsPanel.class,
074: "ProjectActionsOptionsPanel.myRunInClLbl.text")); // NOI18N
075:
076: org.openide.awt.Mnemonics.setLocalizedText(myRunInClBrowser,
077: org.openide.util.NbBundle.getMessage(
078: ProjectActionsOptionsPanel.class,
079: "LBL_RunInClBrowser_chk")); // NOI18N
080: myRunInClBrowser
081: .addActionListener(new java.awt.event.ActionListener() {
082: public void actionPerformed(
083: java.awt.event.ActionEvent evt) {
084: myRunInClBrowserActionPerformed(evt);
085: }
086: });
087:
088: org.openide.awt.Mnemonics.setLocalizedText(myRunInClOutput,
089: org.openide.util.NbBundle.getMessage(
090: ProjectActionsOptionsPanel.class,
091: "LBL_RunInClOutput_chk")); // NOI18N
092: myRunInClOutput
093: .addActionListener(new java.awt.event.ActionListener() {
094: public void actionPerformed(
095: java.awt.event.ActionEvent evt) {
096: myRunInClOutputActionPerformed(evt);
097: }
098: });
099:
100: org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
101: this );
102: this .setLayout(layout);
103: layout
104: .setHorizontalGroup(layout
105: .createParallelGroup(
106: org.jdesktop.layout.GroupLayout.LEADING)
107: .add(
108: layout
109: .createSequentialGroup()
110: .addContainerGap()
111: .add(
112: layout
113: .createParallelGroup(
114: org.jdesktop.layout.GroupLayout.LEADING)
115: .add(
116: layout
117: .createSequentialGroup()
118: .add(
119: myRunInClLbl)
120: .addPreferredGap(
121: org.jdesktop.layout.LayoutStyle.RELATED)
122: .add(
123: jSeparator1,
124: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
125: 280,
126: Short.MAX_VALUE))
127: .add(
128: myRunInClBrowser)
129: .add(
130: myRunInClOutput))
131: .addContainerGap()));
132: layout
133: .setVerticalGroup(layout
134: .createParallelGroup(
135: org.jdesktop.layout.GroupLayout.LEADING)
136: .add(
137: layout
138: .createSequentialGroup()
139: .addContainerGap()
140: .add(
141: layout
142: .createParallelGroup(
143: org.jdesktop.layout.GroupLayout.TRAILING)
144: .add(
145: jSeparator1,
146: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
147: 10,
148: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
149: .add(
150: myRunInClLbl))
151: .addPreferredGap(
152: org.jdesktop.layout.LayoutStyle.UNRELATED)
153: .add(myRunInClBrowser)
154: .addPreferredGap(
155: org.jdesktop.layout.LayoutStyle.RELATED)
156: .add(myRunInClOutput)
157: .addContainerGap(
158: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
159: Short.MAX_VALUE)));
160: }// </editor-fold>//GEN-END:initComponents
161:
162: private void myRunInClBrowserActionPerformed(
163: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_myRunInClBrowserActionPerformed
164: changed();
165: }//GEN-LAST:event_myRunInClBrowserActionPerformed
166:
167: private void myRunInClOutputActionPerformed(
168: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_myRunInClOutputActionPerformed
169: changed();
170: }//GEN-LAST:event_myRunInClOutputActionPerformed
171:
172: // Variables declaration - do not modify//GEN-BEGIN:variables
173: private javax.swing.JSeparator jSeparator1;
174: private javax.swing.JCheckBox myRunInClBrowser;
175: private javax.swing.JLabel myRunInClLbl;
176: private javax.swing.JCheckBox myRunInClOutput;
177:
178: // End of variables declaration//GEN-END:variables
179:
180: private class PanelListener implements DocumentListener {
181:
182: /* (non-Javadoc)
183: * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent)
184: */
185: public void changedUpdate(DocumentEvent e) {
186: fireChange();
187: }
188:
189: /* (non-Javadoc)
190: * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent)
191: */
192: public void insertUpdate(DocumentEvent e) {
193: fireChange();
194: }
195:
196: /* (non-Javadoc)
197: * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.DocumentEvent)
198: */
199: public void removeUpdate(DocumentEvent e) {
200: fireChange();
201: }
202:
203: private void fireChange() {
204: changed();
205: }
206: }
207:
208: private void changed() {
209: //interpreterPathIsValid();
210: myController.changed();
211: }
212:
213: private ProjectActionsOptions.Controller myController;
214: //private PanelListener myListener;
215: }
|