Search in sources :

Example 21 with TabFolder

use of org.eclipse.swt.widgets.TabFolder in project eclipse.platform.swt by eclipse.

the class Test_situational method test_createWidgets.

public void test_createWidgets() {
    PerformanceMeter meter = createMeter("Create composites and widgets");
    int samples;
    Performance performance = Performance.getDefault();
    performance.tagAsGlobalSummary(meter, "Create composites and widgets", Dimension.ELAPSED_PROCESS);
    for (samples = 0; samples < 10; samples++) {
        Shell shell = new Shell(display);
        shell.setLayout(new FillLayout());
        meter.start();
        for (int i = 0; i < 50; i++) {
            Composite c = new Composite(shell, SWT.NONE);
            for (int j = 0; j < 10; j++) {
                new Button(c, SWT.PUSH);
                new Label(c, SWT.NONE);
                new Scale(c, SWT.NONE);
                new ProgressBar(c, SWT.NONE);
                new List(c, SWT.NONE);
                new Text(c, SWT.SINGLE);
                new Text(c, SWT.MULTI);
                new Slider(c, SWT.NONE);
                new Tree(c, SWT.NONE);
                new Table(c, SWT.NONE);
                new TabFolder(c, SWT.NONE);
                new Group(c, SWT.BORDER);
                new Composite(c, SWT.NONE);
            }
        }
        meter.stop();
        shell.dispose();
        while (display.readAndDispatch()) {
        /*empty*/
        }
    }
    disposeMeter(meter);
}
Also used : Group(org.eclipse.swt.widgets.Group) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) Slider(org.eclipse.swt.widgets.Slider) Label(org.eclipse.swt.widgets.Label) TabFolder(org.eclipse.swt.widgets.TabFolder) Scale(org.eclipse.swt.widgets.Scale) Text(org.eclipse.swt.widgets.Text) FillLayout(org.eclipse.swt.layout.FillLayout) Shell(org.eclipse.swt.widgets.Shell) Button(org.eclipse.swt.widgets.Button) PerformanceMeter(org.eclipse.test.performance.PerformanceMeter) Tree(org.eclipse.swt.widgets.Tree) List(org.eclipse.swt.widgets.List) Performance(org.eclipse.test.performance.Performance) ProgressBar(org.eclipse.swt.widgets.ProgressBar)

Example 22 with TabFolder

use of org.eclipse.swt.widgets.TabFolder in project eclipse.platform.swt by eclipse.

the class Test_org_eclipse_swt_widgets_TabFolder method makeCleanEnvironment.

private void makeCleanEnvironment() {
    // this method must be private or protected so the auto-gen tool keeps it
    tabFolder = new TabFolder(shell, 0);
    setWidget(tabFolder);
}
Also used : TabFolder(org.eclipse.swt.widgets.TabFolder)

Example 23 with TabFolder

use of org.eclipse.swt.widgets.TabFolder in project cubrid-manager by CUBRID.

the class TableEditorPart method createPartControl.

public void createPartControl(Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    {
        final GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        gd.heightHint = 500;
        gd.widthHint = 800;
        composite.setLayoutData(gd);
        GridLayout gl = new GridLayout();
        gl.numColumns = 1;
        composite.setLayout(gl);
    }
    tabFolder = new TabFolder(composite, SWT.NONE);
    {
        final GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        gd.heightHint = 469;
        gd.widthHint = 621;
        tabFolder.setLayoutData(gd);
    }
    tabFolder.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            TabItem[] tabItems = tabFolder.getSelection();
            if (tabItems == null || tabItems.length == 0 || tabItems[0] == null) {
                return;
            }
            String tabTitle = tabItems[0].getText();
            if (!StringUtil.isEqual(tabTitle, Messages.infoSQLScriptTab)) {
                return;
            }
            String tableName = tableNameText.getText();
            newSchemaInfo.setClassname(tableName);
            String owner = ownerCombo.getText();
            newSchemaInfo.setOwner(owner);
            if (reuseOIDBtn != null) {
                newSchemaInfo.setReuseOid(reuseOIDBtn.getSelection());
            }
            StringBuilder sql = new StringBuilder();
            if (oldSchemaInfo != null) {
                sql.append(schemaDDL.getSchemaDDL(oldSchemaInfo));
                for (int i = 0; i < 3; i++) {
                    sql.append(StringUtil.NEWLINE);
                }
            }
            String alterSql = schemaDDL.getSchemaDDL(oldSchemaInfo, newSchemaInfo);
            if (alterSql != null) {
                sql.append(alterSql);
            }
            sql.append(getChangeOwnerDDL());
            sqlText.setText(sql.toString());
        }
    });
    editorAdaptor = new TableEditorAdaptor(this);
    createGeneralTabItem(tabFolder);
    createFkIndexTabItem(tabFolder);
    createPartitionTabItem(tabFolder);
    createSqlScriptTabItem(tabFolder);
    toolTip = new ToolTip(columnsTable.getShell(), SWT.NONE);
    toolTip.setAutoHide(true);
    errorBaloon = new ToolTip(tabFolder.getShell(), SWT.NONE);
    errorBaloon.setAutoHide(true);
    init();
    if (isNewTableFlag) {
        tableNameText.setFocus();
    }
    Composite btnComposite = new Composite(composite, SWT.NONE);
    {
        GridLayout gl = new GridLayout();
        gl.numColumns = 2;
        btnComposite.setLayout(gl);
        btnComposite.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false));
    }
    okBtn = new Button(btnComposite, SWT.NONE);
    {
        GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
        gd.minimumWidth = 80;
        gd.widthHint = 80;
        okBtn.setLayoutData(gd);
    }
    okBtn.setText(Messages.btnOK);
    okBtn.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            okPressed();
        }
    });
    Button cancelBtn = new Button(btnComposite, SWT.NONE);
    {
        GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
        gd.minimumWidth = 80;
        gd.widthHint = 80;
        cancelBtn.setLayoutData(gd);
    }
    cancelBtn.setText(Messages.btnCancel);
    cancelBtn.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            if (!CommonUITool.openConfirmBox(Messages.msgCancelEditTableConfirm)) {
                return;
            }
            IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
            if (page != null) {
                page.closeEditor(editor, false);
            }
        }
    });
    addNewColumn();
    if (showDefaultType == EditTableAction.MODE_INDEX_EDIT) {
        tabFolder.setSelection(1);
    }
}
Also used : ToolTip(org.eclipse.swt.widgets.ToolTip) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) TabFolder(org.eclipse.swt.widgets.TabFolder) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) TableEditorAdaptor(com.cubrid.common.ui.cubrid.table.TableEditorAdaptor)

