Package com.l2fprod.common.propertysheet

Examples of com.l2fprod.common.propertysheet.PropertySheetTableModel$Item


    Document doc = _docBuilder.newDocument();
    Element elem = doc.createElement("item-notes");
    Text textValue = doc.createTextNode("SalesID# 3445");
    elem.appendChild(textValue);
   
    Item item = pBuilder.createShoppingItem(itemName, itemDesc, quantity,
      unitPrice, null, currency, elem);
   
    assertEquals(itemName, item.getItemName());
    assertEquals(itemDesc, item.getItemDescription());
    assertEquals(quantity, item.getQuantity());
    assertEquals(4999.99F, item.getUnitPrice().getValue().floatValue());
    assertEquals(currency, item.getUnitPrice().getCurrency());
    assertEquals(elem, item.getMerchantPrivateItemData().getAny());
  }
View Full Code Here


    String[] itemDescs = new String[] {"mp3 player", "podcast subscription"};
    int[] quantities = new int[] {2, 1};
    float[] prices = new float[] {249.99F, 3.99F};
    List<Item> itemList = new ArrayList<Item>();
    for (int i = 0; i < itemNames.length; i++) {
      Item cartItem = pBuilder.createShoppingItem(itemNames[i], itemDescs[i],
        quantities[i], prices[i], null, null, null);
      itemList.add(cartItem);
    }
   
    return itemList;
View Full Code Here

  public Item createShoppingItem(String itemName, String itemDesc,
      int quantity, float unitPrice, String currency,
      String taxTableSelector, Element privateItemData)
      throws ProtocolException {
    Money money = createMoney(unitPrice, currency);
    Item item = _objectFact.createItem();
    item.setItemName(itemName);
    item.setItemDescription(itemDesc);
    item.setQuantity(quantity);
    item.setUnitPrice(money);

    if (taxTableSelector != null) {
      item.setTaxTableSelector(taxTableSelector);
    }
   
    if (privateItemData != null) {
      AnyType anyType = _objectFact.createAnyType();
      anyType.setAny(privateItemData);
      item.setMerchantPrivateItemData(anyType);
    }
   
    return item;
  }
View Full Code Here

      String taxTableSelector, Element privateItemData)
      throws ProtocolException {
   
    try {
      Money money = createMoney(unitPrice, currency);
      Item item = _objectFact.createItem();
      item.setItemName(itemName);
      item.setItemDescription(itemDesc);
      item.setQuantity(quantity);
      item.setUnitPrice(money);
 
      if (taxTableSelector != null) {
        item.setTaxTableSelector(taxTableSelector);
      }
     
      if (privateItemData != null) {
        AnyType anyType = _objectFact.createAnyType();
        anyType.setAny(privateItemData);
        item.setMerchantPrivateItemData(anyType);
      }
     
      return item;
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
View Full Code Here

    Document doc = _docBuilder.newDocument();
    Element elem = doc.createElement("item-notes");
    Text textValue = doc.createTextNode("SalesID# 3445");
    elem.appendChild(textValue);
   
    Item item = pBuilder.createShoppingItem(itemName, itemDesc, quantity,
      unitPrice, null, currency, elem);
   
    assertEquals(itemName, item.getItemName());
    assertEquals(itemDesc, item.getItemDescription());
    assertEquals(quantity, item.getQuantity());
    assertEquals(4999.99F, item.getUnitPrice().getValue().floatValue(), 0);
    assertEquals(currency, item.getUnitPrice().getCurrency());
    assertEquals(elem, item.getMerchantPrivateItemData().getAny());
  }
View Full Code Here

    String[] itemDescs = new String[] {"mp3 player", "podcast subscription"};
    int[] quantities = new int[] {2, 1};
    float[] prices = new float[] {249.99F, 3.99F};
    List itemList = new ArrayList();
    for (int i = 0; i < itemNames.length; i++) {
      Item cartItem = pBuilder.createShoppingItem(itemNames[i], itemDescs[i],
        quantities[i], prices[i], null, null, null);
      itemList.add(cartItem);
    }
   
    return itemList;
View Full Code Here

                });
                JPanel panel = new JPanel(new FormLayout("fill:pref:nogrow,fill:5dlu:nogrow, fill:pref:grow", "fill:pref:grow"));
                panel.add(form.getControl(), new CellConstraints(1, 1));
                JTabbedPane pane = new JTabbedPane();
                pane.addTab("Properties", new JScrollPane(area));
                final PropertySheetTableModel propertySheetTableModel = new PropertySheetTableModel();
                for(final Object property : form.getFormModel().getFieldNames())
                {
                    Property p = new AbstractProperty()
                    {
                        public String getName()
                        {
                            return property.toString();
                        }

                        public String getDisplayName()
                        {
                            return property.toString();
                        }

                        public String getShortDescription()
                        {
                            return property.toString();
                        }

                        public Class getType()
                        {
                            return form.getFormModel().getFieldMetadata(property.toString()).getPropertyType();
                        }

                        public boolean isEditable()
                        {
                            return false;
                        }

                        public String getCategory()
                        {
                           return form.getFormModel().getId();
                        }

                        public Object getValue()
                        {
                            Object value = form.getFormModel().getValueModel(property.toString()).getValue();
                            if(value == null)
                            {
                                return "«null»";
                            }
                            else if(!StringUtils.hasText(value.toString()))
                            {
                                return "«empty string»";
                            }
                            else
                            {
                                return value;
                            }
                        }

                        public void readFromObject(Object o)
                        {
                            throw new UnsupportedOperationException("Method readFromObject not yet implemented");
                        }

                        public void writeToObject(Object o)
                        {
                            throw new UnsupportedOperationException("Method writeToObject not yet implemented");
                        }
                    };
                    propertySheetTableModel.addProperty(p);
                }
                final PropertySheetTable table = new PropertySheetTable(propertySheetTableModel);
                new Thread(new Runnable()
                {
                    public void run()
                    {
                        while(true)
                        {
                            SwingUtilities.invokeLater(new Runnable()
                            {
                                public void run()
                                {
                                    propertySheetTableModel.fireTableDataChanged();
                                    //table.repaint();
                                }
                            });
                            try
                            {
View Full Code Here

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            // TODO Auto-generated method stub
            final JLabel cell = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

            PropertySheetTableModel tableModel = (PropertySheetTableModel) table.getModel();

            Item item = tableModel.getPropertySheetElement(row);

            String name = item.getName();

            if ("contentType".equals(name)) {
                short id = (Short) value;
View Full Code Here

      FilePersistenceTooBigForSerializationException {

    IFilePersistence filePersistence = createFilePersistence(true);
    IDataAccessSession session = filePersistence.createDataAccessSession();
    session.open();
    Item item = new Item(0, "value");
    session.setObject("key", item);
    session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
    filePersistence.close();

    filePersistence = createFilePersistence(false);
    session = filePersistence.createDataAccessSession();
    session.open();
    item = (Item) session.getObject("key");
    assertEquals("bad state", 0, item.getIdentifier());
    assertEquals("bad state", "value", item.getValue());
    session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
    filePersistence.close();
  }
View Full Code Here

TOP

Related Classes of com.l2fprod.common.propertysheet.PropertySheetTableModel$Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.