Search in sources :

Example 26 with ViewerDragAdapter

use of org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter in project Malai by arnobl.

the class InstrumentEditor method createContextMenuFor.

/**
 * 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() };
    viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
    viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
Also used : UnwrappingSelectionProvider(org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider) ViewerDragAdapter(org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) LocalTransfer(org.eclipse.emf.edit.ui.dnd.LocalTransfer) Transfer(org.eclipse.swt.dnd.Transfer) Menu(org.eclipse.swt.widgets.Menu) Separator(org.eclipse.jface.action.Separator) Point(org.eclipse.swt.graphics.Point) EditingDomainViewerDropAdapter(org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)

Example 27 with ViewerDragAdapter

use of org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter in project iobserve-analysis by research-iobserve.

the class systemadaptationEditor method createContextMenuFor.

/**
 * 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));
}
Also used : UnwrappingSelectionProvider(org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider) ViewerDragAdapter(org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) LocalSelectionTransfer(org.eclipse.jface.util.LocalSelectionTransfer) LocalTransfer(org.eclipse.emf.edit.ui.dnd.LocalTransfer) Transfer(org.eclipse.swt.dnd.Transfer) FileTransfer(org.eclipse.swt.dnd.FileTransfer) Menu(org.eclipse.swt.widgets.Menu) Separator(org.eclipse.jface.action.Separator) Point(org.eclipse.swt.graphics.Point) EditingDomainViewerDropAdapter(org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)

Example 28 with ViewerDragAdapter

use of org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter in project iobserve-analysis by research-iobserve.

the class cloudprofileEditor method createContextMenuFor.

/**
 * 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));
}
Also used : UnwrappingSelectionProvider(org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider) ViewerDragAdapter(org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) LocalSelectionTransfer(org.eclipse.jface.util.LocalSelectionTransfer) LocalTransfer(org.eclipse.emf.edit.ui.dnd.LocalTransfer) Transfer(org.eclipse.swt.dnd.Transfer) FileTransfer(org.eclipse.swt.dnd.FileTransfer) Menu(org.eclipse.swt.widgets.Menu) Separator(org.eclipse.jface.action.Separator) Point(org.eclipse.swt.graphics.Point) EditingDomainViewerDropAdapter(org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)

Example 29 with ViewerDragAdapter

use of org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter in project InformationSystem by ObeoNetwork.

the class ApplicationEditor method createContextMenuFor.

/**
 * 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));
}
Also used : UnwrappingSelectionProvider(org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider) ViewerDragAdapter(org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) LocalSelectionTransfer(org.eclipse.jface.util.LocalSelectionTransfer) LocalTransfer(org.eclipse.emf.edit.ui.dnd.LocalTransfer) Transfer(org.eclipse.swt.dnd.Transfer) FileTransfer(org.eclipse.swt.dnd.FileTransfer) Menu(org.eclipse.swt.widgets.Menu) Separator(org.eclipse.jface.action.Separator) Point(org.eclipse.swt.graphics.Point) EditingDomainViewerDropAdapter(org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)

Example 30 with ViewerDragAdapter

use of org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter in project InformationSystem by ObeoNetwork.

the class EcorebindingEditor method createContextMenuFor.

/**
 * 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));
}
Also used : UnwrappingSelectionProvider(org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider) ViewerDragAdapter(org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) LocalSelectionTransfer(org.eclipse.jface.util.LocalSelectionTransfer) LocalTransfer(org.eclipse.emf.edit.ui.dnd.LocalTransfer) Transfer(org.eclipse.swt.dnd.Transfer) FileTransfer(org.eclipse.swt.dnd.FileTransfer) Menu(org.eclipse.swt.widgets.Menu) Separator(org.eclipse.jface.action.Separator) Point(org.eclipse.swt.graphics.Point) EditingDomainViewerDropAdapter(org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)

Aggregations

EditingDomainViewerDropAdapter (org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)45 LocalTransfer (org.eclipse.emf.edit.ui.dnd.LocalTransfer)45 ViewerDragAdapter (org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter)45 Transfer (org.eclipse.swt.dnd.Transfer)45 UnwrappingSelectionProvider (org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider)44 IMenuManager (org.eclipse.jface.action.IMenuManager)44 MenuManager (org.eclipse.jface.action.MenuManager)44 Separator (org.eclipse.jface.action.Separator)44 Point (org.eclipse.swt.graphics.Point)44 Menu (org.eclipse.swt.widgets.Menu)44 LocalSelectionTransfer (org.eclipse.jface.util.LocalSelectionTransfer)23 FileTransfer (org.eclipse.swt.dnd.FileTransfer)23 ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 IFile (org.eclipse.core.resources.IFile)1 EList (org.eclipse.emf.common.util.EList)1 EObject (org.eclipse.emf.ecore.EObject)1 ISelection (org.eclipse.jface.viewers.ISelection)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1