use of org.eclipse.swt.widgets.ExpandBar in project cubrid-manager by CUBRID.
the class DatabaseDashboardEditor method createPartControl.
public void createPartControl(Composite parent) {
Composite composite = new Composite(parent, SWT.None);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
composite.setLayout(layout);
Composite buttonComp = new Composite(composite, SWT.None);
buttonComp.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, 20));
Composite dataComp = new Composite(composite, SWT.None);
dataComp.setLayout(new FillLayout());
dataComp.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
/*Create button*/
createButtonComposite(buttonComp);
/* Database server information */
bar = new ExpandBar(dataComp, SWT.V_SCROLL);
int index = 0;
if (CompatibleUtil.isSupportGetCPUAndMemoryInfo(database.getDatabaseInfo())) {
createDatabaseComposite(bar, index++);
}
createVolumnComposite(bar, index++);
createBrokerComposite(bar, index++);
createLockAndTransactionComposite(bar, index++);
loadData();
}
use of org.eclipse.swt.widgets.ExpandBar in project meclipse by flaper87.
the class CollectionEditor method createPages.
@Override
protected void createPages() {
final Composite composite = new Composite(getContainer(), SWT.FILL);
ImageRegistry reg = MeclipsePlugin.getDefault().getImageRegistry();
composite.setLayout(new MigLayout("wrap 9", "[][][][40px!][][40px!][][][]", "[30px!][]"));
Label find = new Label(composite, SWT.FILL);
find.setLayoutData("w 30!");
find.setText(getCaption("collectionEditor.find"));
query = new Text(composite, SWT.FILL);
query.setLayoutData("w 100: 500: 600");
query.setText("{}");
Label skip = new Label(composite, SWT.FILL);
skip.setText(getCaption("collectionEditor.skip"));
skipV = new Text(composite, SWT.FILL);
skipV.setText("0");
skipV.setLayoutData("w 40px!");
skipV.addListener(SWT.DefaultSelection, runQuery);
Label limit = new Label(composite, SWT.FILL);
limit.setText(getCaption("collectionEditor.limit"));
limitV = new Text(composite, SWT.FILL);
limitV.setText("10");
limitV.setLayoutData("w 40px!");
limitV.addListener(SWT.DefaultSelection, runQuery);
search = new Button(composite, SWT.PUSH);
search.setToolTipText(getCaption("collectionEditor.tooltip.search"));
search.setImage(reg.get(MeclipsePlugin.FIND_IMG_ID));
search.addListener(SWT.Selection, runQuery);
more = new Button(composite, SWT.PUSH);
more.setToolTipText(getCaption("collectionEditor.tooltip.next"));
more.setImage(reg.get(MeclipsePlugin.GET_NEXT_IMG_ID));
more.setEnabled(false);
more.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event arg0) {
loadEntries(false);
}
});
all = new Button(composite, SWT.PUSH);
all.setToolTipText(String.format(getCaption("collectionEditor.tooltip.getAll"), maxElements));
all.setImage(reg.get(MeclipsePlugin.GET_ALL_IMG_ID));
all.setEnabled(false);
all.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event arg0) {
loadEntries(true);
}
});
bar = new ExpandBar(composite, SWT.V_SCROLL);
bar.setLayoutData("span, w 100%-20px !,h 100%-50px !");
cursor = col.getCollection().find().limit(maxElements);
loadEntries(false);
int index = addPage(composite);
setPageText(index, getCaption("collectionEditor.tab.properties"));
}
use of org.eclipse.swt.widgets.ExpandBar in project cubrid-manager by CUBRID.
the class DBSpaceLabelProvider method createPartControl.
public void createPartControl(Composite parent) {
Composite composite = new Composite(parent, SWT.None);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
composite.setLayout(layout);
Composite buttonComp = new Composite(composite, SWT.None);
buttonComp.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, 20));
Composite dataComp = new Composite(composite, SWT.None);
dataComp.setLayout(new FillLayout());
dataComp.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
/*Create button*/
createButtonComposite(buttonComp);
/* Database server information */
bar = new ExpandBar(dataComp, SWT.V_SCROLL);
int index = 0;
createVolumnInfoItem(bar, index++);
createBrokerInfoItem(bar, index++);
createServerStatusItem(bar, index++);
createDBInfoItem(bar, index++);
createServerInfoItem(bar, index++);
loadAllData();
}
use of org.eclipse.swt.widgets.ExpandBar 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();
}
Aggregations