use of org.eclipse.swt.layout.GridLayout in project generator by mybatis.
the class AbstractGeneratorComposite method createFileNameBrowseButtons.
private void createFileNameBrowseButtons(Composite parent) {
new Label(parent, SWT.NONE);
Composite buttonComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
buttonComposite.setLayout(layout);
GridData gd = new GridData(SWT.END, SWT.CENTER, false, false);
buttonComposite.setLayoutData(gd);
buttonComposite.setFont(parent.getFont());
btnBrowseWorkplace = new Button(buttonComposite, SWT.NONE);
btnBrowseWorkplace.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
IResource chosenFile = chooseFileFromWorkspace();
if (chosenFile != null) {
IPath path = chosenFile.getFullPath();
//$NON-NLS-1$ //$NON-NLS-2$
txtFileName.setText("${workspace_loc:" + path.toString() + "}");
javaProjectName = GeneratorLaunchShortcut.getJavaProjectNameFromResource(chosenFile);
}
}
});
btnBrowseWorkplace.setText(Messages.FILE_PICKER_BROWSE_WORKSPACE);
btnBrowseFileSystem = new Button(buttonComposite, SWT.NONE);
btnBrowseFileSystem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
chooseFileFromFileSystem();
}
});
btnBrowseFileSystem.setText(Messages.FILE_PICKER_BROWSE_FILE_SYSTEM);
}
use of org.eclipse.swt.layout.GridLayout in project generator by mybatis.
the class AbstractGeneratorComposite method createFileNameGroup.
protected Composite createFileNameGroup(Composite parent, String groupText) {
Group group = new Group(parent, SWT.NONE);
group.setText(groupText);
GridLayout groupLayout = new GridLayout(2, false);
group.setLayout(groupLayout);
group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
group.setFont(parent.getFont());
createFileNameTextbox(group);
createFileNameBrowseButtons(group);
return group;
}
use of org.eclipse.swt.layout.GridLayout 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.layout.GridLayout in project mechanoid by robotoworks.
the class NewMechanoidElementPage method createControl.
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
// top level group
Composite topLevel = new Composite(parent, SWT.NONE);
topLevel.setLayout(new GridLayout());
topLevel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
topLevel.setFont(parent.getFont());
//PlatformUI.getWorkbench().getHelpSystem().setHelp(topLevel,
// IIDEHelpContextIds.NEW_FILE_WIZARD_PAGE);
createFields(topLevel, parent.getFont());
setControl(topLevel);
}
use of org.eclipse.swt.layout.GridLayout 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);
}
}
Aggregations