Package javax.swing.table

Examples of javax.swing.table.TableColumn


                     || field == DcObject._SYS_LENDBY
                     || field == DcObject._SYS_LOANDAYSTILLOVERDUE || field == DcObject._SYS_LOANDUEDATE))
                continue;

            try {
                TableColumn column = columns.get(Integer.valueOf(field));

                if (column == null)
                    continue;

                if (definition.isRequired())
                    column.setHeaderRenderer(DcTableHeaderRendererRequired.getInstance());
                else
                    column.setHeaderRenderer(DcTableHeaderRenderer.getInstance());

                String label = module.getField(field).getLabel();

                if (label != null && label.length() > 0) {
                    column.setHeaderValue(label);
                } else {
                    column.setHeaderValue(module.getField(definition.getIndex()).getSystemName());
                }

                addColumn(column);

            } catch (Exception e) {
                Integer key = definition.getIndex();
                TableColumn column = columns.containsKey(key) ? columns.get(key) : null;
                logger.debug("Error while applying settings to column "
                        + column + " for field definition "
                        + definition.getLabel());
            }
        }
View Full Code Here


    public void resetTable() {
        removeColumns();

        for (DcFieldDefinition definition : module.getFieldDefinitions().getDefinitions()) {
            TableColumn column = columns.get(Integer.valueOf(definition.getIndex()));
            addColumn(column);
        }
    }
View Full Code Here

    final JTable table = new JTable(data);
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    for (int columnIndex = 0; columnIndex < data.getColumnCount(); columnIndex++)
    {
      final TableColumn column = table.getColumnModel().getColumn(columnIndex);
      column.setMinWidth(50);
      final Class c = data.getColumnClass(columnIndex);
      if (c.equals(Number.class))
      {
        column.setCellRenderer(new NumberCellRenderer());
      }
    }

    return new JScrollPane
        (table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
View Full Code Here

    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    for (int columnIndex = 0; columnIndex < data
        .getColumnCount(); columnIndex++)
    {
      final TableColumn column = table.getColumnModel().getColumn(columnIndex);
      column.setMinWidth(50);
      final Class c = data.getColumnClass(columnIndex);
      if (c.equals(Number.class))
      {
        column.setCellRenderer(new NumberCellRenderer());
      }
    }

    return new JScrollPane
        (table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
View Full Code Here

        sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
       
        tblFiles.setColumnCount(2);
       
        TableColumn columnEnabled = tblFiles.getColumnModel().getColumn(0);
        JCheckBox checkEnabled = new JCheckBox();
        columnEnabled.setCellEditor(new DefaultCellEditor(checkEnabled));
        columnEnabled.setPreferredWidth(30);
        columnEnabled.setMaxWidth(30);
        columnEnabled.setMinWidth(30);
        columnEnabled.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
        columnEnabled.setHeaderValue("");
       
        TableColumn tcDescription = tblFiles.getColumnModel().getColumn(1);
        JTextField textField = ComponentFactory.getTextFieldDisabled();
        tcDescription.setCellEditor(new DefaultCellEditor(textField));
        tcDescription.setHeaderValue(DcResources.getText("lblFile"));

        tblFiles.applyHeaders();
       
        //**********************************************************
        // Main Panel
View Full Code Here

        setLayout(Layout.getGBL());
       
        table = ComponentFactory.getDCTable(false, false);
        table.setColumnCount(1);

        TableColumn c = table.getColumnModel().getColumn(0);
        c.setHeaderValue(DcResources.getText("lblField"));

        JScrollPane scroller = new JScrollPane(table);
        scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scroller.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);
View Full Code Here

        JScrollPane sp = new JScrollPane(tblItems);
        sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        tblItems.activate();
        tblItems.setVisibleColumns(fields);
       
        TableColumn c = new TableColumn();
       
        JCheckBox checkEnabled = new JCheckBox();
        checkEnabled.addActionListener(this);
        checkEnabled.setActionCommand("checkDependencies");
        c.setCellEditor(new DefaultCellEditor(checkEnabled));
        c.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
        c.setHeaderValue(DcResources.getText("lblReplace"));
        c.setIdentifier("ENABLED");
        c.setHeaderRenderer(DcTableHeaderRenderer.getInstance());
        tblItems.addColumn(c);
       
        for (DcObject item : items) {
            String oldvalue = (String) item.getValue(field);
            oldvalue = oldvalue.replaceAll("(?i)" + value, replacement);
View Full Code Here

        //**********************************************************          
        JScrollPane scroller = new JScrollPane(programTable);
        programTable.addMouseListener(this);
        programTable.setColumnCount(2);

        TableColumn columnExtension = programTable.getColumnModel().getColumn(0);
        columnExtension.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));      
        columnExtension.setHeaderValue(DcResources.getText("lblFileExtension"));
       
        TableColumn columnProgram = programTable.getColumnModel().getColumn(1);
        columnProgram.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
        columnProgram.setHeaderValue(DcResources.getText("lblProgram"));
       
        scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scroller.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);       
       
        programTable.applyHeaders();
