use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.
the class AbstractSQLExecution method displayProgress.
/**
* Display progress bar on tab until results are ready.
*/
protected final void displayProgress() {
clearCanvas();
// set label to running
//$NON-NLS-1$
parentTab.setText(Messages.getString("AbstractSQLExecution.Running"));
GridLayout gLayout = new GridLayout();
gLayout.numColumns = 2;
gLayout.marginLeft = 0;
gLayout.horizontalSpacing = 0;
gLayout.verticalSpacing = 0;
gLayout.marginWidth = 0;
gLayout.marginHeight = 50;
composite.setLayout(gLayout);
group = new Group(composite, SWT.NULL);
group.setLayout(new GridLayout());
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
group.setText(progressMessage);
// add progress bar
Composite pbComposite = new Composite(group, SWT.FILL);
FillLayout pbLayout = new FillLayout();
pbLayout.marginHeight = 2;
pbLayout.marginWidth = 5;
pbComposite.setLayout(pbLayout);
pbComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
ProgressBar pb = new ProgressBar(pbComposite, SWT.HORIZONTAL | SWT.INDETERMINATE | SWT.BORDER);
pb.setVisible(true);
pb.setEnabled(true);
pbComposite.layout();
composite.layout();
}
use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.
the class DBDetailsComposite method setSelectedNode.
/**
* DOC qianbing Comment method "setSelectedNode". Displays the message input,if inputs null,it will show default
* message.
*
* @param node INode
* @param message String
*/
public void setSelectedNode(INode node, String message) {
Composite parent = panel.getParent();
panel.dispose();
panel = new Composite(parent, SWT.NONE);
panel.setLayout(new FillLayout());
if (node == null) {
Label label = new Label(panel, SWT.FILL | SWT.WRAP);
if (message == null) {
// add default message
//$NON-NLS-1$
message = Messages.getString("DatabaseDetailView.NoSelection");
}
label.setText(message);
} else {
// add tabs
DetailTabManager.createTabs(panel, node);
}
panel.layout();
panel.getParent().layout();
panel.redraw();
}
use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.
the class BatchExpressionBuilderDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
container = new Composite(parent, SWT.NONE);
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);
container.setLayout(layout);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
applyDialogFont(container);
final SashForm sashForm = new SashForm(container, SWT.NONE);
sashForm.setOrientation(SWT.VERTICAL);
final Composite lowerComposite = new Composite(sashForm, SWT.NONE);
lowerComposite.setLayout(new FillLayout());
categoryComposite = new BatchCategoryComposite(lowerComposite, SWT.NONE, manager);
final Composite upperComposite = new Composite(sashForm, SWT.NONE);
upperComposite.setLayout(new FillLayout());
final SashForm upperSashform = new SashForm(upperComposite, SWT.NONE);
expressionComposite = new BatchExpressionComposite(this, upperSashform, SWT.NONE, dataBean);
expressionComposite.setExpression(defaultExpression, true);
final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
sashForm.setLayoutData(gridData);
sashForm.setWeights(new int[] { 4, 1 });
return container;
}
use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.
the class BRMSSchemaOutputDialog method createDialogArea.
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
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.setLayoutData(new GridData(GridData.FILL_BOTH));
applyDialogFont(composite);
// Composite composite = (Composite) super.createDialogArea(parent);
composite.setLayout(new FillLayout());
tableEditor = new MetadataEmfTableEditor("");
MetadataTable metadataTable = form.getMetadataOutputTable();
tableEditor.setMetadataTable(metadataTable);
tableEditor.removeAll();
// List<MetadataColumn> list = (List<MetadataColumn>) metadataTable.getColumns();
// tableEditor.addAll(list);
// if (list.size() > 0) {
// for (MetadataColumn column : list) {
// boolean toAdd = true;
// for (int i = 0; i < list.size(); i++) {
// String label = column.getLabel();
// String curLabel = list.get(i).getLabel();
// if (label.equals(curLabel)) {
// toAdd = false;
// break;
// }
// }
// if (toAdd) {
// tableEditor.add(column);
// }
// }
// }
tableEditorView = new MetadataEmfTableEditorView(composite, SWT.NONE);
tableEditorView.setMetadataEditor(tableEditor);
addListeners();
return composite;
}
use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.
the class StatLogsAndImplicitcontextTreeViewPage method createStatTree.
private void createStatTree(Composite composite) {
//$NON-NLS-1$
Group g = widgetFactory.createGroup(composite, Messages.getString("StatsAndLogsComposite.StatsLogsSettings"));
GridData gd = new GridData(GridData.FILL_BOTH);
g.setLayoutData(gd);
g.setLayout(new FillLayout());
statViewer = new CheckboxRepositoryTreeViewer(g, SWT.MULTI | SWT.V_SCROLL);
statContentProvider = new AllJobContentProvider(repositoryView);
statViewer.setContentProvider(statContentProvider);
statViewer.setLabelProvider(new RepositoryLabelProvider(repositoryView));
statViewer.setSorter(repositoryView.getViewer().getSorter());
IViewSite viewSite = repositoryView.getViewSite();
statViewer.setInput(viewSite);
// This only tree listener aim is to change open/close icons on folders :
statViewer.addTreeListener(new ITreeViewerListener() {
@Override
public void treeCollapsed(TreeExpansionEvent event) {
RepositoryNode node = (RepositoryNode) event.getElement();
if (node.getType().equals(ENodeType.SIMPLE_FOLDER)) {
TreeItem item = getObject(statViewer.getTree(), event.getElement());
if (item != null) {
item.setImage(ImageProvider.getImage(ECoreImage.FOLDER_CLOSE_ICON));
}
}
}
@Override
public void treeExpanded(TreeExpansionEvent event) {
RepositoryNode node = (RepositoryNode) event.getElement();
if (node.getType().equals(ENodeType.SIMPLE_FOLDER)) {
TreeItem item = getObject(statViewer.getTree(), event.getElement());
if (item != null) {
item.setImage(ImageProvider.getImage(ECoreImage.FOLDER_OPEN_ICON));
}
}
}
});
statViewer.addCheckStateListener(new ICheckStateListener() {
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
RepositoryNode node = (RepositoryNode) event.getElement();
List<RepositoryNode> objects = new ArrayList<RepositoryNode>();
processItems(objects, node);
if (event.getChecked()) {
statAddedObjects.addAll(objects);
statRemovedObjects.removeAll(objects);
statCheckedObjects.addAll(objects);
} else {
statAddedObjects.removeAll(objects);
statRemovedObjects.addAll(objects);
statCheckedObjects.removeAll(objects);
}
// set checked
statViewer.setCheckedElements(statCheckedObjects.toArray());
// viewer.refresh();
}
});
RepositoryNode[] nodes = statContentProvider.getContents();
List<RepositoryNode> objects = new ArrayList<RepositoryNode>();
if (nodes != null) {
for (RepositoryNode n : nodes) {
processItems(objects, n);
for (RepositoryNode node : objects) {
if (isStatUseProjectSetting(node)) {
if (!statCheckedObjects.contains(node)) {
statCheckedObjects.add(node);
}
}
}
}
}
statViewer.setCheckedElements(statCheckedObjects.toArray());
if (nodes != null) {
statViewer.setExpandedElements(nodes);
}
}
Aggregations