use of org.eclipse.swt.widgets.ExpandItem in project cubrid-manager by CUBRID.
the class DBSpaceLabelProvider method createBrokerInfoItem.
private void createBrokerInfoItem(ExpandBar bar, int index) {
ExpandItem brokerInfoItem = new ExpandItem(bar, SWT.NONE, index);
brokerInfoItem.setText(Messages.titleBrokerInfo);
Composite brokerComposite = new Composite(bar, SWT.None);
brokerComposite.setLayout(new FillLayout());
brokerTableViewer = new TableViewer(brokerComposite, SWT.BORDER | SWT.FULL_SELECTION);
brokerTableViewer.getTable().setHeaderVisible(true);
brokerTableViewer.getTable().setLinesVisible(true);
brokerTableViewer.setContentProvider(new BrokersStatusContentProvider());
BrokersStatusLabelProvider brokersStatusLabelProvider = new BrokersStatusLabelProvider();
brokersStatusLabelProvider.setServerInfo(serverInfo);
brokerTableViewer.setLabelProvider(brokersStatusLabelProvider);
TableColumn tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblBrokerName);
tblColumn.setToolTipText(Messages.tipBrokerName);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.CENTER);
tblColumn.setText(Messages.tblBrokerStatus);
tblColumn.setToolTipText(Messages.tipBrokerStatus);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblBrokerProcess);
tblColumn.setToolTipText(Messages.tipBrokerProcess);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblPort);
tblColumn.setToolTipText(Messages.tipPort);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblServer);
tblColumn.setToolTipText(Messages.tipServer);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblQueue);
tblColumn.setToolTipText(Messages.tipQueue);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblRequest);
tblColumn.setToolTipText(Messages.tipRequest);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblTps);
tblColumn.setToolTipText(Messages.tipTps);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblQps);
tblColumn.setToolTipText(Messages.tipQps);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblLongTran);
tblColumn.setToolTipText(Messages.tipLongTran);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblLongQuery);
tblColumn.setToolTipText(Messages.tipLongQuery);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblErrQuery);
tblColumn.setToolTipText(Messages.tipErrQuery);
brokerInfoItem.setHeight(120);
brokerInfoItem.setExpanded(true);
brokerInfoItem.setControl(brokerComposite);
}
use of org.eclipse.swt.widgets.ExpandItem in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_widgets_ExpandBar method test_getItems.
@Test
public void test_getItems() {
int number = 5;
ExpandItem[] items = new ExpandItem[number];
for (int i = 0; i < number; i++) {
items[i] = new ExpandItem(expandBar, 0);
}
assertArrayEquals(items, expandBar.getItems());
expandBar.getItems()[0].dispose();
assertArrayEquals(new ExpandItem[] { items[1], items[2], items[3], items[4] }, expandBar.getItems());
expandBar.getItems()[3].dispose();
assertArrayEquals(new ExpandItem[] { items[1], items[2], items[3] }, expandBar.getItems());
expandBar.getItems()[1].dispose();
assertArrayEquals(new ExpandItem[] { items[1], items[3] }, expandBar.getItems());
}
use of org.eclipse.swt.widgets.ExpandItem in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_widgets_ExpandBar method test_indexOfLorg_eclipse_swt_widgets_ExpandItem.
@Test
public void test_indexOfLorg_eclipse_swt_widgets_ExpandItem() {
int number = 10;
ExpandItem[] items = new ExpandItem[number];
for (int i = 0; i < number; i++) {
items[i] = new ExpandItem(expandBar, 0);
}
for (int i = 0; i < number; i++) {
assertTrue(":a:" + i, expandBar.indexOf(items[i]) == i);
}
items = new ExpandItem[number];
for (int i = 0; i < number; i++) {
items[i] = new ExpandItem(expandBar, 0);
}
for (int i = 0; i < number; i++) {
try {
expandBar.indexOf(null);
fail("No exception thrown for expandItem == null");
} catch (IllegalArgumentException e) {
}
}
}
use of org.eclipse.swt.widgets.ExpandItem in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_widgets_ExpandBar method test_getItemI.
@Test
public void test_getItemI() {
int number = 5;
ExpandItem[] items = new ExpandItem[number];
for (int i = 0; i < number; i++) {
items[i] = new ExpandItem(expandBar, 0);
}
for (int i = 0; i < number; i++) {
assertTrue(":a:", expandBar.getItem(i) == items[i]);
}
expandBar = new ExpandBar(shell, 0);
number = 5;
items = new ExpandItem[number];
for (int i = 0; i < number; i++) {
items[i] = new ExpandItem(expandBar, 0);
}
try {
expandBar.getItem(number);
fail("No exception thrown for illegal index argument");
} catch (IllegalArgumentException e) {
}
}
use of org.eclipse.swt.widgets.ExpandItem in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_widgets_ExpandBar method createExpandBar.
private void createExpandBar(List<String> events) {
expandBar = new ExpandBar(shell, SWT.V_SCROLL);
for (int i = 0; i < 3; i++) {
ExpandItem item = new ExpandItem(expandBar, SWT.NONE);
item.setText("ExpandBar" + i);
hookExpectedEvents(item, getTestName(), events);
}
setWidget(expandBar);
}
Aggregations