Package javax.swing.table

Examples of javax.swing.table.TableColumn


        JPanel panel = new JPanel();
        panel.setLayout(Layout.getGBL());

        table.setColumnCount(4);

        TableColumn cField = table.getColumnModel().getColumn(0);
        JTextField textField = new JTextField();
        textField.setEditable(false);
        textField.setEnabled(false);
        textField.setFont(ComponentFactory.getSystemFont());
        textField.setForeground(ComponentFactory.getDisabledColor());
        cField.setCellEditor(new DefaultCellEditor(textField));

        TableColumn columnEnabled = table.getColumnModel().getColumn(1);
        columnEnabled.setCellEditor(new DefaultCellEditor(new JCheckBox()));
        columnEnabled.setCellRenderer(CheckBoxTableCellRenderer.getInstance());

        TableColumn cFillGaps = table.getColumnModel().getColumn(2);
        cFillGaps.setCellEditor(new DefaultCellEditor(new JCheckBox()));
        cFillGaps.setCellRenderer(CheckBoxTableCellRenderer.getInstance());

        TableColumn cStep = table.getColumnModel().getColumn(3);
        JComboBox comboWeight = ComponentFactory.getComboBox();
        for (int i = 1; i < 101; i++)
            comboWeight.addItem(i);

        cStep.setCellEditor(new DefaultCellEditor(comboWeight));

        cField.setHeaderValue(DcResources.getText("lblField"));
        columnEnabled.setHeaderValue(DcResources.getText("lblEnabled"));
        cFillGaps.setHeaderValue(DcResources.getText("lblFillGaps"));
        cStep.setHeaderValue(DcResources.getText("lblStep"));

        Collection<AutoIncrementer> enhancers = (Collection<AutoIncrementer>)
            ValueEnhancers.getEnhancers(module.getIndex(), ValueEnhancers._AUTOINCREMENT);
       
        setEnhancers(enhancers);
View Full Code Here


        //Defined Programs List
        //**********************************************************          
        JScrollPane scroller = new JScrollPane(mappingTable);
        mappingTable.setColumnCount(2);

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

        setLayout(Layout.getGBL());

        table = ComponentFactory.getDCTable(false, false);
        table.setColumnCount(3);

        TableColumn cModule = table.getColumnModel().getColumn(_COLUMN_LABEL);
        cModule.setHeaderValue(DcResources.getText("lblPlugin"));
       
        TableColumn cView = table.getColumnModel().getColumn(_COLUMN_AUTHORIZED);
        JCheckBox cbView = ComponentFactory.getCheckBox("");
        cbView.addActionListener(this);
        cbView.setActionCommand("applyRight");
        cView.setCellEditor(new DefaultCellEditor(cbView));
        cView.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
        cView.setHeaderValue(DcResources.getText("lblAuthorized"));

        TableColumn cHidden = table.getColumnModel().getColumn(_COLUMN_PERMISSION);
        table.removeColumn(cHidden);
       
        // table
        JScrollPane scroller = new JScrollPane(table);
        scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
