X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fgui%2FManageNodesDialog.java;h=cf32cae2218b7aa67c72d7e2db91648bba398e2f;hb=7e16d0a3b4f15da04f665fc011f78af2bc93a13d;hp=0ae270ca5400d9d99e4a199da2357a90962f2d4d;hpb=6f655f2a30d35fd6192ea86ccfd08149438011b0;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/gui/ManageNodesDialog.java b/src/net/pterodactylus/jsite/gui/ManageNodesDialog.java index 0ae270c..cf32cae 100644 --- a/src/net/pterodactylus/jsite/gui/ManageNodesDialog.java +++ b/src/net/pterodactylus/jsite/gui/ManageNodesDialog.java @@ -44,12 +44,13 @@ import net.pterodactylus.jsite.core.Node; 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; /** * Dialog that lets the user manage her nodes. - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> * @version $Id$ */ @@ -79,6 +80,9 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** The “edit node” dialog. */ private EditNodeDialog editNodeDialog; + /** The warning label. */ + private I18nLabel immediatelyEffectiveLabel; + /** The node list. */ private JList nodeList; @@ -87,7 +91,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Creates a new node manager dialog. - * + * * @param swingInterface * The Swing interface */ @@ -108,7 +112,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Expose the edit node dialog for the simple mode. - * + * * @return The edit node dialog */ EditNodeDialog getEditNodeDialog() { @@ -117,7 +121,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Returns the list of nodes. - * + * * @return The list of nodes */ public List getNodeList() { @@ -126,12 +130,12 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Sets the list of nodes. - * + * * @param nodeList * The list of nodes */ public void setNodeList(List nodeList) { - originalNodeList = nodeList; + originalNodeList = new ArrayList(nodeList); nodeListModel.clear(); for (Node node: nodeList) { nodeListModel.addNode(node); @@ -218,6 +222,11 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, rootPanel.add(contentPanel, BorderLayout.CENTER); contentPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(12, 12, 12, 12))); + JPanel warningPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 12, 12)); + warningPanel.setBorder(BorderFactory.createEmptyBorder(-12, -12, -12, -12)); + warningPanel.add(immediatelyEffectiveLabel = new I18nLabel("manageNodesDialog.label.immediatelyEffective")); + contentPanel.add(warningPanel, BorderLayout.PAGE_START); + JPanel listButtonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 12, 12)); contentPanel.add(listButtonPanel, BorderLayout.PAGE_END); listButtonPanel.setBorder(BorderFactory.createEmptyBorder(-12, -12, -12, -12)); @@ -299,7 +308,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Checks whether the list of nodes is not empty. - * + * * @return true if there is at least one node defined, * false otherwise */ @@ -359,13 +368,14 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, addNodeAction.updateI18n(); editNodeAction.updateI18n(); deleteNodeAction.updateI18n(); + immediatelyEffectiveLabel.updateI18n(); setTitle(I18n.get("manageNodesDialog.title") + " – jSite " + Version.getVersion()); SwingUtils.repackCentered(this); } /** * List model for the {@link ManageNodesDialog#nodeList}. TODO - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> * @version $Id$ */ @@ -384,7 +394,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Adds the given node to the list model. - * + * * @see Collection#add(Object) * @param node * The node to add @@ -396,7 +406,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Removes the given node from the list model. - * + * * @see Collection#remove(Object) * @param node * The node to remove @@ -409,7 +419,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Removes all nodes from the list model. - * + * * @see Collection#clear() */ public void clear() {