Search in sources :

Example 61 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class FindDialog method createButtonsForButtonBar.

/*
     * @see Dialog#createButtonsForButtonBar(Composite)
     */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    findButton = createButton(parent, IDialogConstants.CLIENT_ID, Messages.findButtonLabel, true);
    findButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doFind();
        }
    });
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CLOSE_LABEL, false);
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 62 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class HotSpotsFilteredTree method configureTree.

/*
     * @see AbstractFilteredTree#configureTree()
     */
@Override
protected void configureTree() {
    for (TreeColumn column : getViewer().getTree().getColumns()) {
        column.dispose();
    }
    getViewer().getTree().setLinesVisible(true);
    getViewer().getTree().setHeaderVisible(true);
    for (Entry<String, Boolean> entry : columns.entrySet()) {
        HotSpotsColumn column = getColumn(entry.getKey());
        String label = (column == HotSpotsColumn.HOT_SPOT) ? getMethodColumnName() : column.label;
        String toolTip = (column == HotSpotsColumn.HOT_SPOT) ? getMethodColumnToolTip() : column.toolTip;
        if (!columns.get(label)) {
            continue;
        }
        TreeColumn treeColumn = new TreeColumn(getViewer().getTree(), SWT.NONE);
        treeColumn.setText(label);
        treeColumn.setWidth(column.defalutWidth);
        treeColumn.setAlignment(column.alignment);
        treeColumn.setToolTipText(toolTip);
        treeColumn.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                if (e.widget instanceof TreeColumn) {
                    sortColumn((TreeColumn) e.widget);
                }
            }
        });
    }
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 63 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class HeapHistogramPage method configureTree.

/**
     * Configure the tree adding columns.
     */
private void configureTree() {
    Tree tree = heapViewer.getTree();
    if (tree.isDisposed()) {
        return;
    }
    for (TreeColumn column : tree.getColumns()) {
        column.dispose();
    }
    tree.setLinesVisible(true);
    tree.setHeaderVisible(true);
    for (Entry<String, Boolean> entry : columns.entrySet()) {
        HeapColumn column = HeapColumn.getColumn(entry.getKey());
        if (!columns.get(column.label)) {
            continue;
        }
        TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);
        treeColumn.setText(column.label);
        treeColumn.setWidth(column.defalutWidth);
        treeColumn.setAlignment(column.alignment);
        treeColumn.setToolTipText(column.toolTip);
        treeColumn.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                if (e.widget instanceof TreeColumn) {
                    sortColumn((TreeColumn) e.widget);
                }
            }
        });
    }
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Tree(org.eclipse.swt.widgets.Tree)

Example 64 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class RepositoryWebService method addListenerForWSDLCom.

