Lines 56-61
Link Here
|
56 |
import javax.swing.JList; |
56 |
import javax.swing.JList; |
57 |
import javax.swing.ListCellRenderer; |
57 |
import javax.swing.ListCellRenderer; |
58 |
import javax.swing.event.ChangeListener; |
58 |
import javax.swing.event.ChangeListener; |
|
|
59 |
import javax.swing.event.DocumentEvent; |
60 |
import javax.swing.event.DocumentListener; |
59 |
import org.netbeans.api.j2ee.core.Profile; |
61 |
import org.netbeans.api.j2ee.core.Profile; |
60 |
import org.netbeans.api.java.project.JavaProjectConstants; |
62 |
import org.netbeans.api.java.project.JavaProjectConstants; |
61 |
import org.netbeans.api.project.Project; |
63 |
import org.netbeans.api.project.Project; |
Lines 78-89
Link Here
|
78 |
private final ChangeListener listener; |
80 |
private final ChangeListener listener; |
79 |
private final Project project; |
81 |
private final Project project; |
80 |
private ComboBoxModel projectsList; |
82 |
private ComboBoxModel projectsList; |
|
|
83 |
private final TimerOptions timerOptions; |
81 |
|
84 |
|
82 |
|
85 |
|
83 |
/** Creates new form SingleEJBWizardPanel */ |
86 |
/** Creates new form SingleEJBWizardPanel */ |
84 |
public SessionEJBWizardPanel(Project project, ChangeListener changeListener) { |
87 |
public SessionEJBWizardPanel(Project project, ChangeListener changeListener, TimerOptions timerOptions) { |
85 |
this.listener = changeListener; |
88 |
this.listener = changeListener; |
86 |
this.project = project; |
89 |
this.project = project; |
|
|
90 |
this.timerOptions = timerOptions; |
87 |
initComponents(); |
91 |
initComponents(); |
88 |
|
92 |
|
89 |
J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project); |
93 |
J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project); |
Lines 93-99
Link Here
|
93 |
remoteCheckBox.setVisible(false); |
97 |
remoteCheckBox.setVisible(false); |
94 |
remoteCheckBox.setEnabled(false); |
98 |
remoteCheckBox.setEnabled(false); |
95 |
} |
99 |
} |
|
|
100 |
// enable Schedule section if Timer Session EJB, disable otherwise |
101 |
if (this.timerOptions == null) { |
102 |
schedulePanel.setVisible(false); |
103 |
schedulePanel.setEnabled(false); |
104 |
} else { |
105 |
statefulButton.setEnabled(false); |
106 |
statefulButton.setVisible(false); |
107 |
} |
96 |
} else { |
108 |
} else { |
|
|
109 |
// hide whole Schedule section |
110 |
schedulePanel.setVisible(false); |
111 |
schedulePanel.setEnabled(false); |
112 |
// hide singleton radio button |
97 |
singletonButton.setVisible(false); |
113 |
singletonButton.setVisible(false); |
98 |
singletonButton.setEnabled(false); |
114 |
singletonButton.setEnabled(false); |
99 |
localCheckBox.setSelected(true); |
115 |
localCheckBox.setSelected(true); |
Lines 117-122
Link Here
|
117 |
updateInProjectCombo(remoteCheckBox.isSelected()); |
133 |
updateInProjectCombo(remoteCheckBox.isSelected()); |
118 |
} |
134 |
} |
119 |
}); |
135 |
}); |
|
|
136 |
scheduleTextArea.getDocument().addDocumentListener(new DocumentListener() { |
137 |
public void insertUpdate(DocumentEvent e) { |
138 |
listener.stateChanged(null); |
139 |
} |
140 |
public void removeUpdate(DocumentEvent e) { |
141 |
listener.stateChanged(null); |
142 |
} |
143 |
public void changedUpdate(DocumentEvent e) { |
144 |
listener.stateChanged(null); |
145 |
} |
146 |
}); |
120 |
updateInProjectCombo(false); |
147 |
updateInProjectCombo(false); |
121 |
} |
148 |
} |
122 |
|
149 |
|
Lines 191-196
Link Here
|
191 |
private void initComponents() { |
218 |
private void initComponents() { |
192 |
|
219 |
|
193 |
sessionStateButtons = new javax.swing.ButtonGroup(); |
220 |
sessionStateButtons = new javax.swing.ButtonGroup(); |
|
|
221 |
jInternalFrame1 = new javax.swing.JInternalFrame(); |
194 |
sessionTypeLabel = new javax.swing.JLabel(); |
222 |
sessionTypeLabel = new javax.swing.JLabel(); |
195 |
statelessButton = new javax.swing.JRadioButton(); |
223 |
statelessButton = new javax.swing.JRadioButton(); |
196 |
statefulButton = new javax.swing.JRadioButton(); |
224 |
statefulButton = new javax.swing.JRadioButton(); |
Lines 199-204
Link Here
|
199 |
localCheckBox = new javax.swing.JCheckBox(); |
227 |
localCheckBox = new javax.swing.JCheckBox(); |
200 |
singletonButton = new javax.swing.JRadioButton(); |
228 |
singletonButton = new javax.swing.JRadioButton(); |
201 |
inProjectCombo = new javax.swing.JComboBox(); |
229 |
inProjectCombo = new javax.swing.JComboBox(); |
|
|
230 |
schedulePanel = new javax.swing.JPanel(); |
231 |
scheduleLabel = new javax.swing.JLabel(); |
232 |
scheduleScrollPane = new javax.swing.JScrollPane(); |
233 |
scheduleTextArea = new javax.swing.JTextArea(); |
234 |
|
235 |
jInternalFrame1.setVisible(true); |
236 |
|
237 |
org.jdesktop.layout.GroupLayout jInternalFrame1Layout = new org.jdesktop.layout.GroupLayout(jInternalFrame1.getContentPane()); |
238 |
jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout); |
239 |
jInternalFrame1Layout.setHorizontalGroup( |
240 |
jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
241 |
.add(0, 0, Short.MAX_VALUE) |
242 |
); |
243 |
jInternalFrame1Layout.setVerticalGroup( |
244 |
jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
245 |
.add(0, 0, Short.MAX_VALUE) |
246 |
); |
202 |
|
247 |
|
203 |
org.openide.awt.Mnemonics.setLocalizedText(sessionTypeLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_SessionType")); // NOI18N |
248 |
org.openide.awt.Mnemonics.setLocalizedText(sessionTypeLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_SessionType")); // NOI18N |
204 |
|
249 |
|
Lines 223-256
Link Here
|
223 |
singletonButton.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_Singleton").charAt(0)); |
268 |
singletonButton.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_Singleton").charAt(0)); |
224 |
singletonButton.setText(org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_Singleton")); // NOI18N |
269 |
singletonButton.setText(org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_Singleton")); // NOI18N |
225 |
|
270 |
|
|
|
271 |
scheduleLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_Schedule").charAt(0)); |
272 |
scheduleLabel.setLabelFor(scheduleTextArea); |
273 |
scheduleLabel.setText(org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_Schedule")); // NOI18N |
274 |
scheduleLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
275 |
|
276 |
scheduleTextArea.setColumns(20); |
277 |
scheduleTextArea.setLineWrap(true); |
278 |
scheduleTextArea.setRows(4); |
279 |
scheduleTextArea.setText("minute=\"*\", second=\"0\", dayOfMonth=\"*\", month=\"*\", year=\"*\", hour=\"9-17\", dayOfWeek=\"Mon-Fri\""); // NOI18N |
280 |
scheduleTextArea.setWrapStyleWord(true); |
281 |
scheduleTextArea.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); |
282 |
scheduleScrollPane.setViewportView(scheduleTextArea); |
283 |
scheduleTextArea.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_Schedule")); // NOI18N |
284 |
|
285 |
org.jdesktop.layout.GroupLayout schedulePanelLayout = new org.jdesktop.layout.GroupLayout(schedulePanel); |
286 |
schedulePanel.setLayout(schedulePanelLayout); |
287 |
schedulePanelLayout.setHorizontalGroup( |
288 |
schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
289 |
.add(schedulePanelLayout.createSequentialGroup() |
290 |
.addContainerGap() |
291 |
.add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
292 |
.add(scheduleScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE) |
293 |
.add(schedulePanelLayout.createSequentialGroup() |
294 |
.add(scheduleLabel) |
295 |
.addContainerGap(206, Short.MAX_VALUE)))) |
296 |
); |
297 |
schedulePanelLayout.setVerticalGroup( |
298 |
schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
299 |
.add(schedulePanelLayout.createSequentialGroup() |
300 |
.add(scheduleLabel) |
301 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
302 |
.add(scheduleScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
303 |
.addContainerGap()) |
304 |
); |
305 |
|
306 |
scheduleLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_Schedule")); // NOI18N |
307 |
|
226 |
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
308 |
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
227 |
this.setLayout(layout); |
309 |
this.setLayout(layout); |
228 |
layout.setHorizontalGroup( |
310 |
layout.setHorizontalGroup( |
229 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
311 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|
|
312 |
.add(sessionTypeLabel) |
230 |
.add(layout.createSequentialGroup() |
313 |
.add(layout.createSequentialGroup() |
|
|
314 |
.addContainerGap() |
315 |
.add(statelessButton)) |
316 |
.add(layout.createSequentialGroup() |
317 |
.addContainerGap() |
318 |
.add(statefulButton)) |
319 |
.add(layout.createSequentialGroup() |
320 |
.addContainerGap() |
321 |
.add(singletonButton)) |
322 |
.add(interfaceLabel) |
323 |
.add(layout.createSequentialGroup() |
324 |
.addContainerGap() |
231 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
325 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
232 |
.add(sessionTypeLabel) |
326 |
.add(remoteCheckBox) |
233 |
.add(layout.createSequentialGroup() |
327 |
.add(localCheckBox)) |
234 |
.addContainerGap() |
328 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
235 |
.add(statelessButton)) |
329 |
.add(inProjectCombo, 0, 234, Short.MAX_VALUE) |
236 |
.add(layout.createSequentialGroup() |
|
|
237 |
.addContainerGap() |
238 |
.add(statefulButton)) |
239 |
.add(layout.createSequentialGroup() |
240 |
.addContainerGap() |
241 |
.add(singletonButton)) |
242 |
.add(interfaceLabel) |
243 |
.add(layout.createSequentialGroup() |
244 |
.addContainerGap() |
245 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
246 |
.add(layout.createSequentialGroup() |
247 |
.add(remoteCheckBox) |
248 |
.add(6, 6, 6) |
249 |
.add(inProjectCombo, 0, 129, Short.MAX_VALUE)) |
250 |
.add(layout.createSequentialGroup() |
251 |
.add(localCheckBox) |
252 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 152, Short.MAX_VALUE))))) |
253 |
.addContainerGap()) |
330 |
.addContainerGap()) |
|
|
331 |
.add(schedulePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
254 |
); |
332 |
); |
255 |
layout.setVerticalGroup( |
333 |
layout.setVerticalGroup( |
256 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
334 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
Lines 264-275
Link Here
|
264 |
.add(singletonButton) |
342 |
.add(singletonButton) |
265 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
343 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
266 |
.add(interfaceLabel) |
344 |
.add(interfaceLabel) |
267 |
.add(0, 0, 0) |
345 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
268 |
.add(localCheckBox) |
346 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
269 |
.add(0, 0, 0) |
347 |
.add(layout.createSequentialGroup() |
270 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
348 |
.add(localCheckBox) |
271 |
.add(remoteCheckBox) |
349 |
.add(2, 2, 2) |
272 |
.add(inProjectCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) |
350 |
.add(remoteCheckBox)) |
|
|
351 |
.add(inProjectCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
352 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
353 |
.add(schedulePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
273 |
); |
354 |
); |
274 |
|
355 |
|
275 |
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle"); // NOI18N |
356 |
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle"); // NOI18N |
Lines 287-294
Link Here
|
287 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
368 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
288 |
private javax.swing.JComboBox inProjectCombo; |
369 |
private javax.swing.JComboBox inProjectCombo; |
289 |
private javax.swing.JLabel interfaceLabel; |
370 |
private javax.swing.JLabel interfaceLabel; |
|
|
371 |
private javax.swing.JInternalFrame jInternalFrame1; |
290 |
private javax.swing.JCheckBox localCheckBox; |
372 |
private javax.swing.JCheckBox localCheckBox; |
291 |
private javax.swing.JCheckBox remoteCheckBox; |
373 |
private javax.swing.JCheckBox remoteCheckBox; |
|
|
374 |
private javax.swing.JLabel scheduleLabel; |
375 |
private javax.swing.JPanel schedulePanel; |
376 |
private javax.swing.JScrollPane scheduleScrollPane; |
377 |
private javax.swing.JTextArea scheduleTextArea; |
292 |
private javax.swing.ButtonGroup sessionStateButtons; |
378 |
private javax.swing.ButtonGroup sessionStateButtons; |
293 |
private javax.swing.JLabel sessionTypeLabel; |
379 |
private javax.swing.JLabel sessionTypeLabel; |
294 |
private javax.swing.JRadioButton singletonButton; |
380 |
private javax.swing.JRadioButton singletonButton; |
Lines 316-321
Link Here
|
316 |
return localCheckBox.isSelected(); |
402 |
return localCheckBox.isSelected(); |
317 |
} |
403 |
} |
318 |
|
404 |
|
|
|
405 |
public TimerOptions getTimerOptions() { |
406 |
if (timerOptions == null) { |
407 |
return null; |
408 |
} else { |
409 |
timerOptions.setTimerOptions(scheduleTextArea.getText()); |
410 |
return timerOptions; |
411 |
} |
412 |
} |
413 |
|
414 |
public String getTimerOptionsError() { |
415 |
return TimerOptions.validate(scheduleTextArea.getText()); |
416 |
} |
417 |
|
319 |
public Project getRemoteInterfaceProject() { |
418 |
public Project getRemoteInterfaceProject() { |
320 |
if (projectsList == null) { |
419 |
if (projectsList == null) { |
321 |
return null; |
420 |
return null; |