本文整理汇总了Java中org.eclipse.swt.dnd.DropTargetListener类的典型用法代码示例。如果您正苦于以下问题:Java DropTargetListener类的具体用法?Java DropTargetListener怎么用?Java DropTargetListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DropTargetListener类属于org.eclipse.swt.dnd包,在下文中一共展示了DropTargetListener类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDropTarget
import org.eclipse.swt.dnd.DropTargetListener; //导入依赖的package包/类
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;
}
示例2: preWindowOpen
import org.eclipse.swt.dnd.DropTargetListener; //导入依赖的package包/类
public void preWindowOpen()
{
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(800, 600));
configurer.setShowFastViewBars(true);
configurer.setShowStatusLine(true);
configurer.setShowProgressIndicator(true);
configurer.setShowCoolBar(false);
// A DropTargetAdapter is need for editor DND support
final DropTargetListener dtl = new EditorAreaDropAdapter(
configurer.getWindow());
configurer.configureEditorAreaDropListener(dtl);
}
示例3: hookRecursive
import org.eclipse.swt.dnd.DropTargetListener; //导入依赖的package包/类
protected void hookRecursive(Control child, DropTargetListener dropListener) {
DropTarget childTarget = findDropTarget(child);
if (childTarget != null) {
registerWithExistingTarget(childTarget);
registerDropListener(childTarget, dropListener);
}
if (child instanceof Composite) {
Composite composite = (Composite) child;
Control[] children = composite.getChildren();
for (Control control : children) {
hookRecursive(control, dropListener);
}
}
}
示例4: hookRecursive
import org.eclipse.swt.dnd.DropTargetListener; //导入依赖的package包/类
private void hookRecursive(Control child, DropTargetListener dropListener) {
DropTarget childTarget = findDropTarget(child);
if (childTarget != null) {
registerWithExistingTarget(childTarget);
registerDropListener(childTarget, dropListener);
}
if (child instanceof Composite) {
Composite composite = (Composite) child;
Control[] children = composite.getChildren();
for (Control control : children) {
hookRecursive(control, dropListener);
}
}
}
示例5: registerDropListener
import org.eclipse.swt.dnd.DropTargetListener; //导入依赖的package包/类
protected void registerDropListener(DropTarget target, DropTargetListener dropListener) {
target.removeDropListener(dropListener);
target.addDropListener(dropListener);
}
示例6: addDropSupport
import org.eclipse.swt.dnd.DropTargetListener; //导入依赖的package包/类
@Override
public void addDropSupport(int operations, Transfer[] transferTypes, DropTargetListener listener) {
fViewer.addDropSupport(operations, transferTypes, listener);
}
示例7: registerDropListener
import org.eclipse.swt.dnd.DropTargetListener; //导入依赖的package包/类
private void registerDropListener(DropTarget target, DropTargetListener dropListener) {
target.removeDropListener(dropListener);
target.addDropListener(dropListener);
}
示例8: addDropSupport
import org.eclipse.swt.dnd.DropTargetListener; //导入依赖的package包/类
/**
* Adds support for dropping items into this viewer via a user drag-and-drop
* operation.
*
* @param operations
* a bitwise OR of the supported drag and drop operation types (
* <code>DROP_COPY</code>,<code>DROP_LINK</code>, and
* <code>DROP_MOVE</code>)
* @param transferTypes
* the transfer types that are supported by the drop operation
* @param listener
* the callback that will be invoked after the drag and drop
* operation finishes
* @see org.eclipse.swt.dnd.DND
*/
public void addDropSupport(int operations, Transfer[] transferTypes,
final DropTargetListener listener) {
Control control = getControl();
DropTarget dropTarget = new DropTarget(control, operations);
dropTarget.setTransfer(transferTypes);
dropTarget.addDropListener(listener);
}