Search in sources :

Example 26 with ColumnWeightData

use of org.eclipse.jface.viewers.ColumnWeightData in project cubrid-manager by CUBRID.

the class ShardEnvStatusView method updateTableLayout.

/**
	 * Update table layout
	 */
private void updateTableLayout() {
    TableLayout tlayout = new TableLayout();
    for (BrokerEnvStatusColumn column : BrokerEnvStatusColumn.values()) {
        if (column.getValue() == -1) {
            tlayout.addColumnData(new ColumnWeightData(0, 0, false));
        } else {
            tlayout.addColumnData(new ColumnWeightData(10, 40, true));
        }
    }
    tableViewer.getTable().setLayout(tlayout);
    tableViewer.getTable().layout(true);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) TableLayout(org.eclipse.jface.viewers.TableLayout) BrokerEnvStatusColumn(com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn)

Example 27 with ColumnWeightData

use of org.eclipse.jface.viewers.ColumnWeightData in project cubrid-manager by CUBRID.

the class SetReplicationParamComp method createReplicationParamComp.

/**
	 * 
	 * Create replication parameter editor composite
	 * 
	 * @param parent Composite
	 * @return replParaGroup
	 */
public Control createReplicationParamComp(Composite parent) {
    Group replParaGroup = new Group(parent, SWT.NONE);
    replParaGroup.setText(Messages.grpReplParaSetting);
    replParaGroup.setLayout(new GridLayout());
    replParaGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    columnNameArrs = new String[] { Messages.repparm0tblColumnParameterName, Messages.repparm0tblColumnValueType, Messages.repparm0tblColumnParameterValue };
    replicationParamTableViewer = CommonUITool.createCommonTableViewer(replParaGroup, null, columnNameArrs, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, 200));
    replicationParamTable = replicationParamTableViewer.getTable();
    TableLayout tlayout = new TableLayout();
    tlayout.addColumnData(new ColumnWeightData(50, 50, true));
    tlayout.addColumnData(new ColumnWeightData(50, 50, true));
    tlayout.addColumnData(new ColumnWeightData(50, 50, true));
    replicationParamTable.setLayout(tlayout);
    linkEditorForTable();
    replicationParamTableViewer.setInput(replicationParamList);
    for (int i = 0; i < replicationParamTable.getColumnCount(); i++) {
        replicationParamTable.getColumn(i).pack();
    }
    return replParaGroup;
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) TableLayout(org.eclipse.jface.viewers.TableLayout)

Example 28 with ColumnWeightData

use of org.eclipse.jface.viewers.ColumnWeightData in project cubrid-manager by CUBRID.

the class SqlLogFileListDialog method createTableTargetFile.

/**
	 * This method initializes tableTargetFile
	 *
	 */
