Example usage for javax.swing JDialog getContentPane

List of usage examples for javax.swing JDialog getContentPane

Introduction

In this page you can find the example usage for javax.swing JDialog getContentPane.

Prototype

public Container getContentPane() 

Source Link

Document

Returns the contentPane object for this dialog.

Usage

From source file:com.aw.swing.mvp.JDialogView.java

private JDialog createDialog(String title) {
    JDialog dlg = null;
    Presenter currentPst = AWWindowsManager.instance().getCurrentPst();
    //        boolean thrower = (currentPst!=null && currentPst.getClass().getSimpleName().equals("AbrirDocumentoPst"));
    //        if (thrower){
    //            dlg = new JDialog(null, title, Dialog.ModalityType.MODELESS);
    //        }else
    if (AWWindowsManager.instance().isInMainWindow() || (currentPst == null)) {
        dlg = new JDialog(AWWindowsManager.instance().getFrame(), title, Dialog.ModalityType.DOCUMENT_MODAL);
    } else {/*  w w  w .ja  v a  2s.  c o m*/
        JDialog parent = (JDialog) ((View) currentPst.getView()).getParentContainer();
        dlg = new JDialog(parent, title, Dialog.ModalityType.DOCUMENT_MODAL);
    }
    setupIcons(dlg);
    dlg.setUndecorated(true);
    dlg.getContentPane().setLayout(new BorderLayout());

    installFestFixture(dlg);

    //        installMouseAdapter(dlg);

    return dlg;
}

From source file:com.sshtools.common.ui.SshToolsConnectionPanel.java

/**
 *
 *
 * @param parent//  w  w  w.ja  v a2s  . c o m
 * @param profile
 * @param optionalTabs
 *
 * @return
 */
