label.sequence_name = Sequence Name
label.sequence_description = Sequence Description
label.edit_sequence_name_description = Edit Sequence Name/Description
-label.spaces_converted_to_underscores = Spaces have been converted to _
+label.spaces_converted_to_underscores = Spaces have been converted to underscores (_)
label.no_spaces_allowed_sequence_name = No spaces allowed in Sequence Name
label.select_outline_colour = Select Outline Colour
label.web_browser_not_found_unix = Unixers\: Couldn't find default web browser.\nAdd the full path to your browser in Preferences."
label.sequence_name = Nombre de la secuencia
label.sequence_description = Descripción de la secuencia
label.edit_sequence_name_description = Editar el nombre/descripción de la secuencia
-label.spaces_converted_to_underscores = Los espacios se han convertido en _
+label.spaces_converted_to_underscores = Los espacios se han convertido en guión bajos (_)
label.no_spaces_allowed_sequence_name = No se permiten espacios en el nombre de la secuencia
label.select_outline_colour = Seleccionar el color del límite
label.web_browser_not_found_unix = Unixers\: No es posible encontrar el navegador web por defecto.\nA\u00F1ada la ruta completa de su navegador en la pesta\u00F1a de Preferencias.
import jalview.bin.Console;
import jalview.util.ChannelProperties;
+import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.dialogrunner.DialogRunnerI;
}
public static JvOptionPane frameDialog(String message, String title,
- int messageType, String[] buttonsText, String defaultButton,
+ int messageType, String[] buttonsTextS, String defaultButtonS,
Callable<Void>[] handlers, boolean modal)
{
JFrame parent = new JFrame();
JvOptionPane jvop = JvOptionPane.newOptionDialog();
+ final String[] buttonsText;
+ final String defaultButton;
+ if (buttonsTextS == null)
+ {
+ String ok = MessageManager.getString("action.ok");
+ buttonsText = new String[] { ok };
+ defaultButton = ok;
+ }
+ else
+ {
+ buttonsText = buttonsTextS;
+ defaultButton = defaultButtonS;
+ }
JButton[] buttons = new JButton[buttonsText.length];
for (int i = 0; i < buttonsText.length; i++)
{
{
dialogType = JOptionPane.YES_NO_CANCEL_OPTION;
}
- jvop.setResponseHandler(JOptionPane.YES_OPTION, handlers[0]);
+ Callable<Void> nullCallable = () -> {
+ return null;
+ };
+ jvop.setResponseHandler(JOptionPane.YES_OPTION,
+ (handlers != null && handlers.length > 0) ? handlers[0]
+ : nullCallable);
if (dialogType == JOptionPane.YES_NO_OPTION
|| dialogType == JOptionPane.YES_NO_CANCEL_OPTION)
{
- jvop.setResponseHandler(JOptionPane.NO_OPTION, handlers[1]);
+ jvop.setResponseHandler(JOptionPane.NO_OPTION,
+ (handlers != null && handlers.length > 1) ? handlers[1]
+ : nullCallable);
}
if (dialogType == JOptionPane.YES_NO_CANCEL_OPTION)
{
- jvop.setResponseHandler(JOptionPane.CANCEL_OPTION, handlers[2]);
+ jvop.setResponseHandler(JOptionPane.CANCEL_OPTION,
+ (handlers != null && handlers.length > 2) ? handlers[2]
+ : nullCallable);
}
final int dt = dialogType;
{
if (dialog.getName().indexOf(" ") > -1)
{
- JvOptionPane.showMessageDialog(ap,
+ JvOptionPane.frameDialog(
MessageManager.getString(
"label.spaces_converted_to_underscores"),
MessageManager.getString(
"label.no_spaces_allowed_sequence_name"),
- JvOptionPane.WARNING_MESSAGE);
+ JvOptionPane.WARNING_MESSAGE, null, null, null,
+ false);
}
sequence.setName(dialog.getName().replace(' ', '_'));
ap.paintAlignment(false, false);