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


Java DND.DROP_COPY属性代码示例

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


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

示例1: 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" ); //$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,代码行数:21,代码来源:ProtocolEditor.java

示例2: applyDragFromTableViewer

public void applyDragFromTableViewer(Control sourceControl, int index) {
	Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
	final String portLabel = "in" + index + ".";
	int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
	final Table table = (Table) sourceControl;
	DragSource source = new DragSource(table, operations);
	source.setTransfer(types);
	final String[] columnData = new String[1];
	source.addDragListener(new DragSourceAdapter() {
		public void dragSetData(DragSourceEvent event) {
			// Set the data to be the first selected item's text
			event.data = addDelimeter(portLabel, table.getSelection());
		}
	});

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:16,代码来源:ELTSWTWidgets.java

示例3: createXhtmlTree

private void createXhtmlTree() {
	sourcePicker.createXhtmlTree(treesSashForm);
	
	// DND support
	int ops = DND.DROP_COPY | DND.DROP_MOVE;
	Transfer[] transfers = new Transfer[] {StepSourceTransfer.getInstance()};
	
	DragSource source = new DragSource(sourcePicker.getTwsDomTree().getTree(), ops);
	source.setTransfer(transfers);
	source.addDragListener(new DragSourceAdapter() {			
		@Override
		public void dragStart(DragSourceEvent event) {
			event.doit = true;
			StepSourceTransfer.getInstance().setStepSource(sourcePicker.getDragData());
		}
	});
	
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:18,代码来源:SourcePickerView.java

示例4: 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 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,代码行数:23,代码来源:ComponentEditor.java

示例5: 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));
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:22,代码来源:GenconfEditor.java

示例6: 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));
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:23,代码来源:BpmnDiEditor.java

示例7: handleDrop

/**
 * @see org.eclipse.ui.navigator.CommonDropAdapterAssistant#handleDrop(org.eclipse.ui.navigator.CommonDropAdapter,
 *      org.eclipse.swt.dnd.DropTargetEvent, java.lang.Object)
 */
@Override
public IStatus handleDrop(CommonDropAdapter dropAdapter, DropTargetEvent event, Object target) {

    switch (event.detail) {
        case DND.DROP_DEFAULT:
        case DND.DROP_MOVE:
            return handleDropMove(target, event);
        case DND.DROP_COPY:
            return handleDropCopy(target, event);
        default:
            break;
    }

    return Status.CANCEL_STATUS;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:19,代码来源:ExplorerDropAdapterAssistant.java

示例8: 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));
}
 
开发者ID:cplutte,项目名称:bts,代码行数:21,代码来源:BtsmodelEditor.java

示例9: 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));
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:21,代码来源:SoftwareEditor.java

示例10: 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));
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:20,代码来源:CrtpEditor.java

示例11: getTransferMode

TransferMode getTransferMode(int bits) {
    switch (bits) {
        case DND.DROP_COPY:
            return TransferMode.COPY;
        case DND.DROP_MOVE:
        case DND.DROP_TARGET_MOVE:
            return TransferMode.MOVE;
        case DND.DROP_LINK:
            return TransferMode.LINK;
        default:
           return null;
    }
}
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:13,代码来源:OldFXCanvas.java

示例12: drop

@Override
public void drop(DropTargetEvent event) {
	if (event.data == null) {
		// case of DND drop with stepSource on Linux, see #4473
		for (TransferData transferData : event.dataTypes) {
			if (StepSourceTransfer.getInstance().isSupportedType(transferData)) {
				event.data = StepSourceTransfer.getInstance().getStepSource();
				break;
			}
			if (PaletteSourceTransfer.getInstance().isSupportedType(transferData)) {
				event.data = PaletteSourceTransfer.getInstance().getPaletteSource();
				break;
			}
			if (MobileSourceTransfer.getInstance().isSupportedType(transferData)) {
				event.data = MobileSourceTransfer.getInstance().getMobileSource();
				break;
			}
		}
		if (event.data == null) {
			return;
		}
	}
	
	if ("gtk".equalsIgnoreCase(SWT.getPlatform()) && event.detail == 0) {
		event.detail = DND.DROP_MOVE;
	}
	
	detail = event.detail;
	ConvertigoPlugin.clipboardManagerDND.isCopy = (event.detail == DND.DROP_COPY);
	ConvertigoPlugin.clipboardManagerDND.isCut = (event.detail == DND.DROP_MOVE);
	super.drop(event);
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:32,代码来源:TreeDropAdapter.java

示例13: createContextMenuFor

/**
 * 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,代码行数:19,代码来源:M2DocTemplateEditor.java

示例14: configure

public void configure(CommandManager commandManager, Control control, ISelectionProvider provider) {

		dragAdapter = new DelegatingDragAdapter();
		dragSource = new DragSource(control, DND.DROP_COPY | DND.DROP_MOVE);
		dragAdapter.addDragSourceListener(new OutlineDragSourceListener(provider));
		dragSource.addDragListener(dragAdapter);
		dragSource.setTransfer(dragAdapter.getTransfers());

		dropAdapter = new DelegatingDropAdapter();
		dropTarget = new DropTarget(control, DND.DROP_COPY | DND.DROP_MOVE);
		dropAdapter.addDropTargetListener(new OutlineDropTargetListener(commandManager));
		dropTarget.addDropListener(dropAdapter);
		dropTarget.setTransfer(dropAdapter.getTransfers());
	}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:14,代码来源:DndConfigurationStrategy.java

示例15: dragOperationChanged

public void dragOperationChanged(DropTargetEvent event) {
	if (event.detail == DND.DROP_DEFAULT) {
		if ((event.operations & DND.DROP_COPY) != 0) {
			event.detail = DND.DROP_COPY;
		} else {
			event.detail = DND.DROP_NONE;
		}
	}
}
 
开发者ID:BeckYang,项目名称:TeamFileList,代码行数:9,代码来源:TeamFileListView.java


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