public static SshToolsConnectionProfile showConnectionDialog(Component parent,
        SshToolsConnectionProfile profile, SshToolsConnectionTab[] optionalTabs) {
    //  If no properties are provided, then use the default
    if (profile == null) {
        int port = DEFAULT_PORT;
        String port_S = Integer.toString(DEFAULT_PORT);
        port_S = PreferencesStore.get(SshTerminalPanel.PREF_DEFAULT_SIMPLE_PORT, port_S);
        try {
            port = Integer.parseInt(port_S);
        } catch (NumberFormatException e) {
            log.warn("Could not parse the port number from defaults file (property name"
                    + SshTerminalPanel.PREF_DEFAULT_SIMPLE_PORT + ", property value= " + port_S + ").");
        }
        profile = new SshToolsConnectionProfile();
        profile.setHost(PreferencesStore.get(SshToolsApplication.PREF_CONNECTION_LAST_HOST, ""));
        profile.setPort(PreferencesStore.getInt(SshToolsApplication.PREF_CONNECTION_LAST_PORT, port));
        profile.setUsername(PreferencesStore.get(SshToolsApplication.PREF_CONNECTION_LAST_USER, ""));

    }

    final SshToolsConnectionPanel conx = new SshToolsConnectionPanel(true);

    if (optionalTabs != null) {
        for (int i = 0; i < optionalTabs.length; i++) {
            conx.addTab(optionalTabs[i]);
        }
    }

    conx.setConnectionProfile(profile);

    JDialog d = null;
    Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);

    if (w instanceof JDialog) {
        d = new JDialog((JDialog) w, "Connection Profile", true);
    } else if (w instanceof JFrame) {
        d = new JDialog((JFrame) w, "Connection Profile", true);
    } else {
        d = new JDialog((JFrame) null, "Connection Profile", true);
    }

    final JDialog dialog = d;

    class UserAction {
        boolean connect;
    }

    final UserAction userAction = new UserAction();

    //  Create the bottom button panel
    final JButton cancel = new JButton("Cancel");
    cancel.setMnemonic('c');
    cancel.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            userAction.connect = false;
            dialog.setVisible(false);
        }
    });

    final JButton connect = new JButton("Connect");
    connect.setMnemonic('t');
    connect.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            if (conx.validateTabs()) {
                userAction.connect = true;
                dialog.setVisible(false);
            }
        }
    });
    dialog.getRootPane().setDefaultButton(connect);

    JPanel buttonPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.insets = new Insets(6, 6, 0, 0);
    gbc.weighty = 1.0;
    UIUtil.jGridBagAdd(buttonPanel, connect, gbc, GridBagConstraints.RELATIVE);
    UIUtil.jGridBagAdd(buttonPanel, cancel, gbc, GridBagConstraints.REMAINDER);

    JPanel southPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    southPanel.add(buttonPanel);

    //
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    mainPanel.add(conx, BorderLayout.CENTER);
    mainPanel.add(southPanel, BorderLayout.SOUTH);

    // Show the dialog
    dialog.getContentPane().setLayout(new GridLayout(1, 1));
    dialog.getContentPane().add(mainPanel);
    dialog.pack();
    dialog.setResizable(false);
    UIUtil.positionComponent(SwingConstants.CENTER, dialog);

    //show the simple box and act on the answer.
    SshToolsSimpleConnectionPrompt stscp = SshToolsSimpleConnectionPrompt.getInstance();
    StringBuffer sb = new StringBuffer();
    userAction.connect = !stscp.getHostname(sb, profile.getHost());

    boolean advanced = stscp.getAdvanced();

    if (advanced) {
        userAction.connect = false;
        profile.setHost(sb.toString());
        conx.hosttab.setConnectionProfile(profile);
        dialog.setVisible(true);
    }

    // Make sure we didn't cancel
    if (!userAction.connect) {
        return null;
    }

    conx.applyTabs();
    if (!advanced)
        profile.setHost(sb.toString());
    if (!advanced) {
        int port = DEFAULT_PORT;
        String port_S = Integer.toString(DEFAULT_PORT);
        port_S = PreferencesStore.get(SshTerminalPanel.PREF_DEFAULT_SIMPLE_PORT, port_S);
        try {
            port = Integer.parseInt(port_S);
        } catch (NumberFormatException e) {
            log.warn("Could not parse the port number from defaults file (property name"
                    + SshTerminalPanel.PREF_DEFAULT_SIMPLE_PORT + ", property value= " + port_S + ").");
        }
        profile.setPort(port);
    }
    if (!advanced)
        profile.setUsername("");

    PreferencesStore.put(SshToolsApplication.PREF_CONNECTION_LAST_HOST, profile.getHost());
    // only save user inputed configuration
    if (advanced) {
        PreferencesStore.put(SshToolsApplication.PREF_CONNECTION_LAST_USER, profile.getUsername());
        PreferencesStore.putInt(SshToolsApplication.PREF_CONNECTION_LAST_PORT, profile.getPort());
    }
    // Return the connection properties
    return profile;
}

From source file:net.sf.jabref.openoffice.StyleSelectDialog.java

private void displayDefaultStyle(boolean authoryear) {
    try {//from w w w.java2  s .c o m
        // Read the contents of the default style file:
        URL defPath = authoryear ? JabRef.class.getResource(OpenOfficePanel.DEFAULT_AUTHORYEAR_STYLE_PATH)
                : JabRef.class.getResource(OpenOfficePanel.DEFAULT_NUMERICAL_STYLE_PATH);
        BufferedReader r = new BufferedReader(new InputStreamReader(defPath.openStream()));
        String line;
        StringBuilder sb = new StringBuilder();
        while ((line = r.readLine()) != null) {
            sb.append(line);
            sb.append('\n');
        }

        // Make a dialog box to display the contents:
        final JDialog dd = new JDialog(diag, Localization.lang("Default style"), true);
        JLabel header = new JLabel(
                "<html>" + Localization.lang("The panel below shows the definition of the default style.")
                //+"<br>"
                        + Localization.lang(
                                "If you want to use it as a template for a new style, you can copy the contents into a new .jstyle file")
                        + "</html>");

        header.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        dd.getContentPane().add(header, BorderLayout.NORTH);
        JTextArea ta = new JTextArea(sb.toString());
        ta.setEditable(false);
        JScrollPane sp = new JScrollPane(ta);
        sp.setPreferredSize(new Dimension(700, 500));
        dd.getContentPane().add(sp, BorderLayout.CENTER);
        JButton okButton = new JButton(Localization.lang("OK"));
        ButtonBarBuilder bb = new ButtonBarBuilder();
        bb.addGlue();
        bb.addButton(okButton);
        bb.addGlue();
        bb.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        dd.getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
        okButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                dd.dispose();
            }
        });
        dd.pack();
        dd.setLocationRelativeTo(diag);
        dd.setVisible(true);
    } catch (IOException ex) {
        LOGGER.warn("Problem showing default style", ex);
    }
}

