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
This commit is contained in:
Andrzej Kapolka
2009-05-27 21:38:37 +00:00
parent ff4e05749f
commit 1ef1f31f1f
@@ -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;