Search in sources :

Example 96 with GridData

use of org.eclipse.swt.layout.GridData in project dbeaver by serge-rider.

the class DriverLibraryDetailsDialog method createLicenseTab.

/*
        private void createParametersTab(TabFolder group)
        {
            Composite paramsGroup = new Composite(group, SWT.NONE);
            paramsGroup.setLayout(new GridLayout(1, false));

            parametersEditor = new PropertyTreeViewer(paramsGroup, SWT.BORDER);
            driverPropertySource = new PropertySourceCustom(
                driver.getProviderDescriptor().getDriverProperties(),
                driver.getDriverParameters());
            driverPropertySource.setDefaultValues(driver.getDefaultDriverParameters());
            parametersEditor.loadProperties(driverPropertySource);

            TabItem paramsTab = new TabItem(group, SWT.NONE);
            paramsTab.setText(CoreMessages.dialog_edit_driver_tab_name_advanced_parameters);
            paramsTab.setToolTipText(CoreMessages.dialog_edit_driver_tab_tooltip_advanced_parameters);
            paramsTab.setControl(paramsGroup);
        }

        private void createConnectionPropertiesTab(TabFolder group)
        {
            Composite paramsGroup = new Composite(group, SWT.NONE);
            paramsGroup.setLayout(new GridLayout(1, false));

            connectionPropertiesEditor = new ConnectionPropertiesControl(paramsGroup, SWT.BORDER);
            connectionPropertySource = connectionPropertiesEditor.makeProperties(driver, driver.getConnectionProperties());
            connectionPropertiesEditor.loadProperties(connectionPropertySource);


            TabItem paramsTab = new TabItem(group, SWT.NONE);
            paramsTab.setText(CoreMessages.dialog_edit_driver_tab_name_connection_properties);
            paramsTab.setToolTipText(CoreMessages.dialog_edit_driver_tab_tooltip_connection_properties);
            paramsTab.setControl(paramsGroup);
        }

        private void createClientHomesTab(TabFolder group)
        {
            clientHomesPanel = new ClientHomesPanel(group, SWT.NONE);
            clientHomesPanel.loadHomes(driver);
            clientHomesPanel.setLayoutData(new GridData(GridData.FILL_BOTH));

            TabItem paramsTab = new TabItem(group, SWT.NONE);
            paramsTab.setText(CoreMessages.dialog_edit_driver_tab_name_client_homes);
            paramsTab.setToolTipText(CoreMessages.dialog_edit_driver_tab_name_client_homes);
            paramsTab.setControl(clientHomesPanel);
        }
    */
private void createLicenseTab(TabFolder group) {
    Composite paramsGroup = new Composite(group, SWT.NONE);
    paramsGroup.setLayout(new GridLayout(1, false));
    Text licenseText = new Text(paramsGroup, SWT.BORDER | SWT.WRAP | SWT.MULTI | SWT.V_SCROLL);
    licenseText.setText("License");
    licenseText.setEditable(false);
    licenseText.setMessage(CoreMessages.dialog_edit_driver_text_driver_license);
    final GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 200;
    //gd.grabExcessVerticalSpace = true;
    licenseText.setLayoutData(gd);
    TabItem paramsTab = new TabItem(group, SWT.NONE);
    paramsTab.setText(CoreMessages.dialog_edit_driver_tab_name_license);
    paramsTab.setToolTipText(CoreMessages.dialog_edit_driver_tab_tooltip_license);
    paramsTab.setControl(paramsGroup);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData)

Example 97 with GridData

use of org.eclipse.swt.layout.GridData in project dbeaver by serge-rider.

the class DriverLibraryDetailsDialog method createDetailsTab.

private void createDetailsTab(TabFolder tabs) {
    Composite detailsGroup = new Composite(tabs, SWT.NONE);
    detailsGroup.setLayout(new GridLayout(1, false));
    UIUtils.createControlLabel(detailsGroup, "Description");
    Text descriptionText = new Text(detailsGroup, SWT.READ_ONLY | SWT.BORDER);
    descriptionText.setText(CommonUtils.notEmpty(library.getDescription()));
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = 40;
    descriptionText.setLayoutData(gd);
    TabItem detailsTab = new TabItem(tabs, SWT.NONE);
    detailsTab.setText("Details");
    detailsTab.setToolTipText("Additional library information");
    detailsTab.setControl(detailsGroup);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData)

