Examples of TableColumnExt


Examples of org.jdesktop.swingx.table.TableColumnExt

  //}
 
  private void init() {
       
    // Create columns for server manager
    TableColumnExt name = new TableColumnExt();
    name.setIdentifier(UIConstants.SERVER_LIST_NAME_COLUMN_ID);
    name.setModelIndex(ServerListTableModel.SERVER_NAME);
    name.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_NAME_COLUMN_ID));
    name.setHeaderValue("Name")
    name.setCellRenderer(new ServerNameTableCellRenderer());
    name.setComparator(new GeneralComparator("getName"));
   
    table_columns.add(name);
    //server_tab_column_model.addColumn( name );
   
    TableColumnExt cc = new TableColumnExt();
    cc.setIdentifier(UIConstants.SERVER_LIST_CC_COLUMN_ID);
    cc.setModelIndex(ServerListTableModel.CC);
    cc.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_CC_COLUMN_ID));
    cc.setHeaderValue("CC");
    cc.setCellRenderer(new CCTableCellRenderer());
   
    table_columns.add(cc);
   
    TableColumnExt flag = new TableColumnExt();
    flag.setIdentifier(UIConstants.SERVER_LIST_FLAG_COLUMN_ID);
    flag.setModelIndex(ServerListTableModel.FLAG);
    flag.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_FLAG_COLUMN_ID));
    flag.setHeaderValue("Flag");
    flag.setCellRenderer(new FlagTableCellRenderer());
   
    table_columns.add(flag);
   
    TableColumnExt ip = new TableColumnExt();
    ip.setModelIndex(ServerListTableModel.SERVER_IP);
    ip.setIdentifier(UIConstants.SERVER_LIST_IP_COLUMN_ID);
    ip.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_IP_COLUMN_ID));
    ip.setHeaderValue("IP");
    ip.setCellRenderer(new IPTableCellRenderer());
    ip.setComparator(new GeneralComparator("getAddressAsInt"));

    table_columns.add(ip);
    //server_tab_column_model.addColumn( ip );
   
    TableColumnExt desc = new TableColumnExt();
    desc.setModelIndex(ServerListTableModel.DESCRIPTION);
    desc.setIdentifier(UIConstants.SERVER_LIST_DESCRIPTION_COLUMN_ID);
    desc.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_DESCRIPTION_COLUMN_ID));
    desc.setHeaderValue("Description");
    desc.setCellRenderer(new DescTableCellRenderer());
    desc.setComparator(new GeneralComparator("getDesc"));
   
    table_columns.add(desc);
    //server_tab_column_model.addColumn( desc );
   
    TableColumnExt ping = new TableColumnExt();
    ping.setModelIndex(ServerListTableModel.PING);
    ping.setIdentifier(UIConstants.SERVER_LIST_PING_COLUMN_ID);
    ping.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_PING_COLUMN_ID));
    ping.setHeaderValue("Ping");
    ping.setCellRenderer(new PingTableCellRenderer());
    ping.setComparator(new GeneralComparator("getPing"));
   
    table_columns.add(ping);
    //server_tab_column_model.addColumn( ping );
   
    TableColumnExt users = new TableColumnExt();
    users.setModelIndex(ServerListTableModel.USERS);
    users.setIdentifier(UIConstants.SERVER_LIST_USERS_COLUMN_ID);
    users.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_USERS_COLUMN_ID));
    users.setHeaderValue("Users");
    users.setCellRenderer(new UsersTableCellRenderer());
    users.setComparator(new GeneralComparator("getNumUsers"));
   
    table_columns.add(users);
    //server_tab_column_model.addColumn( users );
   
    TableColumnExt max_users = new TableColumnExt();
    max_users.setModelIndex(ServerListTableModel.MAX_USERS);
    max_users.setIdentifier(UIConstants.SERVER_LIST_MAX_USERS_COLUMN_ID);
    max_users.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_MAX_USERS_COLUMN_ID));
    max_users.setHeaderValue("Max users");
    max_users.setCellRenderer(new MaxUsersTableCellRenderer());
    max_users.setComparator(new GeneralComparator("getMaxUsers"));
   
    table_columns.add(max_users);
    //server_tab_column_model.addColumn(max_users);
   
    TableColumnExt files = new TableColumnExt();
    files.setModelIndex(ServerListTableModel.FILES);
    files.setIdentifier(UIConstants.SERVER_LIST_FILES_COLUMN_ID);
    files.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_FILES_COLUMN_ID));
    files.setHeaderValue("Files");
    files.setCellRenderer(new FilesTableCellRenderer());
    files.setComparator(new GeneralComparator("getNumFiles"));
   
    table_columns.add(files);
    //server_tab_column_model.addColumn(files);
   
    TableColumnExt soft_limit = new TableColumnExt();
    soft_limit.setModelIndex(ServerListTableModel.SOFT_LIMIT);
    soft_limit.setIdentifier(UIConstants.SERVER_LIST_SOFT_LIMIT_COLUMN_ID);
    soft_limit.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_SOFT_LIMIT_COLUMN_ID));
    soft_limit.setHeaderValue("Soft limit");
    soft_limit.setCellRenderer(new SoftLimitTableCellRenderer());
    soft_limit.setComparator(new GeneralComparator("getSoftLimit"));
   
    table_columns.add(soft_limit);
    //server_tab_column_model.addColumn(soft_limit);
   
    TableColumnExt hard_limit = new TableColumnExt();
    hard_limit.setModelIndex(ServerListTableModel.HARD_LIMIT);
    hard_limit.setIdentifier(UIConstants.SERVER_LIST_HARD_LIMIT_COLUMN_ID);
    hard_limit.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_HARD_LIMIT_COLUMN_ID));
    hard_limit.setHeaderValue("Hard limit");
    hard_limit.setCellRenderer(new HardLimitTableCellRenderer());
    hard_limit.setComparator(new GeneralComparator("getHardLimit"));
   
    table_columns.add(hard_limit);
    //server_tab_column_model.addColumn(hard_limit);
   
    TableColumnExt version = new TableColumnExt();
    version.setModelIndex(ServerListTableModel.VERSION);
    version.setIdentifier(UIConstants.SERVER_LIST_VERSION_COLUMN_ID);
    version.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_VERSION_COLUMN_ID));
    version.setHeaderValue("Version");
    version.setCellRenderer(new VersionTableCellRenderer());
    version.setComparator(new GeneralComparator("getVersion"));
 
    //version.setVisible(false);
   
    table_columns.add(version);
    //server_tab_column_model.addColumn(version);
   
    TableColumnExt static_col = new TableColumnExt();
    static_col.setModelIndex(ServerListTableModel.STATIC);
    static_col.setIdentifier(UIConstants.SERVER_LIST_STATIC_COLUMN_ID);
    static_col.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_STATIC_COLUMN_ID));
    static_col.setHeaderValue("Static");
    static_col.setCellRenderer(new StaticTableCellRenderer());
    static_col.setComparator(new GeneralComparator("isStatic"));
   
    table_columns.add(static_col);
   
    TableColumnExt down = new TableColumnExt();
    down.setModelIndex(ServerListTableModel.DOWN);
    down.setIdentifier(UIConstants.SERVER_LIST_DOWN_COLUMN_ID);
    down.setVisible(_pref.isColumnVisible(UIConstants.SERVER_LIST_DOWN_COLUMN_ID));
    down.setHeaderValue("Down");
    down.setCellRenderer(new DownTableCellRenderer());
    down.setComparator(new GeneralComparator("isDown"));
   
    table_columns.add(down);
   
    super.buildColumns(new ServerListTableModel());
       
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

      model.setValueAt(buttonPanel, i, 2);
      i++;
    }
    _columnTable.setModel(model);

    TableColumnExt columnExt = _columnTable.getColumnExt(2);
    columnExt.setMinWidth(26);
    columnExt.setMaxWidth(80);
    columnExt.setPreferredWidth(30);
  }
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

    private String[] getHiddenColumns() {
        List<String> hiddenCols = new ArrayList<String>();
        TableColumnModelExt columnModel = (TableColumnModelExt) table.getColumnModel();
        for (int i = 0; i < columnModel.getColumnCount(); i++) {
            TableColumnExt col = columnModel.getColumnExt(i);
            if (!col.isVisible()) {
                hiddenCols.add((String) col.getHeaderValue());
            }
        }
        return hiddenCols.toArray(new String[0]);
    }
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

    }

    private void setHiddenColumns(String[] columns) {
        TableColumnModelExt columnModel = (TableColumnModelExt) table.getColumnModel();
        for (int i = 0; i < columnModel.getColumnCount(); i++) {
            TableColumnExt col = columnModel.getColumnExt(i);
            for (int j = 0; j < columns.length; j++) {
                if (columns[j].equals(col.getHeaderValue())) {
                    col.setVisible(false);
                }
            }
        }
    }
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

        // bedenking: zouden we tabledesc van een iterator voorzien om over de
        // kolommen te lopen?
        TableCellEditor columnEditor = null;
        for (int i = 0; i < tableDesc.getColumnCount(); ++i)
        {
            TableColumnExt column = (TableColumnExt) theTable.getColumns(true).get(i);
            int columnWidth = tableDesc.getMaxColumnWidth(i);
            if (columnWidth > 0)
            {
                column.setMaxWidth(columnWidth);
            }
            columnWidth = tableDesc.getMinColumnWidth(i);
            if (columnWidth > 0)
            {
                column.setMinWidth(columnWidth);
            }
            column.setResizable(tableDesc.isResizable(i));
            column.setVisible(tableDesc.isVisible(i));
            columnEditor = tableDesc.getColumnEditor(i);
            if (columnEditor != null)
            {
                if (tableDesc.isSelectColumn(i))
                {
                    columnEditor.addCellEditorListener(userSelectionCellEditorListener);
                }
                else
                {
                    columnEditor.addCellEditorListener(dirtyRowCellEditorListener);
                }
                column.setCellEditor(columnEditor);
            }
            if (tableDesc.getColumnRenderer(i) != null)
            {
                TableCellRenderer renderer = tableDesc.getColumnRenderer(i);
                column.setCellRenderer(renderer);
                if (renderer instanceof DefaultTableCellRenderer)
                {
                    int align = ((DefaultTableCellRenderer) renderer).getHorizontalAlignment();
                    switch (align)
                    {
                        case SwingConstants.CENTER:
                            column.setHeaderRenderer(wrapInSortArrowHeaderRenderer(TableCellRenderers.CENTER_ALIGNED_HEADER_RENDERER));
                            break;
                        case SwingConstants.RIGHT:
                            column.setHeaderRenderer(wrapInSortArrowHeaderRenderer(TableCellRenderers.RIGHT_ALIGNED_HEADER_RENDERER));
                            break;
                        default:
                            break;
                    }
                }
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

    public boolean isCellEditable(int row, int column) {
        if (!isEditable())
            return false;
        boolean editable = super.isCellEditable(row, column);
        if (editable) {
            TableColumnExt tableColumn = getColumnExt(column);
            if (tableColumn != null) {
                editable = tableColumn.isEditable();
            }
        }
        return editable;
    }
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

            return getSortController().isSortable(convertColumnIndexToModel(columnIndex));
        }
        //PENDING JW: the fall-back implementation (== no sortController) is rather meaningless.
        // Remove?
        boolean sortable = isSortable();
        TableColumnExt tableColumnExt = getColumnExt(columnIndex);
        if (tableColumnExt != null) {
            sortable = sortable && tableColumnExt.isSortable();
        }
        return sortable;
    }
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

            return getSortController().isSortable();
        }
        //PENDING JW: the fall-back implementation (== no sortController) is rather meaningless.
        // Remove?
        boolean sortable = isSortable();
        TableColumnExt tableColumnExt = getColumnExt(identifier);
        if (tableColumnExt != null) {
            sortable = sortable && tableColumnExt.isSortable();
        }
        return sortable;
    }
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

            updateStringValueForColumn((TableColumn) event.getSource(),
                    (TableCellRenderer) event.getNewValue());
        } else if (event.getPropertyName().startsWith("highlighter")) {
            if (event.getSource() instanceof TableColumnExt
                    && getRowCount() > 0) {
                TableColumnExt column = (TableColumnExt) event.getSource();

                Rectangle r = getCellRect(0, convertColumnIndexToView(column
                        .getModelIndex()), true);
                r.height = getHeight();
                repaint(r);
            } else {
                repaint();
View Full Code Here

Examples of org.jdesktop.swingx.table.TableColumnExt

         */
        for (int i = 0; i < getModel().getColumnCount(); i++) {
            // add directly to columnModel - don't go through this.addColumn
            // to guarantee full control of ColumnFactory
            // addColumn has the side-effect to set the header!
            TableColumnExt tableColumn = getColumnFactory()
                    .createAndConfigureTableColumn(getModel(), i);
            if (tableColumn != null) {
                getColumnModel().addColumn(tableColumn);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.