Search in sources :

Example 6 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class ProcessView method createPartControl.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
     */
@Override
public void createPartControl(Composite parent) {
    this.parent = parent;
    parent.setLayout(new FillLayout());
    sash = new SashForm(parent, SWT.HORIZONTAL | SWT.SMOOTH);
    sash.setLayoutData(new GridData(GridData.FILL_BOTH));
    sash.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    GridLayout layout = new GridLayout();
    sash.setLayout(layout);
    Composite left = new Composite(sash, SWT.NONE);
    left.setLayout(new FillLayout());
    Composite right = new Composite(sash, SWT.NONE);
    right.setLayout(new FormLayout());
    FormData layouDatag = new FormData();
    layouDatag.left = new FormAttachment(0, 0);
    layouDatag.width = 32;
    layouDatag.top = new FormAttachment(0, 0);
    layouDatag.bottom = new FormAttachment(100, 0);
    final Composite buttonComposite = new Composite(right, SWT.ERROR);
    buttonComposite.setLayoutData(layouDatag);
    buttonComposite.setLayout(new GridLayout());
    Composite cotextCom = new Composite(right, SWT.NONE);
    layouDatag = new FormData();
    layouDatag.left = new FormAttachment(0, 32);
    layouDatag.right = new FormAttachment(100, 0);
    layouDatag.top = new FormAttachment(0, 0);
    layouDatag.bottom = new FormAttachment(100, 0);
    cotextCom.setLayoutData(layouDatag);
    cotextCom.setLayout(new GridLayout());
    tabFactory.initComposite(left, false);
    moveButton = new Button(buttonComposite, SWT.PUSH);
    //$NON-NLS-1$
    moveButton.setText(">>");
    moveButton.setToolTipText(Messages.getString("ProcessComposite.hideContext"));
    final GridData layoutData = new GridData();
    layoutData.verticalAlignment = GridData.CENTER;
    layoutData.horizontalAlignment = GridData.CENTER;
    layoutData.grabExcessHorizontalSpace = true;
    layoutData.grabExcessVerticalSpace = true;
    moveButton.setLayoutData(layoutData);
    addListeners();
    sash.setSashWidth(5);
    sash.setWeights(new int[] { 18, 5 });
    contextComposite = new ProcessContextComposite(cotextCom, SWT.NONE);
    contextComposite.setBackground(right.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    // processComposite = new ProcessComposite(tabFactory.getTabComposite(), SWT.H_SCROLL | SWT.V_SCROLL |
    // SWT.NO_FOCUS);
    // dc = processComposite;
    // createBasicComposite(tabFactory.getTabComposite(), element, null);
    tabFactory.getTabComposite().layout();
    tabFactory.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            TalendPropertyTabDescriptor descriptor = (TalendPropertyTabDescriptor) selection.getFirstElement();
            if (descriptor == null) {
                return;
            }
            if (currentSelectedTab != null && (currentSelectedTab.getCategory() != descriptor.getCategory())) {
                for (Control curControl : tabFactory.getTabComposite().getChildren()) {
                    curControl.dispose();
                }
            }
            if (currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
                currentSelectedTab = descriptor;
                selectedPrimary = false;
                createDynamicComposite(tabFactory.getTabComposite(), (Element) descriptor.getData(), descriptor.getCategory());
            }
        }
    });
    setElement();
    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    IHandler handler1;
    IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    if (brandingService.getBrandingConfiguration().isAllowDebugMode()) {
        Action debugAction = new DebugAction();
        handler1 = new ActionHandler(debugAction);
        handlerService.activateHandler(debugAction.getActionDefinitionId(), handler1);
    }
    Action killAction = new KillAction();
    handler1 = new ActionHandler(killAction);
    handlerService.activateHandler(killAction.getActionDefinitionId(), handler1);
    FocusListener fl = new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            //$NON-NLS-1$
            log.trace(Messages.getString("ProcessView.gainFocusLog"));
            IContextService contextService = (IContextService) RunProcessPlugin.getDefault().getWorkbench().getAdapter(IContextService.class);
            //$NON-NLS-1$
            ca = contextService.activateContext("talend.runProcess");
        }

        @Override
        public void focusLost(FocusEvent e) {
            //$NON-NLS-1$
            log.trace(Messages.getString("ProcessView.lostFocusLog"));
            if (ca != null) {
                IContextService contextService = (IContextService) RunProcessPlugin.getDefault().getWorkbench().getAdapter(IContextService.class);
                contextService.deactivateContext(ca);
            }
        }
    };
    addListenerOnChildren(parent, fl);
    rubjobManager.setProcessShell(getSite().getShell());
    contextManagerListener = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (RunProcessContextManager.PROP_ACTIVE.equals(evt.getPropertyName())) {
                // rubjobManager.setBooleanTrace(false);
                runningProcessChanged();
            }
        }
    };
    RunProcessPlugin.getDefault().getRunProcessContextManager().addPropertyChangeListener(contextManagerListener);
    runAction = new RunAction();
}
Also used : Action(org.eclipse.jface.action.Action) ClearPerformanceAction(org.talend.designer.runprocess.ui.actions.ClearPerformanceAction) PropertyChangeListener(java.beans.PropertyChangeListener) Element(org.talend.core.model.process.Element) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) FocusEvent(org.eclipse.swt.events.FocusEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ProcessContextComposite(org.talend.designer.runprocess.ui.ProcessContextComposite) Control(org.eclipse.swt.widgets.Control) Button(org.eclipse.swt.widgets.Button) IContextService(org.eclipse.ui.contexts.IContextService) FormAttachment(org.eclipse.swt.layout.FormAttachment) FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) PropertyChangeEvent(java.beans.PropertyChangeEvent) TraceDebugProcessComposite(org.talend.designer.runprocess.ui.TraceDebugProcessComposite) Composite(org.eclipse.swt.widgets.Composite) TargetExecComposite(org.talend.designer.runprocess.ui.TargetExecComposite) MemoryRuntimeComposite(org.talend.designer.runprocess.ui.MemoryRuntimeComposite) AdvanceSettingComposite(org.talend.designer.runprocess.ui.AdvanceSettingComposite) MultipleThreadDynamicComposite(org.talend.designer.core.ui.views.properties.MultipleThreadDynamicComposite) ProcessComposite(org.talend.designer.runprocess.ui.ProcessComposite) ProcessContextComposite(org.talend.designer.runprocess.ui.ProcessContextComposite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) FillLayout(org.eclipse.swt.layout.FillLayout) TalendPropertyTabDescriptor(org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor) IBrandingService(org.talend.core.ui.branding.IBrandingService) SashForm(org.eclipse.swt.custom.SashForm) IHandlerService(org.eclipse.ui.handlers.IHandlerService) GridData(org.eclipse.swt.layout.GridData) IHandler(org.eclipse.core.commands.IHandler) ActionHandler(org.eclipse.ui.commands.ActionHandler) FocusListener(org.eclipse.swt.events.FocusListener)

