Search in sources :

Example 6 with CopyAction

use of org.talend.designer.runtime.visualization.internal.actions.CopyAction in project tdi-studio-se by Talend.

the class NotificationDetailsDialog method createTree.

/**
     * Creates the tree.
     * 
     * @param composite The parent composite
     */
private void createTree(Composite composite) {
    composite.setLayout(new FillLayout());
    detailsViewer = new TreeViewer(composite, SWT.MULTI | SWT.FULL_SELECTION);
    configureTree(detailsViewer.getTree());
    detailsViewer.setContentProvider(new DetailsContentProvider());
    detailsViewer.setLabelProvider(new DetailsLabelProvider());
    detailsViewer.setInput(new Object());
    copyAction = new CopyAction();
    copyAction.setActionDefinitionId(null);
    detailsViewer.addSelectionChangedListener(copyAction);
}
Also used : CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) TreeViewer(org.eclipse.jface.viewers.TreeViewer) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 7 with CopyAction

use of org.talend.designer.runtime.visualization.internal.actions.CopyAction in project tdi-studio-se by Talend.

the class InvokeDialog method createReturnValueViewer.

/**
     * Creates the return value viewer.
     * 
     * @param parent The parent composite
     */
private void createReturnValueViewer(Composite parent) {
    if (info.getReturnType().equals("void")) {
        //$NON-NLS-1$
        return;
    }
    Label label = new Label(parent, SWT.NONE);
    label.setText(Messages.returnValueLabel);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new FillLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    returnValueViewer = new TreeViewer(composite, SWT.MULTI | SWT.FULL_SELECTION);
    configureTree(returnValueViewer.getTree());
    returnValueViewer.setContentProvider(new ReturnValueContentProvider());
    returnValueViewer.setLabelProvider(new ReturnValueLabelProvider());
    copyAction = new CopyAction();
    copyAction.setActionDefinitionId(null);
    returnValueViewer.addSelectionChangedListener(copyAction);
}
Also used : Composite(org.eclipse.swt.widgets.Composite) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) TreeViewer(org.eclipse.jface.viewers.TreeViewer) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 8 with CopyAction

use of org.talend.designer.runtime.visualization.internal.actions.CopyAction in project tdi-studio-se by Talend.

the class HeapHistogramPage method createContextMenu.

/**
     * Creates the context menu.
     * 
     * @param actionBars The action bars
     */
private void createContextMenu(IActionBars actionBars) {
    final OpenDeclarationAction openAction = OpenDeclarationAction.createOpenDeclarationAction(actionBars);
    final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
    configureColumnsAction = new ConfigureColumnsAction(this);
    heapViewer.addSelectionChangedListener(openAction);
    heapViewer.getControl().addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            heapViewer.removeSelectionChangedListener(copyAction);
        }

        @Override
        public void focusGained(FocusEvent e) {
            heapViewer.addSelectionChangedListener(copyAction);
        }
    });
    heapViewer.addOpenListener(new IOpenListener() {

        @Override
        public void open(OpenEvent event) {
            openAction.run();
        }
    });
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(openAction);
            manager.add(copyAction);
            manager.add(new Separator());
            manager.add(configureColumnsAction);
        }
    });
    Menu menu = menuMgr.createContextMenu(heapViewer.getControl());
    heapViewer.getControl().setMenu(menu);
}
Also used : OpenDeclarationAction(org.talend.designer.runtime.visualization.internal.actions.OpenDeclarationAction) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) FocusEvent(org.eclipse.swt.events.FocusEvent) IMenuListener(org.eclipse.jface.action.IMenuListener) IOpenListener(org.eclipse.jface.viewers.IOpenListener) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) ConfigureColumnsAction(org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction) FocusListener(org.eclipse.swt.events.FocusListener) Separator(org.eclipse.jface.action.Separator) OpenEvent(org.eclipse.jface.viewers.OpenEvent)

Example 9 with CopyAction

use of org.talend.designer.runtime.visualization.internal.actions.CopyAction in project tdi-studio-se by Talend.

the class CpuDumpEditor method contributeToActionBars.

/**
     * Contributes to action bars.
     */
private void contributeToActionBars() {
    IActionBars actionBars = getEditorSite().getActionBars();
    actionBars.setGlobalActionHandler(JdtActionConstants.OPEN, new OpenDeclarationAction());
    actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), new FindAction());
    actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), new CopyAction());
}
Also used : OpenDeclarationAction(org.talend.designer.runtime.visualization.internal.actions.OpenDeclarationAction) FindAction(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.FindAction) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

CopyAction (org.talend.designer.runtime.visualization.internal.actions.CopyAction)9 IMenuListener (org.eclipse.jface.action.IMenuListener)4 IMenuManager (org.eclipse.jface.action.IMenuManager)4 MenuManager (org.eclipse.jface.action.MenuManager)4 Menu (org.eclipse.swt.widgets.Menu)4 Action (org.eclipse.jface.action.Action)3 Separator (org.eclipse.jface.action.Separator)3 FocusEvent (org.eclipse.swt.events.FocusEvent)3 IActionBars (org.eclipse.ui.IActionBars)3 ConfigureColumnsAction (org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction)3 ArrayList (java.util.ArrayList)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 FocusListener (org.eclipse.swt.events.FocusListener)2 FillLayout (org.eclipse.swt.layout.FillLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 OpenDeclarationAction (org.talend.designer.runtime.visualization.internal.actions.OpenDeclarationAction)2 ShowInTimelineAction (org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction)2 PropertiesFilteredTree (org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree)2 List (java.util.List)1 IOpenListener (org.eclipse.jface.viewers.IOpenListener)1