// Path: src/main/net/sf/portecle/FPortecle.java
// public static final ResourceBundle RB = ResourceBundle.getBundle(RB_BASENAME);
// 
// Path: src/main/net/sf/portecle/gui/SwingHelper.java
// public final class SwingHelper
// {
// 	/** Not needed. */
// 	private SwingHelper()
// 	{
// 		// Ignored
// 	}
// 
// 	/**
// 	 * Makes the given Window visible and waits for it to return.
// 	 *
// 	 * @param window The window
// 	 */
// 	public static void showAndWait(final Window window)
// 	{
// 		if (SwingUtilities.isEventDispatchThread())
// 		{
// 			window.setVisible(true);
// 		}
// 		else
// 		{
// 			try
// 			{
// 				SwingUtilities.invokeAndWait(new Runnable()
// 				{
// 					@Override
// 					public void run()
// 					{
// 						window.setVisible(true);
// 					}
// 				});
// 			}
// 			catch (InterruptedException | InvocationTargetException e)
// 			{
// 				LOG.log(Level.WARNING, "Error setting window visible", e); // TODO?
// 			}
// 		}
// 	}
// 
// 	/**
// 	 * Select all text in a text component and focus it.
// 	 *
// 	 * @param component the text component
// 	 */
// 	public static void selectAndFocus(JComponent component)
// 	{
// 		JTextComponent textComponent = null;
// 		if (component instanceof JTextComponent)
// 		{
// 			textComponent = (JTextComponent) component;
// 		}
// 		if (component instanceof JComboBox)
// 		{
// 			Component editorComponent = ((JComboBox<?>) component).getEditor().getEditorComponent();
// 			if (editorComponent instanceof JTextComponent)
// 			{
// 				textComponent = (JTextComponent) editorComponent;
// 			}
// 		}
// 		if (textComponent != null)
// 		{
// 			textComponent.select(0, textComponent.getText().length());
// 		}
// 		component.requestFocusInWindow();
// 	}
// 
// 	/**
// 	 * Shows a simple yes/no confirmation dialog, with the "no" option selected by default. This method exists only
// 	 * because there's apparently no easy way to accomplish that with JOptionPane's static helper methods.
// 	 *
// 	 * @param parentComponent
// 	 * @param message
// 	 * @param title
// 	 * @return
// 	 * @see JOptionPane#showConfirmDialog(Component, Object, String, int)
// 	 */
// 	public static int showConfirmDialog(Component parentComponent, Object message, String title)
// 	{
// 		String[] options = { "Yes", "No" };
// 		return JOptionPane.showOptionDialog(parentComponent, message, title, JOptionPane.YES_NO_OPTION,
// 		    JOptionPane.QUESTION_MESSAGE, null, options, options[1]);
// 	}
// }


import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import net.sf.portecle.gui.SwingHelper;
import static net.sf.portecle.FPortecle.RB;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Window;
import javax.swing.JButton;
import javax.swing.JLabel;
		{
			SwingHelper.selectAndFocus(m_jtfAlias);
		}
	}

	/**
	 * Check that the alias is valid, i.e. that it is not blank.
	 *
	 * @return True if the alias is valid, false otherwise
	 */
	private boolean checkAlias()
	{
		String sAlias = m_jtfAlias.getText().trim();

		if (!sAlias.isEmpty())
		{
			m_sAlias = sAlias;
			return true;
		}

		JOptionPane.showMessageDialog(this, RB.getString("DGetAlias.AliasReq.message"), getTitle(),
		    JOptionPane.WARNING_MESSAGE);

		SwingHelper.selectAndFocus(m_jtfAlias);
		return false;
	}

	@Override
	protected void okPressed()
	{
// Path: src/main/net/sf/portecle/FPortecle.java
// public static final ResourceBundle RB = ResourceBundle.getBundle(RB_BASENAME);
// 
// Path: src/main/net/sf/portecle/gui/SwingHelper.java
// public final class SwingHelper
// {
// 	/** Not needed. */
// 	private SwingHelper()
// 	{
// 		// Ignored
// 	}
// 
// 	/**
// 	 * Makes the given Window visible and waits for it to return.
// 	 *
// 	 * @param window The window
// 	 */
// 	public static void showAndWait(final Window window)
// 	{
// 		if (SwingUtilities.isEventDispatchThread())
// 		{
// 			window.setVisible(true);
// 		}
// 		else
// 		{
// 			try
// 			{
// 				SwingUtilities.invokeAndWait(new Runnable()
// 				{
// 					@Override
// 					public void run()
// 					{
// 						window.setVisible(true);
// 					}
// 				});
// 			}
// 			catch (InterruptedException | InvocationTargetException e)
// 			{
// 				LOG.log(Level.WARNING, "Error setting window visible", e); // TODO?
// 			}
// 		}
// 	}
// 
// 	/**
// 	 * Select all text in a text component and focus it.
// 	 *
// 	 * @param component the text component
// 	 */
// 	public static void selectAndFocus(JComponent component)
// 	{
// 		JTextComponent textComponent = null;
// 		if (component instanceof JTextComponent)
// 		{
// 			textComponent = (JTextComponent) component;
// 		}
// 		if (component instanceof JComboBox)
// 		{
// 			Component editorComponent = ((JComboBox<?>) component).getEditor().getEditorComponent();
// 			if (editorComponent instanceof JTextComponent)
// 			{
// 				textComponent = (JTextComponent) editorComponent;
// 			}
// 		}
// 		if (textComponent != null)
// 		{
// 			textComponent.select(0, textComponent.getText().length());
// 		}
// 		component.requestFocusInWindow();
// 	}
// 
// 	/**
// 	 * Shows a simple yes/no confirmation dialog, with the "no" option selected by default. This method exists only
// 	 * because there's apparently no easy way to accomplish that with JOptionPane's static helper methods.
// 	 *
// 	 * @param parentComponent
// 	 * @param message
// 	 * @param title
// 	 * @return
// 	 * @see JOptionPane#showConfirmDialog(Component, Object, String, int)
// 	 */
// 	public static int showConfirmDialog(Component parentComponent, Object message, String title)
// 	{
// 		String[] options = { "Yes", "No" };
// 		return JOptionPane.showOptionDialog(parentComponent, message, title, JOptionPane.YES_NO_OPTION,
// 		    JOptionPane.QUESTION_MESSAGE, null, options, options[1]);
// 	}
// }


// Path: src/main/net/sf/portecle/DGetAlias.java
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import net.sf.portecle.gui.SwingHelper;
import static net.sf.portecle.FPortecle.RB;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Window;
import javax.swing.JButton;
import javax.swing.JLabel;

		{
			SwingHelper.selectAndFocus(m_jtfAlias);
		}
	}

	/**
	 * Check that the alias is valid, i.e. that it is not blank.
	 *
	 * @return True if the alias is valid, false otherwise
	 */
	private boolean checkAlias()
	{
		String sAlias = m_jtfAlias.getText().trim();

		if (!sAlias.isEmpty())
		{
			m_sAlias = sAlias;
			return true;
		}

		JOptionPane.showMessageDialog(this, RB.getString("DGetAlias.AliasReq.message"), getTitle(),
		    JOptionPane.WARNING_MESSAGE);

		SwingHelper.selectAndFocus(m_jtfAlias);
		return false;
	}

	@Override
	protected void okPressed()
	{
		if (checkAlias())