Search in sources :

Example 1 with ColumnThumbnail

use of com.biglybt.ui.swt.columns.torrent.ColumnThumbnail in project BiglyBT by BiglySoftware.

the class SBC_DevicesView method initColumns.

/**
 * @since 4.1.0.5
 */
private void initColumns(Core core) {
    if (columnsAdded) {
        return;
    }
    columnsAdded = true;
    UIManager uiManager = PluginInitializer.getDefaultInterface().getUIManager();
    TableManager tableManager = uiManager.getTableManager();
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Rank.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Rank(column);
            if (!column.getTableID().equals(TABLE_TRANSCODE_QUEUE)) {
                column.setVisible(false);
            }
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnThumbnail.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnThumbnail(column);
            column.setWidth(70);
            column.setVisible(false);
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Name.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Name(column);
            if (column.getTableID().equals(TABLE_TRANSCODE_QUEUE)) {
                column.setWidth(200);
            } else if (!column.getTableID().endsWith(":type=1")) {
                column.setWidth(140);
            }
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Duration.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Duration(column);
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Device.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Device(column);
            column.setVisible(false);
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Profile.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Profile(column);
            if (column.getTableID().equals(TABLE_TRANSCODE_QUEUE)) {
                column.setWidth(70);
            }
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Resolution.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Resolution(column);
            column.setVisible(false);
            if (column.getTableID().equals(TABLE_TRANSCODE_QUEUE)) {
                column.setWidth(95);
            }
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Status.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Status(column);
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Completion.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Completion(column);
            column.setWidth(145);
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_CopiedToDevice.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_CopiedToDevice(column);
            if (column.getTableID().endsWith(":type=1") || column.getTableID().equals(TABLE_TRANSCODE_QUEUE)) {
                column.setVisible(false);
            }
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Category.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Category(column);
        }
    });
    tableManager.registerColumn(TranscodeFile.class, ColumnTJ_Tags.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTJ_Tags(column);
        }
    });
    TableColumnManager tcm = TableColumnManager.getInstance();
    String[] defaultLibraryColumns = { ColumnTJ_Rank.COLUMN_ID, ColumnTJ_Name.COLUMN_ID, ColumnTJ_Duration.COLUMN_ID, ColumnTJ_Device.COLUMN_ID, ColumnTJ_Status.COLUMN_ID, ColumnTJ_Completion.COLUMN_ID };
    tcm.setDefaultColumnNames(TABLE_TRANSCODE_QUEUE, defaultLibraryColumns);
    String[] defaultQColumns = { ColumnTJ_Name.COLUMN_ID, ColumnTJ_Duration.COLUMN_ID, ColumnTJ_Profile.COLUMN_ID, ColumnTJ_Status.COLUMN_ID, ColumnTJ_Completion.COLUMN_ID };
    tcm.setDefaultColumnNames(TABLE_DEVICE_LIBRARY, defaultQColumns);
    tcm.setDefaultColumnNames(TABLE_DEVICE_LIBRARY + ":type=1", defaultQColumns);
}
Also used : UIManager(com.biglybt.pif.ui.UIManager) ColumnThumbnail(com.biglybt.ui.swt.columns.torrent.ColumnThumbnail) TableColumn(com.biglybt.pif.ui.tables.TableColumn) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager) TableColumnCreationListener(com.biglybt.pif.ui.tables.TableColumnCreationListener) TableManager(com.biglybt.pif.ui.tables.TableManager)

Aggregations

UIManager (com.biglybt.pif.ui.UIManager)1 TableColumn (com.biglybt.pif.ui.tables.TableColumn)1 TableColumnCreationListener (com.biglybt.pif.ui.tables.TableColumnCreationListener)1 TableManager (com.biglybt.pif.ui.tables.TableManager)1 TableColumnManager (com.biglybt.ui.common.table.impl.TableColumnManager)1 ColumnThumbnail (com.biglybt.ui.swt.columns.torrent.ColumnThumbnail)1