use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class ChartCompositePart method updateTableLayout.
/**
* Update table layout
*/
private void updateTableLayout() {
TableLayout seriesLayout = new TableLayout();
setSeriesTableLayout(seriesLayout);
seriesTableViewer.getTable().setLayout(seriesLayout);
seriesTableViewer.getTable().layout(true);
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class SchemaInfoEditorPart method createGeneralInfoTable.
/**
* Create the general information table
*
*/
private void createGeneralInfoTable() {
Label colslabel = new Label(topComposite, SWT.LEFT | SWT.WRAP);
colslabel.setText(Messages.lblGeneral);
colslabel.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
generalInfoTable = new Table(topComposite, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.NO_SCROLL);
{
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
generalInfoTable.setLayoutData(gridData);
new TableColumn(generalInfoTable, SWT.LEFT);
new TableColumn(generalInfoTable, SWT.LEFT);
TableLayout tlayout = new TableLayout();
tlayout.addColumnData(new ColumnWeightData(20, true));
tlayout.addColumnData(new ColumnWeightData(100, true));
generalInfoTable.setLayout(tlayout);
generalInfoTable.setLinesVisible(true);
generalInfoTable.setHeaderVisible(false);
setTableEditor(generalInfoTable, 1);
createContextMenu(generalInfoTable);
}
fillGeneralTableInfo();
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class JdbcOptionComposite method createJdbcTableGroup.
/**
*
* Create JDBC table group
*
* @param composite the composite
*/
private void createJdbcTableGroup(Composite composite) {
final String[] columnNameArr = new String[] { Messages.tblColJdbcAttrName, Messages.tblColJdbcAttrValue };
jdbcInfoTv = CommonUITool.createCommonTableViewer(composite, null, columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, 150));
jdbcInfoTv.setInput(jdbcListData);
TableLayout tableLayout = new TableLayout();
jdbcInfoTv.getTable().setLayout(tableLayout);
tableLayout.addColumnData(new ColumnWeightData(35, true));
tableLayout.addColumnData(new ColumnWeightData(65, true));
editor = new TableEditor(jdbcInfoTv.getTable());
editor.horizontalAlignment = SWT.LEFT;
editor.grabHorizontal = true;
jdbcInfoTv.getTable().addListener(SWT.MouseUp, new Listener() {
public void handleEvent(Event event) {
if (event.button != 1) {
return;
}
Point pt = new Point(event.x, event.y);
int newIndex = jdbcInfoTv.getTable().getSelectionIndex();
if (jdbcInfoTv.getTable().getItemCount() <= newIndex || newIndex < 0) {
return;
}
final TableItem item = jdbcInfoTv.getTable().getItem(newIndex);
if (item == null) {
return;
}
for (int i = 0; i < 2; i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
focusCell(item, newIndex, i);
break;
}
}
}
});
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class JdbcManageComposite method createJdbcTableGroup.
/**
*
* Create JDBC table group
*
* @param composite the composite
*/
private void createJdbcTableGroup(Composite composite) {
final String[] columnNameArr = new String[] { Messages.tblColDriverVersion, Messages.tblColJarPath };
TableViewerSorter sorter = new TableViewerSorter();
sorter.setColumnComparator(0, new Comparator<Object>() {
public int compare(Object o1, Object o2) {
if (o1 instanceof String && o2 instanceof String) {
String s1 = (String) o1;
String s2 = (String) o2;
String[] version1Tokens = s1.substring(s1.lastIndexOf('-') + 1).split("\\.");
String[] version2Tokens = s2.substring(s2.lastIndexOf('-') + 1).split("\\.");
int size = Math.min(version1Tokens.length, version2Tokens.length);
for (int i = 0; i < size; i++) {
Integer first = Integer.parseInt(version1Tokens[i]);
Integer second = Integer.parseInt(version2Tokens[i]);
if (first != second) {
return first - second;
}
}
return version1Tokens.length - version2Tokens.length;
} else {
return 0;
}
}
});
sorter.setAsc(false);
jdbcInfoTv = CommonUITool.createCommonTableViewer(composite, sorter, columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, 200));
jdbcInfoTv.setInput(jdbcListData);
jdbcInfoTv.getTable().setSortColumn(jdbcInfoTv.getTable().getColumn(0));
jdbcInfoTv.getTable().setSortDirection(sorter.isAsc() ? SWT.UP : SWT.DOWN);
TableLayout tableLayout = new TableLayout();
jdbcInfoTv.getTable().setLayout(tableLayout);
tableLayout.addColumnData(new ColumnWeightData(35, true));
tableLayout.addColumnData(new ColumnWeightData(65, true));
}
use of org.eclipse.jface.viewers.TableLayout 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;
}
Aggregations