From source file:net.mariottini.swing.JFontChooser.java

/**
 * Show a "Choose Font" dialog with the specified title and modality.
 * /*from w  w  w  .  j  a v a2  s. c  o  m*/
 * @param parent
 *          the parent component, or null to use a default root frame as parent.
 * @param title
 *          the title for the dialog.
 * @param modal
 *          true to show a modal dialog, false to show a non-modal dialog (in this case the
 *          function will return immediately after making visible the dialog).
 * @return <code>APPROVE_OPTION</code> if the user chose a font, <code>CANCEL_OPTION</code> if the
 *         user canceled the operation. <code>CANCEL_OPTION</code> is always returned for a
 *         non-modal dialog, use an ActionListener to be notified when the user approves/cancels
 *         the dialog.
 * @see #APPROVE_OPTION
 * @see #CANCEL_OPTION
 * @see #addActionListener
 */
public int showDialog(Component parent, String title, boolean modal) {
    final int[] result = new int[] { CANCEL_OPTION };
    while (parent != null && !(parent instanceof Window)) {
        parent = parent.getParent();
    }
    final JDialog d;
    if (parent instanceof Frame) {
        d = new JDialog((Frame) parent, title, modal);
    } else if (parent instanceof Dialog) {
        d = new JDialog((Dialog) parent, title, modal);
    } else {
        d = new JDialog();
        d.setTitle(title);
        d.setModal(modal);
    }
    final ActionListener[] listener = new ActionListener[1];
    listener[0] = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (e.getActionCommand().equals(APPROVE_SELECTION)) {
                result[0] = APPROVE_OPTION;
            }
            removeActionListener(listener[0]);
            d.setContentPane(new JPanel());
            d.setVisible(false);
            d.dispose();
        }
    };
    addActionListener(listener[0]);
    d.setComponentOrientation(getComponentOrientation());
    d.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
    d.getContentPane().add(this, BorderLayout.CENTER);
    d.pack();
    d.setLocationRelativeTo(parent);
    d.setVisible(true);
    return result[0];
}

From source file:com.biosis.biosislite.vistas.AsignarPermiso.java

private void imprimirBoletaViaje(AsignacionPermiso asignacion) {
    File reporte = new File("reportes/permiso_comision-servicios.jasper");

    List<AsignacionPermiso> listadoReporteAsignacion = new ArrayList();
    listadoReporteAsignacion.add(asignacion);

    Map<String, Object> parametros = new HashMap<>();
    parametros.put("reporte_ususario", UsuarioActivo.getUsuario().getLogin());

    Departamento area = asignacion.getEmpleado().getAreaEmpleadoList().get(0).getDepartamento();
    if (area != null) {
        parametros.put("area", area.getNombre());
    }//from www  .  j  a  v a  2 s  . co m

    //        AsignarVacacion vac = new AsignarVacacion();
    long dias = this.fechasAlong(asignacion.getPermiso().getFechaInicio(),
            asignacion.getPermiso().getFechaFin());
    parametros.put("dias", dias);

    //Parametros del viaje
    Viaje viaje = vsc.buscarPorPermiso(asignacion.getPermiso());

    if (viaje != null) {
        parametros.put("alimentacion", viaje.getAlimentacion());
        parametros.put("alojamiento", viaje.getAlojamiento());
        parametros.put("movilidad", viaje.getMovilidad());
        parametros.put("combustible", viaje.getCombustible());
        parametros.put("dias_alimentacion", viaje.getDiasAlimentacion());
        parametros.put("dias_alojamiento", viaje.getDiasAlojamiento());
        parametros.put("dias_movilidad", viaje.getDiasMovLocal());
        //            if (asignacion.getEmpleado().getAreaEmpleadoList().get(0).getDepartamento().getDepartamento().getNombre() != null) {
        //                parametros.put("gerencia", asignacion.getEmpleado().getAreaEmpleadoList().get(0).getDepartamento().getDepartamento().getNombre());
        //            } else {
        parametros.put("gerencia",
                asignacion.getEmpleado().getAreaEmpleadoList().get(0).getGerencia().getNombre());
        //            }
        parametros.put("centro_costo", viaje.getCentroCosto());
        parametros.put("ubigeo", viaje.getDestino());
        parametros.put("cargo", asignacion.getEmpleado().getPuestoList().get(0).getPuesto().getNombre());

        double total = (viaje.getAlimentacion() * viaje.getDiasAlimentacion())
                + (viaje.getAlojamiento() * viaje.getDiasAlojamiento())
                + (viaje.getMovilidad() * viaje.getDiasMovLocal()) + viaje.getCombustible();

        parametros.put("total", total);
    }

    //Fin de parametros del viaje
    Component contentPane = reporteador.obtenerReporte(listadoReporteAsignacion, reporte, parametros);
    Frame principal = JOptionPane.getRootFrame();
    JDialog visor = new JDialog(principal, "Reporte", true);
    visor.setSize(contentPane.getSize());
    //        visor.setSize(ventana.getSize().width, ventana.getSize().height);
    visor.getContentPane().add(contentPane);
    visor.setLocationRelativeTo(this);

    //            visor.setUndecorated(true);
    visor.setBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds());
    visor.setVisible(true);
    visor.setAlwaysOnTop(true);
    //        reporteador.getReporte(reporte, parametros, listado) //        reporteador.setConn(controlador.getDao().getConexion());
    //        reporteador.generarReporte(reporte, parametros, JOptionPane.getFrameForComponent(this));
}

