@Ignore @Test public void testShowInputDialog(){ LOGGER.info("testShowInputDialog"); try{ final String message = new String("Test"); final String title = new String("Test"); CustomDialog.showInputDialog(null, true, message,KeyEvent.VK_E ,title, JOptionPane.INFORMATION_MESSAGE); final CustomDialog cD = CustomDialog.getInstanceCustomDialog(null, true, message, title, JOptionPane.INFORMATION_MESSAGE, true); assertTrue(checkComponentMessageDialog(cD)); } catch (final java.awt.HeadlessException e) { } }
public static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage){ final CustomDialog customDialog = CustomDialog.getInstanceCustomDialog(componentParent, modal, message, title, typeMessage, true); final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridx = 1; c.gridy = 1; c.weightx = 0.0; c.weighty = 0.5; c.gridwidth = 2; c.insets = new Insets(10,0,0,10); customDialog.component = new JTextField(""); customDialog.component.addAncestorListener(new RequestFocusListener()); Utils.remarcar(customDialog.component); Utils.setContrastColor(customDialog.component); Utils.setFontBold(customDialog.component); customDialog.component.getAccessibleContext().setAccessibleName(message.replaceAll(Constants.HTML_SALTO_LINEA, "") +". ALT + " + mnemonic + ". "); customDialog.mainPanel.add(customDialog.component, c); customDialog.infoLabel.setLabelFor(customDialog.component); customDialog.infoLabel.setDisplayedMnemonic(mnemonic); final String text = Utils.remarkMnemonic(customDialog.infoLabel.getText(), mnemonic); customDialog.infoLabel.setText(text); final GridBagConstraints cons = new GridBagConstraints(); cons.fill = GridBagConstraints.HORIZONTAL; cons.gridy = 0; cons.insets = new Insets(0,0,0,10); cancelButton = customDialog.getButton(cancellText, KeyEvent.VK_C); final JPanel cancelPanel = new JPanel(); cancelPanel.add(cancelButton); customDialog.buttonsPanel.add(cancelPanel, cons); cancelButton.addActionListener(customDialog); customDialog.infoLabel.setHorizontalAlignment(SwingConstants.LEFT); customDialog.component.setVisible(true); cancelButton.addActionListener(customDialog); customDialog.setVisible(true); if (customDialog.getAnswer()== JOptionPane.YES_OPTION) { return ((JTextField)customDialog.component).getText(); } return null; }
CustomDialog extends JAccessibilityCustomDialog implements ActionListener { public static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage){ final CustomDialog customDialog = CustomDialog.getInstanceCustomDialog(componentParent, modal, message, title, typeMessage, true); final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridx = 1; c.gridy = 1; c.weightx = 0.0; c.weighty = 0.5; c.gridwidth = 2; c.insets = new Insets(10,0,0,10); customDialog.component = new JTextField(""); customDialog.component.addAncestorListener(new RequestFocusListener()); Utils.remarcar(customDialog.component); Utils.setContrastColor(customDialog.component); Utils.setFontBold(customDialog.component); customDialog.component.getAccessibleContext().setAccessibleName(message.replaceAll(Constants.HTML_SALTO_LINEA, "") +". ALT + " + mnemonic + ". "); customDialog.mainPanel.add(customDialog.component, c); customDialog.infoLabel.setLabelFor(customDialog.component); customDialog.infoLabel.setDisplayedMnemonic(mnemonic); final String text = Utils.remarkMnemonic(customDialog.infoLabel.getText(), mnemonic); customDialog.infoLabel.setText(text); final GridBagConstraints cons = new GridBagConstraints(); cons.fill = GridBagConstraints.HORIZONTAL; cons.gridy = 0; cons.insets = new Insets(0,0,0,10); cancelButton = customDialog.getButton(cancellText, KeyEvent.VK_C); final JPanel cancelPanel = new JPanel(); cancelPanel.add(cancelButton); customDialog.buttonsPanel.add(cancelPanel, cons); cancelButton.addActionListener(customDialog); customDialog.infoLabel.setHorizontalAlignment(SwingConstants.LEFT); customDialog.component.setVisible(true); cancelButton.addActionListener(customDialog); customDialog.setVisible(true); if (customDialog.getAnswer()== JOptionPane.YES_OPTION) { return ((JTextField)customDialog.component).getText(); } return null; } }
CustomDialog extends JAccessibilityCustomDialog implements ActionListener { public static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage){ final CustomDialog customDialog = CustomDialog.getInstanceCustomDialog(componentParent, modal, message, title, typeMessage, true); final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridx = 1; c.gridy = 1; c.weightx = 0.0; c.weighty = 0.5; c.gridwidth = 2; c.insets = new Insets(10,0,0,10); customDialog.component = new JTextField(""); customDialog.component.addAncestorListener(new RequestFocusListener()); Utils.remarcar(customDialog.component); Utils.setContrastColor(customDialog.component); Utils.setFontBold(customDialog.component); customDialog.component.getAccessibleContext().setAccessibleName(message.replaceAll(Constants.HTML_SALTO_LINEA, "") +". ALT + " + mnemonic + ". "); customDialog.mainPanel.add(customDialog.component, c); customDialog.infoLabel.setLabelFor(customDialog.component); customDialog.infoLabel.setDisplayedMnemonic(mnemonic); final String text = Utils.remarkMnemonic(customDialog.infoLabel.getText(), mnemonic); customDialog.infoLabel.setText(text); final GridBagConstraints cons = new GridBagConstraints(); cons.fill = GridBagConstraints.HORIZONTAL; cons.gridy = 0; cons.insets = new Insets(0,0,0,10); cancelButton = customDialog.getButton(cancellText, KeyEvent.VK_C); final JPanel cancelPanel = new JPanel(); cancelPanel.add(cancelButton); customDialog.buttonsPanel.add(cancelPanel, cons); cancelButton.addActionListener(customDialog); customDialog.infoLabel.setHorizontalAlignment(SwingConstants.LEFT); customDialog.component.setVisible(true); cancelButton.addActionListener(customDialog); customDialog.setVisible(true); if (customDialog.getAnswer()== JOptionPane.YES_OPTION) { return ((JTextField)customDialog.component).getText(); } return null; } private  CustomDialog(final JDialog componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); private  CustomDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); private  CustomDialog(final JFrame componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); }
CustomDialog extends JAccessibilityCustomDialog implements ActionListener { public static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage){ final CustomDialog customDialog = CustomDialog.getInstanceCustomDialog(componentParent, modal, message, title, typeMessage, true); final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridx = 1; c.gridy = 1; c.weightx = 0.0; c.weighty = 0.5; c.gridwidth = 2; c.insets = new Insets(10,0,0,10); customDialog.component = new JTextField(""); customDialog.component.addAncestorListener(new RequestFocusListener()); Utils.remarcar(customDialog.component); Utils.setContrastColor(customDialog.component); Utils.setFontBold(customDialog.component); customDialog.component.getAccessibleContext().setAccessibleName(message.replaceAll(Constants.HTML_SALTO_LINEA, "") +". ALT + " + mnemonic + ". "); customDialog.mainPanel.add(customDialog.component, c); customDialog.infoLabel.setLabelFor(customDialog.component); customDialog.infoLabel.setDisplayedMnemonic(mnemonic); final String text = Utils.remarkMnemonic(customDialog.infoLabel.getText(), mnemonic); customDialog.infoLabel.setText(text); final GridBagConstraints cons = new GridBagConstraints(); cons.fill = GridBagConstraints.HORIZONTAL; cons.gridy = 0; cons.insets = new Insets(0,0,0,10); cancelButton = customDialog.getButton(cancellText, KeyEvent.VK_C); final JPanel cancelPanel = new JPanel(); cancelPanel.add(cancelButton); customDialog.buttonsPanel.add(cancelPanel, cons); cancelButton.addActionListener(customDialog); customDialog.infoLabel.setHorizontalAlignment(SwingConstants.LEFT); customDialog.component.setVisible(true); cancelButton.addActionListener(customDialog); customDialog.setVisible(true); if (customDialog.getAnswer()== JOptionPane.YES_OPTION) { return ((JTextField)customDialog.component).getText(); } return null; } private  CustomDialog(final JDialog componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); private  CustomDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); private  CustomDialog(final JFrame componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); static void showMessageDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeMessage); static int showConfirmDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeOption, final int typeMessage); static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage); static Object showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage,
			final Object[] selectionValues, final Object initialSelectionValue); static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final List<String> list, final String nameListElements, final String title, final int typeMessage); static char[] showInputPasswordDialog(final Component componentParent, final boolean modal, final String charSet, final boolean beep, final String message, final int mnemonic, final String title, final int typeMessage); @Override int getMinimumRelation(); static CustomDialog getInstanceCustomDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); @Override void actionPerformed(final ActionEvent e); }
