本文整理汇总了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();
}
});
}
示例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 ) );
}
示例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 ) );
}
示例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;
}
示例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));
}
示例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();
}
示例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));
}
示例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;
}
示例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));
}
示例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();
}
}
示例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;
}
}
示例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));
}
示例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));
}
示例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;
}
示例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));
}