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);
}
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;
}
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);
}
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);
}
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;
}
Aggregations