Lines 43-49
Link Here
|
43 |
package org.netbeans.modules.maven.j2ee.ui.customizer.impl; |
43 |
package org.netbeans.modules.maven.j2ee.ui.customizer.impl; |
44 |
|
44 |
|
45 |
import java.awt.Component; |
45 |
import java.awt.Component; |
|
|
46 |
import java.awt.Cursor; |
47 |
import java.awt.event.ActionEvent; |
48 |
import java.awt.event.ActionListener; |
46 |
import java.io.IOException; |
49 |
import java.io.IOException; |
|
|
50 |
import java.net.MalformedURLException; |
51 |
import java.net.URL; |
47 |
import java.util.List; |
52 |
import java.util.List; |
48 |
import java.util.Set; |
53 |
import java.util.Set; |
49 |
import java.util.TreeSet; |
54 |
import java.util.TreeSet; |
Lines 83-88
Link Here
|
83 |
import org.netbeans.spi.project.ActionProvider; |
88 |
import org.netbeans.spi.project.ActionProvider; |
84 |
import org.openide.DialogDisplayer; |
89 |
import org.openide.DialogDisplayer; |
85 |
import org.openide.NotifyDescriptor; |
90 |
import org.openide.NotifyDescriptor; |
|
|
91 |
import org.openide.awt.HtmlBrowser; |
86 |
import org.openide.util.Exceptions; |
92 |
import org.openide.util.Exceptions; |
87 |
import org.openide.util.NbBundle; |
93 |
import org.openide.util.NbBundle; |
88 |
import org.openide.util.NbBundle.Messages; |
94 |
import org.openide.util.NbBundle.Messages; |
Lines 95-105
Link Here
|
95 |
public class CustomizerRunWeb extends BaseRunCustomizer { |
101 |
public class CustomizerRunWeb extends BaseRunCustomizer { |
96 |
|
102 |
|
97 |
public static final String PROP_SHOW_IN_BROWSER = "netbeans.deploy.showBrowser"; //NOI18N |
103 |
public static final String PROP_SHOW_IN_BROWSER = "netbeans.deploy.showBrowser"; //NOI18N |
|
|
104 |
public static final String PROP_ALWAYS_BUILD_BEFORE_RUNNING = "netbeans.always.build"; // NOI18N |
98 |
private static final Set<Profile> WEB_PROFILES; |
105 |
private static final Set<Profile> WEB_PROFILES; |
99 |
private static final Set<Profile> FULL_PROFILES; |
106 |
private static final Set<Profile> FULL_PROFILES; |
100 |
|
107 |
|
101 |
private final CheckBoxUpdater copyStaticResourcesUpdater; |
108 |
private final CheckBoxUpdater copyStaticResourcesUpdater; |
102 |
private final CheckBoxUpdater showBrowserUpdater; |
109 |
private final CheckBoxUpdater showBrowserUpdater; |
|
|
110 |
private final CheckBoxUpdater alwaysBuildUpdater; |
103 |
private final ComboBoxUpdater versionUpdater; |
111 |
private final ComboBoxUpdater versionUpdater; |
104 |
private final boolean noServer; |
112 |
private final boolean noServer; |
105 |
|
113 |
|
Lines 141-146
Link Here
|
141 |
super(handle, project); |
149 |
super(handle, project); |
142 |
initComponents(); |
150 |
initComponents(); |
143 |
|
151 |
|
|
|
152 |
btnLearnMore.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
153 |
btnLearnMore.addActionListener(new ActionListener() { |
154 |
@Override |
155 |
public void actionPerformed(ActionEvent e) { |
156 |
try { |
157 |
HtmlBrowser.URLDisplayer.getDefault().showURL(new URL("http://wiki.netbeans.org/FaqDeployOnSave")); |
158 |
} catch (MalformedURLException ex) { |
159 |
Exceptions.printStackTrace(ex); |
160 |
} |
161 |
} |
162 |
}); |
163 |
|
144 |
module = WebModule.getWebModule(project.getProjectDirectory()); |
164 |
module = WebModule.getWebModule(project.getProjectDirectory()); |
145 |
if (module != null) { |
165 |
if (module != null) { |
146 |
contextPathTField.setText(module.getContextPath()); |
166 |
contextPathTField.setText(module.getContextPath()); |
Lines 178-183
Link Here
|
178 |
} |
198 |
} |
179 |
}); |
199 |
}); |
180 |
|
200 |
|
|
|
201 |
Boolean alwaysBuild = (Boolean) project.getProjectDirectory().getAttribute(PROP_ALWAYS_BUILD_BEFORE_RUNNING); |
202 |
if (alwaysBuild == null) { |
203 |
alwaysBuild = Boolean.FALSE; |
204 |
} |
205 |
alwaysBuildUpdater = CheckBoxUpdater.create(jCBAlwaysBuild, alwaysBuild, new CheckBoxUpdater.Store() { |
206 |
|
207 |
@Override |
208 |
public void storeValue(boolean value) { |
209 |
try { |
210 |
if (value) { |
211 |
project.getProjectDirectory().setAttribute(PROP_ALWAYS_BUILD_BEFORE_RUNNING, true); |
212 |
} else { |
213 |
project.getProjectDirectory().setAttribute(PROP_ALWAYS_BUILD_BEFORE_RUNNING, false); |
214 |
} |
215 |
} catch (IOException ex) { |
216 |
Exceptions.printStackTrace(ex); |
217 |
} |
218 |
} |
219 |
}); |
220 |
|
181 |
versionUpdater = createVersionUpdater(J2eeModule.Type.WAR); |
221 |
versionUpdater = createVersionUpdater(J2eeModule.Type.WAR); |
182 |
} |
222 |
} |
183 |
|
223 |
|
Lines 198-203
Link Here
|
198 |
|
238 |
|
199 |
serverUpdater.storeValue(); |
239 |
serverUpdater.storeValue(); |
200 |
versionUpdater.storeValue(); |
240 |
versionUpdater.storeValue(); |
|
|
241 |
alwaysBuildUpdater.storeValue(); |
201 |
deployOnSaveUpdater.storeValue(); |
242 |
deployOnSaveUpdater.storeValue(); |
202 |
copyStaticResourcesUpdater.storeValue(); |
243 |
copyStaticResourcesUpdater.storeValue(); |
203 |
|
244 |
|
Lines 297-303
Link Here
|
297 |
public boolean verifyValue(Object value) { |
338 |
public boolean verifyValue(Object value) { |
298 |
if (WarningPanelSupport.isJavaEEChangeWarningActivated()) { |
339 |
if (WarningPanelSupport.isJavaEEChangeWarningActivated()) { |
299 |
WarningPanel panel = new WarningPanel(WARNING_ChangingJavaEEVersion()); |
340 |
WarningPanel panel = new WarningPanel(WARNING_ChangingJavaEEVersion()); |
300 |
NotifyDescriptor dd = new NotifyDescriptor.Message(panel, NotifyDescriptor.OK_CANCEL_OPTION); |
341 |
NotifyDescriptor dd = new NotifyDescriptor.Confirmation(panel, NotifyDescriptor.OK_CANCEL_OPTION); |
301 |
DialogDisplayer.getDefault().notify(dd); |
342 |
DialogDisplayer.getDefault().notify(dd); |
302 |
|
343 |
|
303 |
if (dd.getValue() == NotifyDescriptor.CANCEL_OPTION) { |
344 |
if (dd.getValue() == NotifyDescriptor.CANCEL_OPTION) { |
Lines 402-407
Link Here
|
402 |
browserLabel = new javax.swing.JLabel(); |
443 |
browserLabel = new javax.swing.JLabel(); |
403 |
jCBBrowser = createBrowserComboBox(); |
444 |
jCBBrowser = createBrowserComboBox(); |
404 |
jCBCopyStaticResources = new javax.swing.JCheckBox(); |
445 |
jCBCopyStaticResources = new javax.swing.JCheckBox(); |
|
|
446 |
jCBAlwaysBuild = new javax.swing.JCheckBox(); |
447 |
btnLearnMore = new javax.swing.JButton(); |
405 |
|
448 |
|
406 |
org.openide.awt.Mnemonics.setLocalizedText(serverLabel, org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "LBL_Server")); // NOI18N |
449 |
org.openide.awt.Mnemonics.setLocalizedText(serverLabel, org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "LBL_Server")); // NOI18N |
407 |
|
450 |
|
Lines 438-443
Link Here
|
438 |
org.openide.awt.Mnemonics.setLocalizedText(jCBCopyStaticResources, org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "CustomizerRunWeb.jCBCopyStaticResources.text")); // NOI18N |
481 |
org.openide.awt.Mnemonics.setLocalizedText(jCBCopyStaticResources, org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "CustomizerRunWeb.jCBCopyStaticResources.text")); // NOI18N |
439 |
jCBCopyStaticResources.setToolTipText(org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "CustomizerRunWeb.jCBCopyStaticResources.toolTipText")); // NOI18N |
482 |
jCBCopyStaticResources.setToolTipText(org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "CustomizerRunWeb.jCBCopyStaticResources.toolTipText")); // NOI18N |
440 |
|
483 |
|
|
|
484 |
org.openide.awt.Mnemonics.setLocalizedText(jCBAlwaysBuild, org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "CustomizerRunWeb.jCBAlwaysBuild.text")); // NOI18N |
485 |
jCBAlwaysBuild.setToolTipText(org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "CustomizerRunWeb.jCBAlwaysBuild.toolTipText")); // NOI18N |
486 |
|
487 |
org.openide.awt.Mnemonics.setLocalizedText(btnLearnMore, org.openide.util.NbBundle.getMessage(CustomizerRunWeb.class, "CustomizerRunWeb.btnLearnMore.text")); // NOI18N |
488 |
btnLearnMore.setBorderPainted(false); |
489 |
btnLearnMore.setContentAreaFilled(false); |
490 |
btnLearnMore.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); |
491 |
|
441 |
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); |
492 |
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); |
442 |
this.setLayout(layout); |
493 |
this.setLayout(layout); |
443 |
layout.setHorizontalGroup( |
494 |
layout.setHorizontalGroup( |
Lines 461-475
Link Here
|
461 |
.addComponent(txtRelativeUrl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
512 |
.addComponent(txtRelativeUrl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
462 |
.addComponent(jCBBrowser, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) |
513 |
.addComponent(jCBBrowser, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) |
463 |
.addGroup(layout.createSequentialGroup() |
514 |
.addGroup(layout.createSequentialGroup() |
|
|
515 |
.addComponent(jCBDeployOnSave) |
516 |
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
517 |
.addGroup(layout.createSequentialGroup() |
464 |
.addGap(21, 21, 21) |
518 |
.addGap(21, 21, 21) |
465 |
.addComponent(dosDescription, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)) |
519 |
.addComponent(dosDescription, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)) |
466 |
.addGroup(layout.createSequentialGroup() |
520 |
.addGroup(layout.createSequentialGroup() |
467 |
.addComponent(jCBDeployOnSave) |
521 |
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
468 |
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
522 |
.addGroup(layout.createSequentialGroup() |
469 |
.addGroup(layout.createSequentialGroup() |
523 |
.addGap(21, 21, 21) |
470 |
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) |
524 |
.addComponent(btnLearnMore, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) |
471 |
.addComponent(jCBshowBrowser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
525 |
.addComponent(jCBAlwaysBuild) |
472 |
.addComponent(jCBCopyStaticResources, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
526 |
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) |
|
|
527 |
.addComponent(jCBshowBrowser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
528 |
.addComponent(jCBCopyStaticResources, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) |
473 |
.addGap(0, 0, Short.MAX_VALUE)))) |
529 |
.addGap(0, 0, Short.MAX_VALUE)))) |
474 |
); |
530 |
); |
475 |
layout.setVerticalGroup( |
531 |
layout.setVerticalGroup( |
Lines 505-510
Link Here
|
505 |
.addComponent(jCBDeployOnSave) |
561 |
.addComponent(jCBDeployOnSave) |
506 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
562 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
507 |
.addComponent(dosDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) |
563 |
.addComponent(dosDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) |
|
|
564 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) |
565 |
.addComponent(jCBAlwaysBuild) |
566 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) |
567 |
.addComponent(btnLearnMore, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) |
508 |
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
568 |
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
509 |
); |
569 |
); |
510 |
|
570 |
|
Lines 543-551
Link Here
|
543 |
|
603 |
|
544 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
604 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
545 |
private javax.swing.JLabel browserLabel; |
605 |
private javax.swing.JLabel browserLabel; |
|
|
606 |
private javax.swing.JButton btnLearnMore; |
546 |
private javax.swing.JLabel contextPathLabel; |
607 |
private javax.swing.JLabel contextPathLabel; |
547 |
private javax.swing.JTextField contextPathTField; |
608 |
private javax.swing.JTextField contextPathTField; |
548 |
private javax.swing.JLabel dosDescription; |
609 |
private javax.swing.JLabel dosDescription; |
|
|
610 |
private javax.swing.JCheckBox jCBAlwaysBuild; |
549 |
private javax.swing.JComboBox jCBBrowser; |
611 |
private javax.swing.JComboBox jCBBrowser; |
550 |
private javax.swing.JCheckBox jCBCopyStaticResources; |
612 |
private javax.swing.JCheckBox jCBCopyStaticResources; |
551 |
private javax.swing.JCheckBox jCBDeployOnSave; |
613 |
private javax.swing.JCheckBox jCBDeployOnSave; |