當前位置: 首頁>>代碼示例>>Java>>正文


Java DND.DROP_DEFAULT屬性代碼示例

本文整理匯總了Java中org.eclipse.swt.dnd.DND.DROP_DEFAULT屬性的典型用法代碼示例。如果您正苦於以下問題:Java DND.DROP_DEFAULT屬性的具體用法?Java DND.DROP_DEFAULT怎麽用?Java DND.DROP_DEFAULT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.swt.dnd.DND的用法示例。


在下文中一共展示了DND.DROP_DEFAULT屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureDragAndDrop

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,代碼行數:21,代碼來源:SchemaViewer.java

示例2: validateDrop

@Override
	public boolean validateDrop(Object target, int operation, TransferData type) {
		overrideOperation(DND.DROP_COPY);
//		if (application == null)
//			return false;

		if (operation == DND.DROP_COPY || operation == DND.DROP_DEFAULT) {
			if (LocalSelectionTransfer.getTransfer().isSupportedType(type)) {
				IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer()
						.getSelection();
				Object[] objects = selection.toArray();
				for (Object obj : objects) {
					if (obj instanceof CFServiceInstance) {
						return true;
					}
				}
			}
		}
		return false;
	}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:20,代碼來源:ServicesViewerDropListener.java

示例3: 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

示例4: validateDrop

@Override
	public boolean validateDrop(Object target, int operation, TransferData type) {
		overrideOperation(DND.DROP_COPY);
//		if (application == null)
//			return false;

		if (operation == DND.DROP_COPY || operation == DND.DROP_DEFAULT) {
			if (LocalSelectionTransfer.getTransfer().isSupportedType(type)) {
				IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer()
						.getSelection();
				Object[] objects = selection.toArray();
				for (Object obj : objects) {
					if (obj instanceof CloudService) {
						return true;
					}
				}
			}
		}
		return false;
	}
 
開發者ID:osswangxining,項目名稱:dockerfoundry,代碼行數:20,代碼來源:ServicesViewerDropListener.java

示例5: createOperations

static int createOperations(final Set<DropAction> actions) {
    int result = 0;
    if (actions.contains(DropAction.NONE)) {
        result = result | DND.DROP_NONE;
    }
    if (actions.contains(DropAction.DEFAULT)) {
        result = result | DND.DROP_DEFAULT;
    }
    if (actions.contains(DropAction.COPY)) {
        result = result | DND.DROP_COPY;
    }
    if (actions.contains(DropAction.MOVE)) {
        result = result | DND.DROP_MOVE;
    }
    if (actions.contains(DropAction.LINK)) {
        result = result | DND.DROP_LINK;
    }
    return result;
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:19,代碼來源:DragDropUtil.java

示例6: createActions

static Set<DropAction> createActions(final int operations) {
    final Set<DropAction> result = new HashSet<DropAction>();
    if ((operations & DND.DROP_NONE) != 0) {
        result.add(DropAction.NONE);
    }
    if ((operations & DND.DROP_DEFAULT) != 0) {
        result.add(DropAction.DEFAULT);
    }
    if ((operations & DND.DROP_COPY) != 0) {
        result.add(DropAction.COPY);
    }
    if ((operations & DND.DROP_MOVE) != 0) {
        result.add(DropAction.MOVE);
    }
    if ((operations & DND.DROP_LINK) != 0) {
        result.add(DropAction.LINK);
    }
    return result;
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:19,代碼來源:DragDropUtil.java

示例7: getDropAction

static DropAction getDropAction(final int detail) {
    if (detail == DND.DROP_NONE) {
        return DropAction.NONE;
    }
    else if (detail == DND.DROP_DEFAULT) {
        return DropAction.DEFAULT;
    }
    else if (detail == DND.DROP_COPY) {
        return DropAction.COPY;
    }
    else if (detail == DND.DROP_MOVE) {
        return DropAction.MOVE;
    }
    else if (detail == DND.DROP_LINK) {
        return DropAction.LINK;
    }
    else {
        return DropAction.NONE;
    }
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:20,代碼來源:DragDropUtil.java

示例8: determineOperation

@Override
protected int determineOperation(Object target, int operation, TransferData transferType, int operations) {
	setSelectionFeedbackEnabled(false);
	setExpandEnabled(false);

	initializeSelection();

	if (target != null) {
		return super.determineOperation(target, operation, transferType, operations);
	} else if (getInputElement(getSelection()) != null) {
		setSelectionFeedbackEnabled(false);
		setExpandEnabled(false);
		return operation == DND.DROP_DEFAULT || operation == DND.DROP_MOVE ? DND.DROP_LINK : operation;
	} else {
		return DND.DROP_NONE;
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:17,代碼來源:CallHierarchyTransferDropAdapter.java

示例9: createDropTarget

public DropTarget createDropTarget ( final Transfer[] transfers, final DropTargetListener dropTargetListener )
{
    checkWidget ();

    final DropTarget target = new DropTarget ( this.chartArea, DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_LINK );
    target.setTransfer ( transfers );
    target.addDropListener ( dropTargetListener );
    return target;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:9,代碼來源:ChartManager.java

示例10: addDropSupport

private void addDropSupport(Section section) {
	int ops = DND.DROP_COPY | DND.DROP_LINK | DND.DROP_DEFAULT;
	Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };

	DropTarget dropTarget = new DropTarget(section, ops);
	dropTarget.setTransfer(transfers);
	dropTarget.addDropListener(servicesDropListener);
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:8,代碼來源:ApplicationDetailsPart.java

示例11: dragEnter

@Override
public void dragEnter(DropTargetEvent event) {
	if (event.detail == DND.DROP_DEFAULT || event.detail == DND.DROP_NONE) {
		event.detail = DND.DROP_COPY;
	}
	super.dragEnter(event);
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:7,代碼來源:ServicesViewerDropListener.java

示例12: initializeDragAndDrop

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,代碼行數:8,代碼來源:JSBuildFileView.java

示例13: 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

示例14: getDetailString

/**
 * Utility function to get a string to print out a "detail"
 * @param detail
 * @return the string name of the detail.
 */
protected final String getDetailString(int detail) {
	switch (detail) {
		case DND.DROP_DEFAULT:     return "DND.DROP_DEFAULT"; 
		case DND.DROP_COPY:        return "DND.DROP_COPY";
		case DND.DROP_LINK:        return "DND.DROP_LINK";
		case DND.DROP_MOVE:        return "DND.DROP_MOVE";
		case DND.DROP_NONE:        return "DND.DROP_NONE";
		case DND.DROP_TARGET_MOVE: return "DND.DROP_TARGET_MOVE";
		default:                   return "DND.???";
	}
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:16,代碼來源:EnsembleDragSourceListener.java

示例15: getDetailString

protected final String getDetailString(int detail) {
	switch (detail) {
		case DND.DROP_DEFAULT:     return "DND.DROP_DEFAULT"; 
		case DND.DROP_COPY:        return "DND.DROP_COPY";
		case DND.DROP_LINK:        return "DND.DROP_LINK";
		case DND.DROP_MOVE:        return "DND.DROP_MOVE";
		case DND.DROP_NONE:        return "DND.DROP_NONE";
		case DND.DROP_TARGET_MOVE: return "DND.DROP_TARGET_MOVE";
		default:                   return "DND.???";
	}
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:11,代碼來源:EnsembleDropTargetListener.java


注:本文中的org.eclipse.swt.dnd.DND.DROP_DEFAULT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。