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