use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class JSONFileStep2Form method addFields.
@Override
protected void addFields() {
// compositeFile Main Fields
// Composite mainComposite = Form.startNewGridLayout(this, 1);
SashForm mainComposite = new SashForm(this, SWT.VERTICAL | SWT.SMOOTH);
mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
if (firstTimeWizardOpened == null) {
firstTimeWizardOpened = Boolean.TRUE;
} else if (firstTimeWizardOpened.equals(Boolean.TRUE)) {
firstTimeWizardOpened = Boolean.FALSE;
}
// Splitter
this.jsonToSchemaSash = new SashForm(mainComposite, SWT.HORIZONTAL | SWT.SMOOTH);
jsonToSchemaSash.setLayoutData(new GridData(GridData.FILL_BOTH));
jsonToSchemaSash.setBackgroundMode(SWT.INHERIT_FORCE);
addGroupJSONFileSettings(jsonToSchemaSash, 400, 110);
addGroupSchemaTarget(jsonToSchemaSash, 300, 110);
jsonToSchemaSash.setWeights(new int[] { 40, 60 });
SashForm sash2 = new SashForm(mainComposite, SWT.HORIZONTAL | SWT.SMOOTH);
sash2.setLayoutData(new GridData(GridData.FILL_BOTH));
addGroupFileViewer(sash2, 400, 210);
if (!isInWizard()) {
// Bottom Button
Composite compositeBottomButton = Form.startNewGridLayout(this, 2, false, SWT.CENTER, SWT.CENTER);
// Button Cancel
cancelButton = new UtilsButton(compositeBottomButton, "Cancel", WIDTH_BUTTON_PIXEL, HEIGHT_BUTTON_PIXEL);
}
addUtilsButtonListeners();
mainComposite.setWeights(new int[] { 60, 40 });
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class AddListDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
// Composite baseCom = (Composite) super.createDialogArea(parent);
Composite createDialogArea = (Composite) super.createDialogArea(parent);
createDialogArea.setLayout(new FillLayout());
SashForm baseCom = new SashForm(createDialogArea, SWT.VERTICAL | SWT.BORDER);
treeViewer = new TreeViewer(baseCom, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
tree = treeViewer.getTree();
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
// Paramater Name Column
TreeColumn column1 = new TreeColumn(tree, SWT.LEFT);
column1.setText("Parameter Name");
column1.setWidth(200);
// Array Index Column
TreeColumn column2 = new TreeColumn(tree, SWT.CENTER);
column2.setText("Array Index");
column2.setWidth(100);
treeViewer.setColumnProperties(new String[] { NAME, INDEX });
CellEditor editor = new TextCellEditor(treeViewer.getTree());
// CellEditor nameEditor = new ComboBoxCellEditor(treeViewer.getTree());
treeViewer.setCellEditors(new CellEditor[] { null, editor });
treeViewer.setCellModifier(new ICellModifier() {
public boolean canModify(Object element, String property) {
if (element instanceof ParameterInfo) {
ParameterInfo para = (ParameterInfo) element;
if (INDEX.equals(property) && para.getArraySize() != 0) {
// if item is array it can edit.
return true;
}
}
return false;
}
public Object getValue(Object element, String property) {
if (element instanceof ParameterInfo) {
ParameterInfo para = (ParameterInfo) element;
if (INDEX.equals(property)) {
return para.getIndex() == null ? "" : para.getIndex();
} else if (NAME.equals(property)) {
return para.getName();
}
}
return null;
}
public void modify(Object element, String property, Object value) {
if (element instanceof TreeItem) {
ParameterInfo para = (ParameterInfo) ((TreeItem) element).getData();
if (INDEX.equals(property)) {
para.setIndex(value.toString());
}
}
treeViewer.refresh();
}
});
// DrillDownAdapter adapter = new DrillDownAdapter(treeView);
treeViewer.setContentProvider(new WebServiceTreeContentProvider());
treeViewer.setLabelProvider(new WebServiceTreeLabelProvider());
treeViewer.setInput(para);
treeViewer.addSelectionChangedListener(selectAction);
// tree.addSelectionListener(new SelectionAdapter() {
//
// @Override
// public void widgetSelected(SelectionEvent e) {
// TreeItem[] selects = tree.getSelection();
// ISelection select = (ISelection) treeViewer.getSelection();
// Object obj = ((IStructuredSelection) select).getFirstElement();
// if (obj instanceof ParameterInfo) {
// // if (((ParameterInfo) obj).getParameterInfos().size() > 0) {
// // // ErrorDialog dialog = new ErrorDialog(parentShell, "", "", null, 0);
// // // dialog.open();
// // selectedParaInfo = null;
// // } else {
// selectedParaInfo = (ParameterInfo) obj;
// // }
// }
// }
//
// });
treeViewer.getTree().addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
createAllTypeDialog();
}
});
return baseCom;
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class JSONFileOutputStep2Form method addFields.
@Override
protected void addFields() {
mainSashFormComposite = new SashForm(this, SWT.HORIZONTAL | SWT.SMOOTH);
mainSashFormComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
mainSashFormComposite.setBackgroundMode(SWT.INHERIT_FORCE);
addSchemaViewer(mainSashFormComposite, 300, 100);
addJSONFileViewer(mainSashFormComposite, 400, 100);
mainSashFormComposite.setWeights(new int[] { 40, 60 });
linker = new JSONFileSchema2TreeLinker(mainSashFormComposite);
linker.setForm(this);
linker.init(schemaViewer.getTable(), JSONViewer);
JSONTree2SchemaLinker oppositeLinker = new JSONTree2SchemaLinker(mainSashFormComposite);
oppositeLinker.setConnection(getConnection());
oppositeLinker.setDelegateLinker(linker);
oppositeLinker.init(JSONViewer, schemaViewer);
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class JobScriptsExportWizardPage method createControl.
/**
* (non-Javadoc) Method declared on IDialogPage.
*/
/**
* (non-Javadoc) Method declared on IDialogPage.
*/
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
SashForm sash = createExportTree(parent);
GridLayout layout = new GridLayout();
layout.verticalSpacing = 0;
layout.marginHeight = 0;
layout.marginBottom = 0;
Composite composite = new Composite(sash, SWT.NONE);
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setFont(parent.getFont());
createDestinationGroup(composite);
if (!isMultiNodes()) {
createJobVersionGroup(composite);
}
createUnzipOptionGroup(composite);
createOptionsGroup(composite);
// ie.- local
restoreResourceSpecificationWidgetValues();
// ie.- subclass hook
restoreWidgetValues();
updateWidgetEnablements();
setPageComplete(determinePageCompletion());
// should not initially have error message
setErrorMessage(null);
setControl(sash);
sash.setWeights(new int[] { 0, 2, 23 });
giveFocusToDestination();
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class JobScriptsExportWizardPage method createExportTree.
protected SashForm createExportTree(Composite parent) {
// Using a protected method to provide the tree. LiXiaopeng 2011-9-21
treeViewer = getExportTree();
SashForm sashForm = treeViewer.createContents(parent);
treeViewer.addCheckStateListener(checkStateListener);
return sashForm;
}
Aggregations