Package javax.swing

Examples of javax.swing.DefaultCellEditor


                    || field.getIndex() == DcObject._SYS_LOANDURATION
                    || field.getIndex() == DcObject._SYS_CREATED
                    || field.getIndex() == DcObject._SYS_MODIFIED) {

                DcShortTextField text = ComponentFactory.getTextFieldDisabled();
                columnNew.setCellEditor(new DefaultCellEditor(text));
                DcTableCellRenderer renderer = DcTableCellRenderer.getInstance();
                renderer.setFont(ComponentFactory.getSystemFont());
                columnNew.setCellRenderer(renderer);
            } else if (field.getFieldType() == ComponentFactory._REFERENCESFIELD) {
                columnNew.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
                columnNew.setCellRenderer(ReferencesTableCellRenderer.getInstance());
            } else if (field.getIndex() == DcObject._SYS_MODULE) {
                DcShortTextField text = ComponentFactory.getTextFieldDisabled();
                columnNew.setCellEditor(new DefaultCellEditor(text));
                columnNew.setCellRenderer(ModuleTableCellRenderer.getInstance());
            } else if (dco.getModule().getIndex() == DcModules._LOAN &&
                       field.getIndex() == Loan._C_CONTACTPERSONID) {
                DcShortTextField text = ComponentFactory.getTextFieldDisabled();
                columnNew.setCellEditor(new DefaultCellEditor(text));
                columnNew.setCellRenderer(ContactPersonTableCellRenderer.getInstance());
            } else {
                switch (field.getFieldType()) {
                case ComponentFactory._DATEFIELD:
                    columnNew.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
                    columnNew.setCellRenderer(DateFieldCellRenderer.getInstance());
                    break;
                case ComponentFactory._AVAILABILITYCOMBO:
                    columnNew.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
                    columnNew.setCellRenderer(AvailabilityCheckBoxTableCellRenderer.getInstance());
                    break;
                case ComponentFactory._CHECKBOX:
                    columnNew.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
                    columnNew.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
                    break;
                case ComponentFactory._FILESIZEFIELD:
                    columnNew.setCellEditor(new DefaultCellEditor((JTextField) getEditor(field)));
                    columnNew.setCellRenderer(FileSizeTableCellRenderer.getInstance());
                    break;
                case ComponentFactory._NUMBERFIELD:
                case ComponentFactory._DECIMALFIELD:
                    columnNew.setCellEditor(new DefaultCellEditor((JTextField) getEditor(field)));
                    columnNew.setCellRenderer(NumberTableCellRenderer.getInstance());
                    break;
                case ComponentFactory._LONGTEXTFIELD:
                case ComponentFactory._SHORTTEXTFIELD:
                    columnNew.setCellEditor(new DefaultCellEditor((JTextField) getEditor(field)));
                    break;
                case ComponentFactory._TIMEFIELD:
                    DcNumberField numberField = ComponentFactory.getNumberField();
                    columnNew.setCellEditor(new DefaultCellEditor(numberField));
                    columnNew.setCellRenderer(TimeFieldTableCellRenderer.getInstance());
                    break;
                case ComponentFactory._URLFIELD:
                    columnNew.setCellEditor(new DefaultCellEditor((JTextField) getEditor(field)));
                    DcTableCellRenderer renderer = DcTableCellRenderer.getInstance();
                    renderer.setForeground(new Color(0, 0, 255));
                    columnNew.setCellRenderer(renderer);
                    break;
                case ComponentFactory._PICTUREFIELD:
                    DcShortTextField text = ComponentFactory.getTextFieldDisabled();
                    text.setEditable(false);
                    text.setFont(ComponentFactory.getUnreadableFont());
                    columnNew.setCellEditor(new DefaultCellEditor(text));
                    columnNew.setCellRenderer(PictureTableCellRenderer.getInstance());
                    break;
                case ComponentFactory._REFERENCEFIELD:
                    columnNew.setCellRenderer(ComboBoxTableCellRenderer.getInstance());
                    columnNew.setCellEditor(new DefaultCellEditor((JComboBox) getEditor(field)));
                    break;
                case ComponentFactory._RATINGCOMBOBOX:
                    columnNew.setCellRenderer(RatingTableCellRenderer.getInstance());
                    columnNew.setCellEditor(new DefaultCellEditor((DcRatingComboBox) getEditor(field)));
                    break;
                case ComponentFactory._YESNOCOMBO:
                    columnNew.setCellEditor(new DefaultCellEditor((JComboBox) getEditor(field)));
                    break;
                case ComponentFactory._LOGINNAMEFIELD:
                    columnNew.setCellEditor(new DefaultCellEditor((DcLoginNameField) getEditor(field)));
                    break;
                }
            }
            counter++;
        }
View Full Code Here


       
        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();
       
        //**********************************************************
 
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);       
       
View Full Code Here

        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();
       
View Full Code Here

            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();
View Full Code Here

        //**********************************************************          
        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);       
       
View Full Code Here

            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();
View Full Code Here

       
        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);
View Full Code Here

        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

        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);       
       
View Full Code Here

TOP

Related Classes of javax.swing.DefaultCellEditor

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.