View Full Code Here

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

            table.setColumnCount(8);

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

            c = table.getColumnModel().getColumn(_COL_FIELD);
            table.removeColumn(c);

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

            c = table.getColumnModel().getColumn(_COL_CUSTOM_LABEL);
            DcShortTextField textName = ComponentFactory.getShortTextField(20);
            c.setCellEditor(new DefaultCellEditor(textName));
            c.setHeaderValue(DcResources.getText("lblCustomLabel"));

            c = table.getColumnModel().getColumn(_COL_ENABLED);
            JCheckBox checkEnabled = new JCheckBox();
            checkEnabled.addActionListener(this);
            checkEnabled.setActionCommand("checkDependencies");
            c.setCellEditor(new DefaultCellEditor(checkEnabled));
            c.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            c.setHeaderValue(DcResources.getText("lblEnabled"));

            c = table.getColumnModel().getColumn(_COL_REQUIRED);
            JCheckBox checkRequired = new JCheckBox();
            checkRequired.addActionListener(this);
            checkRequired.setActionCommand("checkDependencies");
            c.setCellEditor(new DefaultCellEditor(checkRequired));
            c.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            c.setHeaderValue(DcResources.getText("lblRequired"));

            c = table.getColumnModel().getColumn(_COL_DESCRIPTIVE);
            JCheckBox checkDescriptive = new JCheckBox();
            checkDescriptive.addActionListener(this);
            checkDescriptive.setActionCommand("checkDependencies");
            c.setCellEditor(new DefaultCellEditor(checkDescriptive));
            c.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            c.setHeaderValue(DcResources.getText("lblDescriptive"));
           
            c = table.getColumnModel().getColumn(_COL_UNIQUE);
            JCheckBox checkUnique = new JCheckBox();
            checkUnique.addActionListener(this);
            checkUnique.setActionCommand("checkDependencies");
            c.setCellEditor(new DefaultCellEditor(checkUnique));
            c.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            c.setHeaderValue(DcResources.getText("lblUnique"));
           
            applyDefinitions();

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

        table = ComponentFactory.getDCTable(false, false);

        DcTableModel model = (DcTableModel) table.getModel();
        model.setColumnCount(3);

        TableColumn columnNr = table.getColumnModel().getColumn(0);
        columnNr.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
        columnNr.setHeaderValue(DcResources.getText("lblField"));
       
        TableColumn columnName = table.getColumnModel().getColumn(1);
        columnName.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
        columnName.setHeaderValue(DcResources.getText("lblSourceName"));

        TableColumn columnField = table.getColumnModel().getColumn(2);
        JComboBox comboFields = ComponentFactory.getComboBox();
        columnField.setHeaderValue(DcResources.getText("lblTargetName"));

        for (DcField field : wizard.getModule().getFields()) {
            if (    (!field.isUiOnly() ||
                      field.getValueType() == DcRepository.ValueTypes._PICTURE ||
                      field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) &&
                     field.getIndex() != DcObject._ID)
               
                comboFields.addItem(field);
        }
       
        columnField.setCellEditor(new DefaultCellEditor(comboFields));

        table.applyHeaders();

        JScrollPane scroller = new JScrollPane(table);
        scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
View Full Code Here

        //Labels
        //**********************************************************          
        JScrollPane scrollerLabels = new JScrollPane(tableLabels);
        tableLabels.setColumnCount(2);

        TableColumn columnKey = tableLabels.getColumnModel().getColumn(0);
        columnKey.setMaxWidth(300);
        columnKey.setPreferredWidth(150);
        columnKey.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));      
        columnKey.setHeaderValue(DcResources.getText("lblKey"));
       
        TableColumn columnValue = tableLabels.getColumnModel().getColumn(1);
        columnValue.setCellEditor(new DefaultCellEditor(ComponentFactory.getShortTextField(1000)));
        columnValue.setHeaderValue(DcResources.getText("lblValue"));
       
        scrollerLabels.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollerLabels.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);       
       
        tableLabels.applyHeaders();
        ComponentFactory.setBorder(scrollerLabels);
       
        //**********************************************************
        //Tips
        //**********************************************************          
        JScrollPane scrollerTips = new JScrollPane(tableTips);
        tableTips.setColumnCount(2);

        columnKey = tableTips.getColumnModel().getColumn(0);
        columnKey.setMaxWidth(300);
        columnKey.setPreferredWidth(150);
        columnKey.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));      
        columnKey.setHeaderValue(DcResources.getText("lblKey"));
       
        columnValue = tableTips.getColumnModel().getColumn(1);
        columnValue.setCellEditor(new DefaultCellEditor(ComponentFactory.getShortTextField(1000)));
        columnValue.setHeaderValue(DcResources.getText("lblValue"));
       
        scrollerTips.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollerTips.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);       
       
        tableTips.applyHeaders();      
        ComponentFactory.setBorder(scrollerTips);
       
        //**********************************************************
        //Messages
        //**********************************************************          
        JScrollPane scrollerMessages = new JScrollPane(tableMessages);
        tableMessages.setColumnCount(2);

        columnKey = tableMessages.getColumnModel().getColumn(0);
        columnKey.setMaxWidth(300);
        columnKey.setPreferredWidth(150);
        columnKey.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));      
        columnKey.setHeaderValue(DcResources.getText("lblKey"));
       
        columnValue = tableMessages.getColumnModel().getColumn(1);
        columnValue.setCellEditor(new DefaultCellEditor(ComponentFactory.getShortTextField(1000)));
        columnValue.setHeaderValue(DcResources.getText("lblValue"));
       
        scrollerMessages.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollerMessages.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);       
       
        tableMessages.applyHeaders();      
        ComponentFactory.setBorder(scrollerMessages);
               
        //**********************************************************
        //Tooltips
        //**********************************************************          
        JScrollPane scrollerTooltips = new JScrollPane(tableTooltips);
        tableTooltips.setColumnCount(2);

        columnKey = tableTooltips.getColumnModel().getColumn(0);
        columnKey.setMaxWidth(300);
        columnKey.setPreferredWidth(150);
        columnKey.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));      
        columnKey.setHeaderValue(DcResources.getText("lblKey"));
       
        columnValue = tableTooltips.getColumnModel().getColumn(1);
        columnValue.setCellEditor(new DefaultCellEditor(ComponentFactory.getShortTextField(1000)));
        columnValue.setHeaderValue(DcResources.getText("lblValue"));
       
        scrollerTooltips.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollerTooltips.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);       
       
        tableTooltips.applyHeaders();
        ComponentFactory.setBorder(scrollerTooltips);
       
        //**********************************************************
        //System Labels
        //**********************************************************          
        JScrollPane scrollerSystemLabels = new JScrollPane(tableSystemLabels);
        tableSystemLabels.setColumnCount(2);

        columnKey = tableSystemLabels.getColumnModel().getColumn(0);
        columnKey.setMaxWidth(300);
        columnKey.setPreferredWidth(150);
        columnKey.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));      
        columnKey.setHeaderValue(DcResources.getText("lblKey"));
       
        columnValue = tableSystemLabels.getColumnModel().getColumn(1);
        columnValue.setCellEditor(new DefaultCellEditor(ComponentFactory.getShortTextField(1000)));
        columnValue.setHeaderValue(DcResources.getText("lblValue"));
       
        scrollerSystemLabels.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollerSystemLabels.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);       
       
        tableSystemLabels.applyHeaders();
