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


Java FileTransfer.getInstance方法代码示例

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


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

示例1: getTransferType

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的package包/类
Transfer getTransferType(String mime) {
    if (mime.equals("text/plain")) {
      return TextTransfer.getInstance();
    }
    if (mime.equals("text/rtf")) {
      return RTFTransfer.getInstance();
    }
    if (mime.equals("text/html")) {
      return HTMLTransfer.getInstance();
    }
    if (mime.equals("text/uri-list")) {
      return URLTransfer.getInstance();
    }
    if (mime.equals("application/x-java-rawimage")) {
      return ImageTransfer.getInstance();
    }
    if (mime.equals("application/x-java-file-list") || mime.equals("java.file-list")) {
        return FileTransfer.getInstance();
    }
    return getCustomTransfer(mime);
}
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:22,代码来源:OldFXCanvas.java

示例2: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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,代码来源:DeploymentEditor.java

示例3: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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,代码行数:24,代码来源:ComponentEditor.java

示例4: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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

示例5: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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

示例6: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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

示例7: runWithEvent

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的package包/类
@Override
public void runWithEvent(Event event) {
	ISelection selection = selectionProvider.getSelection();
	Collection<IProductModel> productModels = ProductSupport.toProductModels(selection);
	Collection<IFeatureModel> featureModels = FeatureSupport.toFeatureModels(selection);
	Collection<IPluginModelBase> pluginModels = PluginSupport.toPluginModels(selection);

	Collection<IProject> projects = new HashSet<IProject>();
	addUnderlyingResources(projects, productModels);
	addUnderlyingResources(projects, featureModels);
	addUnderlyingResources(projects, pluginModels);

	String[] fileData = new String[projects.size()];
	int i = 0;
	for (IProject project : projects) {
		fileData[i++] = project.getLocation().toOSString();
	}

	String textData = getTextData(productModels, featureModels, pluginModels);

	Object[] data = { projects.toArray(new IResource[projects.size()]), textData, fileData };
	Transfer[] dataTypes = { ResourceTransfer.getInstance(), TextTransfer.getInstance(), FileTransfer.getInstance() };
	clipboard.setContents(data, dataTypes);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:25,代码来源:FeatureAndPluginCopyAction.java

示例8: addDragAdapters

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的package包/类
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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:CallHierarchyViewPart.java

示例9: createPartControl

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
	parent.setLayout(new FillLayout());
	this.container = parent;
	CellEditorGlobalActionHanlder.getInstance().setIActionBars(getViewSite().getActionBars());
	DropTarget target = new DropTarget(parent, DND.DROP_MOVE | DND.DROP_COPY);
	Transfer[] tfs = new Transfer[] { FileTransfer.getInstance() };
	target.setTransfer(tfs);
	target.addDropListener(new DropTargetAdapter() {
		@Override
		public void drop(DropTargetEvent event) {
			Object o = event.data;
			if (o instanceof String[]) {
				String[] s = (String[]) o;
				if (s.length == 0 && s[0] == null || s[0].length() == 0) {
					return;
				}
				File f = new File(s[0]);
				if (f.exists() && f.isFile()) {
					open(f);
				}
			}
		}
	});
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:26,代码来源:TmxEditorViewer.java

示例10: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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

示例11: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的package包/类
private final MenuManager createContextMenuFor(StructuredViewer viewer) {
	
	MenuManager contextMenu = new MenuManager("#PopUp", "eu.cloudscale.env.toolcahin.treeview.menumanager");
	contextMenu.add(new Separator("additions"));
	contextMenu.setRemoveAllWhenShown(true);
	contextMenu.addMenuListener(this);
	Menu menu = contextMenu.createContextMenu(viewer.getControl());
	viewer.getControl().setMenu(menu);
	
	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));
	
	return contextMenu;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:17,代码来源:EMFPopupMenuSupport.java

示例12: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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,代码来源:MappingEditor.java

示例13: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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

示例14: initializeDragAndDrop

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的package包/类
private void initializeDragAndDrop() {
	int ops = DND.DROP_COPY | DND.DROP_DEFAULT;
	Transfer[] transfers = new Transfer[] { FileTransfer.getInstance() };
	TreeViewer viewer = getViewer();
	JSBuildFileViewDropAdapter adapter = new JSBuildFileViewDropAdapter(
			this);
	viewer.addDropSupport(ops, transfers, adapter);
}
 
开发者ID:angelozerr,项目名称:jsbuild-eclipse,代码行数:9,代码来源:JSBuildFileView.java

示例15: createContextMenuFor

import org.eclipse.swt.dnd.FileTransfer; //导入方法依赖的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 -->
 *
 * @param viewer the viewer
 * @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:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:23,代码来源:CarchaEditor.java


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