Search in sources :

Example 46 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class EditVirtualTableDialog method createTableInformationGroup.

private void createTableInformationGroup(Composite compositeGenaral) {
    final Group group = new Group(compositeGenaral, SWT.NONE);
    group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    group.setLayout(gridLayout);
    group.setText(Messages.lblTableInfo);
    final Label tableNameLabel = new Label(group, SWT.NONE);
    tableNameLabel.setData(Messages.dataNewKey, null);
    tableNameLabel.setText(Messages.lblTableName);
    final SchemaInfo newSchemaInfo = getNewSchemaInfo();
    tableNameComp = new Composite(group, SWT.NONE);
    {
        GridLayout gl = new GridLayout();
        gl.numColumns = 2;
        gl.marginWidth = 0;
        tableNameComp.setLayout(gl);
        tableNameComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
        tableNameText = new Text(tableNameComp, SWT.BORDER);
        {
            GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
            tableNameText.setLayoutData(gd);
        }
        tableNameText.addModifyListener(new ModifyListener() {

            public void modifyText(ModifyEvent event) {
                if (tableNameText.getText().length() == 0) {
                    CommonUITool.hideErrorBaloon(errorBaloon);
                } else if (verifyTableName()) {
                    String tableName = tableNameText.getText();
                    newSchemaInfo.setClassname(tableName);
                }
            }
        });
        tableNameText.addFocusListener(new FocusAdapter() {

            public void focusLost(FocusEvent e) {
                CommonUITool.hideErrorBaloon(errorBaloon);
            }
        });
    }
    //char set
    if (supportCharset) {
        Composite collationComposite = new Composite(tableNameComp, SWT.NONE);
        collationComposite.setLayout(new GridLayout(2, false));
        final Label collationLabel = new Label(collationComposite, SWT.NONE);
        collationLabel.setText(Messages.lblCollation);
        collationCombo = new Combo(collationComposite, SWT.READ_ONLY);
        collationCombo.setLayout(new FillLayout());
        collationCombo.setVisibleItemCount(10);
        fillCollationCombo();
        String collation = collationCombo.getText();
        newSchemaInfo.setCollation(collation);
        collationCombo.addSelectionListener(new SelectionListener() {

            public void widgetSelected(SelectionEvent e) {
                String collation = collationCombo.getText();
                newSchemaInfo.setCollation(collation);
            }

            public void widgetDefaultSelected(SelectionEvent e) {
            }
        });
        if (!isNewTableFlag && newSchemaInfo.getCollation() != null) {
            collationCombo.setText(newSchemaInfo.getCollation());
        }
    } else {
        new Label(tableNameComp, SWT.NONE);
    }
    if (erSchema.isPhysicModel()) {
        //desc info
        final Label tableDescLabel = new Label(group, SWT.NONE);
        tableDescLabel.setText(Messages.lblTableDesc);
        tableDescText = new Text(group, SWT.BORDER);
        tableDescText.setTextLimit(612);
        tableDescText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        //		tableDescText.setLayoutData(new FillLayout());
        if (newSchemaInfo != null && newSchemaInfo.getDescription() != null) {
            tableDescText.setText(newSchemaInfo.getDescription());
        }
        tableDescText.addFocusListener(new FocusAdapter() {

            public void focusGained(FocusEvent e) {
            }

            public void focusLost(FocusEvent e) {
                CommonUITool.hideErrorBaloon(errorBaloon);
            }
        });
        tableDescText.setEditable(true);
    }
}
Also used : Group(org.eclipse.swt.widgets.Group) FocusAdapter(org.eclipse.swt.events.FocusAdapter) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) FillLayout(org.eclipse.swt.layout.FillLayout) FocusEvent(org.eclipse.swt.events.FocusEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SchemaInfo(com.cubrid.common.core.common.model.SchemaInfo) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 47 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class ViewDashboardEditorPart method createTabFolder.

public void createTabFolder(Composite parent) {
    tabFolder = new CTabFolder(parent, SWT.TOP);
    tabFolder.setLayout(new FillLayout());
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    tabFolder.setSimple(false);
    tabFolder.setUnselectedImageVisible(true);
    tabFolder.setUnselectedCloseVisible(true);
    tabFolder.setBorderVisible(true);
    tabFolder.setSelectionBackground(ResourceManager.getColor(136, 161, 227));
    tabFolder.setSelectionForeground(ResourceManager.getColor(SWT.COLOR_BLACK));
    Menu menu = new Menu(tabFolder.getShell(), SWT.POP_UP);
    tabFolder.setMenu(menu);
    MenuItem closeItem = new MenuItem(menu, SWT.PUSH);
    closeItem.setText(Messages.tablesDetailInfoPartCloseMenu);
    closeItem.addSelectionListener(new SelectionListener() {

        public void widgetSelected(SelectionEvent e) {
            widgetDefaultSelected(e);
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            CTabItem item = tabFolder.getSelection();
            item.dispose();
        }
    });
    MenuItem closeOthersItem = new MenuItem(menu, SWT.PUSH);
    closeOthersItem.setText(Messages.tablesDetailInfoPartCloseOthersMenu);
    closeOthersItem.addSelectionListener(new SelectionListener() {

        public void widgetSelected(SelectionEvent e) {
            widgetDefaultSelected(e);
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            CTabItem[] items = tabFolder.getItems();
            CTabItem selectedItem = tabFolder.getSelection();
            for (CTabItem item : items) {
                if (!item.equals(selectedItem)) {
                    item.dispose();
                }
            }
        }
    });
    MenuItem closeAllItem = new MenuItem(menu, SWT.PUSH);
    closeAllItem.setText(Messages.tablesDetailInfoPartCloseAllMenu);
    closeAllItem.addSelectionListener(new SelectionListener() {

        public void widgetSelected(SelectionEvent e) {
            widgetDefaultSelected(e);
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            CTabItem[] items = tabFolder.getItems();
            for (CTabItem item : items) {
                item.dispose();
            }
        }
    });
}
Also used : CTabFolder(org.eclipse.swt.custom.CTabFolder) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) MenuItem(org.eclipse.swt.widgets.MenuItem) FillLayout(org.eclipse.swt.layout.FillLayout) Menu(org.eclipse.swt.widgets.Menu) ViewsDetailInfoCTabItem(com.cubrid.common.ui.cubrid.view.editor.ViewDashboardComposite.ViewsDetailInfoCTabItem) CTabItem(org.eclipse.swt.custom.CTabItem) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 48 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class ObjectInfoComposite method initDataTabItem.