private void createTableTargetFile() {
    GridData gridData3 = new GridData(GridData.FILL_BOTH);
    gridData3.heightHint = 220;
    gridData3.widthHint = 300;
    tableTargetFile = new Table(groupTargetFile, SWT.MULTI | SWT.FULL_SELECTION);
    tableTargetFile.setHeaderVisible(true);
    tableTargetFile.setLayoutData(gridData3);
    tableTargetFile.setLinesVisible(true);
    TableLayout tlayout = new TableLayout();
    tlayout.addColumnData(new ColumnWeightData(20, 100, true));
    TableColumn logFile = new TableColumn(tableTargetFile, SWT.LEFT);
    logFile.setText(Messages.labelLogFile);
    logFile.setWidth(470);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Table(org.eclipse.swt.widgets.Table) GridData(org.eclipse.swt.layout.GridData) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 29 with ColumnWeightData

use of org.eclipse.jface.viewers.ColumnWeightData in project tdi-studio-se by Talend.

the class AssignmentPropertySection method createControls.

@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    super.createControls(parent, aTabbedPropertySheetPage);
    composite = getWidgetFactory().createFlatFormComposite(parent);
    // PTODO mhelleboid externalize tableviewer creation
    adapterFactory = new BusinessItemProviderAdapterFactory();
    tableViewer = new TableViewer(composite, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
    tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
    tableViewer.setLabelProvider(new RepositoryFactoryProxyLabelProvider(adapterFactory));
    Table table = tableViewer.getTable();
    TableLayout tableLayout = new TableLayout();
    table.setLayout(tableLayout);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    final String[] columnProperties = new String[] { Messages.getString("AssignmentPropertySection.Type"), Messages.getString("AssignmentPropertySection.Name"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    Messages.getString("AssignmentPropertySection.Comment") };
    TableColumn column1 = new TableColumn(table, SWT.NONE);
    tableLayout.addColumnData(new ColumnPixelData(125, true));
    column1.setText(columnProperties[0]);
    TableColumn column2 = new TableColumn(table, SWT.NONE);
    tableLayout.addColumnData(new ColumnPixelData(125, true));
    column2.setText(columnProperties[1]);
    TableColumn column3 = new TableColumn(table, SWT.NONE);
    tableLayout.addColumnData(new ColumnWeightData(1, 150, true));
    column3.setText(columnProperties[2]);
    tableViewer.setColumnProperties(columnProperties);
    final IItemPropertyDescriptor itemPropertyDescriptor = getItemPropertyDescriptor();
    tableViewer.setCellModifier(new ICellModifier() {

        public boolean canModify(Object element, String property) {
            return property.equals(columnProperties[2]);
        }

        public Object getValue(Object element, String property) {
            return EmfPropertyHelper.getValue(itemPropertyDescriptor, element);
        }

        public void modify(Object element, String property, Object value) {
            if (element instanceof TableItem) {
                TableItem tableItem = (TableItem) element;
                itemPropertyDescriptor.setPropertyValue(tableItem.getData(), value);
            }
        }
    });
    CellEditor[] cellEditors = new CellEditor[3];
    cellEditors[2] = new TextCellEditor(table);
    tableViewer.setCellEditors(cellEditors);
    createKeyListener(table);
    createSelectionListener();
    createPopupMenu();
    createDoubleClickListener();
    handleLayout(parent, table, column1, column2, column3);
    aTabbedPropertySheetPage.getSite().setSelectionProvider(this);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Table(org.eclipse.swt.widgets.Table) CellEditor(org.eclipse.jface.viewers.CellEditor) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) TableItem(org.eclipse.swt.widgets.TableItem) ColumnPixelData(org.eclipse.jface.viewers.ColumnPixelData) AdapterFactoryContentProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider) TableColumn(org.eclipse.swt.widgets.TableColumn) BusinessItemProviderAdapterFactory(org.talend.designer.business.model.business.provider.BusinessItemProviderAdapterFactory) ICellModifier(org.eclipse.jface.viewers.ICellModifier) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) IItemPropertyDescriptor(org.eclipse.emf.edit.provider.IItemPropertyDescriptor) TableViewer(org.eclipse.jface.viewers.TableViewer) TableLayout(org.eclipse.jface.viewers.TableLayout)

Example 30 with ColumnWeightData

use of org.eclipse.jface.viewers.ColumnWeightData in project tdi-studio-se by Talend.

the class ListStringValueDialog method createDialogArea.

/**
     * Create contents of the dialog
     * 
     * @param parent
     */
@Override
protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    tableViewer = new TableViewer(container, SWT.FULL_SELECTION | SWT.BORDER);
    table = tableViewer.getTable();
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    TableLayout layout = new TableLayout();
    table.setLayout(layout);
    layout.addColumnData(new ColumnWeightData(100));
    final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
    tableColumn.setAlignment(SWT.CENTER);
    tableColumn.setWidth(100);
    tableColumn.setText("column");
    tableViewer.setContentProvider(new ArrayContentProvider());
    tableViewer.setLabelProvider(new ViewerLabelProvider());
    tableViewer.setInput(dataList);
    tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            selectObj = selection.getFirstElement();
        }
    });
    tableViewer.addDoubleClickListener(new IDoubleClickListener() {

        public void doubleClick(final DoubleClickEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            selectObj = selection.getFirstElement();
            setReturnCode(0);
            close();
        }
    });
    //
    return container;
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) TableColumn(org.eclipse.swt.widgets.TableColumn) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) TableViewer(org.eclipse.jface.viewers.TableViewer) TableLayout(org.eclipse.jface.viewers.TableLayout)

Aggregations

ColumnWeightData (org.eclipse.jface.viewers.ColumnWeightData)31 TableLayout (org.eclipse.jface.viewers.TableLayout)22 GridData (org.eclipse.swt.layout.GridData)15 TableColumn (org.eclipse.swt.widgets.TableColumn)14 Composite (org.eclipse.swt.widgets.Composite)11 Table (org.eclipse.swt.widgets.Table)11 TableViewer (org.eclipse.jface.viewers.TableViewer)9 GridLayout (org.eclipse.swt.layout.GridLayout)8 SelectionEvent (org.eclipse.swt.events.SelectionEvent)7 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)5 Label (org.eclipse.swt.widgets.Label)5 TableItem (org.eclipse.swt.widgets.TableItem)5 BrokerEnvStatusColumn (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn)4 TableColumnLayout (org.eclipse.jface.layout.TableColumnLayout)4 ColumnPixelData (org.eclipse.jface.viewers.ColumnPixelData)4 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 TreeViewer (org.eclipse.jface.viewers.TreeViewer)4 Viewer (org.eclipse.jface.viewers.Viewer)4 CellEditor (org.eclipse.jface.viewers.CellEditor)3