Package com.l2fprod.common.propertysheet

Examples of com.l2fprod.common.propertysheet.PropertySheetTableModel


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

TOP

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

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.