Search in sources :

Example 96 with ToolItem

use of org.eclipse.swt.widgets.ToolItem in project tdi-studio-se by Talend.

the class ToolbarSearchZone method addCommonsComponents.

public void addCommonsComponents() {
    Label findLabel = new Label(composite, SWT.NONE);
    findLabel.setText("Find :");
    searchText = new Text(composite, SWT.BORDER);
    GridData gridData = new GridData();
    gridData.widthHint = 150;
    searchText.setBackground(EntryState.NONE.getColor());
    searchText.setLayoutData(gridData);
    searchText.setToolTipText("Enter search text prefix or pattern(*,?,or camel case).");
    ToolBar toolBarActions = new ToolBar(composite, SWT.FLAT | SWT.RIGHT);
    toolBarActions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    downTableButton = new ToolItem(toolBarActions, SWT.PUSH);
    downTableButton.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.DOWN_ICON)));
    // downTableButton.setText("Next");
    downTableButton.setToolTipText("next");
    upTableButton = new ToolItem(toolBarActions, SWT.PUSH);
    upTableButton.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.UP_ICON)));
    // upTableButton.setText("Previous");
    upTableButton.setToolTipText("previous");
    hightLightAllButton = new ToolItem(toolBarActions, SWT.CHECK);
    hightLightAllButton.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.HIGHTLIGHT_ICON)));
    // hightLightAllButton.setText("Hightlight All");
    hightLightAllButton.setToolTipText("hightlight all");
    hightLightAllButton.setSelection(false);
    // Add Listeners
    addCommonsComponentListeners();
}
Also used : Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) ToolBar(org.eclipse.swt.widgets.ToolBar) Text(org.eclipse.swt.widgets.Text) ToolItem(org.eclipse.swt.widgets.ToolItem)

Example 97 with ToolItem

use of org.eclipse.swt.widgets.ToolItem in project tdi-studio-se by Talend.

the class ToolbarZone method addCommonsComponents.

/**
     * DOC amaumont Comment method "createComponents".
     */
public void addCommonsComponents() {
    upTableButton = new ToolItem(toolBarActions, SWT.PUSH);
    upTableButton.setEnabled(false);
    upTableButton.setToolTipText(getMoveUpTooltipText());
    upTableButton.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.UP_ICON)));
    downTableButton = new ToolItem(toolBarActions, SWT.PUSH);
    downTableButton.setEnabled(false);
    downTableButton.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.DOWN_ICON)));
    downTableButton.setToolTipText(getMoveDownTooltipText());
    new ToolItem(getToolBarActions(), SWT.SEPARATOR);
    minimizeButton = new ToolItem(toolBarActions, SWT.PUSH);
    minimizeButton.setEnabled(false);
    addCommonsComponentListeners();
}
Also used : ToolItem(org.eclipse.swt.widgets.ToolItem)

Example 98 with ToolItem

use of org.eclipse.swt.widgets.ToolItem in project tdi-studio-se by Talend.

the class MultipleSurrogateSection method createToolbarActions.

/**
     * DOC hcw Comment method "createToolbar".
     * 
     * @param composite
     */
private void createToolbarActions(Composite composite) {
    ToolBar toolBar = new ToolBar(composite, SWT.NONE);
    toolBar.setLayoutData(new GridData(157, SWT.DEFAULT));
    ToolItem addToolItem = new ToolItem(toolBar, SWT.PUSH);
    //$NON-NLS-1$
    addToolItem.setImage(SWTResourceManager.getPluginImage(ScdPlugin.getDefault(), "icons/add.gif"));
    addToolItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            addButtonClick();
        }
    });
    ToolItem removeToolItem = new ToolItem(toolBar, SWT.PUSH);
    //$NON-NLS-1$
    removeToolItem.setImage(SWTResourceManager.getPluginImage(ScdPlugin.getDefault(), "icons/delete.gif"));
    removeToolItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            removeButtonClick();
        }
    });
    ToolItem moveUpToolItem = new ToolItem(toolBar, SWT.PUSH);
    //$NON-NLS-1$
    moveUpToolItem.setImage(SWTResourceManager.getPluginImage(ScdPlugin.getDefault(), "icons/up.gif"));
    moveUpToolItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            moveUpButtonClick();
        }
    });
    ToolItem moveDownToolItem = new ToolItem(toolBar, SWT.PUSH);
    //$NON-NLS-1$
    moveDownToolItem.setImage(SWTResourceManager.getPluginImage(ScdPlugin.getDefault(), "icons/down.gif"));
    moveDownToolItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            moveDownButtonClick();
        }
    });
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ToolBar(org.eclipse.swt.widgets.ToolBar) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ToolItem(org.eclipse.swt.widgets.ToolItem)