View Full Code Here

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

            table.setColumnCount(5);
            TableColumn columnHidden = table.getColumnModel().getColumn(3);
            table.removeColumn(columnHidden);

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

            TableColumn columnEnabled = table.getColumnModel().getColumn(1);
            JCheckBox checkEnabled = new JCheckBox();
            columnEnabled.setCellEditor(new DefaultCellEditor(checkEnabled));
            columnEnabled.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            columnEnabled.setHeaderValue(DcResources.getText("lblEnabled"));
           
            JComboBox comboDirection = ComponentFactory.getComboBox(
                    new String[] {DcResources.getText("lblHorizontal"), DcResources.getText("lblVertical")});

            TableColumn columnDirection = table.getColumnModel().getColumn(2);
            columnDirection.setCellEditor(new DefaultCellEditor(comboDirection));
            columnDirection.setHeaderValue(DcResources.getText("lblDirection"));

            TableColumn columnMaxLength = table.getColumnModel().getColumn(3);
            columnMaxLength.setCellEditor(new DefaultCellEditor(ComponentFactory.getNumberField()));
            columnMaxLength.setHeaderValue(DcResources.getText("lblMaxLength"));
           
            applyDefinitions();

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

        int columns = result.getMetaData().getColumnCount();
       
        table.setColumnCount(columns);
        int counter = 1;
        for (Enumeration<TableColumn> enumerator = table.getColumnModel().getColumns(); enumerator.hasMoreElements(); counter++) {
            TableColumn column = enumerator.nextElement();
            column.setHeaderValue(result.getMetaData().getColumnName(counter).toLowerCase());
        }

        Object[] values = new String[columns];
        while (result.next()) {
            for (int i = 0; i < columns; i++) {
View Full Code Here

        JLabel databaseDriverTextLabel = ComponentFactory.getLabel(DcSettings.getString(DcRepository.Settings.stDatabaseDriver));
       
        DcTable table = ComponentFactory.getDCTable(true, false);
        table.setEnabled(false);
        table.setColumnCount(2);
        TableColumn columnName = table.getColumnModel().getColumn(0);
        TableColumn columnCount = table.getColumnModel().getColumn(1);
        columnName.setHeaderValue(DcResources.getText("lblName"));
        columnCount.setHeaderValue(DcResources.getText("lblItems"));
        table.applyHeaders();
       
        columnCount.setCellRenderer(NumberTableCellRenderer.getInstance());
       
        int total = 0;
        for (DcModule module : DcModules.getModules()) {
            if (!module.isAbstract() && module.isTopModule()) {
                int count = getRecordCount(module);
View Full Code Here

        add(textHelp, Layout.getGBC(0, 0, 1, 1, 1.0, 1.0
                ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                 new Insets(5, 5, 5, 5), 0, 0));

        tableDirectoriesAsDrives.setColumnCount(1);
        TableColumn columnDir = tableDirectoriesAsDrives.getColumnModel().getColumn(0);
        JTextField textField = ComponentFactory.getTextFieldDisabled();
        columnDir.setCellEditor(new DefaultCellEditor(textField));
        columnDir.setHeaderValue(DcResources.getText("lblDirectory"));
       
        JPanel panelActions = new JPanel();
       
        buttonAdd.addActionListener(this);
        buttonRemove.addActionListener(this);
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.