/**
	 * Initial demo data table setting
	 * 
	 */
private void initDataTabItem() {
    CTabItem dataTabItem = new CTabItem(objInfoFolder, SWT.NONE);
    dataTabItem.setText(Messages.titleData);
    dataTabItem.setShowClose(false);
    Composite composite = new Composite(objInfoFolder, SWT.None);
    dataTabItem.setControl(composite);
    objInfoFolder.setSelection(dataTabItem);
    composite.setLayout(new FillLayout());
    demoDataTable = new Table(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
    demoDataTable.setHeaderVisible(true);
    demoDataTable.setLinesVisible(true);
    CommonUITool.hackForYosemite(demoDataTable);
}
Also used : Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) FillLayout(org.eclipse.swt.layout.FillLayout) CTabItem(org.eclipse.swt.custom.CTabItem)

Example 49 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class ObjectInfoComposite method initColumnTabItem.

/**
	 * Initial column tab item
	 * 
	 */
private void initColumnTabItem() {
    CTabItem columnTabItem = new CTabItem(objInfoFolder, SWT.NONE);
    columnTabItem.setText(Messages.titleColumn);
    columnTabItem.setShowClose(false);
    Composite composite = new Composite(objInfoFolder, SWT.None);
    columnTabItem.setControl(composite);
    composite.setLayout(new FillLayout());
    if (isTable) {
        initTableColumn(composite);
    } else {
        initViewColumn(composite);
    }
}
Also used : Composite(org.eclipse.swt.widgets.Composite) FillLayout(org.eclipse.swt.layout.FillLayout) CTabItem(org.eclipse.swt.custom.CTabItem)

Example 50 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class ObjectInfoComposite method initDDLTabItem.

/**
	 * Initial ddl tab item
	 * 
	 */
private void initDDLTabItem() {
    CTabItem ddlTabItem = new CTabItem(objInfoFolder, SWT.NONE);
    ddlTabItem.setText(Messages.titleDDL);
    ddlTabItem.setShowClose(false);
    Composite composite = new Composite(objInfoFolder, SWT.NONE);
    ddlTabItem.setControl(composite);
    composite.setLayout(new FillLayout());
    sqlText = new StyledText(composite, SWT.V_SCROLL | SWT.READ_ONLY | SWT.H_SCROLL | SWT.BORDER | SWT.WRAP | SWT.MULTI);
    /*For bug TOOLS-996*/
    CommonUITool.registerCopyPasteContextMenu(sqlText, false);
}
Also used : StyledText(org.eclipse.swt.custom.StyledText) Composite(org.eclipse.swt.widgets.Composite) FillLayout(org.eclipse.swt.layout.FillLayout) CTabItem(org.eclipse.swt.custom.CTabItem)

Aggregations

FillLayout (org.eclipse.swt.layout.FillLayout)298 Composite (org.eclipse.swt.widgets.Composite)180 GridData (org.eclipse.swt.layout.GridData)130 Shell (org.eclipse.swt.widgets.Shell)104 GridLayout (org.eclipse.swt.layout.GridLayout)97 Label (org.eclipse.swt.widgets.Label)69 SelectionEvent (org.eclipse.swt.events.SelectionEvent)67 Display (org.eclipse.swt.widgets.Display)63 Button (org.eclipse.swt.widgets.Button)60 Point (org.eclipse.swt.graphics.Point)55 Table (org.eclipse.swt.widgets.Table)48 Group (org.eclipse.swt.widgets.Group)40 SelectionListener (org.eclipse.swt.events.SelectionListener)38 TableColumn (org.eclipse.swt.widgets.TableColumn)38 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)37 Text (org.eclipse.swt.widgets.Text)36 Test (org.junit.Test)36 TableItem (org.eclipse.swt.widgets.TableItem)35 SashForm (org.eclipse.swt.custom.SashForm)31 Rectangle (org.eclipse.swt.graphics.Rectangle)29