X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fgui%2FEditNodeDialog.java;h=12c91cba5069d50c5518deaf5f240a4c78fa47e8;hb=72a6784258f756eb23b39a9f8021b400829cbcec;hp=73602fc4ba343a9c0876f05b5e71ffd853922109;hpb=b71f4f4aeb7440b88dd82a252cd296506427c440;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/gui/EditNodeDialog.java b/src/net/pterodactylus/jsite/gui/EditNodeDialog.java index 73602fc..12c91cb 100644 --- a/src/net/pterodactylus/jsite/gui/EditNodeDialog.java +++ b/src/net/pterodactylus/jsite/gui/EditNodeDialog.java @@ -39,6 +39,8 @@ import javax.swing.border.EtchedBorder; import net.pterodactylus.jsite.i18n.I18n; import net.pterodactylus.jsite.i18n.I18nable; +import net.pterodactylus.jsite.i18n.gui.I18nAction; +import net.pterodactylus.jsite.i18n.gui.I18nLabel; import net.pterodactylus.jsite.main.Version; import net.pterodactylus.util.swing.SwingUtils; @@ -88,6 +90,9 @@ public class EditNodeDialog extends JDialog implements I18nable { /** The same machine checkbox. */ private JCheckBox sameMachineCheckBox; + + /** The same machine action. */ + private I18nAction sameMachineAction; /** Whether the dialog was cancelled. */ private boolean cancelled; @@ -231,6 +236,12 @@ public class EditNodeDialog extends JDialog implements I18nable { cancel(); } }; + sameMachineAction = new I18nAction("editNodeDialog.checkbox.sameMachine") { + + public void actionPerformed(ActionEvent e) { + /* don't do anything. */ + } + }; } /** @@ -265,12 +276,7 @@ public class EditNodeDialog extends JDialog implements I18nable { 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, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(12, 12, 0, 0), 0, 0)); - sameMachineCheckBox = new JCheckBox(new I18nAction("editNodeDialog.checkbox.sameMachine") { - - public void actionPerformed(ActionEvent e) { - /* don't do anything. */ - } - }); + sameMachineCheckBox = new JCheckBox(sameMachineAction); contentPanel.add(sameMachineCheckBox, new GridBagConstraints(0, 3, 2, 1, 1, 1, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0)); } @@ -375,6 +381,7 @@ public class EditNodeDialog extends JDialog implements I18nable { nameLabel.updateI18n(); hostnameLabel.updateI18n(); portLabel.updateI18n(); + sameMachineAction.updateI18n(); setTitle(I18n.get("editNodeDialog.title") + " – jSite " + Version.getVersion()); SwingUtils.repackCentered(this); }