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);
}
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);
}
}
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);
}
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;
}
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;
}
Aggregations