當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。