当前位置: 首页>>代码示例>>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;未经允许,请勿转载。