use of org.eclipse.jface.viewers.ColumnWeightData 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.ColumnWeightData 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.ColumnWeightData 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);
}
use of org.eclipse.jface.viewers.ColumnWeightData in project cubrid-manager by CUBRID.
the class NewDirectoryDialog method createDirectoryList.
/**
* create the directory list
*
* @param composite the parent composite
*/
private void createDirectoryList(Composite composite) {
directoryList = new Table(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION);
directoryList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
directoryList.setLinesVisible(true);
directoryList.setHeaderVisible(true);
directoryList.setEnabled(false);
TableLayout tableLayout = new TableLayout();
tableLayout.addColumnData(new ColumnWeightData(20, true));
directoryList.setLayout(tableLayout);
final TableColumn currentVolumeColumn = new TableColumn(directoryList, SWT.LEFT);
currentVolumeColumn.setText(Messages.tblColDirectoryVolume);
currentVolumeColumn.pack();
}
use of org.eclipse.jface.viewers.ColumnWeightData in project cubrid-manager by CUBRID.
the class SqlLogAnalyzeResultDialog method createAnalyzeResultTableOptionY.
/**
* This method initializes table when option is yes
*
* @param tlayout TableLayout
*/
private void createAnalyzeResultTableOptionY(TableLayout tlayout) {
tlayout.addColumnData(new ColumnWeightData(20, 60, true));
tlayout.addColumnData(new ColumnWeightData(20, 60, true));
table.setLayout(tlayout);
table.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
if (analyzeCasLogResultList == null || analyzeCasLogResultList.getLogFileInfoList() == null) {
return;
}
int selectioncount = table.getSelectionCount();
int resultCount = analyzeCasLogResultList.getLogFileInfoList().size();
StringBuilder queryString = new StringBuilder();
AnalyzeCasLogResultInfo logResult;
for (int j = 0; j < selectioncount; j++) {
String qindex = table.getSelection()[j].getText(0);
for (int i = 0; i < resultCount; i++) {
logResult = (AnalyzeCasLogResultInfo) (analyzeCasLogResultList.getLogFileInfoList().get(i));
if (qindex.equals(logResult.getQindex())) {
currentResultIndex = i;
queryString = connect(logResult.getQindex(), queryString);
queryString.append(logResult.getQueryString());
queryString.append(NEXT_LINE);
buttonRunOriginalQuery.setEnabled(true);
buttonSaveToFile.setEnabled(true);
break;
}
}
}
textQuery.setText(queryString.toString());
}
});
TableColumn qindex = new TableColumn(table, SWT.LEFT);
qindex.addSelectionListener(new DirectionAwareSelectionAdapter("qindex"));
qindex.setText(Messages.tableIndex);
qindex.setWidth(100);
TableColumn execTime = new TableColumn(table, SWT.LEFT);
execTime.addSelectionListener(new DirectionAwareSelectionAdapter("execTime"));
execTime.setText(Messages.tableTransactionExeTime);
execTime.setWidth(100);
}
Aggregations