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

Java TemplateTransfer类代码示例

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

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



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

示例1: createControl

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void createControl(final Composite parent) {
    sash = new SashForm(parent, SWT.VERTICAL);

    // コンストラクタで指定したビューワの作成
    viewer.createControl(sash);

    // EditPartFactory の設定
    final ERDiagramOutlineEditPartFactory editPartFactory = new ERDiagramOutlineEditPartFactory();
    viewer.setEditPartFactory(editPartFactory);

    // グラフィカル・エディタのルート・モデルをツリー・ビューワにも設定
    viewer.setContents(diagram);

    final Canvas canvas = new Canvas(sash, SWT.BORDER);
    // サムネイル・フィギュアを配置する為の LightweightSystem
    lws = new LightweightSystem(canvas);

    resetView(registry);

    final AbstractTransferDragSourceListener dragSourceListener = new ERDiagramTransferDragSourceListener(viewer, TemplateTransfer.getInstance());
    viewer.addDragSourceListener(dragSourceListener);

    diagram.refreshOutline();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:29,代码来源:ERDiagramOutlinePage.java


示例2: dragStart

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
@Override
public void dragStart(DragSourceEvent dragsourceevent) {
	super.dragStart(dragsourceevent);

	Object target = this.getTargetModel(dragsourceevent);

	if (target != null
			&& target == this.dragSourceViewer.findObjectAt(
					new Point(dragsourceevent.x, dragsourceevent.y))
					.getModel()) {
		TemplateTransfer transfer = (TemplateTransfer) this.getTransfer();
		transfer.setObject(this.createTransferData(dragsourceevent));

	} else {
		dragsourceevent.doit = false;
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:18,代码来源:ERDiagramTransferDragSourceListener.java


示例3: createControl

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
    this.sash = new SashForm(parent, SWT.VERTICAL);
    viewer.createControl(sash);
    editPartFactory = new ERDiagramOutlineEditPartFactory();
    editPartFactory.setQuickMode(quickMode);
    viewer.setEditPartFactory(editPartFactory);
    viewer.setContents(diagram);
    if (!quickMode) {
        final Canvas canvas = new Canvas(sash, SWT.BORDER);
        lws = new LightweightSystem(canvas);
    }
    resetView(registry);
    final AbstractTransferDragSourceListener dragSourceListener =
            new ERDiagramTransferDragSourceListener(viewer, TemplateTransfer.getInstance());
    viewer.addDragSourceListener(dragSourceListener);

    expandVirturalDiagramTree();
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:20,代码来源:ERDiagramOutlinePage.java


示例4: handleValidateDrag

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
 * Validates drag source from palette, layout, or data view
 * 
 * @param dragObj
 * @return validate result
 */
private boolean handleValidateDrag( Object dragObj )
{
	if ( DNDService.getInstance( )
			.validDrop( TemplateTransfer.getInstance( ).getTemplate( ),
					getTargetEditPart( ),
					DND.DROP_DEFAULT,
					new DNDLocation( getDropLocation( ) ) ) )
	{
		return true;
	}
	return dragObj != null
			&& ( handleValidatePalette( dragObj )
					|| handleValidateOutline( dragObj )
					|| handleValidateInsert( dragObj ) || handleValidateLibrary( dragObj ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:ReportTemplateTransferDropTargetListener.java


示例5: dragOver

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
 * @see ViewerDropAdapter#dragOver(DropTargetEvent)
 * 
 */
public void dragOver( DropTargetEvent event )
{
	super.dragOver( event );
	if ( event.detail == DND.DROP_NONE )
		return;
	if ( !validateTarget( getCurrentTarget( ) )
			|| !validateTarget( getCurrentTarget( ),
					TemplateTransfer.getInstance( ).getTemplate( ) ) )
	{
		event.detail = DND.DROP_NONE;
		if ( Policy.TRACING_DND_DRAG )
		{
			System.out.println( "DND >> Drag over " + event.getSource( ) ); //$NON-NLS-1$
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:DesignElementDropAdapter.java


示例6: dragStart

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
@Override
public void dragStart(final DragSourceEvent dragsourceevent) {
    super.dragStart(dragsourceevent);

    final Object target = getTargetModel(dragsourceevent);

    if (target != null && target == dragSourceViewer.findObjectAt(new Point(dragsourceevent.x, dragsourceevent.y)).getModel()) {
        final TemplateTransfer transfer = (TemplateTransfer) getTransfer();
        transfer.setObject(createTransferData(dragsourceevent));

    } else {
        dragsourceevent.doit = false;
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:15,代码来源:ERDiagramTransferDragSourceListener.java


示例7: initDragAndDrop

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
private void initDragAndDrop(final GraphicalViewer viewer) {
    final AbstractTransferDragSourceListener dragSourceListener = new ERDiagramTransferDragSourceListener(viewer, TemplateTransfer.getInstance());
    viewer.addDragSourceListener(dragSourceListener);

    final AbstractTransferDropTargetListener dropTargetListener = new ERDiagramTransferDropTargetListener(viewer, TemplateTransfer.getInstance());

    viewer.addDropTargetListener(dropTargetListener);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:9,代码来源:ERDiagramEditor.java


示例8: createControl

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void createControl(Composite parent) {
	this.sash = new SashForm(parent, SWT.VERTICAL);

	// コンストラクタで指定したビューワの作成
	this.viewer.createControl(this.sash);

	// EditPartFactory の設定
	ERDiagramOutlineEditPartFactory editPartFactory = new ERDiagramOutlineEditPartFactory();
	this.viewer.setEditPartFactory(editPartFactory);

	// グラフィカル・エディタのルート・モデルをツリー・ビューワにも設定
	this.viewer.setContents(this.diagram);

	Canvas canvas = new Canvas(this.sash, SWT.BORDER);
	// サムネイル・フィギュアを配置する為の LightweightSystem
	this.lws = new LightweightSystem(canvas);

	this.resetView(this.registry);

	AbstractTransferDragSourceListener dragSourceListener = new ERDiagramTransferDragSourceListener(
			this.viewer, TemplateTransfer.getInstance());
	this.viewer.addDragSourceListener(dragSourceListener);
	
	this.diagram.refreshOutline();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:30,代码来源:ERDiagramOutlinePage.java


示例9: initDragAndDrop

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
private void initDragAndDrop(GraphicalViewer viewer) {
	AbstractTransferDragSourceListener dragSourceListener = new ERDiagramTransferDragSourceListener(
			viewer, TemplateTransfer.getInstance());
	viewer.addDragSourceListener(dragSourceListener);

	AbstractTransferDropTargetListener dropTargetListener = new ERDiagramTransferDropTargetListener(
			viewer, TemplateTransfer.getInstance());

	viewer.addDropTargetListener(dropTargetListener);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:11,代码来源:ERDiagramEditor.java


示例10: initDragAndDrop

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
protected void initDragAndDrop(GraphicalViewer viewer) {
    final AbstractTransferDragSourceListener dragSourceListener =
            new ERDiagramTransferDragSourceListener(viewer, TemplateTransfer.getInstance());
    viewer.addDragSourceListener(dragSourceListener);
    final AbstractTransferDropTargetListener dropTargetListener =
            new ERDiagramTransferDropTargetListener(viewer, TemplateTransfer.getInstance());
    viewer.addDropTargetListener(dropTargetListener);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:9,代码来源:MainDiagramEditor.java


示例11: dragStart

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
@Override
public void dragStart(DragSourceEvent dragsourceevent) {
    super.dragStart(dragsourceevent);

    final Object target = getTargetModel(dragsourceevent);
    if (target != null) {
        final TemplateTransfer transfer = (TemplateTransfer) getTransfer();
        transfer.setObject(target);
    } else {
        dragsourceevent.doit = false;
    }
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:13,代码来源:ERDiagramTransferDragSourceListener.java


示例12: dragStart

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
public void dragStart( DragSourceEvent event )
{
	boolean doit = !getViewer( ).getSelection( ).isEmpty( );
	if ( doit )
	{
		IStructuredSelection selection = (IStructuredSelection) getViewer( ).getSelection( );
		List objectList = selection.toList( );
		selectionList.clear( );
		for ( int i = 0; i < objectList.size( ); i++ )
		{
			if ( objectList.get( i ) instanceof ReportResourceEntry )
				selectionList.add( ( (ReportResourceEntry) objectList.get( i ) ).getReportElement( ) );
			else
				selectionList.add( objectList.get( i ) );
		}
		Object[] objects = selectionList.toArray( );
		if ( validateType( objects ) )
		{
			for ( int i = 0; i < objects.length; i++ )
				if ( !validateTransfer( objects[i] ) )
				{
					doit = false;
					break;
				}
		}
		else
			doit = false;
		if ( doit )
			TemplateTransfer.getInstance( ).setTemplate( objects );
	}
	event.doit = doit;
	if ( Policy.TRACING_DND_DRAG && doit )
	{
		System.out.println( "DND >> Drag starts." ); //$NON-NLS-1$
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:37,代码来源:LibraryDragListener.java


示例13: dragOver

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
public void dragOver( DropTargetEvent event )
{
	super.dragOver( event );
	if ( !handleValidateDrag( TemplateTransfer.getInstance( ).getTemplate( ) ) )
	{
		event.detail = DND.DROP_NONE;
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:ReportTemplateTransferDropTargetListener.java


示例14: validateDrop

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
 * @see ViewerDropAdapter#validateDrop(Object, int, TransferData)
 */
public boolean validateDrop( Object target, int op, TransferData type )
{

	//		if(target!=null){
	//			Object adapter = ElementAdapterManager.getAdatper( target, IElementDropAdapter.class );
	//			if(adapter!=null){
	//				IElementDropAdapter dropAdapter = (IElementDropAdapter)adapter;
	//				return dropAdapter.validateDrop( target, getCurrentOperation( ), getCurrentLocation( ), null, type );
	//			}
	//		}

	return TemplateTransfer.getInstance( ).isSupportedType( type );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:DesignElementDropAdapter.java


示例15: dragFinished

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
 * @see DragSourceAdapter#dragFinished(DragSourceEvent)
 */
public void dragFinished( DragSourceEvent event )
{
	if ( event.doit )
	{
		TemplateTransfer.getInstance( ).setTemplate( null );
		if ( Policy.TRACING_DND_DRAG )
		{
			System.out.println( "DND >> Drag finished." ); //$NON-NLS-1$
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:DesignElementDragAdapter.java


示例16: dragSetData

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
	 * @see DragSourceAdapter#dragSetData(DragSourceEvent)
	 */
	public void dragSetData( DragSourceEvent event )
	{
//		IStructuredSelection selection = (IStructuredSelection) getViewer( ).getSelection( );
//		Object[] objects = selection.toList( ).toArray( );

		// fix bug 116180
		Object[] objects = selectionList.toArray( );
		if ( TemplateTransfer.getInstance( ).isSupportedType( event.dataType ) )
			event.data = objects;
	}
 
开发者ID:eclipse,项目名称:birt,代码行数:14,代码来源:DesignElementDragAdapter.java


示例17: dragStart

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
 * @see DragSourceAdapter#dragStart(DragSourceEvent)
 */
public void dragStart( DragSourceEvent event )
{
	boolean doit = !getViewer( ).getSelection( ).isEmpty( );
	if ( doit )
	{
		IStructuredSelection selection = (IStructuredSelection) getViewer( ).getSelection( );
		selectionList = selection.toList( );
		Object[] objects = selection.toList( ).toArray( );
		if ( validateType( objects ) )
		{
			for ( int i = 0; i < objects.length; i++ )
				if ( !validateTransfer( objects[i] ) )
				{
					doit = false;
					break;
				}
		}
		else
			doit = false;
		if ( doit )
			TemplateTransfer.getInstance( ).setTemplate( objects );
	}
	event.doit = doit;
	if ( Policy.TRACING_DND_DRAG && doit )
	{
		System.out.println( "DND >> Drag starts." ); //$NON-NLS-1$
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:32,代码来源:DesignElementDragAdapter.java


示例18: dragSetData

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
/**
 * @see DragSourceAdapter#dragSetData(DragSourceEvent)
 */
public void dragSetData( DragSourceEvent event )
{
	IStructuredSelection selection = (IStructuredSelection) getViewer( )
			.getSelection( );
	Object[] objects = selection.toList( ).toArray( );

	if ( TemplateTransfer.getInstance( ).isSupportedType( event.dataType ) )
	{
		event.data = objects;
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:ParameterDragListener.java


示例19: initDropTarget

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
private void initDropTarget() {
    final AbstractTransferDropTargetListener dropTargetListener = new ERDiagramOutlineTransferDropTargetListener(graphicalViewer, TemplateTransfer.getInstance());

    graphicalViewer.addDropTargetListener(dropTargetListener);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:6,代码来源:ERDiagramOutlinePage.java


示例20: getTargetModel

import org.eclipse.gef.dnd.TemplateTransfer; //导入依赖的package包/类
private Object getTargetModel() {
    final TemplateTransfer transfer = (TemplateTransfer) getTransfer();
    return transfer.getObject();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:5,代码来源:ERDiagramTransferDropTargetListener.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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