use of org.eclipse.swt.layout.GridLayout in project dbeaver by serge-rider.
the class BaseAuthDialog method createDialogArea.
@Override
protected Composite createDialogArea(Composite parent) {
Composite addrGroup = new Composite(parent, SWT.NONE);
GridLayout gl = new GridLayout(1, false);
gl.marginHeight = 10;
gl.marginWidth = 10;
addrGroup.setLayout(gl);
GridData gd = new GridData(GridData.FILL_BOTH);
addrGroup.setLayoutData(gd);
{
Group credGroup = new Group(addrGroup, SWT.NONE);
credGroup.setText(CoreMessages.dialog_connection_auth_group_user_cridentials);
gl = new GridLayout(2, false);
gl.marginHeight = 5;
gl.marginWidth = 5;
credGroup.setLayout(gl);
gd = new GridData(GridData.FILL_BOTH);
credGroup.setLayoutData(gd);
if (!passwordOnly) {
Label usernameLabel = new Label(credGroup, SWT.NONE);
usernameLabel.setText(CoreMessages.dialog_connection_auth_label_username);
usernameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
usernameText = new Text(credGroup, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 120;
//gd.horizontalSpan = 3;
usernameText.setLayoutData(gd);
if (authInfo.getUserName() != null) {
usernameText.setText(authInfo.getUserName());
}
}
Label passwordLabel = new Label(credGroup, SWT.NONE);
passwordLabel.setText(CoreMessages.dialog_connection_auth_label_password);
passwordLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
passwordText = new Text(credGroup, SWT.BORDER | SWT.PASSWORD);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.grabExcessHorizontalSpace = true;
passwordText.setLayoutData(gd);
if (authInfo.getUserPassword() != null && authInfo.isSavePassword()) {
passwordText.setText(authInfo.getUserPassword());
}
}
savePasswordCheck = new Button(addrGroup, SWT.CHECK);
savePasswordCheck.setText(CoreMessages.dialog_connection_auth_checkbox_save_password);
gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
savePasswordCheck.setLayoutData(gd);
savePasswordCheck.setSelection(authInfo.isSavePassword());
if (passwordOnly || !CommonUtils.isEmpty(usernameText.getText())) {
passwordText.setFocus();
}
return addrGroup;
}
use of org.eclipse.swt.layout.GridLayout in project dbeaver by serge-rider.
the class ConnectionPageAbstract method createDriverPanel.
protected void createDriverPanel(Composite parent) {
int numColumns = ((GridLayout) parent.getLayout()).numColumns;
Composite panel = UIUtils.createPlaceholder(parent, 4, 5);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = numColumns;
panel.setLayoutData(gd);
Composite placeholder = UIUtils.createPlaceholder(panel, 1);
gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_END);
gd.horizontalSpan = 4;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
placeholder.setLayoutData(gd);
if (!site.isNew() && !site.getDriver().isEmbedded()) {
Link netConfigLink = new Link(panel, SWT.NONE);
netConfigLink.setText("<a>Network settings (SSH, SSL, Proxy, ...)</a>");
netConfigLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
site.openSettingsPage(ConnectionPageNetwork.PAGE_NAME);
}
});
gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
gd.horizontalSpan = 4;
netConfigLink.setLayoutData(gd);
}
Label divLabel = new Label(panel, SWT.SEPARATOR | SWT.HORIZONTAL);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 4;
divLabel.setLayoutData(gd);
Label driverLabel = new Label(panel, SWT.NONE);
driverLabel.setText(CoreMessages.dialog_connection_driver);
gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
driverLabel.setLayoutData(gd);
driverText = new Text(panel, SWT.READ_ONLY);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
//gd.widthHint = 200;
driverText.setLayoutData(gd);
Button driverButton = new Button(panel, SWT.PUSH);
driverButton.setText(CoreMessages.dialog_connection_edit_driver_button);
gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
driverButton.setLayoutData(gd);
driverButton.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
if (site.openDriverEditor()) {
updateDriverInfo(site.getDriver());
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
}
});
}
use of org.eclipse.swt.layout.GridLayout in project dbeaver by serge-rider.
the class DataFormatProfilesEditDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
getShell().setText(CoreMessages.dialog_data_format_profiles_title);
Composite group = new Composite(parent, SWT.NONE);
group.setLayout(new GridLayout(1, false));
group.setLayoutData(new GridData(GridData.FILL_BOTH));
profileList = new org.eclipse.swt.widgets.List(group, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 300;
gd.heightHint = 200;
profileList.setLayoutData(gd);
profileList.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
getButton(DELETE_ID).setEnabled(profileList.getSelectionIndex() >= 0);
}
});
loadProfiles();
return parent;
}
use of org.eclipse.swt.layout.GridLayout in project dbeaver by serge-rider.
the class ExasolExportTableToolDialog method createControls.
@Override
protected void createControls(final Composite parent) {
Group optionsGroup = UIUtils.createControlGroup(parent, ExasolMessages.dialog_table_tools_options, 1, 0, 0);
optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite composite = new Composite(optionsGroup, 2);
composite.setLayout(new GridLayout(2, false));
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
// Directory select Button
btSelectDirectory = UIUtils.createPushButton(composite, ExasolMessages.dialog_table_open_output_directory, null);
btSelectDirectory.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
final DirectoryDialog dialog = new DirectoryDialog(parent.getShell());
final String directory = dialog.open();
if (directory != null) {
selectedDirectory.setVisible(true);
selectedDirectory.setText(directory + File.separatorChar);
} else {
selectedDirectory.setVisible(false);
}
updateSQL();
}
});
//label for selected directory
selectedDirectory = UIUtils.createLabel(composite, "");
selectedDirectory.setVisible(false);
//file template
filename = "${schema}_${table}_${date}";
txFileName = UIUtils.createLabelText(composite, ExasolMessages.dialog_table_tools_file_template, filename);
txFileName.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent arg0) {
filename = txFileName.getText();
updateSQL();
}
});
// compress output
btSelectCompress = UIUtils.createCheckbox(composite, ExasolMessages.dialog_table_tools_export_compress, false);
btSelectCompress.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateSQL();
}
});
// PlaceHolder
UIUtils.createPlaceholder(composite, 1);
// include column headings
btInclColNames = UIUtils.createCheckbox(composite, ExasolMessages.dialog_table_tools_column_heading, true);
btInclColNames.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateSQL();
}
});
// PlaceHolder
UIUtils.createPlaceholder(composite, 1);
// encoding combo
cbEncoding = UIUtils.createLabelCombo(composite, ExasolMessages.dialog_table_tools_encoding, SWT.DROP_DOWN | SWT.READ_ONLY);
for (String enc : ExasolConstants.encodings) {
cbEncoding.add(enc);
}
cbEncoding.select(0);
encoding = ExasolConstants.encodings.get(0);
cbEncoding.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
encoding = ExasolConstants.encodings.get(cbEncoding.getSelectionIndex());
updateSQL();
}
});
// row seperator
cbRowSep = UIUtils.createLabelCombo(composite, ExasolMessages.dialog_table_tools_string_sep_mode, SWT.DROP_DOWN | SWT.READ_ONLY);
for (String mode : ExasolConstants.rowSeperators) {
cbRowSep.add(mode);
}
cbRowSep.select(0);
rowSep = ExasolConstants.rowSeperators.get(0);
cbRowSep.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
rowSep = ExasolConstants.rowSeperators.get(cbRowSep.getSelectionIndex());
updateSQL();
}
});
// string sep mode
cbStringSepMode = UIUtils.createLabelCombo(composite, ExasolMessages.dialog_table_tools_string_sep_mode, SWT.DROP_DOWN | SWT.READ_ONLY);
for (String mode : ExasolConstants.stringSepModes) {
cbStringSepMode.add(mode);
}
cbStringSepMode.select(0);
sepMode = ExasolConstants.stringSepModes.get(0);
cbStringSepMode.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
sepMode = ExasolConstants.stringSepModes.get(cbStringSepMode.getSelectionIndex());
updateSQL();
}
});
// column sep
txColSep = UIUtils.createLabelText(composite, ExasolMessages.dialog_table_tools_column_sep, ";");
txColSep.setTextLimit(1);
txColSep.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent arg0) {
updateSQL();
}
});
// string sep
txStringSep = UIUtils.createLabelText(composite, ExasolMessages.dialog_table_tools_string_sep, "\"");
txStringSep.setTextLimit(1);
txStringSep.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent arg0) {
updateSQL();
}
});
createObjectsSelector(parent);
}
use of org.eclipse.swt.layout.GridLayout in project dbeaver by serge-rider.
the class ExasolImportTableToolDialog method createControls.
@Override
protected void createControls(final Composite parent) {
Group optionsGroup = UIUtils.createControlGroup(parent, ExasolMessages.dialog_table_tools_options, 1, 0, 0);
optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite composite = new Composite(optionsGroup, 2);
composite.setLayout(new GridLayout(2, false));
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
// Directory select Button
btSelectDirectory = UIUtils.createPushButton(composite, ExasolMessages.dialog_table_open_output_directory, null);
btSelectDirectory.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
final DirectoryDialog dialog = new DirectoryDialog(parent.getShell());
final String directory = dialog.open();
if (directory != null) {
selectedDirectory.setVisible(true);
selectedDirectory.setText(directory + File.separatorChar);
} else {
selectedDirectory.setVisible(false);
}
updateSQL();
}
});
//label for selected directory
selectedDirectory = UIUtils.createLabel(composite, "");
selectedDirectory.setVisible(false);
//file template
filename = "${schema}_${table}_${date}";
txFileName = UIUtils.createLabelText(composite, ExasolMessages.dialog_table_tools_file_template, filename);
txFileName.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent arg0) {
filename = txFileName.getText();
updateSQL();
}
});
// compress output
btSelectCompress = UIUtils.createCheckbox(composite, ExasolMessages.dialog_table_tools_export_compress, false);
btSelectCompress.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateSQL();
}
});
// PlaceHolder
UIUtils.createPlaceholder(composite, 1);
// include column headings
btInclColNames = UIUtils.createCheckbox(composite, ExasolMessages.dialog_table_tools_column_heading, true);
btInclColNames.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateSQL();
}
});
// PlaceHolder
UIUtils.createPlaceholder(composite, 1);
// encoding combo
cbEncoding = UIUtils.createLabelCombo(composite, ExasolMessages.dialog_table_tools_encoding, SWT.DROP_DOWN | SWT.READ_ONLY);
for (String enc : ExasolConstants.encodings) {
cbEncoding.add(enc);
}
cbEncoding.select(0);
encoding = ExasolConstants.encodings.get(0);
cbEncoding.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
encoding = ExasolConstants.encodings.get(cbEncoding.getSelectionIndex());
updateSQL();
}
});
// row seperator
cbRowSep = UIUtils.createLabelCombo(composite, ExasolMessages.dialog_table_tools_string_sep_mode, SWT.DROP_DOWN | SWT.READ_ONLY);
for (String mode : ExasolConstants.rowSeperators) {
cbRowSep.add(mode);
}
cbRowSep.select(0);
rowSep = ExasolConstants.rowSeperators.get(0);
cbRowSep.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
rowSep = ExasolConstants.rowSeperators.get(cbRowSep.getSelectionIndex());
updateSQL();
}
});
// column sep
txColSep = UIUtils.createLabelText(composite, ExasolMessages.dialog_table_tools_column_sep, ";");
txColSep.setTextLimit(1);
txColSep.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent arg0) {
updateSQL();
}
});
// string sep
txStringSep = UIUtils.createLabelText(composite, ExasolMessages.dialog_table_tools_string_sep, "\"");
txStringSep.setTextLimit(1);
txStringSep.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent arg0) {
updateSQL();
}
});
createObjectsSelector(parent);
}
Aggregations