Example 24 with TabFolder

use of org.eclipse.swt.widgets.TabFolder in project cubrid-manager by CUBRID.

the class CreateOrEditSerialDialog method createDialogArea.

protected Control createDialogArea(Composite parent) {
    Composite parentComp = (Composite) super.createDialogArea(parent);
    Composite composite = new Composite(parentComp, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);
    tabFolder = new TabFolder(composite, SWT.NONE);
    tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
    layout = new GridLayout();
    tabFolder.setLayout(layout);
    TabItem item = new TabItem(tabFolder, SWT.NONE);
    item.setText(Messages.grpGeneral);
    composite = createGeneralInfoComp();
    item.setControl(composite);
    item = new TabItem(tabFolder, SWT.NONE);
    item.setText(Messages.grpSqlScript);
    composite = createSqlScriptComposite();
    item.setControl(composite);
    tabFolder.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            if (tabFolder.getSelectionIndex() == 0) {
                serialNameText.setFocus();
            } else if (tabFolder.getSelectionIndex() == tabFolder.getItemCount() - 1) {
                sqlScriptText.setText(getSQLScript());
            }
        }
    });
    initialize();
    if (editedNode == null) {
        setTitle(Messages.titleCreateSerialDialog);
        setMessage(Messages.msgCreateSerialDialog);
    } else {
        setTitle(Messages.titleEditSerialDialog);
        setMessage(Messages.msgEditSerialDialog);
    }
    return parentComp;
}
Also used : TabItem(org.eclipse.swt.widgets.TabItem) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) TabFolder(org.eclipse.swt.widgets.TabFolder) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 25 with TabFolder

use of org.eclipse.swt.widgets.TabFolder in project dbeaver by serge-rider.

the class ConnectionPageNetwork method createControl.

@Override
public void createControl(Composite parent) {
    handlersFolder = new TabFolder(parent, SWT.TOP);
    handlersFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
    setControl(handlersFolder);
}
Also used : TabFolder(org.eclipse.swt.widgets.TabFolder) GridData(org.eclipse.swt.layout.GridData)

Aggregations

TabFolder (org.eclipse.swt.widgets.TabFolder)40 TabItem (org.eclipse.swt.widgets.TabItem)33 GridData (org.eclipse.swt.layout.GridData)30 Composite (org.eclipse.swt.widgets.Composite)28 GridLayout (org.eclipse.swt.layout.GridLayout)27 SelectionEvent (org.eclipse.swt.events.SelectionEvent)12 Text (org.eclipse.swt.widgets.Text)12 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)11 Button (org.eclipse.swt.widgets.Button)11 Label (org.eclipse.swt.widgets.Label)10 Combo (org.eclipse.swt.widgets.Combo)5 Shell (org.eclipse.swt.widgets.Shell)5 FillLayout (org.eclipse.swt.layout.FillLayout)4 Control (org.eclipse.swt.widgets.Control)4 Display (org.eclipse.swt.widgets.Display)4 Group (org.eclipse.swt.widgets.Group)4 Table (org.eclipse.swt.widgets.Table)4 Link (org.eclipse.swt.widgets.Link)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 SWT (org.eclipse.swt.SWT)2