layer = ComponentFactory.create(newClassName);
if (layer instanceof PropertyConsumer) {
if (layer instanceof PlugIn) {
PlugInLayer pil = new PlugInLayer();
pil.setPlugIn((PlugIn) layer);
pil.setName(prefix);
layer = pil;
}
if (layer instanceof Layer) {
// Set the pretty name to what the user chose.
((Layer) layer).setName(prefix);
}
// Set the prefix to a modified version of the pretty
// name.
prefix = propertyHandler.getUniquePrefix(prefix);
((PropertyConsumer) layer).setPropertyPrefix(prefix);
inspector.inspectPropertyConsumer((PropertyConsumer) layer);
}
} else if (e.getActionCommand() == Inspector.doneCommand) {
// the confirmation button of the Inspector panel was
// pressed
// find the beancontext and add the layer at hand (var.
// layer)
if (layer != null && layerHandler != null) {
if (layer instanceof Layer) {
// Let's add it on top, so the user can find it
// easier, instead of adding it to the bottom and
// having it lost behind some other layers.
layerHandler.addLayer((Layer) layer, 0);
} else if (layer instanceof PlugIn) {
PlugInLayer pil = (PlugInLayer) ((PlugIn) layer).getComponent();
layerHandler.addLayer(pil, 0);
}
prefixTextField.setText(DefaultLayerName);
} else if (layerHandler != null) {
String message = i18n.get(LayerAddPanel.class,