Java Code Examples for org.eclipse.swt.widgets.Table.setRedraw()

The following are Jave code examples for showing how to use setRedraw() of the org.eclipse.swt.widgets.Table class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: ide-plugins   File: PluginsSWT.java   Source Code and License Vote up 6 votes
private void redrawTables() {
    Table sourceTable = sourceTableViewer.getTable();
    sourceTable.setRedraw(false);
    clean(sourceTable);
    source.sort(Plugin::compareTo);
    sourceTableViewer.setInput(source);
    btnSelectAll.setEnabled(source.size() > 0);
    sourceTable.setRedraw(true);
    checkSelection(sourceTable);

    Table targetTable = targetTableViewer.getTable();
    targetTable.setRedraw(false);
    clean(targetTable);
    target.sort(Plugin::compareTo);
    targetTableViewer.setInput(target);
    btnDeselectAll.setEnabled(target.size() > 0);
    targetTable.setRedraw(true);
    checkSelection(targetTable);

    if (getButton(IDialogConstants.OK_ID) != null) {
        getButton(IDialogConstants.OK_ID).setEnabled(! targetOriginal.equals(target));
    }
}
 
Example 2
Project: eZooKeeper   File: ZnodeAclComposite.java   Source Code and License Vote up 5 votes
private void removeItems(TableItem[] items) {

        Table table = getTable();
        table.setRedraw(false);
        try {

            for (TableItem item : items) {

                Control schemeTableEditorControl = _SchemeTableEditor.getEditor();
                if (schemeTableEditorControl != null) {
                    schemeTableEditorControl.dispose();
                }

                _SchemeTableEditor.setEditor(null, item, 0);

                Control idTableEditorControl = _IdTableEditor.getEditor();
                if (idTableEditorControl != null) {
                    idTableEditorControl.dispose();
                }

                _IdTableEditor.setEditor(null, item, 1);

                for (int perm : PERMS) {
                    TableEditor tableEditor = getItemPermTableEditor(item, perm);
                    Button checkBox = (Button) tableEditor.getEditor();
                    tableEditor.dispose();
                    checkBox.dispose();
                }

                item.dispose();
            }
        }
        finally {
            table.setRedraw(true);
        }
    }
 
Example 3
Project: eZooKeeper   File: BaseZnodeModelTableFormPage.java   Source Code and License Vote up 5 votes
protected final void initFromModelInternal() {

        Table table = getTable();

        if (table == null || getModel().isDestroyed()) {
            return;
        }

        table.setRedraw(false);

        try {
            initTableItemsFromZnode();
            setDirtyInternal(false);
        }
        finally {
            table.setRedraw(true);
        }

        table.pack();
        forceLayout();

        TableColumn[] columns = getTable().getColumns();
        int[] columnWidths = getTableColumnWidths();
        for (int i = 0; i < columns.length; i++) {

            if (columnWidths == null) {
                columns[i].pack();
            }
            else {
                int columnWidth = columnWidths[i];
                if (columnWidth == SWT.DEFAULT) {
                    columns[i].pack();
                }
                else {
                    columns[i].setWidth(columnWidth);
                }
            }
        }
    }