use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BatchRunComposite method createTableGroup.
private void createTableGroup(Composite composite) {
final String[] columnNames = new String[] { "", com.cubrid.common.ui.query.Messages.msgBatchRunSqlFile, com.cubrid.common.ui.query.Messages.msgBatchRunMemo, com.cubrid.common.ui.query.Messages.msgBatchRunRegdate };
tv = (CheckboxTableViewer) CommonUITool.createCheckBoxTableViewer(composite, null, columnNames, CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, 200));
tv.setInput(listData);
TableLayout tableLayout = new TableLayout();
tv.getTable().setLayout(tableLayout);
tableLayout.addColumnData(new ColumnPixelData(30));
tableLayout.addColumnData(new ColumnPixelData(209));
tableLayout.addColumnData(new ColumnPixelData(272));
tableLayout.addColumnData(new ColumnPixelData(118));
editor = new TableEditor(tv.getTable());
editor.horizontalAlignment = SWT.LEFT;
editor.grabHorizontal = true;
tv.getTable().addListener(SWT.MouseUp, new Listener() {
public void handleEvent(Event event) {
if (event.button != 1) {
return;
}
validateCheck();
Point pt = new Point(event.x, event.y);
int newIndex = tv.getTable().getSelectionIndex();
if (tv.getTable().getItemCount() <= newIndex || newIndex < 0) {
return;
}
final TableItem item = tv.getTable().getItem(newIndex);
if (item == null) {
return;
}
Rectangle rect = item.getBounds(2);
if (rect.contains(pt)) {
focusCell(item, newIndex, 2);
}
}
});
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class SqlmapNavigatorView method createCondView.
/**
* Create the main view.
*
* @param parent {@link Composite} the parent composite
*/
private void createCondView(Composite parent) {
String[] columnNames = { Messages.lblSqlmapUse, Messages.lblSqlmapCondition };
Label lblCondTitle = new Label(parent, SWT.NONE);
lblCondTitle.setText(Messages.lblSqlmapConditions);
condView = CommonUITool.createCommonTableViewer(parent, null, columnNames, CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, 80));
condView.setColumnProperties(columnNames);
condView.setContentProvider(new TableContentProvider());
condView.setLabelProvider(new SqlmapLabelProvider(this));
condView.setCellModifier(new SqlmapCellModifier(this));
CellEditor[] cellEditor = new CellEditor[columnNames.length];
cellEditor[0] = new CheckboxCellEditor(condView.getTable());
condView.setCellEditors(cellEditor);
TableLayout tableLayout = new TableLayout();
tableLayout.addColumnData(new ColumnPixelData(30));
tableLayout.addColumnData(new ColumnPixelData(160));
condView.getTable().setLayout(tableLayout);
condView.getTable().addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.character == ' ') {
toggleUsedBySelectedCondition();
}
super.keyPressed(e);
}
});
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BrokerEnvStatusView method createTable.
/**
* This method initializes table
*
*/
private void createTable() {
tableViewer = new TableViewer(composite, SWT.FULL_SELECTION);
tableViewer.getTable().setHeaderVisible(true);
tableViewer.getTable().setLinesVisible(true);
BrokerTblColumnSetHelp bcsh = BrokerTblColumnSetHelp.getInstance();
bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerEnvStatusColumn, BrokerEnvStatusColumn.values());
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().addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent event) {
int index = -1;
if ((index = tableViewer.getTable().getSelectionIndex()) >= 0) {
TableItem tableItem = tableViewer.getTable().getItem(index);
String brokename = tableItem.getText(0).trim();
ICubridNode input = null;
for (ICubridNode node : cubridNode.getChildren()) {
if (node.getLabel().equalsIgnoreCase(brokename)) {
input = node;
break;
}
}
LayoutManager.getInstance().setCurrentSelectedNode(input);
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (null == window) {
return;
}
IWorkbenchPage activePage = window.getActivePage();
IViewPart viewPart = window.getActivePage().findView(BrokerStatusView.ID);
if (null != viewPart) {
activePage.hideView(viewPart);
}
try {
activePage.showView(BrokerStatusView.ID);
} catch (PartInitException e1) {
LOGGER.error(e1.getMessage(), e1);
}
}
}
});
makeTableColumn();
tableViewer.setContentProvider(new BrokersStatusContentProvider());
ServerInfo serverInfo = cubridNode.getServer().getServerInfo();
BrokersStatusLabelProvider brokersStatusLabelProvider = new BrokersStatusLabelProvider();
brokersStatusLabelProvider.setServerInfo(serverInfo);
tableViewer.setLabelProvider(brokersStatusLabelProvider);
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BrokersParameterPropertyPage method createBrokerLstComp.
/**
* Creates brokers list Composite
*
* @param parent the parent composite
* @return the composite
*/
private Control createBrokerLstComp(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
createBasicGroup(composite);
Group brokerLstGroup = new Group(composite, SWT.NONE);
brokerLstGroup.setText(BROKER_LIST);
brokerLstGroup.setLayout(new GridLayout(2, false));
brokerLstGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
String[] columnNameArrs = new String[] { nameOfBrokerLst, portOfBrokerLst };
brokersTableViewer = CommonUITool.createCommonTableViewer(brokerLstGroup, null, columnNameArrs, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, 200));
Table brokersTable = brokersTableViewer.getTable();
TableLayout tlayout = new TableLayout();
tlayout.addColumnData(new ColumnWeightData(120, 100, true));
tlayout.addColumnData(new ColumnWeightData(120, 100, true));
brokersTable.setLayout(tlayout);
createDealButton(brokerLstGroup);
return composite;
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BrokerEnvStatusView 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);
}
Aggregations