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

Java GroupRequest类代码示例

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

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



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

示例1: createDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest) {
	
	DwFeatureEditPart editPart = (DwFeatureEditPart)getHost();
	DwGraphicalFeatureModelViewer viewer = (DwGraphicalFeatureModelViewer)editPart.getEditor();
	DwFeatureWrapped wrappedFeature = (DwFeatureWrapped)getHost().getModel();
	
	if(!viewer.isLastDateSelected())
		return null;
	
	Command deleteCommand = null;
	if(viewer.getCurrentSelectedDate().equals(new Date(Long.MIN_VALUE))){
		deleteCommand = new DwFeatureDeletePermanentlyCommand(viewer, getHost());
		
		((DwFeatureDeletePermanentlyCommand)deleteCommand).setFeature(wrappedFeature);
	}else{
		deleteCommand = new DwFeatureDeleteCommand(viewer, getHost());
		
		((DwFeatureDeleteCommand)deleteCommand).setFeature(wrappedFeature);			
	}

	return deleteCommand;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:DwFeatureComponentEditPolicy.java


示例2: createDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command createDeleteCommand(final GroupRequest request) {
    if (getHost() instanceof DeleteableEditPart) {
        final DeleteableEditPart editPart = (DeleteableEditPart) getHost();

        if (!editPart.isDeleteable()) {
            return null;
        }

    } else {
        return null;
    }

    final ERDiagram diagram = (ERDiagram) getHost().getRoot().getContents().getModel();

    return this.createDeleteCommand(diagram, getHost().getModel());
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:21,代码来源:NotElementComponentEditPolicy.java


示例3: createDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command createDeleteCommand(GroupRequest request) {
	if (this.getHost() instanceof DeleteableEditPart) {
		DeleteableEditPart editPart = (DeleteableEditPart) this.getHost();

		if (!editPart.isDeleteable()) {
			return null;
		}

	} else {
		return null;
	}

	ERDiagram diagram = (ERDiagram) this.getHost().getRoot().getContents()
			.getModel();

	return this.createDeleteCommand(diagram, this.getHost().getModel());
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:22,代码来源:NotElementComponentEditPolicy.java


示例4: createDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
protected Command createDeleteCommand(GroupRequest deleteRequest) {
	Object parent = getHost().getParent().getModel();
	Object child = getHost().getModel();
	if (parent instanceof Window
			&& child instanceof TitleBar){
		return new DeleteTitleBarCommand((Window) parent,
				(TitleBar) child);
	} else if (parent instanceof TitleBar){
		return new DeleteTitleBarChildCommand((TitleBar) parent,
				(TitaniumUIBoundedElement) child);
	} else if (parent instanceof Container
			&& child instanceof Element) {
		return new DeleteElementCommand((Container) parent, (Element) child);
	} else if (parent instanceof TitaniumUIContainer
			&& child instanceof TitaniumUIElement) {
		return new DeleteTitaniumElementCommand((TitaniumUIContainer) parent,
				(TitaniumUIBoundedElement) child);
	}
	return super.createDeleteCommand(deleteRequest);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:21,代码来源:DeleteElementEditPolicy.java


示例5: getDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editpolicies.ComponentEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
 */
@Override
protected Command getDeleteCommand(GroupRequest request) {
    Command command;

    if (getHost() instanceof AbstractChildCompartmentEditPart) {
        if (!(getHost() instanceof AttributeEditPart) && !(getHost() instanceof OperationEditPart)) {
            return null;
        }
    }

    command = new DeleteNodeCommand();
    ((DeleteNodeCommand) command).setParent(getHost().getParent().getModel());
    ((DeleteNodeCommand) command).setNode(getHost().getModel());
    return command;

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:DiagramComponentEditPolicy.java


示例6: getDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editpolicies.ComponentEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
 */
@Override
protected Command getDeleteCommand(GroupRequest request) {
   
    if (getHost() instanceof LifeLineNameHeaderEditPart) {
        return null;
    }

    if (getHost() instanceof AbstractChildCompartmentEditPart) {
        return null;
    } else {
        DeleteLifeLineCommand command = new DeleteLifeLineCommand();
        ((DeleteLifeLineCommand) command).setDiagram(SequenceUtil.getDiagram(getHost()));
        ((DeleteLifeLineCommand) command).setLifeLineNode((LifeLineNode) getHost().getModel());
        return command;
    }

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:LifeLineComponentEditPolicy.java


示例7: createEditPolicies

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
	installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy() {
		@Override
		protected Command createDeleteCommand(GroupRequest deleteRequest) {
			return new DeleteCommand(getModel());
		}
	});

	installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new TableNodeEditPolicy());
	installEditPolicy(EditPolicy.LAYOUT_ROLE, new TableLayoutEditPolicy());
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {

		@Override
		protected void hideSelection() {
			getFigure().hideSelectedBorder();
		}

		@Override
		protected void showSelection() {
			getFigure().showSelectedBorder();
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:TableEditPart.java


示例8: createDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * Search for every AMcollection (superclass of the row of the table)
 * and create a delete cell command for everyone of its children
 */
@Override
public Command createDeleteCommand(List objects) {
	if (objects.isEmpty())
		return null;
	if (!(objects.get(0) instanceof EditPart))
		return null;

	GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE);
	deleteReq.setEditParts(objects);

	JSSCompoundCommand compoundCmd = new JSSCompoundCommand(getText(), null);
	for (int i = 0; i < objects.size(); i++) {
		EditPart object = (EditPart) objects.get(i);
		if (object.getModel() instanceof AMCollection && !(object.getModel() instanceof MTableDetail)) {
			AMCollection model = (AMCollection) object.getModel();
			compoundCmd.setReferenceNodeIfNull(model);
			createDeleteCommands(model.getChildren(), compoundCmd);
		}
	}
	return compoundCmd;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:DeleteRowAction.java


示例9: createEditPolicies

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
  installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
      new NonResizableEditPolicy());

  installEditPolicy(EditPolicy.CONTAINER_ROLE, new AxisContainerEditPolicy());

  installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
  {
    protected Command createDeleteCommand(GroupRequest deleteRequest)
    {
      DependentAxis dataset = (DependentAxis) getHost().getModel();
      Chart parent = (Chart) dataset.eContainer();
      DeleteAxisFromChartCommand cmd =
          new DeleteAxisFromChartCommand(parent, dataset);
      return cmd;
    }
  });
}
 
开发者ID:debrief,项目名称:limpet,代码行数:21,代码来源:AxisEditPart.java


示例10: createEditPolicies

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
  installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
      new NonResizableEditPolicy());
  installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
  {
    protected Command createDeleteCommand(GroupRequest deleteRequest)
    {
      Dataset dataset = (Dataset) getHost().getModel();
      DependentAxis parent = (DependentAxis) getHost().getParent().getModel();
      DeleteDatasetsFromAxisCommand cmd =
          new DeleteDatasetsFromAxisCommand(parent, dataset);
      return cmd;
    }
  });
}
 
