Search in sources :

Example 1 with ConnectionComposite

use of com.cubrid.common.ui.common.control.ConnectionComposite in project cubrid-manager by CUBRID.

the class LoginQueryEditDialog method createDialogArea.

/**
	 * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
	 * @param parent The parent composite to contain the dialog area
	 * @return the dialog area control
	 */
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.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);
    }
    Group serverInfoGroup = new Group(composite, SWT.NONE);
    {
        serverInfoGroup.setText(Messages.grpAddeHosts);
        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
        serverInfoGroup.setLayoutData(gridData);
        GridLayout layout = new GridLayout();
        layout.numColumns = 3;
        serverInfoGroup.setLayout(layout);
        Label allHostLabel = new Label(serverInfoGroup, SWT.LEFT);
        allHostLabel.setText(Messages.lblAddedHost);
        allHostLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
        allHostCombo = new Combo(serverInfoGroup, SWT.LEFT | SWT.BORDER | SWT.READ_ONLY);
        allHostCombo.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                selServerName = allHostCombo.getText();
                changeSelection();
                valid();
            }
        });
        allHostCombo.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 2, 1, 100, -1));
    }
    connectionComp = new ConnectionComposite(composite, false, true);
    connectionComp.getDatabaseCombo().addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            selDatabaseName = connectionComp.getDatabaseCombo().getText();
            changeSelection();
            valid();
        }
    });
    setTitle(com.cubrid.cubridmanager.ui.common.Messages.titleNewQueryDialog);
    setMessage(com.cubrid.cubridmanager.ui.common.Messages.msgNewQueryDialog);
    initial();
    return parentComp;
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ConnectionComposite(com.cubrid.common.ui.common.control.ConnectionComposite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ConnectionComposite(com.cubrid.common.ui.common.control.ConnectionComposite) Combo(org.eclipse.swt.widgets.Combo)

Example 2 with ConnectionComposite

use of com.cubrid.common.ui.common.control.ConnectionComposite in project cubrid-manager by CUBRID.

the class QueryConnDialog method createDialogArea.

/**
	 * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
	 * @param parent The parent composite to contain the dialog area
	 * @return the dialog area control
	 */
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.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);
    }
    Composite connectionNameComp = new Composite(composite, SWT.NONE);
    {
        connectionNameComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        GridLayout layout = new GridLayout(4, false);
        connectionNameComp.setLayout(layout);
        Label queryConnNameLabel = new Label(connectionNameComp, SWT.LEFT);
        queryConnNameLabel.setText(Messages.lblConnName);
        queryConnNameLabel.setLayoutData(CommonUITool.createGridData(GridData.HORIZONTAL_ALIGN_BEGINNING, 1, 1, -1, -1));
        queryConnNameText = new Text(connectionNameComp, SWT.LEFT | SWT.BORDER);
        queryConnNameText.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
        Label backgroundLabel = new Label(connectionNameComp, SWT.None);
        backgroundLabel.setText(Messages.lblBackground);
        backgroundLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
        DatabaseEditorConfig editorConfig = QueryOptions.getEditorConfig(database, false);
        RGB selectedColor = null;
        if (editorConfig != null) {
            selectedColor = editorConfig.getBackGround();
        } else {
            selectedColor = EditorConstance.getDefaultBackground();
        }
        selectColorCombo = new SelectColorCombo(connectionNameComp, SWT.BORDER, selectedColor);
        selectColorCombo.setLayoutData(CommonUITool.createGridData(GridData.HORIZONTAL_ALIGN_END, 1, 1, -1, -1));
        Label commentLabel = new Label(connectionNameComp, SWT.None);
        commentLabel.setText(Messages.lblComment);
        commentLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
        commentText = new Text(connectionNameComp, SWT.BORDER);
        commentText.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
        commentText.setTextLimit(64);
        if (editorConfig != null && editorConfig.getDatabaseComment() != null) {
            commentText.setText(editorConfig.getDatabaseComment());
        }
    }
    connectionComp = new ConnectionComposite(composite, true, false);
    initial();
    if (isNewQueryConn) {
        setTitle(Messages.titleNewQueryConnDialog);
        setMessage(Messages.msgNewQueryConnDialog);
        queryConnNameText.setFocus();
    } else {
        setTitle(Messages.titleLoginQueryConnDialog);
        setMessage(Messages.msgLoginQueryConnDialog);
        connectionComp.getPasswordText().setFocus();
    }
    if (isNewQueryConn && database != null) {
        queryConnNameText.selectAll();
    }
    return parentComp;
}
Also used : SelectColorCombo(com.cubrid.common.ui.common.control.SelectColorCombo) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ConnectionComposite(com.cubrid.common.ui.common.control.ConnectionComposite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) ConnectionComposite(com.cubrid.common.ui.common.control.ConnectionComposite) Text(org.eclipse.swt.widgets.Text) RGB(org.eclipse.swt.graphics.RGB) DatabaseEditorConfig(com.cubrid.common.ui.spi.model.DatabaseEditorConfig)

Example 3 with ConnectionComposite

use of com.cubrid.common.ui.common.control.ConnectionComposite in project cubrid-manager by CUBRID.

the class LoginQueryEditorDialog method createDialogArea.

/**
	 * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
	 * @param parent The parent composite to contain the dialog area
	 * @return the dialog area control
	 */
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.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);
    }
    Group connInfoGroup = new Group(composite, SWT.NONE);
    {
        connInfoGroup.setText(Messages.grpRegisteredConnInfo);
        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
        connInfoGroup.setLayoutData(gridData);
        GridLayout layout = new GridLayout();
        layout.numColumns = 3;
        connInfoGroup.setLayout(layout);
        Label allConnLabel = new Label(connInfoGroup, SWT.LEFT);
        allConnLabel.setText(Messages.lblConnName);
        allConnLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
        allConnCombo = new Combo(connInfoGroup, SWT.LEFT | SWT.BORDER | SWT.READ_ONLY);
        allConnCombo.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                selectedConnName = allConnCombo.getText();
                changeSelection();
                valid();
            }
        });
        allConnCombo.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, 100, -1));
    }
    connectionComp = new ConnectionComposite(composite, false, false);
    setTitle(Messages.titleNewQueryDialog);
    setMessage(Messages.msgNewQueryDialog);
    initial();
    return parentComp;
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ConnectionComposite(com.cubrid.common.ui.common.control.ConnectionComposite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ConnectionComposite(com.cubrid.common.ui.common.control.ConnectionComposite) Combo(org.eclipse.swt.widgets.Combo)

Aggregations

ConnectionComposite (com.cubrid.common.ui.common.control.ConnectionComposite)3 GridData (org.eclipse.swt.layout.GridData)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Composite (org.eclipse.swt.widgets.Composite)3 Label (org.eclipse.swt.widgets.Label)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 Combo (org.eclipse.swt.widgets.Combo)2 Group (org.eclipse.swt.widgets.Group)2 SelectColorCombo (com.cubrid.common.ui.common.control.SelectColorCombo)1 DatabaseEditorConfig (com.cubrid.common.ui.spi.model.DatabaseEditorConfig)1 RGB (org.eclipse.swt.graphics.RGB)1 Text (org.eclipse.swt.widgets.Text)1