From source file:de.codesourcery.jasm16.ide.ui.utils.UIUtils.java

public static void showErrorDialog(Component parent, String title, String textMessage, Throwable cause) {
    final String stacktrace;
    if (cause == null) {
        stacktrace = null;//w ww .  j av a2  s.  c  o m
    } else {
        final ByteArrayOutputStream stackTrace = new ByteArrayOutputStream();
        cause.printStackTrace(new PrintStream(stackTrace));
        stacktrace = new String(stackTrace.toByteArray());
    }

    final JDialog dialog = new JDialog((Window) null, title);

    dialog.setModal(true);

    final JTextArea message = createMultiLineLabel(textMessage);
    final DialogResult[] outcome = { DialogResult.CANCEL };

    final JButton okButton = new JButton("Ok");
    okButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            outcome[0] = DialogResult.YES;
            dialog.dispose();
        }
    });

    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout());
    buttonPanel.add(okButton);

    final JPanel messagePanel = new JPanel();
    messagePanel.setLayout(new GridBagLayout());

    GridBagConstraints cnstrs = constraints(0, 0, true, true, GridBagConstraints.BOTH);
    cnstrs.weightx = 1;
    cnstrs.weighty = 0.1;
    cnstrs.gridheight = 1;
    messagePanel.add(message, cnstrs);

    if (stacktrace != null) {
        final JTextArea createMultiLineLabel = new JTextArea(stacktrace);

        createMultiLineLabel.setBackground(null);
        createMultiLineLabel.setEditable(false);
        createMultiLineLabel.setBorder(null);
        createMultiLineLabel.setLineWrap(false);
        createMultiLineLabel.setWrapStyleWord(false);

        final JScrollPane pane = new JScrollPane(createMultiLineLabel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

        cnstrs = constraints(0, 1, true, true, GridBagConstraints.BOTH);
        cnstrs.weightx = 1.0;
        cnstrs.weighty = 0.9;
        cnstrs.gridwidth = GridBagConstraints.REMAINDER;
        cnstrs.gridheight = GridBagConstraints.REMAINDER;
        messagePanel.add(pane, cnstrs);
    }

    final JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());

    cnstrs = constraints(0, 0, true, false, GridBagConstraints.BOTH);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.gridheight = 1;
    cnstrs.weighty = 1.0;
    cnstrs.insets = new Insets(5, 2, 5, 2); // top,left,bottom,right           
    panel.add(messagePanel, cnstrs);

    cnstrs = constraints(0, 1, true, true, GridBagConstraints.HORIZONTAL);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.gridheight = 1;
    cnstrs.weighty = 0;
    cnstrs.insets = new Insets(0, 2, 10, 2); // top,left,bottom,right      
    panel.add(buttonPanel, cnstrs);

    dialog.getContentPane().add(panel);

    dialog.setMinimumSize(new Dimension(600, 400));
    dialog.setPreferredSize(new Dimension(600, 400));
    dialog.setMaximumSize(new Dimension(600, 400));

    dialog.pack();
    dialog.setVisible(true);
}

