• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TemplateTransferDragSourceListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.gef.dnd.TemplateTransferDragSourceListener的典型用法代码示例。如果您正苦于以下问题:Java TemplateTransferDragSourceListener类的具体用法?Java TemplateTransferDragSourceListener怎么用?Java TemplateTransferDragSourceListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: createPaletteViewerProvider

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
@Override
protected PaletteViewerProvider createPaletteViewerProvider() {
	final ELTGraphicalEditor editor = this;
	return new PaletteViewerProvider(getEditDomain()) {

		@Override
		protected void configurePaletteViewer(final PaletteViewer viewer) {
			super.configurePaletteViewer(viewer);
			
			paletteEditPartFactory = new CustomPaletteEditPartFactory(palatteTextColor,viewer.getControl().getBackground());
			viewer.setEditPartFactory(paletteEditPartFactory);
			
			
			// create a drag source listener for this palette viewer
			// together with an appropriate transfer drop target listener,
			// this will enable
			// model element creation by dragging a
			// CombinatedTemplateCreationEntries
			// from the palette into the editor
			// @see ShapesEditor#createTransferDropTargetListener()

			viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
			PaletteContainerListener paletteContainerListener = new PaletteContainerListener(viewer, getGraphicalViewer());
			viewer.getControl().addMouseListener(paletteContainerListener);
			viewer.getControl().addMouseTrackListener(paletteContainerListener);
			viewer.getControl().addMouseMoveListener(paletteContainerListener);
			setDefaultToolUndoRedoStatus();
		}

		@Override
		public PaletteViewer createPaletteViewer(Composite parent) {
			CustomPaletteViewer pViewer = new CustomPaletteViewer();
			CustomFigureCanvas figureCanvas=new CustomFigureCanvas(parent,pViewer.getLightweightSys(),pViewer, getPalettesRoot(),editor);
			pViewer.setFigureCanvas(figureCanvas);
			configurePaletteViewer(pViewer);
			hookPaletteViewer(pViewer);
			return pViewer;
		}
	};
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:41,代码来源:ELTGraphicalEditor.java


示例2: createPaletteViewerProvider

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
protected PaletteViewerProvider createPaletteViewerProvider() {
	PaletteViewerProvider paletteViewerProvider = new PaletteViewerProvider(getEditDomain()) {
		public PaletteViewer createPaletteViewer(Composite parent) {
			PaletteViewer paletteViewer = super.createPaletteViewer(parent);
			paletteViewer.getPaletteViewerPreferences().setUseLargeIcons(PaletteViewerPreferences.LAYOUT_LIST, !PALETTE_USE_ICON16);
			return paletteViewer;
		}

		protected void configurePaletteViewer(PaletteViewer viewer) {
			super.configurePaletteViewer(viewer);
			viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
		}
	};
	return paletteViewerProvider;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:16,代码来源:DbToolGefEditor.java


示例3: createPaletteViewerProvider

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
protected PaletteViewerProvider createPaletteViewerProvider() {
	return new PaletteViewerProvider(getEditDomain()) {
		protected void configurePaletteViewer(PaletteViewer viewer) {
			super.configurePaletteViewer(viewer);
			viewer.addDragSourceListener(new TemplateTransferDragSourceListener(
					viewer));
		}

	};
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:11,代码来源:GUIEditor.java


示例4: initializePaletteViewer

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
@Override
protected void initializePaletteViewer()
{
	super.initializePaletteViewer();
	super.getPaletteViewer().addDragSourceListener(
			new TemplateTransferDragSourceListener(super.getPaletteViewer()));
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:8,代码来源:QueryDesignerEditor.java


示例5: initializePaletteViewer

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
/**
 * 初始化PaletteViewer
 */
protected void initializePaletteViewer()
{
	super.initializePaletteViewer();
	super.getPaletteViewer().addDragSourceListener(
			new TemplateTransferDragSourceListener(super.getPaletteViewer()));
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:10,代码来源:BODesignerEditor.java


示例6: initializePaletteViewer

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
@Override
protected void initializePaletteViewer() {
	super.initializePaletteViewer();
	super.getPaletteViewer()
			.addDragSourceListener(
					new TemplateTransferDragSourceListener(super
							.getPaletteViewer()));
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:9,代码来源:PageDesignerEditor.java


示例7: createPaletteViewerProvider

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
protected PaletteViewerProvider createPaletteViewerProvider() {
	return new PaletteViewerProvider(getEditDomain()) {
		protected void configurePaletteViewer(PaletteViewer viewer) {
			super.configurePaletteViewer(viewer);
			// create a drag source listener for this palette viewer
			// together with an appropriate transfer drop target listener,
			// this will enable
			// model element creation by dragging a
			// CombinatedTemplateCreationEntries
			// from the palette into the editor
			// @see ShapesEditor#createTransferDropTargetListener()
			viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
		}
	};
}
 
开发者ID:lunifera,项目名称:lunifera-sharky-m2m,代码行数:16,代码来源:ShapesEditor.java


示例8: configurePaletteViewer

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
@Override
protected void configurePaletteViewer(PaletteViewer viewer) {
  super.configurePaletteViewer(viewer);
  viewer.getKeyHandler().setParent(getPaletteKeyHandler());
  viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:7,代码来源:PaletteTreeViewerProvider.java


示例9: configureOutlineViewer

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
/**
 * Configure outline viewer.
 */
protected void configureOutlineViewer() {
	final EditPartViewer viewer = getViewer();
	viewer.setEditDomain(editor.getEditDomain());
	viewer.setEditPartFactory(getEditPartFactory());
	ContextMenuProvider provider = getMenuContentProvider();
	viewer.setContextMenu(provider);

	viewer.addDropTargetListener(new JSSTemplateTransferDropTargetListener(viewer));
	viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer) {
		@Override
		protected Object getTemplate() {
			List<Object> models = new ArrayList<Object>();
			Object obj = super.getTemplate();
			if (obj == null) {
				List<?> selection = getViewer().getSelectedEditParts();
				for (Object it : selection) {
					if (it instanceof EditPart) {
						Object model = ((EditPart) it).getModel();
						if (model instanceof IDragable) {
							models.add(model);
						}
						if (model instanceof MBand){
							BandTypeEnum bandType =((MBand)model).getBandType();
							if (BandTypeEnum.DETAIL.equals(bandType) || BandTypeEnum.GROUP_FOOTER.equals(bandType) || BandTypeEnum.GROUP_HEADER.equals(bandType)){
								models.add(model);
							}
						}
					}
				}
			}
			return models;
		}
	});
	// Add images drop listeners
	viewer.addDropTargetListener(new ImageResourceDropTargetListener(viewer, ResourceTransfer.getInstance()));
	viewer.addDropTargetListener(new ImageResourceDropTargetListener(viewer, FileTransfer.getInstance()));
	viewer.addDropTargetListener(new ImageResourceDropTargetListener(viewer, ImageURLTransfer.getInstance()));

	IPageSite site = getSite();
	site.registerContextMenu(provider.getId(), provider, site.getSelectionProvider());

	IToolBarManager tbm = site.getActionBars().getToolBarManager();
	registerToolbarAction(tbm);
	
	showPage(ID_ACTION_OUTLINE);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:50,代码来源:JDReportOutlineView.java


示例10: initializePaletteViewer

import org.eclipse.gef.dnd.TemplateTransferDragSourceListener; //导入依赖的package包/类
protected void initializePaletteViewer() {
    super.initializePaletteViewer();
    getPaletteViewer().addDragSourceListener(new TemplateTransferDragSourceListener(getPaletteViewer()));
}
 
开发者ID:hejiehui,项目名称:xeda,代码行数:5,代码来源:XedaDiagramGraphicalEditor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PropertyName类代码示例发布时间:2022-05-22
下一篇:
Java MixinEnvironment类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap