Search in sources :

Example 1 with TaskPane

use of com.jgoodies.jsdl.core.pane.TaskPane in project kindergarten by clear-group-ausbildung.

the class PurchaseEditorModel method removeLineItem.

@Action(enabled = false)
public void removeLineItem(final ActionEvent e) {
    final PurchaseBean purchase = getSelection();
    final String mainInstruction = RESOURCES.getString("deleteItem.mainInstruction", "Artikel-Nr: " + purchase.getItemNumber() + ", Verk\u00e4fernummer: " + purchase.getVendorNumber());
    final TaskPane pane = new TaskPane(MessageType.QUESTION, mainInstruction, CommandValue.YES, CommandValue.NO);
    pane.setPreferredWidth(PreferredWidth.MEDIUM);
    pane.showDialog(e, RESOURCES.getString("deleteItem.title"));
    if (pane.getCommitValue() == CommandValue.YES) {
        getSelectionInList().getList().remove(purchase);
        refreshSummary();
    }
}
Also used : PurchaseBean(de.clearit.kindergarten.domain.PurchaseBean) TaskPane(com.jgoodies.jsdl.core.pane.TaskPane) Action(com.jgoodies.application.Action)

Example 2 with TaskPane

use of com.jgoodies.jsdl.core.pane.TaskPane in project kindergarten by clear-group-ausbildung.

the class VendorHomeModel method deleteItem.

@Action(enabled = false)
public void deleteItem(ActionEvent e) {
    VendorBean vendor = getSelection();
    String mainInstruction = RESOURCES.getString("deleteItem.mainInstruction", vendor.getLastName() + ", " + vendor.getFirstName());
    TaskPane pane = new TaskPane(MessageType.QUESTION, mainInstruction, CommandValue.YES, CommandValue.NO);
    pane.setPreferredWidth(PreferredWidth.MEDIUM);
    pane.showDialog(e, RESOURCES.getString("deleteItem.title"));
    if (pane.getCommitValue() == CommandValue.YES) {
        SERVICE.delete(vendor);
        postChangeHandler.onPostDelete();
    }
}
Also used : VendorBean(de.clearit.kindergarten.domain.VendorBean) TaskPane(com.jgoodies.jsdl.core.pane.TaskPane) Action(com.jgoodies.application.Action)

Example 3 with TaskPane

use of com.jgoodies.jsdl.core.pane.TaskPane in project kindergarten by clear-group-ausbildung.

the class Dialogs method purchaseHasErrors.

/**
 * @return {@code true} if canceled, {@code false} otherwise
 */
public static boolean purchaseHasErrors(EventObject e, PurchaseBean purchase) {
    String title = RESOURCES.getString("dialogs.documentHasErrors.title");
    String mainInstruction = RESOURCES.getString("dialogs.documentHasErrors.mainInstruction", purchase.getItemNumber());
    String contentText = RESOURCES.getString("dialogs.documentHasErrors.content", purchase.getItemNumber());
    TaskPane pane = new TaskPane(MessageType.WARNING, mainInstruction, contentText, CommandValue.DISCARD, CommandValue.CANCEL);
    pane.setMarginContentTop(4);
    pane.setMarginContentBottom(14);
    pane.showDialog(e, title);
    return pane.isCancelled();
}
Also used : TaskPane(com.jgoodies.jsdl.core.pane.TaskPane)

Example 4 with TaskPane

use of com.jgoodies.jsdl.core.pane.TaskPane in project kindergarten by clear-group-ausbildung.

the class DefaultDesktopFrame method rejectFrameClosing.

// Helper Code ************************************************************
/**
 * Handles the case where a frame close request has been rejected. Opens a task
 * dialog that informs about the rejected request.
 *
 * @param e
 *          describes the rejected event
 *
 * @see #modalFrameClosing(EventObject, Runnable)
 */
private void rejectFrameClosing(EventObject e) {
    TaskPane pane = new TaskPane(MessageType.INFORMATION, RESOURCES.getString("desktop.rejectFrameClosing.mainInstructionText"), RESOURCES.getString("desktop.rejectFrameClosing.contentText"), CommandValue.OK);
    pane.setPreferredWidth(PreferredWidth.MEDIUM);
    pane.showDialog(e, RESOURCES.getString("desktop.rejectFrameClosing.title"));
}
Also used : TaskPane(com.jgoodies.jsdl.core.pane.TaskPane)

Example 5 with TaskPane

use of com.jgoodies.jsdl.core.pane.TaskPane in project kindergarten by clear-group-ausbildung.

the class PurchaseHomeModel method deleteItem.

@Action(enabled = false)
public void deleteItem(final ActionEvent e) {
    final PurchaseBean purchase = getSelection();
    final String mainInstruction = RESOURCES.getString("deleteItem.mainInstruction", "Artikel-Nr: " + purchase.getItemNumber());
    final TaskPane pane = new TaskPane(MessageType.QUESTION, mainInstruction, CommandValue.YES, CommandValue.NO);
    pane.setPreferredWidth(PreferredWidth.MEDIUM);
    pane.showDialog(e, RESOURCES.getString("deleteItem.title"));
    if (pane.getCommitValue() == CommandValue.YES) {
        SERVICE.delete(purchase);
        filterPurchases();
    }
}
Also used : PurchaseBean(de.clearit.kindergarten.domain.PurchaseBean) TaskPane(com.jgoodies.jsdl.core.pane.TaskPane) Action(com.jgoodies.application.Action)

Aggregations

TaskPane (com.jgoodies.jsdl.core.pane.TaskPane)9 Action (com.jgoodies.application.Action)3 PurchaseBean (de.clearit.kindergarten.domain.PurchaseBean)2 ValidationMessage (com.jgoodies.validation.ValidationMessage)1 VendorBean (de.clearit.kindergarten.domain.VendorBean)1 EventObject (java.util.EventObject)1 Vector (java.util.Vector)1 JList (javax.swing.JList)1 JScrollPane (javax.swing.JScrollPane)1