public void verifiedStatusChanged(boolean verified) { optionPane.setOKEnabled(verified); } };
public void setOKEnabled(boolean enabled){ if (okButton == null){ okButton = getButtonComponent(this, JButton.class, (String)UIManager.get("OptionPane.okButtonText")); } if (okButton != null){ okButton.setEnabled(enabled); } else{ logger.error("Cannot find OK button for this system. " + "Please report this with details of your Operating System and language."); } }
final InputVerificationStatusChangedListener verificationListener = verified -> optionPane.setOKEnabled(verified && frameObject.checkEditorResults(editor)); final JDialog dlg = optionPane.createDialog(parent, null);
public void componentHidden(ComponentEvent e) { Object retVal = optionPane.getValue(); editorComponent.setPreferredSize(editorComponent.getSize()); if (retVal != null && retVal.equals(JOptionPane.OK_OPTION)) { handler.handleEditFinished(editor); } setSelectedValue(frameObject, true); if (editor instanceof VerifiedInputEditor) { ((VerifiedInputEditor) editor).removeStatusChangedListener(verificationListener); } // editor.dispose(); if (isRowEditor) { editor.dispose(); } } });
final JDialog dlg = optionPane.createDialog(parent, null);
final InputVerificationStatusChangedListener verificationListener = verified -> optionPane.setOKEnabled(verified && frameObject.checkEditorResults(editor)); final JDialog dlg = optionPane.createDialog(parent, null);
public void componentHidden(ComponentEvent e) { Object retVal = optionPane.getValue(); editorComponent.setPreferredSize(editorComponent.getSize()); if (retVal != null && retVal.equals(JOptionPane.OK_OPTION)) { handler.handleEditFinished(editor); } setSelectedValue(frameObject, true); if (editor instanceof VerifiedInputEditor) { ((VerifiedInputEditor) editor).removeStatusChangedListener(verificationListener); } // editor.dispose(); if (isRowEditor) { editor.dispose(); } } });
final JDialog dlg = optionPane.createDialog(parent, null);
public void verifiedStatusChanged(boolean verified) { optionPane.setOKEnabled(verified); } };
public void setOKEnabled(boolean enabled){ if (okButton == null){ okButton = getButtonComponent(this, JButton.class, (String)UIManager.get("OptionPane.okButtonText")); } if (okButton != null){ okButton.setEnabled(enabled); } else{ logger.warn("Cannot find OK button for this system. Please report this with details of your OS and language."); } }
public void componentHidden(ComponentEvent e) { Object retVal = optionPane.getValue(); editorComponent.setPreferredSize(editorComponent.getSize()); if (retVal != null && retVal.equals(JOptionPane.OK_OPTION)) { handler.handleEditFinished(editor); } setSelectedValue(frameObject, true); if (editor instanceof VerifiedInputEditor) { ((VerifiedInputEditor) editor) .removeStatusChangedListener(verificationListener); } // editor.dispose(); if (isRowEditor) { editor.dispose(); } } });
public void verifiedStatusChanged(boolean verified) { optionPane.setOKEnabled(verified && frameObject.checkEditorResults(editor)); } };
public void setOKEnabled(boolean enabled){ if (okButton == null){ okButton = getButtonComponent(this, JButton.class, (String)UIManager.get("OptionPane.okButtonText")); } if (okButton != null){ okButton.setEnabled(enabled); } else{ logger.warn("Cannot find OK button for this system. Please report this with details of your OS and language."); } }
public void componentHidden(ComponentEvent e) { Object retVal = optionPane.getValue(); editorComponent.setPreferredSize(editorComponent.getSize()); if (retVal != null && retVal.equals(JOptionPane.OK_OPTION)) { handler.handleEditFinished(editor); } setSelectedValue(frameObject, true); if (editor instanceof VerifiedInputEditor) { ((VerifiedInputEditor) editor).removeStatusChangedListener(verificationListener); } // editor.dispose(); if (isRowEditor) { editor.dispose(); } } });
public void verifiedStatusChanged(boolean verified) { optionPane.setOKEnabled(verified && frameObject.checkEditorResults(editor)); } };
private <T extends JComponent> T getButtonComponent(JComponent parent, Class<T> type, String name) { if (type.isAssignableFrom(parent.getClass())){ if (parent instanceof JButton){ if (name.equals(((JButton)parent).getText())){ return (T)parent; } } } for (Component c : parent.getComponents()){ if (c instanceof JComponent){ T target = getButtonComponent((JComponent)c, type, name); if (target != null){ return target; } } } return null; } }
private <T extends JComponent> T getButtonComponent(JComponent parent, Class<T> type, String name) { if (type.isAssignableFrom(parent.getClass())){ if (parent instanceof JButton){ if (name.equals(((JButton)parent).getText())){ return (T)parent; } } } for (Component c : parent.getComponents()){ if (c instanceof JComponent){ T target = getButtonComponent((JComponent)c, type, name); if (target != null){ return target; } } } return null; } }
private <T extends JComponent> T getButtonComponent(JComponent parent, Class<T> type, String name) { if (type.isAssignableFrom(parent.getClass())){ if (parent instanceof JButton){ if (name.equals(((JButton)parent).getText())){ return (T)parent; } } } for (Component c : parent.getComponents()){ if (c instanceof JComponent){ T target = getButtonComponent((JComponent)c, type, name); if (target != null){ return target; } } } return null; } }