Example 7 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class AllTypeDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite createDialogArea = (Composite) super.createDialogArea(parent);
    createDialogArea.setLayout(new FillLayout());
    SashForm baseCom = new SashForm(createDialogArea, SWT.VERTICAL | SWT.BORDER);
    baseCom.setLayout(new GridLayout(1, true));
    Group group1 = new Group(baseCom, SWT.None);
    group1.setText(Messages.getString("AllTypeDialog.Group1Text"));
    group1.setLayoutData(new GridData(GridData.FILL_BOTH));
    group1.setLayout(new FillLayout());
    Font font = new Font(Display.getCurrent(), "Arial", 43, 3);
    group1.setFont(font);
    font.dispose();
    Group group2 = new Group(baseCom, SWT.None);
    group2.setText(Messages.getString("AllTypeDialog.Group2Text"));
    group2.setLayoutData(new GridData(GridData.FILL_BOTH));
    font = new Font(Display.getCurrent(), "Arial", 43, 3);
    group2.setFont(font);
    group2.setLayout(new FillLayout());
    font.dispose();
    list = new List(group1, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
    list.setItems(allXMLSchemaTypeName);
    treeViewer = new TreeViewer(group2, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
    tree = treeViewer.getTree();
    tree.setHeaderVisible(false);
    tree.setLinesVisible(true);
    treeViewer.setContentProvider(new WebServiceTreeContentProvider());
    treeViewer.setLabelProvider(new AllTypeLabelProvider());
    treeViewer.setInput(null);
    treeViewer.refresh();
    list.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            String selection = list.getSelection()[0];
            if (selection.contains(COMPLEXTYPE)) {
                String[] split = selection.split(":");
                String complexTypeName = split[1];
                for (XmlSchemaType xmlSchemaType : allXmlSchemaType) {
                    if (xmlSchemaType.getName().equals(complexTypeName)) {
                        ParameterInfo parameterRoot = new ParameterInfo();
                        parameterRoot.setName("parameters");
                        ParameterInfo parameterSon = new ParameterInfo();
                        parameterSon.setName(complexTypeName);
                        parameterSon.setParent(parameterRoot);
                        parameterRoot.getParameterInfos().add(parameterSon);
                        XmlSchemaComplexType xmlElementComplexType = (XmlSchemaComplexType) xmlSchemaType;
                        XmlSchemaParticle xmlSchemaParticle = xmlElementComplexType.getParticle();
                        if (xmlSchemaParticle instanceof XmlSchemaGroupBase) {
                            XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase) xmlSchemaParticle;
                            XmlSchemaObjectCollection childCollection = xmlSchemaGroupBase.getItems();
                            if (childCollection != null) {
                                buildParameterFromCollection(childCollection, parameterSon);
                            }
                        }
                        treeViewer.setInput(parameterRoot);
                        treeViewer.refresh();
                        selectedParaInfo = parameterSon;
                    }
                }
            } else {
                treeViewer.setInput(null);
                treeViewer.refresh();
                selectedParaInfo = null;
            }
        }
    });
    return baseCom;
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) XmlSchemaParticle(org.apache.ws.commons.schema.XmlSchemaParticle) FillLayout(org.eclipse.swt.layout.FillLayout) ParameterInfo(org.talend.designer.webservice.ws.wsdlinfo.ParameterInfo) XmlSchemaType(org.apache.ws.commons.schema.XmlSchemaType) XmlSchemaGroupBase(org.apache.ws.commons.schema.XmlSchemaGroupBase) Font(org.eclipse.swt.graphics.Font) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) List(org.eclipse.swt.widgets.List) ArrayList(java.util.ArrayList) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType) WebServiceTreeContentProvider(org.talend.designer.webservice.ui.tree.WebServiceTreeContentProvider) XmlSchemaObjectCollection(org.apache.ws.commons.schema.XmlSchemaObjectCollection)

