public int showDialog(String title, JComponent component) { return JOptionPaneEx.showConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null); }
public int showValidatingDialog(String title, JComponent component, JComponent focusedComponent){ return JOptionPaneEx.showValidatingConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, focusedComponent); }
public static int showValidatingConfirmDialog(Component parent, String title, JComponent component, int messageType, int optionType, final JComponent defaultFocusedComponent) { if (component instanceof VerifiedInputEditor){ final VerifyingOptionPane optionPane = new VerifyingOptionPane(component, messageType, optionType) { /** * */ private static final long serialVersionUID = 7128847118051849761L; public void selectInitialValue() { // This is overridden so that the option pane dialog default // button doesn't get the focus. } }; final InputVerificationStatusChangedListener verificationListener = new InputVerificationStatusChangedListener() { public void verifiedStatusChanged(boolean verified) { optionPane.setOKEnabled(verified); } }; ((VerifiedInputEditor) component).addStatusChangedListener(verificationListener); final JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setModal(true); dlg.setVisible(true); return getReturnValue(optionPane); } else{ logger.warn("Component should implement VerifiedInputEditor for validating dialog to work. " + "Using normal dialog with no validating"); return showConfirmDialog(parent, title, component, messageType, optionType, null); } }
public static int showConfirmDialog(Component parent, String title, JComponent content, int messageType, int optionType, final JComponent defaultFocusedComponent) { JOptionPane optionPane = new JOptionPane(content, messageType, optionType) { @Override public void selectInitialValue() { // This makes focusing more consistent between // various operating systems / window managers if(defaultFocusedComponent != null) { defaultFocusedComponent.requestFocusInWindow(); } } }; JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setVisible(true); return getReturnValueAsInteger(optionPane); }
public static int showConfirmDialog(Component parent, String title, JComponent content, int messageType, int optionType, final JComponent defaultFocusedComponent) { JOptionPane optionPane = new JOptionPane(content, messageType, optionType); JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setVisible(true); return getReturnValue(optionPane); }
public static int showValidatingConfirmDialog(Component parent, String title, JComponent component, int messageType, int optionType, final JComponent defaultFocusedComponent) { if (component instanceof VerifiedInputEditor) { final VerifyingOptionPane optionPane = new VerifyingOptionPane(component, messageType, optionType) { public void selectInitialValue() { // This is overridden so that the option pane dialog default // button doesn't get the focus. if (defaultFocusedComponent != null) { defaultFocusedComponent.requestFocusInWindow(); } } }; final InputVerificationStatusChangedListener verificationListener = optionPane::setOKEnabled; ((VerifiedInputEditor) component).addStatusChangedListener(verificationListener); final JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setModal(true); dlg.setVisible(true); return getReturnValueAsInteger(optionPane); } else { logger.warn("Component should implement VerifiedInputEditor for validating dialog to work. " + "Using normal dialog with no validating"); return showConfirmDialog(parent, title, component, messageType, optionType, null); } }
public static int showConfirmDialog(Component parent, String title, JComponent content, int messageType, int optionType, final JComponent defaultFocusedComponent, Object[] options, Object defaultOption) { JOptionPane optionPane = new JOptionPane(content, messageType, optionType, null, options, defaultOption); JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setVisible(true); return getReturnValue(optionPane); }
public static int showConfirmDialog(Component parent, String title, JComponent content, int messageType, int optionType, final JComponent defaultFocusedComponent, Object[] options, Object defaultOption) { JOptionPane optionPane = new JOptionPane(content, messageType, optionType, null, options, defaultOption) { @Override public void selectInitialValue() { // This makes focusing more consistent between // various operating systems / window managers if(defaultFocusedComponent != null) { defaultFocusedComponent.requestFocusInWindow(); } } }; JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setVisible(true); return getReturnValueAsInteger(optionPane); }
public int showDialog(String title, JComponent component, JComponent focusedComponent) { return JOptionPaneEx.showConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, focusedComponent); }
public int showValidatingDialog(String title, JComponent component, JComponent focusedComponent){ return JOptionPaneEx.showValidatingConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, focusedComponent); }
((VerifiedInputEditor) component).addStatusChangedListener(verificationListener); final JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setModal(true); dlg.setVisible(true); return getReturnValue(optionPane); return showConfirmDialog(parent, title, component, messageType, optionType, null);
public static int showConfirmDialog(Component parent, String title, JComponent content, int messageType, int optionType, final JComponent defaultFocusedComponent) { JOptionPane optionPane = new JOptionPane(content, messageType, optionType); JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setVisible(true); return getReturnValue(optionPane); }
public int showDialog(String title, JComponent component) { return JOptionPaneEx.showConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null); }
public int showValidatingDialog(String title, JComponent component, JComponent focusedComponent){ return JOptionPaneEx.showValidatingConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, focusedComponent); }
public static int showConfirmDialog(Component parent, String title, JComponent content, int messageType, int optionType, final JComponent defaultFocusedComponent, Object[] options, Object defaultOption) { JOptionPane optionPane = new JOptionPane(content, messageType, optionType, null, options, defaultOption); JDialog dlg = createDialog(parent, title, optionPane, defaultFocusedComponent); dlg.setVisible(true); return getReturnValue(optionPane); }
public int showDialog(String title, JComponent component, int options) { return JOptionPaneEx.showConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, options, null); }
public int showValidatingDialog(String title, JComponent component, JComponent focusedComponent){ return JOptionPaneEx.showValidatingConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, focusedComponent); }
public int showDialog(String title, JComponent component, int options) { return JOptionPaneEx.showConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, options, null); }
public static URI showDialog() { OpenFromURLPanel panel = new OpenFromURLPanel(); int ret = JOptionPaneEx.showValidatingConfirmDialog(null, "Enter or select a URI", panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, panel.uriField); if (ret == JOptionPane.OK_OPTION) { return panel.getURI(); } return null; } }
public int showDialog(String title, JComponent component, JComponent focusedComponent) { return JOptionPaneEx.showConfirmDialog(getParent(), title, component, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, focusedComponent); }