/** * Returns a basic confirmation dialog (yes/no/cancel). * * @param owner the owner of the dialog * @param modal the modality of the dialog */ public static ApprovalDialog getConfirmationDialog(Dialog owner, ModalityType modal) { ApprovalDialog result; result = new ApprovalDialog(owner, modal); result.setApproveCaption("Yes"); result.setApproveMnemonic(KeyEvent.VK_Y); result.setDiscardCaption("No"); result.setDiscardMnemonic(KeyEvent.VK_N); result.setDiscardVisible(true); return result; }
/** * Returns a basic (modal) confirmation dialog (yes/no/cancel). * * @param owner the owner of the dialog */ public static ApprovalDialog getConfirmationDialog(Dialog owner) { return getConfirmationDialog(owner, ModalityType.DOCUMENT_MODAL); }
/** * Returns a basic (modal) approval dialog (ok/cancel). * * @param owner the owner of the dialog */ public static ApprovalDialog getDialog(Frame owner) { return getDialog(owner, true); }
/** * Returns a basic info dialog (ok). * * @param owner the owner of the dialog * @param modal the modality of the dialog */ public static ApprovalDialog getInformationDialog(Dialog owner, ModalityType modal) { ApprovalDialog result; result = new ApprovalDialog(owner, modal); result.setApproveVisible(true); result.setDiscardVisible(false); result.setCancelVisible(false); return result; }
setApproveCaption("OK"); setApproveMnemonic(KeyEvent.VK_O); m_ButtonApprove.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setDiscardCaption("Discard"); setDiscardMnemonic(KeyEvent.VK_D); m_ButtonDiscard.setVisible(false); m_ButtonDiscard.addActionListener(new ActionListener() { setCancelCaption("Cancel"); setCancelMnemonic(KeyEvent.VK_C); m_ButtonCancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {
public void actionPerformed(ActionEvent e) { String msg = checkInput(); if (msg == null) { m_Option = APPROVE_OPTION; setVisible(false); } else { GUIHelper.showErrorMessage(ApprovalDialog.this, msg); } } });
/** * Returns a basic (modal) approval dialog (ok/cancel). * * @param owner the owner of the dialog * @param modal whether to create a modal frame */ public static ApprovalDialog getDialog(Frame owner, boolean modal) { return new ApprovalDialog(owner, modal); }
/** * Returns a basic (modal) info dialog (ok). * * @param owner the owner of the dialog */ public static ApprovalDialog getInformationDialog(Dialog owner) { return getInformationDialog(owner, ModalityType.DOCUMENT_MODAL); }
/** * Returns a basic info dialog (ok). * * @param owner the owner of the dialog * @param modal whether to create a modal dialog */ public static ApprovalDialog getInformationDialog(Frame owner, boolean modal) { ApprovalDialog result; result = new ApprovalDialog(owner, modal); result.setApproveVisible(true); result.setDiscardVisible(false); result.setCancelVisible(false); return result; } }
/** * Returns a basic approval dialog (ok/cancel). * * @param owner the owner of the dialog * @param modal the modality of the dialog */ public static ApprovalDialog getDialog(Dialog owner, ModalityType modal) { return new ApprovalDialog(owner, modal); }
/** * Returns a basic (modal) info dialog (ok). * * @param owner the owner of the dialog */ public static ApprovalDialog getInformationDialog(Frame owner) { return getInformationDialog(owner, true); }
/** * Returns a basic confirmation dialog (yes/no/cancel). * * @param owner the owner of the dialog * @param modal whether to create a modal dialog */ public static ApprovalDialog getConfirmationDialog(Frame owner, boolean modal) { ApprovalDialog result; result = new ApprovalDialog(owner, modal); result.setApproveCaption("Yes"); result.setApproveMnemonic(KeyEvent.VK_Y); result.setDiscardCaption("No"); result.setDiscardMnemonic(KeyEvent.VK_N); result.setDiscardVisible(true); return result; }
/** * Returns a basic (modal) confirmation dialog (yes/no/cancel). * * @param owner the owner of the dialog */ public static ApprovalDialog getConfirmationDialog(Frame owner) { return getConfirmationDialog(owner, true); }
/** * Returns a basic (modal) approval dialog (ok/cancel). * * @param owner the owner of the dialog */ public static ApprovalDialog getDialog(Dialog owner) { return getDialog(owner, ModalityType.DOCUMENT_MODAL); }