Search in sources :

Example 1 with TableEditorContentNotModifiable

use of org.talend.commons.ui.runtime.swt.tableviewer.tableeditor.TableEditorContentNotModifiable in project tdi-studio-se by Talend.

the class MetadataTableEditorViewExt method updateHeader.

public void updateHeader(String id, String currTitle, boolean isHide) {
    final TableViewerCreatorColumnNotModifiable funColumn = getTableViewerCreator().getColumn(id);
    if (isHide) {
        final TableEditorContentNotModifiable tableEditorContent = funColumn.getTableEditorContent();
        if (tableEditorContent != null && tableEditorContent instanceof CheckboxTableEditorContent) {
            funColumn.setTableEditorContent(null);
        }
        //$NON-NLS-1$
        funColumn.getTableColumn().setText("");
        funColumn.getTableColumn().setWidth(0);
        funColumn.setWidth(0);
        funColumn.getTableColumn().setResizable(false);
        funColumn.setMoveable(false);
        if ((id.equals(ID_COLUMN_FUNCTION) && getTableViewerCreator().getColumn(ID_COLUMN_PARAMETER).getTableColumn().getWidth() == 0) || ((id.equals(ID_COLUMN_PARAMETER)) && getTableViewerCreator().getColumn(ID_COLUMN_FUNCTION).getTableColumn().getWidth() == 0)) {
            funCom.setVisible(false);
        }
        if (id.equals(ID_COLUMN_PREVIEW)) {
            preCom.setVisible(false);
        }
        getTableViewerCreator().refreshTableEditorControls();
    } else {
        final TableEditorContentNotModifiable tableEditorContent = funColumn.getTableEditorContent();
        if (tableEditorContent == null && (funColumn.getId().equals(ID_COLUMN_KEY) || funColumn.getId().equals(ID_COLUMN_NULLABLE))) {
            final CheckboxTableEditorContent checkboxTableEditorContent = new CheckboxTableEditorContent();
            checkboxTableEditorContent.setToolTipText(currTitle);
            checkboxTableEditorContent.createTableEditor(getTable());
            funColumn.setTableEditorContent(checkboxTableEditorContent);
        }
        funColumn.setModifiable(!isReadOnly());
        funColumn.setMinimumWidth(35);
        funColumn.getTableColumn().setWidth(65);
        funColumn.getTableColumn().setText(currTitle);
        funColumn.getTableColumn().setResizable(true);
        funColumn.setTitle(currTitle);
        funColumn.setMoveable(true);
        if (id.equals(ID_COLUMN_FUNCTION) || id.equals(ID_COLUMN_PARAMETER)) {
            funCom.setVisible(true);
        }
        if (id.equals(ID_COLUMN_PREVIEW)) {
            preCom.setVisible(true);
        }
        getTableViewerCreator().refreshTableEditorControls();
    }
    attachLabelPosition();
}
Also used : TableEditorContentNotModifiable(org.talend.commons.ui.runtime.swt.tableviewer.tableeditor.TableEditorContentNotModifiable) CheckboxTableEditorContent(org.talend.commons.ui.swt.tableviewer.tableeditor.CheckboxTableEditorContent) TableViewerCreatorColumnNotModifiable(org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorColumnNotModifiable)

Aggregations

TableViewerCreatorColumnNotModifiable (org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorColumnNotModifiable)1 TableEditorContentNotModifiable (org.talend.commons.ui.runtime.swt.tableviewer.tableeditor.TableEditorContentNotModifiable)1 CheckboxTableEditorContent (org.talend.commons.ui.swt.tableviewer.tableeditor.CheckboxTableEditorContent)1