Example 98 with GridData

use of org.eclipse.swt.layout.GridData in project dbeaver by serge-rider.

the class ContentEditor method createPageContainer.

@Override
protected Composite createPageContainer(Composite parent) {
    Composite panel = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 0;
    layout.horizontalSpacing = 0;
    panel.setLayout(layout);
    if (parent.getLayout() instanceof GridLayout) {
        panel.setLayoutData(new GridData(GridData.FILL_BOTH));
    }
    {
        IValueController valueController = getValueController();
        assert valueController != null;
        infoPanel = new ColumnInfoPanel(panel, SWT.NONE, valueController);
        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.exclude = true;
        infoPanel.setLayoutData(gd);
        infoPanel.setVisible(false);
    }
    Composite editotPanel = new Composite(panel, SWT.NONE);
    layout = new GridLayout(1, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 0;
    layout.horizontalSpacing = 0;
    editotPanel.setLayout(layout);
    editotPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
    return editotPanel;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) ColumnInfoPanel(org.jkiss.dbeaver.ui.dialogs.ColumnInfoPanel) IValueController(org.jkiss.dbeaver.ui.data.IValueController)

Example 99 with GridData

use of org.eclipse.swt.layout.GridData in project dbeaver by serge-rider.

the class ContentEditor method toggleInfoBar.

void toggleInfoBar() {
    boolean visible = infoPanel.isVisible();
    visible = !visible;
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.exclude = !visible;
    infoPanel.setLayoutData(gd);
    infoPanel.setVisible(visible);
    infoPanel.getParent().layout();
}
Also used : GridData(org.eclipse.swt.layout.GridData)

Example 100 with GridData

use of org.eclipse.swt.layout.GridData in project dbeaver by serge-rider.

the class GenerateMultiSQLDialog method createObjectsSelector.

protected void createObjectsSelector(Composite parent) {
    if (selectedObjects.size() < 2) {
        // Don't need it for a single object
        return;
    }
    UIUtils.createControlLabel(parent, "Tables");
    objectsTable = new Table(parent, SWT.BORDER | SWT.CHECK);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = 100;
    objectsTable.setLayoutData(gd);
    for (T table : selectedObjects) {
        TableItem item = new TableItem(objectsTable, SWT.NONE);
        item.setText(DBUtils.getObjectFullName(table, DBPEvaluationContext.UI));
        item.setImage(DBeaverIcons.getImage(DBIcon.TREE_TABLE));
        item.setChecked(true);
        item.setData(table);
    }
    objectsTable.addSelectionListener(SQL_CHANGE_LISTENER);
    objectsTable.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean hasChecked = !getCheckedObjects().isEmpty();
            getButton(IDialogConstants.OK_ID).setEnabled(hasChecked);
            getButton(IDialogConstants.DETAILS_ID).setEnabled(hasChecked);
        }
    });
}
Also used : Table(org.eclipse.swt.widgets.Table) SWT(org.eclipse.swt.SWT) TableItem(org.eclipse.swt.widgets.TableItem) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Aggregations

GridData (org.eclipse.swt.layout.GridData)1831 GridLayout (org.eclipse.swt.layout.GridLayout)1286 Composite (org.eclipse.swt.widgets.Composite)1136 Label (org.eclipse.swt.widgets.Label)709 SelectionEvent (org.eclipse.swt.events.SelectionEvent)602 Button (org.eclipse.swt.widgets.Button)526 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)512 Text (org.eclipse.swt.widgets.Text)427 Group (org.eclipse.swt.widgets.Group)383 ModifyListener (org.eclipse.swt.events.ModifyListener)184 ModifyEvent (org.eclipse.swt.events.ModifyEvent)181 Combo (org.eclipse.swt.widgets.Combo)171 Table (org.eclipse.swt.widgets.Table)140 TableViewer (org.eclipse.jface.viewers.TableViewer)136 Point (org.eclipse.swt.graphics.Point)107 SelectionListener (org.eclipse.swt.events.SelectionListener)100 FillLayout (org.eclipse.swt.layout.FillLayout)93 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)85 TableColumn (org.eclipse.swt.widgets.TableColumn)80 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)76