import javax.swing.BorderFactory;
import javax.swing.JButton;
-import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/** The FNP port number of the node. */
private int port;
- /** Whether the node is on the same machine. */
- private boolean sameMachine;
-
/** Action of the okay button. */
private I18nAction okayAction;
/** The port textfield. */
private JTextField portTextField;
- /** The same machine checkbox. */
- private JCheckBox sameMachineCheckBox;
-
- /** The same machine action. */
- private I18nAction sameMachineAction;
-
/** Whether the dialog was cancelled. */
private boolean cancelled;
}
/**
- * Returns whether the node is on the same machine as jSite.
- *
- * @return <code>true</code> if the node is on the same machine as jSite,
- * <code>false</code> otherwise
- */
- public boolean isNodeOnSameMachine() {
- return sameMachine;
- }
-
- /**
- * Sets whether the node is on the same machine as jSite.
- *
- * @param sameMachine
- * <code>true</code> if the node is on the same machine as
- * jSite, <code>false</code> otherwise
- */
- public void setNodeOnSameMachine(boolean sameMachine) {
- this.sameMachine = sameMachine;
- sameMachineCheckBox.setSelected(sameMachine);
- }
-
- /**
* Returns whether the dialog was cancelled.
*
* @return <code>true</code> if the dialog was cancelled,
cancel();
}
};
- sameMachineAction = new I18nAction("editNodeDialog.checkbox.sameMachine") {
-
- public void actionPerformed(ActionEvent e) {
- /* don't do anything. */
- }
- };
}
/**
contentPanel.add(portLabel = new I18nLabel("editNodeDialog.label.port", portTextField), new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.LINE_END, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0));
contentPanel.add(portTextField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(12, 12, 0, 0), 0, 0));
- sameMachineCheckBox = new JCheckBox(sameMachineAction);
- contentPanel.add(sameMachineCheckBox, new GridBagConstraints(0, 3, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0));
-
- contentPanel.add(new JPanel(), new GridBagConstraints(0, 4, 2, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+ contentPanel.add(new JPanel(), new GridBagConstraints(0, 3, 2, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
}
//
/* should not occur, the value was checked! */
assert false: "port number is invalid though it was checked!";
}
- sameMachine = sameMachineCheckBox.isSelected();
cancelled = false;
setVisible(false);
}
nameLabel.updateI18n();
hostnameLabel.updateI18n();
portLabel.updateI18n();
- sameMachineAction.updateI18n();
setTitle(I18n.get("editNodeDialog.title") + " – jSite " + Version.getVersion());
SwingUtils.repackCentered(this);
}