use of org.eclipse.swt.widgets.ExpandItem in project cubrid-manager by CUBRID.
the class DBSpaceLabelProvider method createServerStatusItem.
private void createServerStatusItem(ExpandBar bar, int index) {
/* Server information */
ExpandItem serverInfoItem = new ExpandItem(bar, SWT.NONE, index);
serverInfoItem.setText(Messages.titleSystemInfo);
Composite serverComposite = new Composite(bar, SWT.None);
serverComposite.setLayout(new FillLayout());
serverTableViewer = new TableViewer(serverComposite, SWT.BORDER | SWT.FULL_SELECTION);
serverTableViewer.getTable().setHeaderVisible(true);
serverTableViewer.getTable().setLinesVisible(true);
serverTableViewer.setContentProvider(new TableContentProvider());
serverTableViewer.setLabelProvider(new ServerStatusLabelProvider());
TableColumn cpuTypeColumn = new TableColumn(serverTableViewer.getTable(), SWT.LEFT);
cpuTypeColumn.setText(Messages.columnType);
cpuTypeColumn.setToolTipText(Messages.columnType);
cpuTypeColumn.setWidth(90);
TableColumn memoryColumn = new TableColumn(serverTableViewer.getTable(), SWT.LEFT);
memoryColumn.setText(Messages.columnMemmory);
memoryColumn.setToolTipText(Messages.columnMemmory);
memoryColumn.setWidth(120);
TableColumn freespaceColumn = new TableColumn(serverTableViewer.getTable(), SWT.LEFT);
freespaceColumn.setText(Messages.columnFreespace);
freespaceColumn.setToolTipText(Messages.tipFreespace);
freespaceColumn.setWidth(100);
TableColumn cpuColumn = new TableColumn(serverTableViewer.getTable(), SWT.LEFT);
cpuColumn.setText(Messages.columnCpu);
cpuColumn.setToolTipText(Messages.columnCpu);
cpuColumn.setWidth(80);
TableColumn tpsColumn = new TableColumn(serverTableViewer.getTable(), SWT.LEFT);
tpsColumn.setText(Messages.columnTps);
tpsColumn.setToolTipText(Messages.tipTps);
tpsColumn.setWidth(100);
TableColumn qpsColumn = new TableColumn(serverTableViewer.getTable(), SWT.LEFT);
qpsColumn.setText(Messages.columnQps);
qpsColumn.setToolTipText(Messages.tipQps);
qpsColumn.setWidth(100);
serverInfoItem.setHeight(80);
serverInfoItem.setExpanded(true);
serverInfoItem.setControl(serverComposite);
}
use of org.eclipse.swt.widgets.ExpandItem in project tdi-studio-se by Talend.
the class MultiSchemasUI method init.
public void init() {
uiParent.setLayout(new GridLayout());
Composite composite = new Composite(uiParent, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setLayout(new FillLayout());
ExpandBar bar = new ExpandBar(composite, SWT.V_SCROLL);
final Composite fileGroup = new Composite(bar, SWT.NONE);
createFileGroup(fileGroup);
final ExpandItem settingItem = new ExpandItem(bar, SWT.NONE, 0);
settingItem.setText(ExternalMultiSchemasUIProperties.SETTINGS_LABEL);
settingItem.setHeight(fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
settingItem.setControl(fileGroup);
settingItem.setExpanded(true);
allContentForm = new SashForm(bar, SWT.NONE);
createViewers(allContentForm);
final ExpandItem previewItem = new ExpandItem(bar, SWT.NONE, 1);
previewItem.setText(ExternalMultiSchemasUIProperties.PREVIEW_LABEL);
previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 100);
previewItem.setControl(allContentForm);
previewItem.setExpanded(true);
bar.addExpandListener(new ExpandListener() {
public void itemExpanded(ExpandEvent e) {
if (e.item != null && e.item instanceof ExpandItem) {
if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.PREVIEW_LABEL)) {
if (settingItem.getExpanded()) {
previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
} else {
previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
}
} else if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.SETTINGS_LABEL)) {
settingItem.setHeight(fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
}
}
}
public void itemCollapsed(ExpandEvent e) {
if (e.item != null && e.item instanceof ExpandItem) {
if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.PREVIEW_LABEL)) {
// settingItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y
// + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
} else if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.SETTINGS_LABEL)) {
previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
}
}
}
});
initFieldValues();
// listener
addFieldListeners();
addButtonListeners();
addFieldsListenersGroupFileSettings();
addFieldsListenersGroupsEscapeChar();
// preview
refreshPreview();
checkDialog();
// reload
reloadSchemaDataFromNode();
}
use of org.eclipse.swt.widgets.ExpandItem in project meclipse by flaper87.
the class CollectionEditor method createExpander.
public void createExpander(final ExpandBar bar, Map<String, Object> o, CollectionType collType) {
// First item
final Composite composite = new Composite(bar, SWT.FILL);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.marginLeft = layout.marginTop = layout.marginRight = layout.marginBottom = 10;
composite.setLayout(layout);
final ExpandItem expandItem = new ExpandItem(bar, SWT.NONE, 0);
for (Object key : o.keySet()) {
if (key == "_id" || key == "_ns")
continue;
Label keyLabel = new Label(composite, SWT.FILL);
keyLabel.setText(key.toString());
Label valueLabel = new Label(composite, SWT.WRAP);
Object value = o.get(key);
valueLabel.setText(String.valueOf(value));
}
Object value;
switch(collType) {
case SYSINDEX:
value = o.get("ns").toString() + "." + o.get("name").toString();
break;
default:
value = o.get("_id");
break;
}
expandItem.setText(String.valueOf(value));
expandItem.setControl(composite);
expandItem.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
}
Aggregations