Search in sources :

Example 1 with MCoordinateFile

use of org.mapton.api.MCoordinateFile in project mapton by trixon.

the class FilesPane method remove.

private void remove() {
    final MCoordinateFile document = getSelected();
    SwingUtilities.invokeLater(() -> {
        String[] buttons = new String[] { Dict.CANCEL.toString(), Dict.CLOSE.toString() };
        NotifyDescriptor d = new NotifyDescriptor(String.format(Dict.Dialog.MESSAGE_FILE_CLOSE.toString(), document.getFile().getName()), String.format(Dict.Dialog.TITLE_CLOSE_S.toString(), Dict.FILE.toString().toLowerCase()) + "?", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.WARNING_MESSAGE, buttons, Dict.CLOSE.toString());
        if (Dict.CLOSE.toString() == DialogDisplayer.getDefault().notify(d)) {
            Platform.runLater(() -> {
                mManager.removeAll(document);
            });
        }
    });
}
Also used : NotifyDescriptor(org.openide.NotifyDescriptor) MCoordinateFile(org.mapton.api.MCoordinateFile)

Aggregations

MCoordinateFile (org.mapton.api.MCoordinateFile)1 NotifyDescriptor (org.openide.NotifyDescriptor)1