use of org.eclipse.swt.widgets.TabFolder in project eclipse.platform.swt by eclipse.
the class Test_situational method test_createWidgets.
public void test_createWidgets() {
PerformanceMeter meter = createMeter("Create composites and widgets");
int samples;
Performance performance = Performance.getDefault();
performance.tagAsGlobalSummary(meter, "Create composites and widgets", Dimension.ELAPSED_PROCESS);
for (samples = 0; samples < 10; samples++) {
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
meter.start();
for (int i = 0; i < 50; i++) {
Composite c = new Composite(shell, SWT.NONE);
for (int j = 0; j < 10; j++) {
new Button(c, SWT.PUSH);
new Label(c, SWT.NONE);
new Scale(c, SWT.NONE);
new ProgressBar(c, SWT.NONE);
new List(c, SWT.NONE);
new Text(c, SWT.SINGLE);
new Text(c, SWT.MULTI);
new Slider(c, SWT.NONE);
new Tree(c, SWT.NONE);
new Table(c, SWT.NONE);
new TabFolder(c, SWT.NONE);
new Group(c, SWT.BORDER);
new Composite(c, SWT.NONE);
}
}
meter.stop();
shell.dispose();
while (display.readAndDispatch()) {
/*empty*/
}
}
disposeMeter(meter);
}
use of org.eclipse.swt.widgets.TabFolder in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_widgets_TabFolder method makeCleanEnvironment.
private void makeCleanEnvironment() {
// this method must be private or protected so the auto-gen tool keeps it
tabFolder = new TabFolder(shell, 0);
setWidget(tabFolder);
}
use of org.eclipse.swt.widgets.TabFolder in project cubrid-manager by CUBRID.
the class TableEditorPart method createPartControl.
public void createPartControl(Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
{
final GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 500;
gd.widthHint = 800;
composite.setLayoutData(gd);
GridLayout gl = new GridLayout();
gl.numColumns = 1;
composite.setLayout(gl);
}
tabFolder = new TabFolder(composite, SWT.NONE);
{
final GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 469;
gd.widthHint = 621;
tabFolder.setLayoutData(gd);
}
tabFolder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
TabItem[] tabItems = tabFolder.getSelection();
if (tabItems == null || tabItems.length == 0 || tabItems[0] == null) {
return;
}
String tabTitle = tabItems[0].getText();
if (!StringUtil.isEqual(tabTitle, Messages.infoSQLScriptTab)) {
return;
}
String tableName = tableNameText.getText();
newSchemaInfo.setClassname(tableName);
String owner = ownerCombo.getText();
newSchemaInfo.setOwner(owner);
if (reuseOIDBtn != null) {
newSchemaInfo.setReuseOid(reuseOIDBtn.getSelection());
}
StringBuilder sql = new StringBuilder();
if (oldSchemaInfo != null) {
sql.append(schemaDDL.getSchemaDDL(oldSchemaInfo));
for (int i = 0; i < 3; i++) {
sql.append(StringUtil.NEWLINE);
}
}
String alterSql = schemaDDL.getSchemaDDL(oldSchemaInfo, newSchemaInfo);
if (alterSql != null) {
sql.append(alterSql);
}
sql.append(getChangeOwnerDDL());
sqlText.setText(sql.toString());
}
});
editorAdaptor = new TableEditorAdaptor(this);
createGeneralTabItem(tabFolder);
createFkIndexTabItem(tabFolder);
createPartitionTabItem(tabFolder);
createSqlScriptTabItem(tabFolder);
toolTip = new ToolTip(columnsTable.getShell(), SWT.NONE);
toolTip.setAutoHide(true);
errorBaloon = new ToolTip(tabFolder.getShell(), SWT.NONE);
errorBaloon.setAutoHide(true);
init();
if (isNewTableFlag) {
tableNameText.setFocus();
}
Composite btnComposite = new Composite(composite, SWT.NONE);
{
GridLayout gl = new GridLayout();
gl.numColumns = 2;
btnComposite.setLayout(gl);
btnComposite.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false));
}
okBtn = new Button(btnComposite, SWT.NONE);
{
GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
gd.minimumWidth = 80;
gd.widthHint = 80;
okBtn.setLayoutData(gd);
}
okBtn.setText(Messages.btnOK);
okBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
okPressed();
}
});
Button cancelBtn = new Button(btnComposite, SWT.NONE);
{
GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
gd.minimumWidth = 80;
gd.widthHint = 80;
cancelBtn.setLayoutData(gd);
}
cancelBtn.setText(Messages.btnCancel);
cancelBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
if (!CommonUITool.openConfirmBox(Messages.msgCancelEditTableConfirm)) {
return;
}
IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
if (page != null) {
page.closeEditor(editor, false);
}
}
});
addNewColumn();
if (showDefaultType == EditTableAction.MODE_INDEX_EDIT) {
tabFolder.setSelection(1);
}
}
use of org.eclipse.swt.widgets.TabFolder in project cubrid-manager by CUBRID.
the class CreateOrEditSerialDialog method createDialogArea.
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.numColumns = 2;
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);
tabFolder = new TabFolder(composite, SWT.NONE);
tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
layout = new GridLayout();
tabFolder.setLayout(layout);
TabItem item = new TabItem(tabFolder, SWT.NONE);
item.setText(Messages.grpGeneral);
composite = createGeneralInfoComp();
item.setControl(composite);
item = new TabItem(tabFolder, SWT.NONE);
item.setText(Messages.grpSqlScript);
composite = createSqlScriptComposite();
item.setControl(composite);
tabFolder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
if (tabFolder.getSelectionIndex() == 0) {
serialNameText.setFocus();
} else if (tabFolder.getSelectionIndex() == tabFolder.getItemCount() - 1) {
sqlScriptText.setText(getSQLScript());
}
}
});
initialize();
if (editedNode == null) {
setTitle(Messages.titleCreateSerialDialog);
setMessage(Messages.msgCreateSerialDialog);
} else {
setTitle(Messages.titleEditSerialDialog);
setMessage(Messages.msgEditSerialDialog);
}
return parentComp;
}
use of org.eclipse.swt.widgets.TabFolder in project dbeaver by serge-rider.
the class ConnectionPageNetwork method createControl.
@Override
public void createControl(Composite parent) {
handlersFolder = new TabFolder(parent, SWT.TOP);
handlersFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
setControl(handlersFolder);
}
Aggregations