开发者ID:debrief,项目名称:limpet,代码行数:18,代码来源:DatasetEditPart.java


示例11: createEditPolicies

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
  installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
      new NonResizableEditPolicy());
  installEditPolicy(EditPolicy.CONTAINER_ROLE, new ChartContainerEditPolicy());

  installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
  {
    protected Command createDeleteCommand(GroupRequest deleteRequest)
    {
      Chart chart = getModel();
      ChartSet parent = chart.getParent();
      DeleteChartCommand deleteChartCommand =
          new DeleteChartCommand(parent, chart);
      return deleteChartCommand;
    }
  });
}
 
开发者ID:debrief,项目名称:limpet,代码行数:20,代码来源:ChartEditPart.java


示例12: createEditPolicies

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
  installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
      new NonResizableEditPolicy());

  installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
  {
    protected Command createDeleteCommand(GroupRequest deleteRequest)
    {
      // TODO: implement
      // 1. do not use this scatter set in the current chart
      // 2. if scatter set used only here, then delete scatter set from shared axis
      return new DeleteScatterSetCommand(getModel(), getChart());
    }
  });
}
 
开发者ID:debrief,项目名称:limpet,代码行数:18,代码来源:ScatterSetEditPart.java


示例13: createDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * Create a command to remove the selected objects.
 * 
 * @param objects
 *            The objects to be deleted.
 * @return The command to remove the selected objects.
 */
public Command createDeleteCommand(List objects) {
	if (objects.isEmpty())
		return null;
	if (!(objects.get(0) instanceof EditPart))
		return null;

	GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE);
	deleteReq.setEditParts(objects);

	CompoundCommand compoundCmd = new CompoundCommand(
			GEFMessages.DeleteAction_ActionDeleteCommandName);
	for (int i = 0; i < objects.size(); i++) {
		EditPart object = (EditPart) objects.get(i);
		Command cmd = object.getCommand(deleteReq);
		if (cmd != null)
			compoundCmd.add(cmd);
	}

	return compoundCmd;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:28,代码来源:DeleteAction.java


示例14: getOrphanChildrenCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected Command getOrphanChildrenCommand(GroupRequest request) {
  CompoundCommand result = new CompoundCommand();
  List<EditPart> list = request.getEditParts();

  result.setDebugLabel("Orphan children");

  for (EditPart part : list) {
    ORMOrphanChildCommand orphan = new ORMOrphanChildCommand();
    orphan.setChild((Shape) part.getModel());
    orphan.setParent((Model) this.getHost().getModel());
    orphan.setLabel("Reparenting");

    result.add(orphan);
  }
  return result.unwrap();
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:18,代码来源:ORMContainerEditPolicy.java


示例15: createEditPolicies

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
	// mark & unmark commands
	installEditPolicy("Mark and Unmark", new CodeElementMarkEditPolicy());

	// delete command
	installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
	{
		@Override
		protected Command createDeleteCommand(GroupRequest deleteRequest)
		{
			Object container = getHost().getParent().getModel();
			Object ce = getHost().getModel();
			if (container instanceof Shape && ce instanceof CodeElement)
				return new DeleteCodeElementCommand((Shape) container, (CodeElement) ce);
			return super.createDeleteCommand(deleteRequest);
		}
	});
}
 
