Search in sources :

Example 1 with ExpandBar

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();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ExpandBar(org.eclipse.swt.widgets.ExpandBar) Composite(org.eclipse.swt.widgets.Composite) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 2 with ExpandBar

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"));
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) ExpandBar(org.eclipse.swt.widgets.ExpandBar) Listener(org.eclipse.swt.widgets.Listener) IResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) MigLayout(net.miginfocom.swt.MigLayout) Label(org.eclipse.swt.widgets.Label) Event(org.eclipse.swt.widgets.Event) IResourceChangeEvent(org.eclipse.core.resources.IResourceChangeEvent) Text(org.eclipse.swt.widgets.Text)

Example 3 with ExpandBar

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();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ExpandBar(org.eclipse.swt.widgets.ExpandBar) Composite(org.eclipse.swt.widgets.Composite) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 4 with ExpandBar

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();
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) ExpandBar(org.eclipse.swt.widgets.ExpandBar) Composite(org.eclipse.swt.widgets.Composite) CommandStackForComposite(org.talend.commons.ui.command.CommandStackForComposite) ExpandItem(org.eclipse.swt.widgets.ExpandItem) GridData(org.eclipse.swt.layout.GridData) ExpandEvent(org.eclipse.swt.events.ExpandEvent) FillLayout(org.eclipse.swt.layout.FillLayout) ExpandListener(org.eclipse.swt.events.ExpandListener)

Aggregations

Composite (org.eclipse.swt.widgets.Composite)4 ExpandBar (org.eclipse.swt.widgets.ExpandBar)4 FillLayout (org.eclipse.swt.layout.FillLayout)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 MigLayout (net.miginfocom.swt.MigLayout)1 IResourceChangeEvent (org.eclipse.core.resources.IResourceChangeEvent)1 IResourceChangeListener (org.eclipse.core.resources.IResourceChangeListener)1 ImageRegistry (org.eclipse.jface.resource.ImageRegistry)1 SashForm (org.eclipse.swt.custom.SashForm)1 ExpandEvent (org.eclipse.swt.events.ExpandEvent)1 ExpandListener (org.eclipse.swt.events.ExpandListener)1 GridData (org.eclipse.swt.layout.GridData)1 Button (org.eclipse.swt.widgets.Button)1 Event (org.eclipse.swt.widgets.Event)1 ExpandItem (org.eclipse.swt.widgets.ExpandItem)1 Label (org.eclipse.swt.widgets.Label)1 Listener (org.eclipse.swt.widgets.Listener)1 Text (org.eclipse.swt.widgets.Text)1 CommandStackForComposite (org.talend.commons.ui.command.CommandStackForComposite)1