Java Code Examples for org.eclipse.jface.viewers.StructuredViewer#addDragSupport()
The following examples show how to use
org.eclipse.jface.viewers.StructuredViewer#addDragSupport() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MemoryEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); contextMenu.add ( new Separator ( "additions" ) ); contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 2
Source File: GenconfEditor.java From M2Doc with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ protected void createContextMenuFor(StructuredViewer viewer) { MenuManager contextMenu = new MenuManager("#PopUp"); contextMenu.add(new Separator("additions")); contextMenu.setRemoveAllWhenShown(true); contextMenu.addMenuListener(this); Menu menu = contextMenu.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(menu); getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] {LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance()}; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); }
Example 3
Source File: ItemEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 4
Source File: ComponentEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well * registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ protected void createContextMenuFor ( final StructuredViewer viewer ) { final MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); final Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; final Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance (), ItemTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new DropAdapterExtension ( this.editingDomain, viewer ) ); }
Example 5
Source File: GlobalizeEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 6
Source File: InfrastructureEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 7
Source File: RecipeEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 8
Source File: ProtocolEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 9
Source File: OsgiEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 10
Source File: SetupEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 11
Source File: DeploymentEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 12
Source File: VisualInterfaceEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
Example 13
Source File: CallHierarchyViewPart.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private void addDragAdapters(StructuredViewer viewer) { int ops= DND.DROP_COPY | DND.DROP_LINK; Transfer[] transfers= new Transfer[] { LocalSelectionTransfer.getInstance(), ResourceTransfer.getInstance(), FileTransfer.getInstance()}; DelegatingDragAdapter dragAdapter= new DelegatingDragAdapter() { @Override public void dragStart(DragSourceEvent event) { IStructuredSelection selection= (IStructuredSelection) fSelectionProviderMediator.getSelection(); if (selection.isEmpty()) { event.doit= false; return; } super.dragStart(event); } }; dragAdapter.addDragSourceListener(new SelectionTransferDragAdapter(fSelectionProviderMediator)); dragAdapter.addDragSourceListener(new EditorInputTransferDragAdapter(fSelectionProviderMediator)); dragAdapter.addDragSourceListener(new ResourceTransferDragAdapter(fSelectionProviderMediator)); dragAdapter.addDragSourceListener(new FileTransferDragAdapter(fSelectionProviderMediator)); viewer.addDragSupport(ops, transfers, dragAdapter); }
Example 14
Source File: ChartEditor.java From neoscada with Eclipse Public License 1.0 | 6 votes |
/** * This creates a context menu for the viewer and adds a listener as well * registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ protected void createContextMenuFor ( final StructuredViewer viewer ) { final MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); final Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; final Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance (), ItemTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new DropAdapterExtension ( this.editingDomain, viewer ) ); }
Example 15
Source File: JavaSearchResultPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void addDragAdapters(StructuredViewer viewer) { Transfer[] transfers= new Transfer[] { LocalSelectionTransfer.getInstance(), ResourceTransfer.getInstance() }; int ops= DND.DROP_COPY | DND.DROP_LINK; JdtViewerDragAdapter dragAdapter= new JdtViewerDragAdapter(viewer); dragAdapter.addDragSourceListener(new SelectionTransferDragAdapter(viewer)); dragAdapter.addDragSourceListener(new EditorInputTransferDragAdapter(viewer)); dragAdapter.addDragSourceListener(new ResourceTransferDragAdapter(viewer)); viewer.addDragSupport(ops, transfers, dragAdapter); }
Example 16
Source File: ExtensionsEditor.java From ifml-editor with MIT License | 5 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor(StructuredViewer viewer) { MenuManager contextMenu = new MenuManager("#PopUp"); contextMenu.add(new Separator("additions")); contextMenu.setRemoveAllWhenShown(true); contextMenu.addMenuListener(this); Menu menu= contextMenu.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(menu); getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); }
Example 17
Source File: BeansEditor.java From hybris-commerce-eclipse-plugin with Apache License 2.0 | 5 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor(StructuredViewer viewer) { MenuManager contextMenu = new MenuManager("#PopUp"); contextMenu.add(new Separator("additions")); contextMenu.setRemoveAllWhenShown(true); contextMenu.addMenuListener(this); Menu menu= contextMenu.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(menu); getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); }
Example 18
Source File: EipEditor.java From eip-designer with Apache License 2.0 | 5 votes |
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor(StructuredViewer viewer) { MenuManager contextMenu = new MenuManager("#PopUp"); contextMenu.add(new Separator("additions")); contextMenu.setRemoveAllWhenShown(true); contextMenu.addMenuListener(this); Menu menu= contextMenu.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(menu); getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); }
Example 19
Source File: FileSearchPage.java From Pydev with Eclipse Public License 1.0 | 4 votes |
private void addDragAdapters(StructuredViewer viewer) { Transfer[] transfers = new Transfer[] { ResourceTransfer.getInstance() }; int ops = DND.DROP_COPY | DND.DROP_LINK; viewer.addDragSupport(ops, transfers, new NavigatorDragAdapter(viewer)); }
Example 20
Source File: AbstractSearchIndexResultPage.java From Pydev with Eclipse Public License 1.0 | 4 votes |
private void addDragAdapters(StructuredViewer viewer) { Transfer[] transfers = new Transfer[] { ResourceTransfer.getInstance() }; int ops = DND.DROP_COPY | DND.DROP_LINK; viewer.addDragSupport(ops, transfers, new NavigatorDragAdapter(viewer)); }