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


Java GroupRequest类代码示例

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


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


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