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

Java AbstractEditPart类代码示例

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

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



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

示例1: elementChanged

import org.eclipse.gef.editparts.AbstractEditPart; //导入依赖的package包/类
public void elementChanged( DesignElementHandle element,
		NotificationEvent ev )
{
	switch ( ev.getEventType( ) )
	{
		case NotificationEvent.CONTENT_EVENT :
		case NotificationEvent.ELEMENT_DELETE_EVENT :
		case NotificationEvent.PROPERTY_EVENT :
		case NotificationEvent.STYLE_EVENT :
		case NotificationEvent.THEME_EVENT :
		case NotificationEvent.TEMPLATE_TRANSFORM_EVENT :
		{
			markDirty( true );
			refresh( );
			// The children of master page edit part keep
			// virtual model
			// Those edit part will not get notification
			// refresh them explicit
			for ( Iterator it = getChildren( ).iterator( ); it.hasNext( ); )
			{
				( (AbstractEditPart) it.next( ) ).refresh( );
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:MasterPageEditPart.java


示例2: getSelection

import org.eclipse.gef.editparts.AbstractEditPart; //导入依赖的package包/类
/**
 * This method should return a {@link org.eclipse.jface.viewers.StructuredSelection} containing
 * one or more of the viewer's EditParts underline EMF objects . If no editparts are selected,
 * root EMF object will return
 * 
 */
public ISelection getSelection()
{
  StructuredSelection selection = (StructuredSelection) viewer.getSelection();
  if (!selection.isEmpty())
  {
    List<Object> emfObj = new ArrayList<Object>();
    Object[] array = selection.toArray();
    for (Object object : array)
    {
      if (object instanceof AbstractEditPart)
      {
        AbstractEditPart abstractEditPart = (AbstractEditPart) object;
        if(abstractEditPart instanceof IPropertySourceProvider)
        {
          IPropertySourceProvider mergeModelProvider = (IPropertySourceProvider) abstractEditPart; 
          IPropertySource merged = mergeModelProvider.getPropertySource();
          if(merged==null)
          {
            emfObj.add(abstractEditPart.getModel());
          }
          else
          {
            emfObj.add(merged);
          }
        }
        else
          emfObj.add(abstractEditPart.getModel());
      }
    }
    return new StructuredSelection(emfObj);
  }

  return viewer.getSelection();
}
 
开发者ID:debrief,项目名称:limpet,代码行数:41,代码来源:StackedchartsEditControl.java


示例3: getAdapter

import org.eclipse.gef.editparts.AbstractEditPart; //导入依赖的package包/类
public Object getAdapter(Object adaptableObject, Class adapterType) {
	AbstractEditPart part = (AbstractEditPart) adaptableObject;
	Object model = part.getModel();
	if (model instanceof IPropertySource)
		return model;
	if (model instanceof IAdaptable)
		return ((IAdaptable) model).getAdapter(adapterType);
	return null;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:10,代码来源:PropertySourceAdapterFactory.java


示例4: tokenize

import org.eclipse.gef.editparts.AbstractEditPart; //导入依赖的package包/类
/**
 * Tokenizes the first element in the {@code IStructuredSelection} by delegating to the
 * appropriate tokenizer.
 */
private void tokenize(final IStructuredSelection selection)
{
  final Object element = selection.getFirstElement();
  if (element instanceof IJavaElement)
  {
    try
    {
      tokenize((IJavaElement) element);
    }
    catch (final JavaModelException e)
    {
      // do nothing
    }
  }
  else if (element instanceof AbstractEditPart)
  {
    final Object model = ((AbstractEditPart) element).getModel();
    if (model instanceof IInitiatorEvent)
    {
      tokenize((IInitiatorEvent) model);
    }
    else if (model instanceof IContour)
    {
      tokenize((IContour) model);
    }
  }
}
 
开发者ID:UBPL,项目名称:jive,代码行数:32,代码来源:SelectionTokenizer.java


示例5: getAction

import org.eclipse.gef.editparts.AbstractEditPart; //导入依赖的package包/类
protected IAction getAction( ReportLayoutEditor reportDesigner )
{
	AbstractEditPart part = (AbstractEditPart) selection;
	ListingHandle handle = (ListingHandle) part.getModel( );

	SlotHandle groups = handle.getGroups( );
	Iterator iter = groups.iterator( );
	GroupHandle groupToEdit = null;

	// look for the group with the right name
	while ( iter.hasNext( ) )
	{
		GroupHandle group = (GroupHandle) iter.next( );
		if ( group.getName( ) != null
				&& group.getName( ).equals( params[1] ) )
		{
			groupToEdit = group;
			break;
		}
	}

	// no group with the right name found, use the first one if any
	if ( groupToEdit == null && groups.getCount( ) > 0 )
	{
		groupToEdit = (GroupHandle) groups.iterator( ).next( );
	}
	if ( groupToEdit != null )
	{
		EditGroupAction action = new EditGroupAction( reportDesigner,
				groupToEdit );
		return action;
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:35,代码来源:TemplateEditGroupAction.java


示例6: PasteElementCommand

import org.eclipse.gef.editparts.AbstractEditPart; //导入依赖的package包/类
public PasteElementCommand(AbstractEditPart pasteTarget, GUIEditor guiEditor){
	this.pasteTarget = pasteTarget;
	this.guiEditor = guiEditor;
	newTopLevelParts = new ArrayList<EditPart>();
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:6,代码来源:PasteElementCommand.java


示例7: createPasteCommand

import org.eclipse.gef.editparts.AbstractEditPart; //导入依赖的package包/类
private Command createPasteCommand() {
	List selectedObjects = getSelectedObjects();
	if(selectedObjects != null && selectedObjects.size() > 0 && selectedObjects.get(0) != null && selectedObjects.get(0) instanceof AbstractEditPart)
		return new PasteElementCommand(((AbstractEditPart)selectedObjects.get(0)),(GUIEditor)getWorkbenchPart());
	return null;
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:7,代码来源:PasteElementAction.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java PropertyAccessException类代码示例发布时间:2022-05-23
下一篇:
Java GrammarSection类代码示例发布时间: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