Search in sources :

Example 1 with Action

use of com.jgoodies.application.Action 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 Action

use of com.jgoodies.application.Action in project kindergarten by clear-group-ausbildung.

the class PurchaseEditorModel method addLineItem.

// Actions ****************************************************************
@Action
public void addLineItem(final ActionEvent e) {
    TextComponentUtils.commitImmediately();
    triggerCommit();
    if (checkBeanContent()) {
        getSelectionInList().getList().add(getBean());
        refreshSummary();
        setBean(new PurchaseBean());
    }
}
Also used : PurchaseBean(de.clearit.kindergarten.domain.PurchaseBean) Action(com.jgoodies.application.Action)

Example 3 with Action

use of com.jgoodies.application.Action in project kindergarten by clear-group-ausbildung.

the class PurchaseHomeModel method newItem.

@Action
public void newItem(final ActionEvent e) {
    final String title = RESOURCES.getString("newPurchase.title");
    editItem(e, title, new PurchaseBean(), true);
}
Also used : PurchaseBean(de.clearit.kindergarten.domain.PurchaseBean) Action(com.jgoodies.application.Action)

Example 4 with Action

use of com.jgoodies.application.Action 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 5 with Action

use of com.jgoodies.application.Action 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

Action (com.jgoodies.application.Action)8 PurchaseBean (de.clearit.kindergarten.domain.PurchaseBean)4 TaskPane (com.jgoodies.jsdl.core.pane.TaskPane)3 VendorBean (de.clearit.kindergarten.domain.VendorBean)2 VendorNumberBean (de.clearit.kindergarten.domain.VendorNumberBean)2 JFrame (javax.swing.JFrame)1