01: package com.caucho.netbeans.ide.ui;
02:
03: import com.caucho.netbeans.ide.AddInstanceIterator;
04: import java.awt.Component;
05: import java.util.logging.Logger;
06: import org.openide.util.HelpCtx;
07:
08: public class AddServerLocationPanel extends AbstractWizardPanel {
09: private static final Logger log = Logger
10: .getLogger(AddServerLocationPanel.class.getName());
11:
12: private final static String ERROR_MESSAGE = "WizardPanel_errorMessage";
13:
14: private AddInstanceIterator _addServer;
15: private AddServerVisualPanel _component;
16:
17: public AddServerLocationPanel(AddInstanceIterator addServer) {
18: _addServer = addServer;
19:
20: addChangeListener(addServer);
21: }
22:
23: public boolean isValid() {
24: getComponent();
25:
26: _addServer.setResinHome(_component.getResinHome());
27:
28: if (!_addServer.isResinHomeValid()) {
29: _wizard.putProperty(ERROR_MESSAGE, "Invalid resin-home");
30: return false;
31: }
32:
33: _addServer.setPort(_component.getPort());
34:
35: if (1024 < _addServer.getPort() && _addServer.getPort() < 32767) {
36:
37: } else {
38: _wizard.putProperty(ERROR_MESSAGE, "Invalid port");
39: }
40:
41: _wizard.putProperty(ERROR_MESSAGE, null);
42:
43: return true;
44: }
45:
46: @Override
47: public HelpCtx getHelp() {
48: return HelpCtx.DEFAULT_HELP;
49: }
50:
51: public Component getComponent() {
52: if (_component == null)
53: _component = new AddServerVisualPanel(_addServer, this);
54:
55: return _component;
56: }
57: }
|