From source file:ucar.unidata.idv.control.chart.ChartManager.java

/**
 * show dialog for chart//  w  w  w. ja v  a 2  s .c  o  m
 *
 * @param chartHolder chart
 */
protected void showPropertiesDialog(final ChartHolder chartHolder) {
    List comps = new ArrayList();
    getPropertiesComponents(chartHolder, comps);
    GuiUtils.tmpInsets = GuiUtils.INSETS_5;
    JComponent contents = GuiUtils.doLayout(comps, 2, GuiUtils.WT_NY, GuiUtils.WT_N);
    final JDialog propertiesDialog = GuiUtils.createDialog(chartHolder.getName() + " Properties", true);

    ActionListener listener = new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            String cmd = ae.getActionCommand();
            if (cmd.equals(GuiUtils.CMD_OK) || cmd.equals(GuiUtils.CMD_APPLY)) {
                if (!applyProperties(chartHolder)) {
                    return;
                }
                updateThumb(true);
            }
            if (cmd.equals(GuiUtils.CMD_OK) || cmd.equals(GuiUtils.CMD_CANCEL)) {
                propertiesDialog.dispose();
            }
        }
    };
    JPanel buttons = GuiUtils.makeButtons(listener,
            new String[] { GuiUtils.CMD_APPLY, GuiUtils.CMD_OK, GuiUtils.CMD_CANCEL });

    contents = GuiUtils.centerBottom(contents, buttons);
    contents = GuiUtils.inset(contents, 5);
    propertiesDialog.getContentPane().add(GuiUtils.top(contents));
    propertiesDialog.pack();

    propertiesDialog.setLocation(200, 200);
    propertiesDialog.setVisible(true);
}

From source file:de.codesourcery.jasm16.ide.ui.utils.UIUtils.java

/**
 * //  w  w w .  j ava2  s  . c  o m
 * @param parent
 * @param title
 * @param message
 * @return <code>true</code> if project should also be physically deleted,
 * <code>false</code> is project should be deleted but all files should be left alone,
 * <code>null</code> if user cancelled the dialog/project should not be deleted
 */
public static Boolean showDeleteProjectDialog(IAssemblyProject project) {
    final JDialog dialog = new JDialog((Window) null, "Delete project " + project.getName());

    dialog.setModal(true);

    final JTextArea message = createMultiLineLabel(
            "Do you really want to delete project '" + project.getName() + " ?");
    final JCheckBox checkbox = new JCheckBox("Delete project files");

    final DialogResult[] outcome = { DialogResult.CANCEL };

    final JButton yesButton = new JButton("Yes");
    yesButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            outcome[0] = DialogResult.YES;
            dialog.dispose();
        }
    });

    final JButton noButton = new JButton("No");
    noButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            outcome[0] = DialogResult.NO;
            dialog.dispose();
        }
    });
    final JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            outcome[0] = DialogResult.CANCEL;
            dialog.dispose();
        }
    });

    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout());
    buttonPanel.add(yesButton);
    buttonPanel.add(noButton);
    buttonPanel.add(cancelButton);

    final JPanel messagePanel = new JPanel();
    messagePanel.setLayout(new GridBagLayout());

    GridBagConstraints cnstrs = constraints(0, 0, true, false, GridBagConstraints.NONE);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.weighty = 0;
    cnstrs.gridheight = 1;
    messagePanel.add(message, cnstrs);

    cnstrs = constraints(0, 1, true, true, GridBagConstraints.NONE);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.gridheight = 1;
    cnstrs.weighty = 0;
    messagePanel.add(checkbox, cnstrs);

    final JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());

    cnstrs = constraints(0, 0, true, false, GridBagConstraints.NONE);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.gridheight = 1;
    cnstrs.weighty = 0;
    cnstrs.insets = new Insets(5, 2, 5, 2); // top,left,bottom,right         
    panel.add(messagePanel, cnstrs);

    cnstrs = constraints(0, 1, true, true, GridBagConstraints.HORIZONTAL);
    cnstrs.gridwidth = GridBagConstraints.REMAINDER;
    cnstrs.gridheight = 1;
    cnstrs.weighty = 0;
    cnstrs.insets = new Insets(0, 2, 10, 2); // top,left,bottom,right      
    panel.add(buttonPanel, cnstrs);

    dialog.getContentPane().add(panel);
    dialog.pack();
    dialog.setVisible(true);

    if (outcome[0] != DialogResult.YES) {
        return null;
    }
    return checkbox.isSelected();
}