Example 8 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class DB2ExplainPlanExecution method displayResults.

private void displayResults(final ExplainNode node) {
    Display.getDefault().asyncExec(new Runnable() {

        @Override
        @SuppressWarnings("deprecation")
        public void run() {
            clearCanvas();
            GridLayout gLayout = new GridLayout();
            gLayout.numColumns = 2;
            gLayout.marginLeft = 0;
            gLayout.horizontalSpacing = 0;
            gLayout.verticalSpacing = 0;
            gLayout.marginWidth = 0;
            gLayout.marginHeight = 0;
            composite.setLayout(gLayout);
            try {
                //$NON-NLS-1$
                composite.setData("parenttab", parentTab);
                Composite pp = new Composite(composite, SWT.NULL);
                pp.setLayout(new FillLayout());
                pp.setLayoutData(new GridData(GridData.FILL_BOTH));
                TreeViewer tv = new TreeViewer(pp, SWT.BORDER | SWT.FULL_SELECTION);
                Tree tree = tv.getTree();
                tree.setLinesVisible(true);
                tree.setHeaderVisible(true);
                TreeColumn tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText("");
                tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText(Messages.getString("DB2ExplainPlanExecution.tableColumnText1"));
                tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText(Messages.getString("DB2ExplainPlanExecution.tableColumnText2"));
                TableLayout tableLayout = new TableLayout();
                tableLayout.addColumnData(new ColumnWeightData(6, 150, true));
                tableLayout.addColumnData(new ColumnWeightData(1, 50, true));
                tableLayout.addColumnData(new ColumnWeightData(1, 50, true));
                tree.setLayout(tableLayout);
                tv.setContentProvider(new ITreeContentProvider() {

                    @Override
                    public void dispose() {
                    }

                    @Override
                    public Object[] getChildren(Object parentElement) {
                        return ((ExplainNode) parentElement).getChildren();
                    }

                    @Override
                    public Object[] getElements(Object inputElement) {
                        ExplainNode nd = ((ExplainNode) inputElement);
                        return nd.getChildren();
                    }

                    @Override
                    public Object getParent(Object element) {
                        return ((ExplainNode) element).getParent();
                    }

                    @Override
                    public boolean hasChildren(Object element) {
                        if (((ExplainNode) element).getChildren().length > 0) {
                            return true;
                        }
                        return false;
                    }

                    @Override
                    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
                    }
                });
                tv.setLabelProvider(new TreeLabelProvider() {
                });
                tv.setInput(node);
                tv.refresh();
                tv.expandAll();
                // make columns full size
                for (int i = 0; i < tree.getColumnCount(); i++) {
                    tree.getColumn(i).pack();
                }
                final Composite parent = composite;
                tree.addKeyListener(new KeyAdapter() {

                    @Override
                    public void keyReleased(KeyEvent e) {
                        switch(e.keyCode) {
                            case SWT.F5:
                                // refresh SQL Results
                                try {
                                    //$NON-NLS-1$
                                    Object o = parent.getData("parenttab");
                                    if (o != null) {
                                        AbstractSQLExecution sqlExec = (AbstractSQLExecution) ((TabItem) o).getData();
                                        if (sqlExec != null) {
                                            sqlExec.startExecution();
                                        }
                                    }
                                } catch (Exception e1) {
                                    //$NON-NLS-1$
                                    SqlBuilderPlugin.log(Messages.getString("DB2ExplainPlanExecution.logMessageError1"), e1);
                                }
                                break;
                            default:
                                return;
                        }
                    }
                });
            } catch (Exception e) {
                // add message
                String message = e.getMessage();
                Label errorLabel = new Label(composite, SWT.FILL);
                errorLabel.setText(message);
                errorLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
                //$NON-NLS-1$
                SqlBuilderPlugin.log(Messages.getString("DB2ExplainPlanExecution.logMessageError2"), e);
            }
            composite.layout();
            composite.redraw();
        }

        ;
    });
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) KeyAdapter(org.eclipse.swt.events.KeyAdapter) Label(org.eclipse.swt.widgets.Label) Viewer(org.eclipse.jface.viewers.Viewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer) FillLayout(org.eclipse.swt.layout.FillLayout) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) TreeColumn(org.eclipse.swt.widgets.TreeColumn) AbstractSQLExecution(org.talend.sqlbuilder.sqlcontrol.AbstractSQLExecution) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) TableLayout(org.eclipse.jface.viewers.TableLayout)

