Search in sources :

Example 6 with Action

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

the class VendorEditorModel method removeVendorNumber.

@Action(enabled = false)
public void removeVendorNumber(ActionEvent e) {
    VendorNumberBean vendorNumberBean = getSelection();
    // Remove from model list
    getSelectionInList().getList().remove(vendorNumberBean);
}
Also used : VendorNumberBean(de.clearit.kindergarten.domain.VendorNumberBean) Action(com.jgoodies.application.Action)

Example 7 with Action

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

the class VendorEditorModel method addVendorNumber.

// Actions ****************************************************************
@Action
public void addVendorNumber(ActionEvent e) {
    TextComponentUtils.commitImmediately();
    if (getVendorNumberFieldModel().getValue() != null) {
        // Check for vendor numbers in current model
        if (vendorNumberAlreadyExists(Integer.valueOf((String) getVendorNumberFieldModel().getValue()))) {
            JOptionPane.showMessageDialog(new JFrame(), "Verk\u00e4ufernummer bereits vorhanden!");
            // Reset input field
            getVendorNumberFieldModel().setValue(null);
            return;
        }
        if (!VendorNumberService.getInstance().isVendorNumberExisting(Integer.valueOf((String) getVendorNumberFieldModel().getValue()))) {
            VendorNumberBean vendorNumberBean = new VendorNumberBean();
            // Read Vendor number from input field
            vendorNumberBean.setVendorNumber(Integer.valueOf((String) getVendorNumberFieldModel().getValue()));
            // Add to model list
            getSelectionInList().getList().add(vendorNumberBean);
        } else {
            JOptionPane.showMessageDialog(new JFrame(), "Verk\u00e4ufernummer bereits vorhanden!");
        }
        Collections.sort(getBean().getVendorNumbers(), Comparator.<VendorNumberBean>comparingInt(VendorNumberBean::getVendorNumber));
        Collections.sort(getSelectionInList().getList(), Comparator.<VendorNumberBean>comparingInt(VendorNumberBean::getVendorNumber));
        // Reset input field
        getVendorNumberFieldModel().setValue(null);
    }
}
Also used : JFrame(javax.swing.JFrame) VendorNumberBean(de.clearit.kindergarten.domain.VendorNumberBean) Action(com.jgoodies.application.Action)

Example 8 with Action

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

the class VendorHomeModel method newItem.

@Action
public void newItem(ActionEvent e) {
    String title = RESOURCES.getString("newVendor.title");
    editItem(title, new VendorBean(), true);
}
Also used : VendorBean(de.clearit.kindergarten.domain.VendorBean) 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