JOptionPane.showMessageDialog(this, "No Layer instantiated");
String message = i18n.get(LayerAddPanel.class, "noLayerCreatedMessage", "No Layer instantiated."); JOptionPane.showMessageDialog(this, message);
    public void actionPerformed(ActionEvent e) {        if (e.getActionCommand() == configureActionCommand) {            // instanciate a default instance of the chosen layer            // and bring up the Inspector to configure it            String prettyName = (String) list.getSelectedItem();            String prefix = prefixTextField.getText().trim();            if (prettyName == null) {                return;            }            String newClassName = (String) layerClasses.get(prettyName);            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) {                JOptionPane.showMessageDialog(this,                        "Layer Handler not found.\nCan't find anything to add the layer to.");            } else {                JOptionPane.showMessageDialog(this, "No Layer instantiated");            }        } else if (e.getActionCommand() == Inspector.cancelCommand) {            if (layer != null && propertyHandler != null) {                propertyHandler.removeUsedPrefix(((PropertyConsumer) layer).getPropertyPrefix());            }        } else {            showPanel();        }    }