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:
@@ -71,6 +71,12 @@ public class ConfigEditorPanel extends JPanel
|
|||||||
"but not yet committed."), VGroupLayout.FIXED);
|
"but not yet committed."), VGroupLayout.FIXED);
|
||||||
add(new JLabel("Press return in a modified field to commit " +
|
add(new JLabel("Press return in a modified field to commit " +
|
||||||
"the change."), VGroupLayout.FIXED);
|
"the change."), VGroupLayout.FIXED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addNotify ()
|
||||||
|
{
|
||||||
|
super.addNotify();
|
||||||
|
|
||||||
// ship off a getConfigInfo request to find out what config
|
// ship off a getConfigInfo request to find out what config
|
||||||
// objects are available for editing
|
// objects are available for editing
|
||||||
@@ -91,6 +97,7 @@ public class ConfigEditorPanel extends JPanel
|
|||||||
scrolly.getViewport().getView();
|
scrolly.getViewport().getView();
|
||||||
opanel.cleanup();
|
opanel.cleanup();
|
||||||
}
|
}
|
||||||
|
_oeditors.removeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,6 +105,11 @@ public class ConfigEditorPanel extends JPanel
|
|||||||
*/
|
*/
|
||||||
public void gotConfigInfo (final String[] keys, final int[] oids)
|
public void gotConfigInfo (final String[] keys, final int[] oids)
|
||||||
{
|
{
|
||||||
|
// make sure we're still added
|
||||||
|
if (!isDisplayable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Integer indexes[] = new Integer[keys.length];
|
Integer indexes[] = new Integer[keys.length];
|
||||||
for (int ii = 0; ii < indexes.length; ii++) {
|
for (int ii = 0; ii < indexes.length; ii++) {
|
||||||
indexes[ii] = ii;
|
indexes[ii] = ii;
|
||||||
|
|||||||
Reference in New Issue
Block a user