use of eu.ggnet.dwoss.redtape.ee.entity.SalesProduct in project dwoss by gg-net.
the class SalesProductUpdateCask method initComponents.
/**
* This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
void initComponents() {
bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
salesProduct = new SalesProduct();
jLabel6 = new javax.swing.JLabel();
nameField = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
priceIncTaxField = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
priceField = new javax.swing.JTextField();
partNoField = new javax.swing.JLabel();
setRequestFocusEnabled(false);
jLabel6.setText("Name:");
org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, salesProduct, org.jdesktop.beansbinding.ELProperty.create("${name}"), nameField, org.jdesktop.beansbinding.BeanProperty.create("text"), "nameField");
bindingGroup.addBinding(binding);
jLabel1.setText("PartNo.");
jLabel2.setText("Preis (netto)");
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, salesProduct, org.jdesktop.beansbinding.ELProperty.create("${price}"), priceIncTaxField, org.jdesktop.beansbinding.BeanProperty.create("text"), "bruttoPrice");
binding.setConverter(taxedConverter);
bindingGroup.addBinding(binding);
jLabel3.setText("Preis (brutto)");
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, salesProduct, org.jdesktop.beansbinding.ELProperty.create("${price}"), priceField, org.jdesktop.beansbinding.BeanProperty.create("text"), "nettoPrice");
binding.setConverter(stringConverter);
bindingGroup.addBinding(binding);
partNoField.setText("<PartNo>");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(partNoField, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)).addGroup(layout.createSequentialGroup().addComponent(jLabel6).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(nameField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))).addGap(20, 20, 20)).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 92, Short.MAX_VALUE).addComponent(priceField)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(priceIncTaxField).addContainerGap()).addGroup(layout.createSequentialGroup().addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE).addGap(20, 20, 20)))))));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING).addComponent(nameField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1).addComponent(partNoField)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel2).addComponent(jLabel3)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(priceIncTaxField).addComponent(priceField)).addContainerGap()));
bindingGroup.bind();
}
use of eu.ggnet.dwoss.redtape.ee.entity.SalesProduct in project dwoss by gg-net.
the class SalesProductChooserCask method productTableMouseClicked.
// </editor-fold>//GEN-END:initComponents
private void productTableMouseClicked(java.awt.event.MouseEvent evt) {
// GEN-FIRST:event_productTableMouseClicked
String s = (String) productTable.getValueAt(productTable.getSelectedRow(), 0);
for (SalesProduct p : products) {
if (p.getPartNo().equals(s))
product = p;
}
if (evt.getClickCount() > 1) {
HtmlDialog dialog = new HtmlDialog(SwingUtilities.getWindowAncestor(this), Dialog.ModalityType.MODELESS);
dialog.setText(product.toHtml());
dialog.setVisible(true);
}
}
use of eu.ggnet.dwoss.redtape.ee.entity.SalesProduct in project dwoss by gg-net.
the class SalesProductOperationIT method testUpdateSalesProdukt.
/**
* Test of updatePrice method, of class SalesProductOperation.
* <p>
* @throws de.dw.util.UserInfoException
*/
// Fails under Linux, Enable with Arquilian
@Ignore
@Test
public void testUpdateSalesProdukt() throws UserInfoException {
ProductSpec ps = receiptGenerator.makeProductSpec();
SalesProduct createSalesProduct = redTapeWorker.createSalesProduct(ps.getPartNo());
createSalesProduct.setPrice(1337.37);
SalesProduct updateSalesProdukt = redTapeAgent.merge(createSalesProduct);
assertTrue(updateSalesProdukt.getPrice() == 1337.37);
}
use of eu.ggnet.dwoss.redtape.ee.entity.SalesProduct in project dwoss by gg-net.
the class SalesProductOperationIT method testCreateSalesProduct.
/**
* Test of createSalesProduct method, of class SalesProductOperation.
* <p>
* @throws de.dw.util.UserInfoException
*/
// Fails under Linux, Enable with Arquilian
@Ignore
@Test
public void testCreateSalesProduct() throws UserInfoException {
ProductSpec ps = receiptGenerator.makeProductSpec();
redTapeWorker.createSalesProduct(ps.getPartNo());
List<SalesProduct> salesProducts = redTapeAgent.findAll(SalesProduct.class);
SalesProduct salesProduct = new SalesProduct(ps.getPartNo(), ps.getModel().getName(), 0., ps.getProductId(), SpecFormater.toSingleLine(ps));
assertTrue(salesProducts.contains(salesProduct));
}
use of eu.ggnet.dwoss.redtape.ee.entity.SalesProduct in project dwoss by gg-net.
the class SalesProductOperationIT method testRemoveSalesProdukt.
/**
* Test of removeSalesProdukt method, of class SalesProductOperation.
*/
@Test
public void testRemoveSalesProdukt() {
SalesProduct product1 = new SalesProduct("Part1", "Name1", 1D, 1, "Descritpt1");
SalesProduct product2 = new SalesProduct("Part2", "Name2", 2D, 2, "Descritpt1");
SalesProduct product3 = new SalesProduct("Part3", "Name3", 3D, 3, "Descritpt1");
SalesProduct product4 = new SalesProduct("Part4", "Name4", 4D, 4, "Descritpt1");
redTapeAgent.persist(product1);
redTapeAgent.persist(product2);
redTapeAgent.persist(product3);
redTapeAgent.persist(product4);
redTapeAgent.remove(product1);
redTapeAgent.remove(product2);
assertTrue(redTapeAgent.findAll(SalesProduct.class).size() == 2);
}
Aggregations