Search in sources :

Example 11 with FillLayout

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();
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) ProgressBar(org.eclipse.swt.widgets.ProgressBar)

Example 12 with FillLayout

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();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 13 with FillLayout

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;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 14 with FillLayout

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;
}
Also used : MetadataEmfTableEditorView(org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) MetadataEmfTableEditor(org.talend.core.ui.metadata.editor.MetadataEmfTableEditor) GridData(org.eclipse.swt.layout.GridData) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 15 with FillLayout

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);
    }
}
Also used : Group(org.eclipse.swt.widgets.Group) TreeItem(org.eclipse.swt.widgets.TreeItem) ICheckStateListener(org.eclipse.jface.viewers.ICheckStateListener) ITreeViewerListener(org.eclipse.jface.viewers.ITreeViewerListener) ArrayList(java.util.ArrayList) FillLayout(org.eclipse.swt.layout.FillLayout) RepositoryLabelProvider(org.talend.core.repository.ui.view.RepositoryLabelProvider) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) IViewSite(org.eclipse.ui.IViewSite) CheckboxRepositoryTreeViewer(org.talend.repository.viewer.ui.viewer.CheckboxRepositoryTreeViewer) GridData(org.eclipse.swt.layout.GridData) List(java.util.List) ArrayList(java.util.ArrayList) CheckStateChangedEvent(org.eclipse.jface.viewers.CheckStateChangedEvent) TreeExpansionEvent(org.eclipse.jface.viewers.TreeExpansionEvent)

Aggregations

FillLayout (org.eclipse.swt.layout.FillLayout)688 Composite (org.eclipse.swt.widgets.Composite)444 GridData (org.eclipse.swt.layout.GridData)267 GridLayout (org.eclipse.swt.layout.GridLayout)187 Shell (org.eclipse.swt.widgets.Shell)164 Label (org.eclipse.swt.widgets.Label)150 SelectionEvent (org.eclipse.swt.events.SelectionEvent)140 Button (org.eclipse.swt.widgets.Button)118 Display (org.eclipse.swt.widgets.Display)99 Group (org.eclipse.swt.widgets.Group)95 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)89 Point (org.eclipse.swt.graphics.Point)89 Text (org.eclipse.swt.widgets.Text)84 Table (org.eclipse.swt.widgets.Table)80 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)77 Rectangle (org.eclipse.swt.graphics.Rectangle)77 TableColumn (org.eclipse.swt.widgets.TableColumn)65 SelectionListener (org.eclipse.swt.events.SelectionListener)61 Tree (org.eclipse.swt.widgets.Tree)60 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)54