Example 9 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class OracleExplainPlanExecution method displayResults.

private void displayResults(final ExplainNode node) {
    Display.getDefault().asyncExec(new Runnable() {

        @Override
        @SuppressWarnings("deprecation")
        public void run() {
            clearCanvas();
            GridLayout gLayout = new GridLayout();
            gLayout.numColumns = 2;
            gLayout.marginLeft = 0;
            gLayout.horizontalSpacing = 0;
            gLayout.verticalSpacing = 0;
            gLayout.marginWidth = 0;
            gLayout.marginHeight = 0;
            composite.setLayout(gLayout);
            try {
                //$NON-NLS-1$
                composite.setData("parenttab", parentTab);
                Composite pp = new Composite(composite, SWT.NULL);
                pp.setLayout(new FillLayout());
                pp.setLayoutData(new GridData(GridData.FILL_BOTH));
                TreeViewer tv = new TreeViewer(pp, SWT.BORDER | SWT.FULL_SELECTION);
                Tree tree = tv.getTree();
                tree.setLinesVisible(true);
                tree.setHeaderVisible(true);
                TreeColumn tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText("");
                tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText(Messages.getString("OracleExplainPlanExecution.tableColumnText1"));
                tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText(Messages.getString("OracleExplainPlanExecution.tableColumnText2"));
                TableLayout tableLayout = new TableLayout();
                tableLayout.addColumnData(new ColumnWeightData(6, 150, true));
                tableLayout.addColumnData(new ColumnWeightData(1, 50, true));
                tableLayout.addColumnData(new ColumnWeightData(1, 50, true));
                tree.setLayout(tableLayout);
                tv.setContentProvider(new ITreeContentProvider() {

                    @Override
                    public void dispose() {
                    }

                    @Override
                    public Object[] getChildren(Object parentElement) {
                        return ((ExplainNode) parentElement).getChildren();
                    }

                    @Override
                    public Object[] getElements(Object inputElement) {
                        ExplainNode nd = ((ExplainNode) inputElement);
                        return nd.getChildren();
                    }

                    @Override
                    public Object getParent(Object element) {
                        return ((ExplainNode) element).getParent();
                    }

                    @Override
                    public boolean hasChildren(Object element) {
                        if (((ExplainNode) element).getChildren().length > 0) {
                            return true;
                        }
                        return false;
                    }

                    @Override
                    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
                    }
                });
                tv.setLabelProvider(new TreeLabelProvider() {
                });
                tv.setInput(node);
                tv.refresh();
                tv.expandAll();
                // make columns full size
                for (int i = 0; i < tree.getColumnCount(); i++) {
                    tree.getColumn(i).pack();
                }
                final Composite parent = composite;
                tree.addKeyListener(new KeyAdapter() {

                    @Override
                    public void keyReleased(KeyEvent e) {
                        switch(e.keyCode) {
                            case SWT.F5:
                                // refresh SQL Results
                                try {
                                    //$NON-NLS-1$
                                    Object o = parent.getData("parenttab");
                                    if (o != null) {
                                        AbstractSQLExecution sqlExec = (AbstractSQLExecution) ((TabItem) o).getData();
                                        if (sqlExec != null) {
                                            sqlExec.startExecution();
                                        }
                                    }
                                } catch (Exception e1) {
                                    //$NON-NLS-1$
                                    SqlBuilderPlugin.log(Messages.getString("OracleExplainPlanExecution.logMessage1"), e1);
                                }
                                break;
                            default:
                                return;
                        }
                    }
                });
            } catch (Exception e) {
                // add message
                String message = e.getMessage();
                Label errorLabel = new Label(composite, SWT.FILL);
                errorLabel.setText(message);
                errorLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
                //$NON-NLS-1$
                SqlBuilderPlugin.log(Messages.getString("OracleExplainPlanExecution.logMessage2"), e);
            }
            composite.layout();
            composite.redraw();
        }

        ;
    });
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) KeyAdapter(org.eclipse.swt.events.KeyAdapter) Label(org.eclipse.swt.widgets.Label) Viewer(org.eclipse.jface.viewers.Viewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer) FillLayout(org.eclipse.swt.layout.FillLayout) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) TreeColumn(org.eclipse.swt.widgets.TreeColumn) AbstractSQLExecution(org.talend.sqlbuilder.sqlcontrol.AbstractSQLExecution) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) TableLayout(org.eclipse.jface.viewers.TableLayout)

