use of com.igormaznitsa.sciareto.ui.editors.mmeditors.UriEditPanel in project netbeans-mmd-plugin by raydac.
the class UiUtils method editURI.
@Nullable
public static MMapURI editURI(@Nonnull final String title, @Nullable final MMapURI uri) {
final UriEditPanel textEditor = new UriEditPanel(uri == null ? null : uri.asString(false, false));
textEditor.doLayout();
textEditor.setPreferredSize(new Dimension(450, textEditor.getPreferredSize().height));
if (DialogProviderManager.getInstance().getDialogProvider().msgOkCancel(null, title, textEditor)) {
final String text = textEditor.getText();
if (text.isEmpty()) {
return EMPTY_URI;
}
try {
return new MMapURI(text.trim());
} catch (URISyntaxException ex) {
DialogProviderManager.getInstance().getDialogProvider().msgError(null, String.format(BUNDLE.getString("NbUtils.errMsgIllegalURI"), text));
return null;
}
} else {
return null;
}
}
Aggregations