Search in sources :

Example 1 with ClientHomesSelector

use of org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesSelector in project dbeaver by serge-rider.

the class PostgreConnectionPage method createControl.

@Override
public void createControl(Composite composite) {
    //Composite group = new Composite(composite, SWT.NONE);
    //group.setLayout(new GridLayout(1, true));
    ModifyListener textListener = new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            if (activated) {
                saveSettings(site.getActiveDataSource());
                site.updateButtons();
            }
        }
    };
    Composite addrGroup = UIUtils.createPlaceholder(composite, 4);
    GridLayout gl = new GridLayout(4, false);
    addrGroup.setLayout(gl);
    GridData gd = new GridData(GridData.FILL_BOTH);
    addrGroup.setLayoutData(gd);
    Label hostLabel = UIUtils.createControlLabel(addrGroup, "Host");
    hostLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    hostText = new Text(addrGroup, SWT.BORDER);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.grabExcessHorizontalSpace = true;
    hostText.setLayoutData(gd);
    hostText.addModifyListener(textListener);
    Label portLabel = UIUtils.createControlLabel(addrGroup, "Port");
    gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
    portLabel.setLayoutData(gd);
    portText = new Text(addrGroup, SWT.BORDER);
    gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.widthHint = 40;
    portText.setLayoutData(gd);
    portText.addVerifyListener(UIUtils.getIntegerVerifyListener(Locale.getDefault()));
    portText.addModifyListener(textListener);
    Label dbLabel = UIUtils.createControlLabel(addrGroup, "Database");
    dbLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    dbText = new Text(addrGroup, SWT.BORDER);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 3;
    dbText.setLayoutData(gd);
    dbText.addModifyListener(textListener);
    Label usernameLabel = UIUtils.createControlLabel(addrGroup, "User");
    usernameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    usernameText = new Text(addrGroup, SWT.BORDER);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.grabExcessHorizontalSpace = true;
    usernameText.setLayoutData(gd);
    usernameText.addModifyListener(textListener);
    Label passwordLabel = UIUtils.createControlLabel(addrGroup, "Password");
    passwordLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    passwordText = new Text(addrGroup, SWT.BORDER | SWT.PASSWORD);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.grabExcessHorizontalSpace = true;
    passwordText.setLayoutData(gd);
    passwordText.addModifyListener(textListener);
    {
        Composite buttonsGroup = new Composite(addrGroup, SWT.NONE);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.horizontalSpan = 2;
        buttonsGroup.setLayoutData(gd);
        buttonsGroup.setLayout(new GridLayout(2, false));
        homesSelector = new ClientHomesSelector(buttonsGroup, SWT.NONE, "Local Client");
        gd = new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING);
        homesSelector.getPanel().setLayoutData(gd);
    }
    {
        Group secureGroup = new Group(addrGroup, SWT.NONE);
        secureGroup.setText("Settings");
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.horizontalSpan = 4;
        secureGroup.setLayoutData(gd);
        secureGroup.setLayout(new GridLayout(2, false));
        hideNonDefault = UIUtils.createLabelCheckbox(secureGroup, "Show non-default databases", true);
    }
    createDriverPanel(addrGroup);
    setControl(addrGroup);
}
Also used : ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ClientHomesSelector(org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesSelector) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData)

Example 2 with ClientHomesSelector

use of org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesSelector in project dbeaver by serge-rider.

the class OracleConnectionPage method createClientHomeGroup.

private void createClientHomeGroup(Composite bottomControls) {
    oraHomeSelector = new ClientHomesSelector(bottomControls, SWT.NONE, OracleMessages.dialog_connection_ora_home) {

        @Override
        protected void handleHomeChange() {
            populateTnsNameCombo();
        }
    };
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.widthHint = 300;
    oraHomeSelector.getPanel().setLayoutData(gd);
    Label ph = new Label(bottomControls, SWT.NONE);
    ph.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
Also used : ClientHomesSelector(org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesSelector) GridData(org.eclipse.swt.layout.GridData)

Example 3 with ClientHomesSelector

use of org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesSelector in project dbeaver by serge-rider.

the class MySQLConnectionPage method createControl.

@Override
public void createControl(Composite composite) {
    //Composite group = new Composite(composite, SWT.NONE);
    //group.setLayout(new GridLayout(1, true));
    ModifyListener textListener = new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            if (activated) {
                saveSettings(site.getActiveDataSource());
                site.updateButtons();
            }
        }
    };
    final int fontHeight = UIUtils.getFontHeight(composite);
    Composite addrGroup = UIUtils.createPlaceholder(composite, 2);
    GridLayout gl = new GridLayout(2, false);
    addrGroup.setLayout(gl);
    GridData gd = new GridData(GridData.FILL_BOTH);
    addrGroup.setLayoutData(gd);
    Label hostLabel = UIUtils.createControlLabel(addrGroup, MySQLMessages.dialog_connection_host);
    hostLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    hostText = new Text(addrGroup, SWT.BORDER);
    hostText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    hostText.addModifyListener(textListener);
    Label portLabel = UIUtils.createControlLabel(addrGroup, MySQLMessages.dialog_connection_port);
    portLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    portText = new Text(addrGroup, SWT.BORDER);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.widthHint = fontHeight * 10;
    portText.setLayoutData(gd);
    portText.addVerifyListener(UIUtils.getIntegerVerifyListener(Locale.getDefault()));
    portText.addModifyListener(textListener);
    Label dbLabel = UIUtils.createControlLabel(addrGroup, MySQLMessages.dialog_connection_database);
    dbLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    dbText = new Text(addrGroup, SWT.BORDER);
    dbText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    dbText.addModifyListener(textListener);
    Label usernameLabel = UIUtils.createControlLabel(addrGroup, MySQLMessages.dialog_connection_user_name);
    usernameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    usernameText = new Text(addrGroup, SWT.BORDER);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.widthHint = fontHeight * 20;
    usernameText.setLayoutData(gd);
    usernameText.addModifyListener(textListener);
    Label passwordLabel = UIUtils.createControlLabel(addrGroup, MySQLMessages.dialog_connection_password);
    passwordLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    passwordText = new Text(addrGroup, SWT.BORDER | SWT.PASSWORD);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.widthHint = fontHeight * 20;
    passwordText.setLayoutData(gd);
    passwordText.addModifyListener(textListener);
    {
        Composite clientPanel = UIUtils.createPlaceholder(addrGroup, 1);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.horizontalSpan = 2;
        clientPanel.setLayoutData(gd);
        UIUtils.createHorizontalLine(clientPanel);
        homesSelector = new ClientHomesSelector(clientPanel, SWT.NONE, "Local Client");
        gd = new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING);
        homesSelector.getPanel().setLayoutData(gd);
    }
    createDriverPanel(addrGroup);
    setControl(addrGroup);
}
Also used : ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ClientHomesSelector(org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesSelector) ModifyListener(org.eclipse.swt.events.ModifyListener) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text)

Aggregations

GridData (org.eclipse.swt.layout.GridData)3 ClientHomesSelector (org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesSelector)3 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1