Search in sources :

Example 16 with Label

use of org.eclipse.swt.widgets.Label in project generator by mybatis.

the class SqlScriptComposite method createConnectionGroup.

private void createConnectionGroup(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    group.setText(Messages.SQL_SCRIPT_TAB_JDBC_CONNECTION_GROUP_TITLE);
    GridLayout groupLayout = new GridLayout(2, false);
    group.setLayout(groupLayout);
    group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    group.setFont(parent.getFont());
    Label lblJdbcDriverClass = new Label(group, SWT.NONE);
    lblJdbcDriverClass.setText(Messages.SQL_SCRIPT_TAB_JDBC_DRIVER_LABEL);
    new Label(group, SWT.NONE);
    txtJdbcDriver = new Text(group, SWT.BORDER);
    txtJdbcDriver.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    GridData gd_txtJdbcDriver = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtJdbcDriver.horizontalIndent = 30;
    txtJdbcDriver.setLayoutData(gd_txtJdbcDriver);
    new Label(group, SWT.NONE);
    Label lblJdbcUrl = new Label(group, SWT.NONE);
    lblJdbcUrl.setText(Messages.SQL_SCRIPT_TAB_JDBC_URL_LABEL);
    new Label(group, SWT.NONE);
    txtJdbcURL = new Text(group, SWT.BORDER);
    txtJdbcURL.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    GridData gd_txtJdbcURL = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtJdbcURL.horizontalIndent = 30;
    txtJdbcURL.setLayoutData(gd_txtJdbcURL);
    new Label(group, SWT.NONE);
    Label lblUserId = new Label(group, SWT.NONE);
    lblUserId.setText(Messages.SQL_SCRIPT_TAB_USERID_LABEL);
    new Label(group, SWT.NONE);
    txtUserID = new Text(group, SWT.BORDER);
    txtUserID.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    GridData gd_txtUserID = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtUserID.horizontalIndent = 30;
    txtUserID.setLayoutData(gd_txtUserID);
    new Label(group, SWT.NONE);
    Label lblPassword = new Label(group, SWT.NONE);
    lblPassword.setText(Messages.SQL_SCRIPT_TAB_PASSWORD_LABEL);
    new Label(group, SWT.NONE);
    txtPassword = new Text(group, SWT.PASSWORD | SWT.BORDER);
    txtPassword.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    GridData gd_txtPassword = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtPassword.horizontalIndent = 30;
    txtPassword.setLayoutData(gd_txtPassword);
    new Label(group, SWT.NONE);
    btnSecureStorage = new Button(group, SWT.CHECK);
    btnSecureStorage.setText(Messages.SQL_SCRIPT_TAB_SECURE_STORAGE);
    btnSecureStorage.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    new Label(group, SWT.NONE);
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Text(org.eclipse.swt.widgets.Text)

Example 17 with Label

use of org.eclipse.swt.widgets.Label in project mechanoid by robotoworks.

the class TextField method addDummyFillerLabel.

protected void addDummyFillerLabel(Composite parent, boolean fillRemainingColumns) {
    //
    if (parent.getLayout() instanceof GridLayout && fillRemainingColumns) {
        GridLayout grid = (GridLayout) parent.getLayout();
        int remainingColumns = grid.numColumns - 2;
        Label dummy = new Label(parent, SWT.NONE);
        GridData dummyData = new GridData(SWT.FILL, SWT.CENTER, false, false);
        dummyData.horizontalSpan = remainingColumns > 1 ? remainingColumns : 1;
        dummy.setLayoutData(dummyData);
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData)

Example 18 with Label

use of org.eclipse.swt.widgets.Label in project dbeaver by serge-rider.

the class StatusLineContributionItemEx method fill.

@Override
public void fill(Composite parent) {
    Composite statusLine = parent;
    Label sep = new Label(parent, SWT.SEPARATOR);
    label = new CLabel(statusLine, SWT.SHADOW_NONE);
    label.setText(text);
    if (toolTip != null) {
        label.setToolTipText(toolTip);
    }
    // compute the size of the label to get the width hint for the contribution
    Point preferredSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    int widthHint = preferredSize.x;
    int heightHint = preferredSize.y;
    StatusLineLayoutData data = new StatusLineLayoutData();
    data.widthHint = widthHint;
    label.setLayoutData(data);
    data = new StatusLineLayoutData();
    data.heightHint = heightHint;
    sep.setLayoutData(data);
}
Also used : CLabel(org.eclipse.swt.custom.CLabel) Composite(org.eclipse.swt.widgets.Composite) CLabel(org.eclipse.swt.custom.CLabel) Label(org.eclipse.swt.widgets.Label) StatusLineLayoutData(org.eclipse.jface.action.StatusLineLayoutData) Point(org.eclipse.swt.graphics.Point) Point(org.eclipse.swt.graphics.Point)

Example 19 with Label

use of org.eclipse.swt.widgets.Label in project dbeaver by serge-rider.

the class ToolbarVerticalSeparator method createControl.

@Override
protected Control createControl(Composite parent) {
    Label label = new Label(parent, SWT.NONE);
    label.setImage(DBeaverIcons.getImage(UIIcon.DRAG_HANDLE));
    return label;
}
Also used : Label(org.eclipse.swt.widgets.Label)

Example 20 with Label

use of org.eclipse.swt.widgets.Label in project dbeaver by serge-rider.

the class DefaultValueViewDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite dialogGroup = (Composite) super.createDialogArea(parent);
    Label label = new Label(dialogGroup, SWT.NONE);
    label.setText(CoreMessages.dialog_data_label_value);
    Composite editorPlaceholder = UIUtils.createPlaceholder(dialogGroup, 1);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.minimumHeight = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 4;
    editorPlaceholder.setLayoutData(gd);
    editorPlaceholder.setLayout(new FillLayout());
    try {
        panelEditor = createPanelEditor(editorPlaceholder);
        if (panelEditor == null) {
            return dialogGroup;
        }
        panelEditor.primeEditorValue(getValueController().getValue());
    } catch (DBException e) {
        log.error(e);
        return dialogGroup;
    }
    ReferenceValueEditor referenceValueEditor = new ReferenceValueEditor(getValueController(), this);
    if (referenceValueEditor.isReferenceValue()) {
        referenceValueEditor.createEditorSelector(dialogGroup);
    }
    return dialogGroup;
}
Also used : DBException(org.jkiss.dbeaver.DBException) Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) ReferenceValueEditor(org.jkiss.dbeaver.ui.data.editors.ReferenceValueEditor)

Aggregations

Label (org.eclipse.swt.widgets.Label)849 GridData (org.eclipse.swt.layout.GridData)709 GridLayout (org.eclipse.swt.layout.GridLayout)617 Composite (org.eclipse.swt.widgets.Composite)594 Text (org.eclipse.swt.widgets.Text)394 Button (org.eclipse.swt.widgets.Button)338 SelectionEvent (org.eclipse.swt.events.SelectionEvent)324 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)266 Group (org.eclipse.swt.widgets.Group)241 Combo (org.eclipse.swt.widgets.Combo)164 ModifyEvent (org.eclipse.swt.events.ModifyEvent)140 ModifyListener (org.eclipse.swt.events.ModifyListener)140 SelectionListener (org.eclipse.swt.events.SelectionListener)77 Table (org.eclipse.swt.widgets.Table)63 TableViewer (org.eclipse.jface.viewers.TableViewer)60 Point (org.eclipse.swt.graphics.Point)59 FormAttachment (org.eclipse.swt.layout.FormAttachment)47 FormData (org.eclipse.swt.layout.FormData)47 ArrayList (java.util.ArrayList)45 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)44