Example 99 with ToolItem

use of org.eclipse.swt.widgets.ToolItem in project tesb-studio-se by Talend.

the class CamelDependenciesPanel method createButtons.

protected void createButtons(ToolBar tb) {
    final SelectionListener selectionListener = new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (e.getSource() == addBtn) {
                addNewItem();
            } else if (e.getSource() == remBtn) {
                removeItems();
            } else if (e.getSource() == upBtn) {
                moveUp();
            } else if (e.getSource() == downBtn) {
                moveDown();
            } else if (e.getSource() == editBtn) {
                editSelected();
            }
        }
    };
    addBtn = new ToolItem(tb, SWT.PUSH);
    addBtn.setText(Messages.RouterDependenciesPanel_addBtn);
    addBtn.addSelectionListener(selectionListener);
    remBtn = new ToolItem(tb, SWT.PUSH);
    remBtn.setText(Messages.RouterDependenciesPanel_removeBtn);
    remBtn.addSelectionListener(selectionListener);
    remBtn.setEnabled(false);
    editBtn = new ToolItem(tb, SWT.PUSH);
    editBtn.setText(Messages.RouterDependenciesPanel_editBtn);
    editBtn.setEnabled(false);
    editBtn.addSelectionListener(selectionListener);
    if (type != ManifestItem.EXPORT_PACKAGE) {
        upBtn = new ToolItem(tb, SWT.PUSH);
        upBtn.setText(Messages.RouterDependenciesPanel_upBtn);
        upBtn.addSelectionListener(selectionListener);
        upBtn.setEnabled(false);
        downBtn = new ToolItem(tb, SWT.PUSH);
        downBtn.setText(Messages.RouterDependenciesPanel_downBtn);
        downBtn.addSelectionListener(selectionListener);
        downBtn.setEnabled(false);
    }
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ToolItem(org.eclipse.swt.widgets.ToolItem) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 100 with ToolItem

use of org.eclipse.swt.widgets.ToolItem in project tesb-studio-se by Talend.

the class CheckedCamelDependenciesPanel method createButtons.

@Override
protected void createButtons(ToolBar tb) {
    final SelectionListener selectionListener = new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (e.getSource() == selectAll) {
                selectAll(true);
            } else if (e.getSource() == deselectAll) {
                selectAll(false);
            }
        }
    };
    selectAll = new ToolItem(tb, SWT.PUSH);
    selectAll.setText(Messages.RouterDependenciesPanel_selectAll);
    selectAll.addSelectionListener(selectionListener);
    deselectAll = new ToolItem(tb, SWT.PUSH);
    deselectAll.setText(Messages.RouterDependenciesPanel_deselectAll);
    deselectAll.addSelectionListener(selectionListener);
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ToolItem(org.eclipse.swt.widgets.ToolItem) SelectionListener(org.eclipse.swt.events.SelectionListener)

Aggregations

ToolItem (org.eclipse.swt.widgets.ToolItem)112 SelectionEvent (org.eclipse.swt.events.SelectionEvent)89 ToolBar (org.eclipse.swt.widgets.ToolBar)85 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)79 GridData (org.eclipse.swt.layout.GridData)62 Composite (org.eclipse.swt.widgets.Composite)50 GridLayout (org.eclipse.swt.layout.GridLayout)47 Image (org.eclipse.swt.graphics.Image)28 DisposeEvent (org.eclipse.swt.events.DisposeEvent)24 DisposeListener (org.eclipse.swt.events.DisposeListener)24 Label (org.eclipse.swt.widgets.Label)21 Cursor (org.eclipse.swt.graphics.Cursor)20 TableViewer (org.eclipse.jface.viewers.TableViewer)16 SelectionListener (org.eclipse.swt.events.SelectionListener)14 Point (org.eclipse.swt.graphics.Point)11 ArrayList (java.util.ArrayList)10 List (java.util.List)10 SashForm (org.eclipse.swt.custom.SashForm)10 FillLayout (org.eclipse.swt.layout.FillLayout)10 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)9