CustomDialog extends JAccessibilityCustomDialog implements ActionListener { public static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage){ final CustomDialog customDialog = CustomDialog.getInstanceCustomDialog(componentParent, modal, message, title, typeMessage, true); final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridx = 1; c.gridy = 1; c.weightx = 0.0; c.weighty = 0.5; c.gridwidth = 2; c.insets = new Insets(10,0,0,10); customDialog.component = new JTextField(""); customDialog.component.addAncestorListener(new RequestFocusListener()); Utils.remarcar(customDialog.component); Utils.setContrastColor(customDialog.component); Utils.setFontBold(customDialog.component); customDialog.component.getAccessibleContext().setAccessibleName(message.replaceAll(Constants.HTML_SALTO_LINEA, "") +". ALT + " + mnemonic + ". "); customDialog.mainPanel.add(customDialog.component, c); customDialog.infoLabel.setLabelFor(customDialog.component); customDialog.infoLabel.setDisplayedMnemonic(mnemonic); final String text = Utils.remarkMnemonic(customDialog.infoLabel.getText(), mnemonic); customDialog.infoLabel.setText(text); final GridBagConstraints cons = new GridBagConstraints(); cons.fill = GridBagConstraints.HORIZONTAL; cons.gridy = 0; cons.insets = new Insets(0,0,0,10); cancelButton = customDialog.getButton(cancellText, KeyEvent.VK_C); final JPanel cancelPanel = new JPanel(); cancelPanel.add(cancelButton); customDialog.buttonsPanel.add(cancelPanel, cons); cancelButton.addActionListener(customDialog); customDialog.infoLabel.setHorizontalAlignment(SwingConstants.LEFT); customDialog.component.setVisible(true); cancelButton.addActionListener(customDialog); customDialog.setVisible(true); if (customDialog.getAnswer()== JOptionPane.YES_OPTION) { return ((JTextField)customDialog.component).getText(); } return null; } private  CustomDialog(final JDialog componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); private  CustomDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); private  CustomDialog(final JFrame componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); static void showMessageDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeMessage); static int showConfirmDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeOption, final int typeMessage); static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage); static Object showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final String title, final int typeMessage,
			final Object[] selectionValues, final Object initialSelectionValue); static String showInputDialog(final Component componentParent, final boolean modal, final String message, final int mnemonic, final List<String> list, final String nameListElements, final String title, final int typeMessage); static char[] showInputPasswordDialog(final Component componentParent, final boolean modal, final String charSet, final boolean beep, final String message, final int mnemonic, final String title, final int typeMessage); @Override int getMinimumRelation(); static CustomDialog getInstanceCustomDialog(final Component componentParent, final boolean modal, final String message, final String title, final int typeMessage, final boolean isInputDialog); @Override void actionPerformed(final ActionEvent e);  }