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


Java PaletteViewer.addDragSourceListener方法代码示例

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


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

示例1: createPaletteViewerProvider

import org.eclipse.gef.ui.palette.PaletteViewer; //导入方法依赖的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.ui.palette.PaletteViewer; //导入方法依赖的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.ui.palette.PaletteViewer; //导入方法依赖的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: configurePaletteViewer

import org.eclipse.gef.ui.palette.PaletteViewer; //导入方法依赖的package包/类
public 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()
    list = new UrnDragSourceListener(viewer);
    viewer.addDragSourceListener(list);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:11,代码来源:UrnPaletteViewerProvider.java

示例5: createPaletteViewerProvider

import org.eclipse.gef.ui.palette.PaletteViewer; //导入方法依赖的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

示例6: configurePaletteViewer

import org.eclipse.gef.ui.palette.PaletteViewer; //导入方法依赖的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


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