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


Java GroupRequest.getEditParts方法代码示例

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


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

示例1: 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

示例2: getOrphanChildrenCommand

import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Command getOrphanChildrenCommand(GroupRequest request) {
	List<EditPart> parts = request.getEditParts();
	for (int i = 0; i < parts.size(); i++) {
		EditPart part = parts.get(i);
		//System.out.println("THe part is something here..." + part);
		// We will just return and do nothing at all.
		if (part instanceof TabbedBarButtonEditPart) { 
			return null;
		}
	}
	
	CompoundCommand result = new CompoundCommand("Moving from one part to another");
	for (int i = 0; i < parts.size(); i++) {
		if (parts.get(i).getModel() instanceof TitaniumUIBoundedElement) {
			TitaniumOrphanChildCommand c = new TitaniumOrphanChildCommand();
			c.setChild((TitaniumUIBoundedElement)parts.get(i).getModel());
			c.setParent((Container) getHost().getModel());
			result.add(c);
		} else {
			OrphanChildCommand orphan = new OrphanChildCommand();
			orphan.setChild((ElementImpl)parts.get(i).getModel());
			orphan.setParent((Container) getHost().getModel());
			result.add(orphan);
		}
		
	}
	return result.unwrap();
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:30,代码来源:EditorContainerEditPolicy.java

示例3: getOrphanChildrenCommand

import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
public Command getOrphanChildrenCommand(GroupRequest request) {
	TitleBarEditPart host = (TitleBarEditPart)getHost();
	List parts = request.getEditParts();
	CompoundCommand result = new CompoundCommand("Moving from title bar part to another");
	for (int i = 0; i < parts.size(); i++) {
		final EditPart ep = (EditPart)parts.get(i);
		if (ep.getModel() instanceof TitaniumUIElement) {
			DeleteTitleBarChildCommand dtbc = new DeleteTitleBarChildCommand(host.getTitleBar(), (TitaniumUIBoundedElement)ep.getModel());
			result.add(dtbc);
		}
	}
	return result.unwrap();
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:14,代码来源:TitleBarContainerEditPolicy.java

示例4: getOrphanChildrenCommand

import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@Override
public Command getOrphanChildrenCommand(GroupRequest request) {
	List<?> parts = request.getEditParts();
	JSSCompoundCommand result = new JSSCompoundCommand("orphans", null); //$NON-NLS-1$
	for (int i = 0; i < parts.size(); i++) {
		ANode child = (ANode) ((EditPart) parts.get(i)).getModel();
		result.setReferenceNodeIfNull(child);
		result.add(OutlineTreeEditPartFactory.getOrphanCommand((ANode) getHost().getModel(), child));

	}
	return result.unwrap();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:JDContainerEditPolicy.java

示例5: getOrphanChildrenCommand

import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
public Command getOrphanChildrenCommand(GroupRequest request) {
	List<?> parts = request.getEditParts();
	JSSCompoundCommand result = new JSSCompoundCommand("orphans", null); //$NON-NLS-1$
	for (int i = 0; i < parts.size(); i++) {
		ANode child = (ANode) ((EditPart) parts.get(i)).getModel();
		result.setReferenceNodeIfNull(child);
		result.add(StyleTreeEditPartFactory.getOrphanCommand((ANode) getHost().getModel(), child));

	}
	return result.unwrap();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:JDStyleContainerEditPolicy.java

示例6: getOrphanChildrenCommand

import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@Override
protected Command getOrphanChildrenCommand(GroupRequest request)
{
  @SuppressWarnings("rawtypes")
  List toRemove = request.getEditParts();
  Dataset[] datasets = new Dataset[toRemove.size()];
  int i = 0;
  for (Object o : toRemove)
  {
    datasets[i++] = (Dataset) ((DatasetEditPart) o).getModel();
  }
  return new DeleteDatasetsFromAxisCommand((DependentAxis) getHost()
      .getModel(), datasets);
}
 
开发者ID:debrief,项目名称:limpet,代码行数:15,代码来源:AxisContainerEditPolicy.java

示例7: getOrphanChildrenCommand

import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
public Command getOrphanChildrenCommand( GroupRequest request )
{
	List parts = request.getEditParts( );
	CompoundCommand result = new CompoundCommand( "Move in layout" );//$NON-NLS-1$
	for ( int i = 0; i < parts.size( ); i++ )
	{
		DeleteCommand command = new DeleteCommand( ( (EditPart) parts.get( i ) ).getModel( ) );
		command.setClear( false );
		result.add( command );
	}
	return result.unwrap( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:13,代码来源:ReportContainerEditPolicy.java

示例8: getAddCommand

import org.eclipse.gef.requests.GroupRequest; //导入方法依赖的package包/类
@Override
protected Command getAddCommand(final GroupRequest request)
{
  @SuppressWarnings("rawtypes")
  final List toAdd = request.getEditParts();
  final Command res;

  if (toAdd.size() == 0)
  {
    res = null;
  }
  else
  {

    final Object first = toAdd.get(0);
    if (first instanceof ScatterSetEditPart)
    {
      ScatterSetEditPart scatterSetEditPart = ((ScatterSetEditPart) first);
      ScatterSet scatterSet = scatterSetEditPart.getModel();
      Chart from = scatterSetEditPart.getChart();

      ScatterSetContainerEditPart container =
          (ScatterSetContainerEditPart) getHost();
      Chart to = (Chart) container.getParent().getModel();

      res = new MoveScatterSetCommand(scatterSet, from, to);
    }
    else if (first instanceof DatasetEditPart)
    {

      // find the landing side
      final AxisLandingPadEditPart landingPadEditPart =
          (AxisLandingPadEditPart) getHost();
      final ChartPaneEditPart.AxisLandingPad pad =
          (ChartPaneEditPart.AxisLandingPad) landingPadEditPart.getModel();

      // find out which list (min/max) this axis is currently on
      final EList<DependentAxis> destination = pad
          .getPos() == ChartPanePosition.MIN ? pad.getChart().getMinAxes()
              : pad.getChart().getMaxAxes();

      if (destination != null)
      {
        CompoundCommand compoundCommand = new CompoundCommand();
        res = compoundCommand;

        if (first instanceof DatasetEditPart)
        {
          // ok, it's a dataset. we need to wrap it into an axis before
          // we can add it to the chart
          DatasetEditPart datasetEditPart = (DatasetEditPart) first;
          AxisEditPart parent = (AxisEditPart) datasetEditPart.getParent();
          Dataset dataset = (Dataset) datasetEditPart.getModel();
          DependentAxis parentAxis = (DependentAxis) parent.getModel();

          // take a copy of the parent axis, since we know it's suitable
          DependentAxis newAxis = EcoreUtil.copy(parentAxis);
          newAxis.getDatasets().clear();
          compoundCommand.add(new AddAxisToChartCommand(destination,
              newAxis));
          compoundCommand.add(new AddDatasetsToAxisCommand(newAxis, dataset));
        }
      }
      else
      {
        // we don't have a target location
        res = null;
      }
    }
    else
    {
      // it's not a type that we're interested in
      res = null;
    }
  }
  return res;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:78,代码来源:ScatterSetContainerEditPolicy.java


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