当前位置: 首页>>代码示例>>Java>>正文


Java LocalSelectionTransfer.getTransfer方法代码示例

本文整理汇总了Java中org.eclipse.jface.util.LocalSelectionTransfer.getTransfer方法的典型用法代码示例。如果您正苦于以下问题:Java LocalSelectionTransfer.getTransfer方法的具体用法?Java LocalSelectionTransfer.getTransfer怎么用?Java LocalSelectionTransfer.getTransfer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.util.LocalSelectionTransfer的用法示例。


在下文中一共展示了LocalSelectionTransfer.getTransfer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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 ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:ProtocolEditor.java

示例2: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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 ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:29,代码来源:ChartEditor.java

示例3: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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 ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:MemoryEditor.java

示例4: configureDragAndDrop

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
protected void configureDragAndDrop(DragAndDropConfiguration dragAndDropConfiguration, TreeViewer treeViewer) {

      // drop
      Transfer[] transferTypes = new Transfer[] { LocalSelectionTransfer.getTransfer() };
      int operations = dragAndDropConfiguration.getSupportedDropOperations(this);
      
      DropTarget target = new DropTarget(treeViewer.getControl(), operations);
      target.setTransfer(transferTypes);

      // Drop listeners pour le drop des elements sur l'arbre
      SchemaViewerDropPolicy dropPolicy = dragAndDropConfiguration.getDropPolicy(this);
      DnDTargetListener targetListener = new DnDTargetListener(this, nodeConverter, dropPolicy);
      target.addDropListener(targetListener);

      // Drag listener pour le drag des elements de l'arbre
      DragSourceListener sourceListener = new DnDSourceListener(this);
      operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT;
      transferTypes = new Transfer[] { LocalSelectionTransfer.getTransfer() };
      treeViewer.addDragSupport(operations, transferTypes, sourceListener);
      
  }
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:22,代码来源:SchemaViewer.java

示例5: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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));
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:23,代码来源:GenconfEditor.java

示例6: initDragAndDrop

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
void initDragAndDrop() {
		int operations = DND.DROP_MOVE;
		Transfer[] transferTypes = new Transfer[]{ LocalSelectionTransfer.getTransfer() };
		
		treeViewer.addDragSupport(operations, transferTypes, new DragSourceAdapter() {			
			@Override public void dragStart(DragSourceEvent event) {
				LocalSelectionTransfer.getTransfer().setSelection(treeViewer.getSelection()); // not really needed since we can get selection from member variable
			}
//			@Override public void dragSetData(DragSourceEvent event) {
//			}
//			@Override public void dragFinished(DragSourceEvent event) {
//			}
		});
		
		treeViewer.addDropSupport(operations, transferTypes, new StructureTreeDropAdapter(treeViewer));
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:17,代码来源:StructureTreeWidget.java

示例7: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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));
}
 
开发者ID:cplutte,项目名称:bts,代码行数:22,代码来源:BtsmodelEditor.java

示例8: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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));
}
 
开发者ID:mondo-project,项目名称:mondo-demo-wt,代码行数:23,代码来源:WTSpec4MEditor.java

示例9: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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));
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:22,代码来源:JaMoPPDiffEditor.java

示例10: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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));
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:22,代码来源:softwareEditor.java

示例11: toClipboard

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * Kopiert eine volle Kopie der Auswahl in die Zwischenablage.
 * @param selection
 */
public static void toClipboard(IStructuredSelection selection)
{
	Clipboard cb = new Clipboard(Display.getDefault());
	try
	{
		IStructuredSelection selectionCopy = ObjectUtil.clone(selection);
		// Auswahl
		LocalSelectionTransfer selectionTransfer = LocalSelectionTransfer.getTransfer();
		selectionTransfer.setSelection(selectionCopy);

		cb.setContents(new Object[] { selectionCopy },  new Transfer[] { selectionTransfer });
	}
	finally
	{
		cb.dispose();
	}
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:22,代码来源:ClipboardUtil.java

示例12: selectionToClipboard

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
private void selectionToClipboard()
{
	Clipboard cb = new Clipboard(Display.getDefault());
	try
	{
		
		StructuredSelection selection = getParentSelection();
		// Text
		TextTransfer textTransfer = TextTransfer.getInstance();
		String text = getTextRepresentation(selection);
		// Auswahl
		
		LocalSelectionTransfer selectionTransfer = LocalSelectionTransfer.getTransfer();
		selectionTransfer.setSelection(selection);

		cb.setContents(new Object[]   { text, 		  selection },
					   new Transfer[] { textTransfer, selectionTransfer });
	}
	finally
	{
		cb.dispose();
	}
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:24,代码来源:DatabaseUtil.java

示例13: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * 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));
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:21,代码来源:GrmEditor.java

示例14: dragSetData

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
@Override
public void dragSetData(DragSourceEvent event) {
    if (schemaViewer.getSelection() instanceof IStructuredSelection) {
        LocalSelectionTransfer transfer = LocalSelectionTransfer.getTransfer();
        IStructuredSelection ss = (IStructuredSelection) schemaViewer.getSelection();
        Object[] objects = ss.toArray();
        transfer.setSelection(new StructuredSelection(objects));
        event.data = transfer.getSelection();
    }
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:11,代码来源:DnDSourceListener.java

示例15: createContextMenuFor

import org.eclipse.jface.util.LocalSelectionTransfer; //导入方法依赖的package包/类
/**
 * Creates the generic menu for the given {@link StructuredViewer}.
 * 
 * @param viewer
 *            the {@link StructuredViewer}
 */
protected void createContextMenuFor(StructuredViewer viewer) {
    MenuManager contextMenu = new MenuManager("#PopUp");
    contextMenu.add(new Separator("additions"));
    contextMenu.setRemoveAllWhenShown(true);
    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));
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:20,代码来源:M2DocTemplateEditor.java


注:本文中的org.eclipse.jface.util.LocalSelectionTransfer.getTransfer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。