use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class SQLBuilderDialog method createDialogArea.
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
container = (Composite) super.createDialogArea(parent);
// container.setLayout(new GridLayout());
final SashForm mainSashForm = new SashForm(container, SWT.NONE | SWT.VERTICAL);
mainSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
final SashForm sashFormStructureAndEditor = new SashForm(mainSashForm, SWT.NONE);
final SashForm sashFormResultAndDetail = new SashForm(mainSashForm, SWT.NONE);
mainSashForm.setWeights(new int[] { 3, 1 });
createResult(sashFormResultAndDetail);
createDetail(sashFormResultAndDetail);
sashFormResultAndDetail.setWeights(new int[] { 4, 3 });
createDatabaseStructure(sashFormStructureAndEditor);
createSQLEditor(sashFormStructureAndEditor);
sashFormStructureAndEditor.setWeights(new int[] { 4, 6 });
if (connParameters.isFromRepository() && connParameters.getQueryObject() != null) {
structureComposite.openNewQueryEditor();
} else if (connParameters.isFromRepository() && connParameters.getMetadataTable() != null) {
structureComposite.openNewTableEditor();
} else {
structureComposite.openNewEditor();
}
// RefreshDetailCompositeAction refreshAction =
new RefreshDetailCompositeAction(structureComposite.getTreeViewer(), this.getShell());
return container;
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class RowGeneratorUI method init.
/**
* yzhang Comment method "init".
*
* @param fromDialog
*/
public void init(boolean fromDialog) {
uiManager = generatorManager.getUiManager();
final ExternalRowGeneratorUiProperties uiProperties = uiManager.getUiProperties();
addParentListeners(uiManager, uiProperties);
final Display display = rowGenUIParent.getDisplay();
GridLayout parentLayout = new GridLayout(1, true);
rowGenUIParent.setLayout(parentLayout);
addKeyListener(uiManager, display);
mainSashForm = new SashForm(rowGenUIParent, SWT.SMOOTH | SWT.VERTICAL);
GridData mainSashFormGridData = new GridData(GridData.FILL_BOTH);
mainSashForm.setLayoutData(mainSashFormGridData);
datasFlowViewSashForm = new SashForm(mainSashForm, SWT.SMOOTH | SWT.HORIZONTAL | SWT.BORDER);
datasFlowViewSashForm.setLayoutData(mainSashFormGridData);
datasFlowViewSashForm.setBackgroundMode(SWT.INHERIT_FORCE);
initBackgroundComponents();
// if (WindowSystem.isGTK()) {
// datasFlowViewSashForm.setBackground(display.getSystemColor(SWT.COLOR_DARK_GRAY));
// }
/* Create Schema Table Editor */
createSchemaComposite();
/* Create the tabs */
tabFolderEditors = new TabFolderEditors(mainSashForm, SWT.BORDER, externalNode, dataTableView);
tabFolderEditors.setRowGeneratorUI(this);
tabFolderEditors.getProcessPreview().refreshTablePreview(outputMetaTable.getListColumns(), null, true);
if (!fromDialog) {
new FooterComposite(this.rowGenUIParent, SWT.NONE, generatorManager);
}
dataTableView.getTable().addSelectionListener(new SelectionAdapter() {
/*
* (non-Java)
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@SuppressWarnings("unchecked")
@Override
public void widgetSelected(SelectionEvent e) {
updateFunParameter((Table) e.getSource());
}
});
dataTableView.getTable().addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
dataTableView.getTableViewerCreator().refresh();
}
@Override
public void focusLost(FocusEvent e) {
// TODO Auto-generated method stub
}
});
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class MultiSchemasUI method init.
public void init() {
uiParent.setLayout(new GridLayout());
Composite composite = new Composite(uiParent, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setLayout(new FillLayout());
ExpandBar bar = new ExpandBar(composite, SWT.V_SCROLL);
final Composite fileGroup = new Composite(bar, SWT.NONE);
createFileGroup(fileGroup);
final ExpandItem settingItem = new ExpandItem(bar, SWT.NONE, 0);
settingItem.setText(ExternalMultiSchemasUIProperties.SETTINGS_LABEL);
settingItem.setHeight(fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
settingItem.setControl(fileGroup);
settingItem.setExpanded(true);
allContentForm = new SashForm(bar, SWT.NONE);
createViewers(allContentForm);
final ExpandItem previewItem = new ExpandItem(bar, SWT.NONE, 1);
previewItem.setText(ExternalMultiSchemasUIProperties.PREVIEW_LABEL);
previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 100);
previewItem.setControl(allContentForm);
previewItem.setExpanded(true);
bar.addExpandListener(new ExpandListener() {
public void itemExpanded(ExpandEvent e) {
if (e.item != null && e.item instanceof ExpandItem) {
if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.PREVIEW_LABEL)) {
if (settingItem.getExpanded()) {
previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
} else {
previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
}
} else if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.SETTINGS_LABEL)) {
settingItem.setHeight(fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
}
}
}
public void itemCollapsed(ExpandEvent e) {
if (e.item != null && e.item instanceof ExpandItem) {
if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.PREVIEW_LABEL)) {
// settingItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y
// + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
} else if (((ExpandItem) e.item).getText().equals(ExternalMultiSchemasUIProperties.SETTINGS_LABEL)) {
previewItem.setHeight(allContentForm.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + fileGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
}
}
}
});
initFieldValues();
// listener
addFieldListeners();
addButtonListeners();
addFieldsListenersGroupFileSettings();
addFieldsListenersGroupsEscapeChar();
// preview
refreshPreview();
checkDialog();
// reload
reloadSchemaDataFromNode();
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class MapperUI method createCompositeContent.
public void createCompositeContent(MapperModel mapperModel) {
// long time1 = System.currentTimeMillis();
// CommandStack commandStack = new CommandStackForComposite(this.mapperUIParent);
// mapperManager.setCommandStack(commandStack);
updateBackgroundEnabled = false;
List<? extends IConnection> inConnections = mapperManager.getAbstractMapComponent().getIncomingConnections();
List<? extends IConnection> outConnections = mapperManager.getAbstractMapComponent().getOutgoingConnections();
// see bug 7471, record the precolumns value
for (IConnection conn : inConnections) {
conn.getMetadataTable();
if (conn.getMetadataTable() != null) {
List<IMetadataColumn> inputColumns = conn.getMetadataTable().getListColumns();
for (IMetadataColumn inputColumn : inputColumns) {
Set<String> columnSet = preColumnSet.get(conn);
if (columnSet == null) {
columnSet = new HashSet<String>();
preColumnSet.put(conn, columnSet);
}
columnSet.add(inputColumn.getLabel());
preColumnSet.put(conn, columnSet);
}
}
}
for (IConnection conn : outConnections) {
if (conn.getMetadataTable() != null) {
List<IMetadataColumn> outputColumns = conn.getMetadataTable().getListColumns();
for (IMetadataColumn outputColumn : outputColumns) {
Set<String> columnSet = preColumnSet.get(conn);
if (columnSet == null) {
columnSet = new HashSet<String>();
preColumnSet.put(conn, columnSet);
}
columnSet.add(outputColumn.getLabel());
preColumnSet.put(conn, columnSet);
}
}
}
final UIManager uiManager = mapperManager.getUiManager();
final ExternalMapperUiProperties uiProperties = uiManager.getUiProperties();
addParentListeners(uiManager, uiProperties);
bgColorLinksZone = ColorProviderMapper.getColor(ColorInfo.COLOR_BACKGROUND_LINKS_ZONE);
GridLayout parentLayout = new GridLayout(1, true);
mapperUIParent.setLayout(parentLayout);
addKeyListener(uiManager, display);
addBackgroundRefreshLimiters(display);
this.dropTargetOperationListener = new DropTargetOperationListener(mapperManager);
dropTargetOperationListener.addControl(this.mapperUIParent.getShell());
mainSashForm = new SashForm(mapperUIParent, SWT.SMOOTH | SWT.VERTICAL);
GridData mainSashFormGridData = new GridData(GridData.FILL_BOTH);
mainSashForm.setLayoutData(mainSashFormGridData);
datasFlowViewSashForm = new SashForm(mainSashForm, SWT.SMOOTH | SWT.HORIZONTAL | SWT.BORDER);
datasFlowViewSashForm.setBackgroundMode(SWT.INHERIT_FORCE);
initBackgroundComponents();
if (WindowSystem.isGTK()) {
datasFlowViewSashForm.setBackground(display.getSystemColor(SWT.COLOR_DARK_GRAY));
}
// dropTargetOperationListener.addControl(datasFlowViewSashForm);
// datasFlowViewSashForm.addControlListener(new ControlListener() {
//
// public void controlMoved(ControlEvent e) {
// }
//
// public void controlResized(ControlEvent e) {
// createBgImages();
// updateBackground(true, false);
// }
//
// });
/* Create the tabs */
tabFolderEditors = new TabFolderEditors(mainSashForm, SWT.BORDER, mapperManager);
createInputZoneWithTables(mapperModel, display);
createVarsZoneWithTables(mapperModel, display);
createOutputZoneWithTables(mapperModel, uiManager, display);
uiManager.parseAllExpressionsForAllTables();
mapperManager.getProblemsManager().checkProblemsForAllEntriesOfAllTables(true);
mapperManager.getProblemsManager().checkLookupExpressionProblem();
this.draggingInfosPopup = DraggingInfosPopup.getNewShell(this.mapperUIParent.getShell());
configureZoneScrollBars(display);
int[] weightsDatasFlowViewSashForm = uiProperties.getWeightsDatasFlowViewSashForm();
datasFlowViewSashForm.setWeights(weightsDatasFlowViewSashForm.length != 0 ? weightsDatasFlowViewSashForm : ExternalMapperUiProperties.DEFAULT_WEIGHTS_DATAS_FLOW_SASH_FORM);
int[] weightsMainSashForm = uiProperties.getWeightsMainSashForm();
weightsMainSashForm = weightsMainSashForm.length != 0 ? weightsMainSashForm : ExternalMapperUiProperties.DEFAULT_WEIGHTS_MAIN_SASH_FORM;
mainSashForm.setWeights(weightsMainSashForm);
footerComposite = new FooterComposite(this.mapperUIParent, SWT.NONE, mapperManager);
selectFirstInOutTablesView();
updateBackgroundEnabled = true;
updateBackground(true, false);
// List<DataMapTableView> inputsTablesView = uiManager.getInputsTablesView();
// for (DataMapTableView table : inputsTablesView) {
//
// table.showTableGlobalMap(false);
// table.showTableGlobalMap(true);
//
// // table.updateGridDataHeightForTableGlobalMap();
// // table.resizeAtExpandedSize();
// }
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class CpuDumpEditor method createCallerCalleePage.
/**
* Creates the caller/callee page.
*/
private void createCallerCalleePage() {
callersCalleesPageBook = new PageBook(getContainer(), SWT.NONE);
Label messageLabel = new Label(callersCalleesPageBook, SWT.WRAP);
messageLabel.setText(Messages.noCallersCalleesMessage);
SashForm sashForm = new SashForm(callersCalleesPageBook, SWT.NONE);
sashForm.setOrientation(SWT.VERTICAL);
sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
int page = addPage(callersCalleesPageBook);
createCallerViewer(sashForm, page);
createCalleeViewer(sashForm, page);
setPageText(page, Messages.callerCalleePageLabel);
setPageImage(page, getCallerCalleeImage());
callersCalleesPageBook.showPage(sashForm);
}
Aggregations