Search in sources :

Example 51 with Transfer

use of org.eclipse.swt.dnd.Transfer in project InformationSystem by ObeoNetwork.

the class ClassDiagramConfigurationEditor 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 52 with Transfer

use of org.eclipse.swt.dnd.Transfer in project InformationSystem by ObeoNetwork.

the class ToolkitsEditor 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 53 with Transfer

use of org.eclipse.swt.dnd.Transfer in project InformationSystem by ObeoNetwork.

the class FlowEditor 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 54 with Transfer

use of org.eclipse.swt.dnd.Transfer in project InformationSystem by ObeoNetwork.

the class CinematicEditor 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 55 with Transfer

use of org.eclipse.swt.dnd.Transfer in project InformationSystem by ObeoNetwork.

the class EntityEditor 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)

Aggregations

Transfer (org.eclipse.swt.dnd.Transfer)151 TextTransfer (org.eclipse.swt.dnd.TextTransfer)71 Point (org.eclipse.swt.graphics.Point)63 Clipboard (org.eclipse.swt.dnd.Clipboard)51 Menu (org.eclipse.swt.widgets.Menu)37 IMenuManager (org.eclipse.jface.action.IMenuManager)32 MenuManager (org.eclipse.jface.action.MenuManager)32 Separator (org.eclipse.jface.action.Separator)32 LocalSelectionTransfer (org.eclipse.jface.util.LocalSelectionTransfer)32 EditingDomainViewerDropAdapter (org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)30 LocalTransfer (org.eclipse.emf.edit.ui.dnd.LocalTransfer)30 ViewerDragAdapter (org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter)30 UnwrappingSelectionProvider (org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider)30 FileTransfer (org.eclipse.swt.dnd.FileTransfer)30 DropTargetEvent (org.eclipse.swt.dnd.DropTargetEvent)27 DropTarget (org.eclipse.swt.dnd.DropTarget)23 GridData (org.eclipse.swt.layout.GridData)23 GridLayout (org.eclipse.swt.layout.GridLayout)22 Composite (org.eclipse.swt.widgets.Composite)22 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)20