From 1ef1f31f1fee05fd54f15a5b9a90ad63aa95b262 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 27 May 2009 21:38:37 +0000 Subject: [PATCH] Get the config objects on add, rather than on construction. That way we can remove and re-add the same panel (if it's in a tabbed pane, for instance). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5807 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/admin/client/ConfigEditorPanel.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/java/com/threerings/admin/client/ConfigEditorPanel.java b/src/java/com/threerings/admin/client/ConfigEditorPanel.java index ac67e1f4e..5d2dd3e45 100644 --- a/src/java/com/threerings/admin/client/ConfigEditorPanel.java +++ b/src/java/com/threerings/admin/client/ConfigEditorPanel.java @@ -71,6 +71,12 @@ public class ConfigEditorPanel extends JPanel "but not yet committed."), VGroupLayout.FIXED); add(new JLabel("Press return in a modified field to commit " + "the change."), VGroupLayout.FIXED); + } + + @Override + public void addNotify () + { + super.addNotify(); // ship off a getConfigInfo request to find out what config // objects are available for editing @@ -91,6 +97,7 @@ public class ConfigEditorPanel extends JPanel scrolly.getViewport().getView(); opanel.cleanup(); } + _oeditors.removeAll(); } /** @@ -98,6 +105,11 @@ public class ConfigEditorPanel extends JPanel */ public void gotConfigInfo (final String[] keys, final int[] oids) { + // make sure we're still added + if (!isDisplayable()) { + return; + } + Integer indexes[] = new Integer[keys.length]; for (int ii = 0; ii < indexes.length; ii++) { indexes[ii] = ii;