Example 10 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class MultiPageSqlBuilderEditor method createContainer.

private CTabFolder createContainer(Composite parent) {
    // use SWT.FLAT style so that an extra 1 pixel border is not reserved
    // inside the folder
    parent.setLayout(new FillLayout());
    final CTabFolder newContainer = new CTabFolder(parent, SWT.BOTTOM | SWT.FLAT);
    newContainer.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            int newPageIndex = newContainer.indexOf((CTabItem) e.item);
            pageChange(newPageIndex);
        }
    });
    newContainer.addTraverseListener(new TraverseListener() {

        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=199499 : Switching tabs by Ctrl+PageUp/PageDown must not be caught on the inner tab set
        @Override
        public void keyTraversed(TraverseEvent e) {
            switch(e.detail) {
                case SWT.TRAVERSE_PAGE_NEXT:
                case SWT.TRAVERSE_PAGE_PREVIOUS:
                    int detail = e.detail;
                    e.doit = true;
                    e.detail = SWT.TRAVERSE_NONE;
                    Control control = newContainer.getParent();
                    do {
                        if (control.traverse(detail))
                            return;
                        if (control.getListeners(SWT.Traverse).length != 0)
                            return;
                        if (control instanceof Shell)
                            return;
                        control = control.getParent();
                    } while (control != null);
            }
        }
    });
    return newContainer;
}
Also used : Control(org.eclipse.swt.widgets.Control) Shell(org.eclipse.swt.widgets.Shell) CTabFolder(org.eclipse.swt.custom.CTabFolder) TraverseEvent(org.eclipse.swt.events.TraverseEvent) TraverseListener(org.eclipse.swt.events.TraverseListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FillLayout(org.eclipse.swt.layout.FillLayout) CTabItem(org.eclipse.swt.custom.CTabItem)

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