From source file:idontwant2see.IDontWant2See.java

public ActionMenu getButtonAction() {
    final ContextMenuAction baseAction = new ContextMenuAction(mLocalizer.msg("name", "I don't want to see!"),
            createImageIcon("apps", "idontwant2see", 16));

    final ContextMenuAction openExclusionList = new ContextMenuAction(
            mLocalizer.msg("editExclusionList", "Edit exclusion list"),
            createImageIcon("apps", "idontwant2see", 16));
    openExclusionList.putValue(Plugin.BIG_ICON, createImageIcon("apps", "idontwant2see", 22));
    openExclusionList.setActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            final Window w = UiUtilities.getLastModalChildOf(getParentFrame());

            JDialog temDlg = null;

            if (w instanceof JDialog) {
                temDlg = new JDialog((JDialog) w, true);
            } else {
                temDlg = new JDialog((JFrame) w, true);
            }//from   w w w .  j av a  2 s .c  o  m

            final JDialog exclusionListDlg = temDlg;
            exclusionListDlg.setTitle(mLocalizer.msg("name", "I don't want to see!") + " - "
                    + mLocalizer.msg("editExclusionList", "Edit exclusion list"));

            UiUtilities.registerForClosing(new WindowClosingIf() {
                public void close() {
                    exclusionListDlg.dispose();
                }

                public JRootPane getRootPane() {
                    return exclusionListDlg.getRootPane();
                }
            });

            final ExclusionTablePanel exclusionPanel = new ExclusionTablePanel(mSettings);

            final JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
            ok.addActionListener(new ActionListener() {
                public void actionPerformed(final ActionEvent e) {
                    exclusionPanel.saveSettings(mSettings);
                    exclusionListDlg.dispose();
                }
            });

            final JButton cancel = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
            cancel.addActionListener(new ActionListener() {
                public void actionPerformed(final ActionEvent e) {
                    exclusionListDlg.dispose();
                }
            });

            final FormLayout layout = new FormLayout("0dlu:grow,default,3dlu,default",
                    "fill:500px:grow,2dlu,default,5dlu,default");
            layout.setColumnGroups(new int[][] { { 2, 4 } });

            final CellConstraints cc = new CellConstraints();
            final PanelBuilder pb = new PanelBuilder(layout, (JPanel) exclusionListDlg.getContentPane());
            pb.setDefaultDialogBorder();

            pb.add(exclusionPanel, cc.xyw(1, 1, 4));
            pb.addSeparator("", cc.xyw(1, 3, 4));
            pb.add(ok, cc.xy(2, 5));
            pb.add(cancel, cc.xy(4, 5));

            layoutWindow("exclusionListDlg", exclusionListDlg, new Dimension(600, 450));
            exclusionListDlg.setVisible(true);
        }
    });

    final ContextMenuAction undo = new ContextMenuAction(
            mLocalizer.msg("undoLastExclusion", "Undo last exclusion"),
            createImageIcon("actions", "edit-undo", 16));
    undo.putValue(Plugin.BIG_ICON, createImageIcon("actions", "edit-undo", 22));
    undo.setActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            String lastEnteredExclusionString = mSettings.getLastEnteredExclusionString();
            if (lastEnteredExclusionString.length() > 0) {
                for (int i = mSettings.getSearchList().size() - 1; i >= 0; i--) {
                    if (mSettings.getSearchList().get(i).getSearchText().equals(lastEnteredExclusionString)) {
                        mSettings.getSearchList().remove(i);
                    }
                }

                mSettings.setLastEnteredExclusionString("");

                updateFilter(true);
            }
        }
    });

    return new ActionMenu(baseAction, new Action[] { openExclusionList, undo });
}