本文整理汇总了Java中org.eclipse.jface.util.TransferDropTargetListener类的典型用法代码示例。如果您正苦于以下问题:Java TransferDropTargetListener类的具体用法?Java TransferDropTargetListener怎么用?Java TransferDropTargetListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TransferDropTargetListener类属于org.eclipse.jface.util包,在下文中一共展示了TransferDropTargetListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeGraphicalViewer
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
protected void initializeGraphicalViewer() {
super.initializeGraphicalViewer();
getGraphicalViewer().setContents(getDiagram());
// getGraphicalViewer()
// .addDropTargetListener(
// (TransferDropTargetListener) new TemplateTransferDropTargetListener(
// getGraphicalViewer()));
getGraphicalViewer()
.addDropTargetListener(
(TransferDropTargetListener) new MyTemplateTransferDropTargetListener(
getGraphicalViewer(), getDiagram()));
// getGraphicalViewer().setSelection(new StructuredSelection(elements))
/*
* getGraphicalViewer().addDropTargetListener((TransferDropTargetListener
* ) new TextTransferDropTargetListener( getGraphicalViewer(),
* TextTransfer.getInstance()));
*/
}
示例2: createTransferDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
/**
* Create a transfer drop target listener. When using a
* CombinedTemplateCreationEntry tool in the palette, this will enable model
* element creation by dragging from the palette.
*
* @see #createPaletteViewerProvider()
*/
public TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
@Override
protected CreationFactory getFactory(Object template) {
return new SimpleFactory((Class) template);
}
};
}
示例3: createTransferDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
private TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
protected CreationFactory getFactory(Object template) {
return new SimpleFactory((Class<?>) template);
}
};
}
示例4: configureOutlineViewer
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
protected void configureOutlineViewer(){
getViewer().setEditDomain(editor.getEditorEditDomain());
getViewer().setEditPartFactory(new DiagramTreePartFactory());
ContextMenuProvider cmProvider = new GUIEditorContextMenuProvider(
getViewer(), editor.getEditorActionRegistry());
getViewer().setContextMenu(cmProvider);
getSite().registerContextMenu(
"com.forgedui.editor.view.outline.contextmenu",
cmProvider, getSite().getSelectionProvider());
// Making this view as a selection provider to the workbench.
editor.getEditorSelectionSynchronizer().addViewer(getViewer());
getViewer().addDropTargetListener((TransferDropTargetListener)
new MyTemplateTransferDropTargetListener(getViewer(), diagram));
IToolBarManager tbm = getSite().getActionBars().getToolBarManager();
showOutlineAction = new Action() {
public void run() {
showPage(ID_OUTLINE);
}
};
showOutlineAction.setImageDescriptor(GUIEditorPlugin.getImageDescriptor("icons/outline.gif")); //$NON-NLS-1$
showOutlineAction.setToolTipText("Show Outline");
tbm.add(showOutlineAction);
showOverviewAction = new Action() {
public void run() {
showPage(ID_OVERVIEW);
}
};
showOverviewAction.setImageDescriptor(GUIEditorPlugin.getImageDescriptor("icons/overview.gif")); //$NON-NLS-1$
showOverviewAction.setToolTipText("Show Overview");
tbm.add(showOverviewAction);
showPage(ID_OUTLINE);
}
示例5: getTransferDropTargetListeners
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
@Override
public List<TransferDropTargetListener> getTransferDropTargetListeners(TreeViewer treeViewer) {
List<TransferDropTargetListener> dropListeners = new ArrayList<TransferDropTargetListener>(1);
dropListeners.add(new RepositoryFileResourceDropTargetListener(FileTransfer.getInstance()));
dropListeners.add(new InputControlDropTargetListener(treeViewer));
return dropListeners;
}
示例6: addDNDListeners
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
/**
* Add the listeners for the drag and drop
*/
private void addDNDListeners() {
int operations = DND.DROP_COPY | DND.DROP_MOVE;
List<TransferDragSourceListener> dragListeners = new ArrayList<TransferDragSourceListener>();
List<TransferDropTargetListener> dropListeners = new ArrayList<TransferDropTargetListener>();
for (IRepositoryViewProvider rp : rprovs) {
List<TransferDragSourceListener> tdsl = rp.getTransferDragSourceListeners(treeViewer);
if (tdsl != null)
dragListeners.addAll(tdsl);
List<TransferDropTargetListener> tdtl = rp.getTransferDropTargetListeners(treeViewer);
if (tdtl != null)
dropListeners.addAll(tdtl);
}
// In case its needed add the related delegating adapter for both drag and drop operations
if (!dragListeners.isEmpty()) {
DelegatingDragAdapter dragAdapter = new DelegatingDragAdapter();
for (TransferDragSourceListener dragListener : dragListeners) {
dragAdapter.addDragSourceListener(dragListener);
}
treeViewer.addDragSupport(operations, dragAdapter.getTransfers(), dragAdapter);
}
if (!dropListeners.isEmpty()) {
DelegatingDropAdapter dropAdapter = new DelegatingDropAdapter();
for (TransferDropTargetListener dropListener : dropListeners) {
dropAdapter.addDropTargetListener(dropListener);
}
treeViewer.addDropSupport(operations, dropAdapter.getTransfers(), dropAdapter);
}
}
示例7: createTransferDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
/**
* Create a transfer drop target listener. When using a
* CombinedTemplateCreationEntry tool in the palette, this will enable model
* element creation by dragging from the palette.
*
* @see #createPaletteViewerProvider()
*/
private TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
protected CreationFactory getFactory(Object template) {
return new SimpleFactory((Class) template);
}
};
}
示例8: getTransferDropTargetListeners
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
@Override
public List<TransferDropTargetListener> getTransferDropTargetListeners(TreeViewer treeViewer) {
return new ArrayList<TransferDropTargetListener>(0);
}
示例9: addDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
public void addDropTargetListener(TransferDropTargetListener listener) {
Assert.isLegal(!fStarted);
fDelegatingDropAdapter.addDropTargetListener(listener);
}
示例10: addDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
/**
* @see EditPartViewer#addDropTargetListener(org.eclipse.gef.dnd.TransferDropTargetListener)
*/
public void addDropTargetListener(
org.eclipse.gef.dnd.TransferDropTargetListener listener) {
addDropTargetListener((TransferDropTargetListener) listener);
}
示例11: removeDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
/**
* @see EditPartViewer#removeDropTargetListener(org.eclipse.gef.dnd.TransferDropTargetListener)
* @deprecated
*/
public void removeDropTargetListener(
org.eclipse.gef.dnd.TransferDropTargetListener listener) {
removeDropTargetListener((TransferDropTargetListener) listener);
}
示例12: getTransferDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
protected TransferDropTargetListener getTransferDropTargetListener() {
// if we cached it, we'd share it amongst models.
return new UrnDropTargetListener(viewer, ((URNspec)((UCMNavMultiPageEditor)viewer.getContents()).getModel()));
}
示例13: getTransferDropTargetListeners
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
/**
* Returns the list of {@link TransferDropTargetListener}s that should be added to the viewer.
*/
public List<TransferDropTargetListener> getTransferDropTargetListeners(TreeViewer treeViewer);
示例14: addDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
/**
* Provided for compatibility with existing code.
*
* @param listener
* the listener
* @see #addDropTargetListener(TransferDropTargetListener)
*/
void addDropTargetListener(
org.eclipse.gef.dnd.TransferDropTargetListener listener);
示例15: removeDropTargetListener
import org.eclipse.jface.util.TransferDropTargetListener; //导入依赖的package包/类
/**
* Removes the specified drop target listener. If all listeners are removed,
* the DropTarget that was created will be disposed.
*
* @see #addDropTargetListener(TransferDropTargetListener)
* @param listener
* @deprecated
*/
void removeDropTargetListener(
org.eclipse.gef.dnd.TransferDropTargetListener listener);