开发者ID:ArchieProject,项目名称:Archie-Smart-IDE,代码行数:21,代码来源:CodeElementEditPart.java


示例16: createEditPolicies

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
protected void createEditPolicies( )
{
	installEditPolicy( EditPolicy.COMPONENT_ROLE,
			new ReportComponentEditPolicy( ) {

				protected org.eclipse.gef.commands.Command createDeleteCommand(
						GroupRequest deleteRequest )
				{
					return UnexecutableCommand.INSTANCE;
				}

				protected Command getOrphanCommand( )
				{
					return new Command( ) {

					};
				}
			} );
	installEditPolicy( EditPolicy.LAYOUT_ROLE,
			new CrosstabCellFlowLayoutEditPolicy( ) );
	installEditPolicy( EditPolicy.CONTAINER_ROLE,
			new CrosstabCellContainerEditPolicy( ) );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:CrosstabCellEditPart.java


示例17: getDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * Returns either a DeletePathNodeCommand
 * 
 * @see org.eclipse.gef.editpolicies.ComponentEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
 */
protected Command getDeleteCommand(GroupRequest request) {
    Object parent = getHost().getParent().getModel();
    Object node = getHost().getModel();
    java.util.Map registry;

    if (getHost().getViewer() instanceof TreeViewer) {
        // we need an editpart registry with NodeConnectionEditParts
        UCMNavMultiPageEditor editor = (UCMNavMultiPageEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
        registry = editor.getCurrentPage().getGraphicalViewer().getEditPartRegistry();
    } else
        registry = getHost().getViewer().getEditPartRegistry();

    if (parent instanceof UCMmap && node instanceof PathNode) {
        return new DeletePathNodeCommand((PathNode) node, registry);
    }

    return super.createDeleteCommand(request);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:24,代码来源:PathNodeComponentEditPolicy.java


示例18: getDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * Returns a DeleteMapCommand
 * 
 * @see org.eclipse.gef.editpolicies.ComponentEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
 */
protected Command getDeleteCommand(GroupRequest request) {
    Object elem = getHost().getModel();
    if (elem instanceof UCMmap) {
        UCMmap diagram = (UCMmap) elem;
        URNspec urn = (URNspec) diagram.eContainer().eContainer();
        int nbDiagrams = urn.getUrndef().getSpecDiagrams().size();
        if (nbDiagrams > 1) {
            // we can delete it, not the last GRL/UCM diagram
            return new DeleteMapCommand(diagram);
        } else {
            // last diagram, cannot delete!
            return null;
        }
    } else
        return null;
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:22,代码来源:MapComponentEditPolicy.java


示例19: getDeleteCommand

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * Returns a DeleteGRLGraphCommand
 * 
 * @see org.eclipse.gef.editpolicies.ComponentEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
 */
protected Command getDeleteCommand(GroupRequest request) {
    Object elem = getHost().getModel();
    if (elem instanceof GRLGraph) {
        GRLGraph diagram = (GRLGraph) elem;
        URNspec urn = (URNspec) diagram.eContainer().eContainer();
        int nbDiagrams = urn.getUrndef().getSpecDiagrams().size();
        if (nbDiagrams > 1) {
            // we can delete it, not the last GRL/UCM diagram
            return new DeleteGRLGraphCommand(diagram);
        } else {
            // last diagram, cannot delete!
            return null;
        }
    } else
        return null;
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:22,代码来源:GRLGraphComponentEditPolicy.java


示例20: testReqElemDelete3

import org.eclipse.gef.requests.GroupRequest; //导入依赖的package包/类
/**
 * Test #3 for requirement ReqElemDelete
 * 
 * Author: jkealey
 */
public void testReqElemDelete3() {
    testReqComp1();

    // set the parent somewhere.
    ComponentRefEditPart parentEditPart = (ComponentRefEditPart) getMapEditPart(0).getChildren().get(2);
    Command cmd = parentEditPart.getCommand(new GroupRequest(RequestConstants.REQ_DELETE));
    assertTrue("ComponentRefEditPolicy doesn't return a valid DeleteComponentRefCommand", cmd instanceof DeleteComponentRefCommand && cmd.canExecute()); //$NON-NLS-1$
    getGraphicalViewer().getEditDomain().getCommandStack().execute(cmd);

    // refresh the edit part tree because we aren't hooked up to the command stack
    getMapEditPart(0).refreshChildren();

    assertEquals("only one ComponentRef should remain in model ", 1, getMap().getContRefs().size()); //$NON-NLS-1$
    assertEquals("Only one ComponentRefEditPart should remain in editpart tree ", 2, getMapEditPart(0).getChildren().size()); //$NON-NLS-1$

}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:22,代码来源:ProgressTests.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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