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);
}
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);
}
}
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);
}
Aggregations