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


Java DND.DROP_MOVE属性代码示例

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


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

示例1: attachDropListener

private void attachDropListener() {
	dropTarget = new DropTarget(targetTable, DND.DROP_MOVE);
	dropTarget.setTransfer(new Transfer[] { TextTransfer.getInstance() });
	dropTarget.addDropListener(new DropTargetAdapter() {
		public void drop(DropTargetEvent event) {
			for (String fieldName : getformatedData((String) event.data)) {
				if(isPropertyAlreadyExists(fieldName)){
					return;
				}else{
					ExcelConfigurationDataStructure excelConfigurationDataStructure = new ExcelConfigurationDataStructure();
					excelConfigurationDataStructure.setFieldName(fieldName);
					listOfExcelConfiguration.add(excelConfigurationDataStructure);
					targetTableViewer.refresh();
					draggedFields.add(fieldName);
					enableDeleteButton();
				}
			}
			combo.setItems(convertToArray(draggedFields));
			combo.select(0);
			top_composite.layout();
			top_composite.getParent().layout();
			highlightDropFields();

		}
	});
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:26,代码来源:ExcelFormattingDialog.java

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

示例3: 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,代码行数:28,代码来源:ChartEditor.java

示例4: dragOver

@Override
public int dragOver(AvroNode draggedNode, AvroNode targetNode, TargetPosition position) {
	
	int detail = DND.DROP_NONE;
	
	AvroSchemaController schemaController = context.getService(AvroSchemaController.class);				

	if (schemaController.canDnDElement(DragAndDropPolicy.Action.MOVE, draggedNode, targetNode, position)) {
		detail = DND.DROP_MOVE;
	} else if (schemaController.canDnDElement(DragAndDropPolicy.Action.COPY, draggedNode, targetNode, position))  {
		detail = DND.DROP_COPY;
	} else if (schemaController.canDnDElement(DragAndDropPolicy.Action.REFERENCE, draggedNode, targetNode, position))  {
		detail = DND.DROP_MOVE;
	} 
	
	return detail;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:17,代码来源:AvroSchemaViewerDropPolicy.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: dragFinished

/**
    * Finish the drag by removing the source text if the operation
    * was MOVE.
    * 
    * Trigger updating of TexlipseModel and outline when done.
    * 
    * @param event the dragEvent
 * @see org.eclipse.swt.dnd.DragSourceListener#dragFinished(org.eclipse.swt.dnd.DragSourceEvent)
 */
public void dragFinished(DragSourceEvent event) {

       // remove MOVE source
       if (event.detail == DND.DROP_MOVE) {
		int sourceLength = this.dragSource.getPosition().getLength();
		try {
			getDocument().replace(removeOffset, sourceLength, "");
		} catch (BadLocationException e) {
		    TexlipsePlugin.log("Could not remove drag'n'drop source.", e);
		}
	}

       // trigger parsing
	this.outline.getEditor().updateModelNow();
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:24,代码来源:TexOutlineDNDAdapter.java

示例7: initDragAndDrop

void initDragAndDrop() {
		int operations = DND.DROP_MOVE;
		Transfer[] transferTypes = new Transfer[]{ LocalSelectionTransfer.getTransfer() };
		
		treeViewer.addDragSupport(operations, transferTypes, new DragSourceAdapter() {			
			@Override public void dragStart(DragSourceEvent event) {
				LocalSelectionTransfer.getTransfer().setSelection(treeViewer.getSelection()); // not really needed since we can get selection from member variable
			}
//			@Override public void dragSetData(DragSourceEvent event) {
//			}
//			@Override public void dragFinished(DragSourceEvent event) {
//			}
		});
		
		treeViewer.addDropSupport(operations, transferTypes, new StructureTreeDropAdapter(treeViewer));
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:16,代码来源:StructureTreeWidget.java

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

示例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:cplutte,项目名称:bts,代码行数:21,代码来源:BtsmodelEditor.java

示例10: dragFinished

/**
 * Method declared on DragSourceListener
 */
public void dragFinished(DragSourceEvent event) {
	if (!event.doit)
		return;
	// if the gadget was moved, remove it from the source viewer
	if (event.detail == DND.DROP_MOVE) {
		IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
		for (Iterator<?> it = selection.iterator(); it.hasNext();) {
			Object obj = it.next();
			if (obj instanceof ANode) {
				ANode n = (ANode) obj;
				if (n.isCut())
					((ANode) obj).setParent(null, -1);
			}
		}
		viewer.refresh();
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:NodeDragListener.java

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

示例12: 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,代码来源:DiEditor.java

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

示例14: createContextMenuFor

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,代码行数:16,代码来源:EMFPopupMenuSupport.java

示例15: 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:polarsys,项目名称:time4sys,代码行数:20,代码来源:SrmEditor.java


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