use of org.eclipse.swt.widgets.Text 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.Text in project dbeaver by serge-rider.
the class SelectDataSourceDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
getShell().setText(CoreMessages.dialog_select_datasource_title);
Composite group = (Composite) super.createDialogArea(parent);
GridData gd = new GridData(GridData.FILL_BOTH);
group.setLayoutData(gd);
DBeaverCore core = DBeaverCore.getInstance();
DBNNode rootNode = null;
if (project != null) {
DBNProject projectNode = core.getNavigatorModel().getRoot().getProject(project);
if (projectNode != null) {
rootNode = projectNode.getDatabases();
}
}
if (rootNode == null) {
rootNode = core.getNavigatorModel().getRoot();
}
DatabaseNavigatorTree dataSourceTree = new DatabaseNavigatorTree(group, rootNode, SWT.SINGLE | SWT.BORDER, false);
dataSourceTree.setLayoutData(new GridData(GridData.FILL_BOTH));
final Text descriptionText = new Text(group, SWT.READ_ONLY);
descriptionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
dataSourceTree.getViewer().addFilter(new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return element instanceof DBNProject || element instanceof DBNProjectDatabases || element instanceof DBNLocalFolder || element instanceof DBNDataSource;
}
});
dataSourceTree.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection structSel = (IStructuredSelection) event.getSelection();
Object selNode = structSel.isEmpty() ? null : structSel.getFirstElement();
if (selNode instanceof DBNDataSource) {
dataSource = ((DBNDataSource) selNode).getObject();
getButton(IDialogConstants.OK_ID).setEnabled(true);
String description = dataSource.getDescription();
if (description == null) {
description = dataSource.getName();
}
descriptionText.setText(description);
} else {
dataSource = null;
getButton(IDialogConstants.OK_ID).setEnabled(false);
}
}
});
dataSourceTree.getViewer().addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
if (getButton(IDialogConstants.OK_ID).isEnabled()) {
okPressed();
}
}
});
return group;
}
use of org.eclipse.swt.widgets.Text in project dbeaver by serge-rider.
the class ViewExceptionDialog method createDialogArea.
@Override
protected Composite createDialogArea(Composite parent) {
Composite composite = super.createDialogArea(parent);
UIUtils.createControlLabel(composite, "Stacktrace");
Text stText = new Text(composite, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY);
StringWriter sw = new StringWriter();
PrintWriter buffer = new PrintWriter(sw, true);
error.printStackTrace(buffer);
stText.setText(sw.toString());
return composite;
}
use of org.eclipse.swt.widgets.Text in project dbeaver by serge-rider.
the class EditTextDialog method createDialogArea.
@Override
protected Composite createDialogArea(Composite parent) {
Composite composite = super.createDialogArea(parent);
createControlsBeforeText(composite);
textControl = new Text(composite, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
if (text != null) {
textControl.setText(text);
}
textControl.setEditable(!readonly);
GridData gd = new GridData(GridData.FILL_BOTH);
if (textWidth > 0) {
gd.widthHint = textWidth;
}
if (textHeight > 0) {
gd.heightHint = textHeight;
}
gd.minimumHeight = 100;
gd.minimumWidth = 100;
textControl.setLayoutData(gd);
return composite;
}
use of org.eclipse.swt.widgets.Text in project dbeaver by serge-rider.
the class AcceptLicenseDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
getShell().setText(title);
Composite composite = (Composite) super.createDialogArea(parent);
UIUtils.createControlLabel(composite, title);
Text textControl = new Text(composite, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
textControl.setText(license);
textControl.setEditable(false);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 400;
gd.heightHint = 300;
gd.minimumHeight = 100;
gd.minimumWidth = 100;
textControl.setLayoutData(gd);
return parent;
}
Aggregations