View Full Code Here

        //Preview panel
        //**********************************************************
        JPanel panelPreview = new JPanel();
       
        table.setColumnCount(3);
        TableColumn tcDescription = table.getColumnModel().getColumn(0);
        JTextField textField = ComponentFactory.getTextFieldDisabled();
        tcDescription.setCellEditor(new DefaultCellEditor(textField));
        tcDescription.setHeaderValue(DcModules.get(module).getObjectName());

        TableColumn tcOldFilename = table.getColumnModel().getColumn(1);
        textField = ComponentFactory.getTextFieldDisabled();
        tcOldFilename.setCellEditor(new DefaultCellEditor(textField));
        tcOldFilename.setHeaderValue(DcResources.getText("lblOldFilename"));
       
        TableColumn tcNewFilename = table.getColumnModel().getColumn(2);
        textField = ComponentFactory.getTextFieldDisabled();
        tcNewFilename.setCellEditor(new DefaultCellEditor(textField));
        tcNewFilename.setHeaderValue(DcResources.getText("lblNewFilename"));
       
        table.addMouseListener(this);
        table.applyHeaders();
       
        panelPreview.setLayout(Layout.getGBL());
View Full Code Here

        private void build() {
            setLayout(Layout.getGBL());

            table.setColumnCount(7);

            TableColumn c = table.getColumnModel().getColumn(6);
            table.removeColumn(c);

            c = table.getColumnModel().getColumn(0);
            JTextField textField = ComponentFactory.getTextFieldDisabled();
            c.setCellEditor(new DefaultCellEditor(textField));
            c.setHeaderValue(DcResources.getText("lblField"));

            c = table.getColumnModel().getColumn(1);
            c.setCellEditor(new DefaultCellEditor(ComponentFactory.getNumberField()));
            c.setHeaderValue(DcResources.getText("lblWidth"));

            c = table.getColumnModel().getColumn(2);
            c.setCellEditor(new DefaultCellEditor(ComponentFactory.getNumberField()));
            c.setHeaderValue(DcResources.getText("lblMaxTextLength"));
           
            c = table.getColumnModel().getColumn(3);
            c.setCellEditor(new DefaultCellEditor(ComponentFactory.getCheckBox("")));
            c.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            c.setHeaderValue(DcResources.getText("lblVisible"));
           
            c = table.getColumnModel().getColumn(4);
            c.setCellEditor(new DefaultCellEditor(ComponentFactory.getCheckBox("")));
            c.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            c.setHeaderValue(DcResources.getText("lblLinkToDetails"));
           
            c = table.getColumnModel().getColumn(5);
            c.setCellEditor(new DefaultCellEditor(ComponentFactory.getCheckBox("")));
            c.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            c.setHeaderValue(DcResources.getText("lblQuickSearchField"));           

            applyDefinitions();

            JScrollPane scroller = new JScrollPane(table);
            scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
View Full Code Here

TOP

Related Classes of javax.swing.table.TableColumn

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.