private void addListenerForWSDLCom() {
    refreshbut.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell().getShell());
            IRunnableWithProgress runnable = new IRunnableWithProgress() {

                public void run(final IProgressMonitor monitor) {
                    //$NON-NLS-1$
                    monitor.beginTask("Retrieve WSDL parameter from net.", IProgressMonitor.UNKNOWN);
                    Display.getDefault().syncExec(new Runnable() {

                        public void run() {
                            getDataFromNet();
                        }
                    });
                    monitor.done();
                }
            };
            try {
                progressDialog.run(true, true, runnable);
            } catch (InvocationTargetException e1) {
                ExceptionHandler.process(e1);
            } catch (InterruptedException e1) {
                ExceptionHandler.process(e1);
            } catch (WebServiceCancelException e1) {
                return;
            }
            if (currentPortName != null) {
                connection.setPortName(currentPortName.getPortName());
            } else if (currentPortName == null && allPortNames != null) {
                currentPortName = allPortNames.get(0);
                connection.setPortName(currentPortName.getPortName());
            }
            listTable.setSelection(listTable.getItem(0));
            if (currentFunction != null) {
                connection.setMethodName(currentFunction.getName());
                connection.setServerNameSpace(currentFunction.getServerNameSpace());
                connection.setServerName(currentFunction.getServerName());
                connection.setPortNameSpace(currentFunction.getServerNameSpace());
            }
            // listTable.select(0);
            isFirst = false;
        }
    });
    // TableItem firstItem = listTable.getItem(0);
    // currentFunction = firstItem.getData();
    listTable = listTableView.getTable();
    portListTable = portListTableView.getTable();
    listTable.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            TableItem[] item = listTable.getSelection();
            currentFunction = (Function) item[0].getData();
            if (currentFunction != null) {
                connection.setServerName(currentFunction.getServerName());
                connection.setServerNameSpace(currentFunction.getServerNameSpace());
                connection.setMethodName(currentFunction.getName());
            }
            // if select the same as before ,don't change it
            // IElementParameter METHODPara = connector.getElementParameter("METHOD"); //$NON-NLS-1$
            // Object obj = METHODPara.getValue();
            // if (currentFunction.getName().equals(obj.toString())) {
            // return;
            // }
            List<ParameterInfo> listIn = currentFunction.getInputParameters();
            List<ParameterInfo> listOut = currentFunction.getOutputParameters();
        }
    });
    portListTable.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            TableItem[] item = portListTable.getSelection();
            currentPortName = (PortNames) item[0].getData();
            connection.setPortName(currentPortName.getPortName());
        }
    });
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress) Function(org.talend.designer.webservice.ws.wsdlinfo.Function) PortNames(org.talend.designer.webservice.ws.wsdlinfo.PortNames) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) SelectionEvent(org.eclipse.swt.events.SelectionEvent) List(java.util.List) ArrayList(java.util.ArrayList)

Example 65 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class AddArrayIndexDialog method createDialogArea.

protected Control createDialogArea(Composite parent) {
    Composite createDialogArea = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout();
    layout.horizontalSpacing = 1;
    layout.numColumns = 2;
    createDialogArea.setLayout(layout);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 2;
    arrayButton = new Button(createDialogArea, SWT.RADIO);
    arrayButton.setText("Get all the list element.");
    arrayButton.setLayoutData(layoutData);
    arrayButton.setSelection(true);
    arrayButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            text.setEnabled(false);
        }
    });
    arrayToItemButton = new Button(createDialogArea, SWT.RADIO);
    arrayToItemButton.setText("Get one element of the list.");
    arrayToItemButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            text.setEnabled(true);
        }
    });
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 1;
    text = new Text(createDialogArea, SWT.BORDER);
    text.setLayoutData(data);
    text.setEnabled(false);
    text.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            indexText = text.getText();
        // String com = text.getText();
        // int index = Integer.valueOf(com);
        // if(index<0||index>arraySize){
        //                    
        // }
        }
    });
    return createDialogArea;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Text(org.eclipse.swt.widgets.Text)

Aggregations

SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3041 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3036 GridData (org.eclipse.swt.layout.GridData)1608 Button (org.eclipse.swt.widgets.Button)1600 Composite (org.eclipse.swt.widgets.Composite)1220 Label (org.eclipse.swt.widgets.Label)1106 GridLayout (org.eclipse.swt.layout.GridLayout)1095 Text (org.eclipse.swt.widgets.Text)773 ModifyListener (org.eclipse.swt.events.ModifyListener)638 ModifyEvent (org.eclipse.swt.events.ModifyEvent)630 Group (org.eclipse.swt.widgets.Group)459 FormAttachment (org.eclipse.swt.layout.FormAttachment)428 FormData (org.eclipse.swt.layout.FormData)428 Shell (org.eclipse.swt.widgets.Shell)407 FormLayout (org.eclipse.swt.layout.FormLayout)406 Event (org.eclipse.swt.widgets.Event)384 Listener (org.eclipse.swt.widgets.Listener)378 Display (org.eclipse.swt.widgets.Display)353 ShellEvent (org.eclipse.swt.events.ShellEvent)323 ShellAdapter (org.eclipse.swt.events.ShellAdapter)321