Search in sources :

Example 26 with FillLayout

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

the class DBAuthComparator method createPartControl.

public void createPartControl(Composite parent) {
    parent.setLayout(new GridLayout(1, false));
    ToolBar toolBar = new ToolBar(parent, SWT.LEFT_TO_RIGHT | SWT.FLAT);
    toolBar.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    ToolItem refreshItem = new ToolItem(toolBar, SWT.PUSH);
    refreshItem.setText(Messages.btnRefresh);
    refreshItem.setToolTipText(Messages.btnRefresh);
    refreshItem.setImage(CommonUIPlugin.getImage("icons/action/refresh.png"));
    refreshItem.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            refresh();
        }
    });
    new ToolItem(toolBar, SWT.SEPARATOR);
    ToolItem addUserItem = new ToolItem(toolBar, SWT.NONE);
    addUserItem.setText(Messages.btnAddUser);
    addUserItem.setImage(CommonUIPlugin.getImage("icons/action/user_add.png"));
    addUserItem.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            addUser();
        }
    });
    ToolItem editUserItem = new ToolItem(toolBar, SWT.NONE);
    editUserItem.setText(Messages.btnEditUser);
    editUserItem.setImage(CommonUIPlugin.getImage("icons/action/user_edit.png"));
    editUserItem.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            editUser();
        }
    });
    ToolItem dropUserItem = new ToolItem(toolBar, SWT.NONE);
    dropUserItem.setText(Messages.btnDropUser);
    dropUserItem.setImage(CommonUIPlugin.getImage("icons/action/user_delete.png"));
    dropUserItem.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            dropUser();
        }
    });
    SashForm form = new SashForm(parent, SWT.HORIZONTAL);
    form.setLayout(new FillLayout());
    form.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
    createUsersTable(form);
    createAuthTable(form);
    form.setWeights(new int[] { 150, 850 });
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ToolBar(org.eclipse.swt.widgets.ToolBar) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FillLayout(org.eclipse.swt.layout.FillLayout) ToolItem(org.eclipse.swt.widgets.ToolItem)

Example 27 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 28 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 29 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 30 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)

Aggregations

FillLayout (org.eclipse.swt.layout.FillLayout)688 Composite (org.eclipse.swt.widgets.Composite)444 GridData (org.eclipse.swt.layout.GridData)267 GridLayout (org.eclipse.swt.layout.GridLayout)187 Shell (org.eclipse.swt.widgets.Shell)164 Label (org.eclipse.swt.widgets.Label)150 SelectionEvent (org.eclipse.swt.events.SelectionEvent)140 Button (org.eclipse.swt.widgets.Button)118 Display (org.eclipse.swt.widgets.Display)99 Group (org.eclipse.swt.widgets.Group)95 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)89 Point (org.eclipse.swt.graphics.Point)89 Text (org.eclipse.swt.widgets.Text)84 Table (org.eclipse.swt.widgets.Table)80 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)77 Rectangle (org.eclipse.swt.graphics.Rectangle)77 TableColumn (org.eclipse.swt.widgets.TableColumn)65 SelectionListener (org.eclipse.swt.events.SelectionListener)61 Tree (org.eclipse.swt.widgets.Tree)60 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)54