use of com.igormaznitsa.nbmindmap.nb.swing.FileEditPanel in project netbeans-mmd-plugin by raydac.
the class NbUtils method editFilePath.
@Nullable
public static FileEditPanel.DataContainer editFilePath(@Nullable Component parentComponent, @Nonnull final String title, @Nullable final File projectFolder, @Nullable final FileEditPanel.DataContainer data) {
final FileEditPanel filePathEditor = new FileEditPanel(projectFolder, data);
filePathEditor.doLayout();
filePathEditor.setPreferredSize(new Dimension(450, filePathEditor.getPreferredSize().height));
final NotifyDescriptor desc = new NotifyDescriptor.Confirmation(filePathEditor, title, NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE);
FileEditPanel.DataContainer result = null;
if (DialogDisplayer.getDefault().notify(desc) == NotifyDescriptor.OK_OPTION) {
result = filePathEditor.getData();
if (!result.isValid()) {
NbUtils.msgError(parentComponent, String.format(java.util.ResourceBundle.getBundle("com/igormaznitsa/nbmindmap/i18n/Bundle").getString("MMDGraphEditor.editFileLinkForTopic.errorCantFindFile"), result.getPath()));
result = null;
}
}
return result;
}
Aggregations