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


Java UnexecutableCommand.INSTANCE属性代码示例

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


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

示例1: getCreateCommand

@Override
protected Command getCreateCommand(CreateViewRequest request) {
	StateEditPart parent = (StateEditPart) getHost().getParent();
	BooleanValueStyle isInline = GMFNotationUtil.getBooleanValueStyle(parent.getNotationView(),
			DiagramPartitioningUtil.INLINE_STYLE);
	if (isInline != null && !isInline.isBooleanValue())
		return UnexecutableCommand.INSTANCE;

	List<? extends ViewDescriptor> viewDescriptors = request.getViewDescriptors();
	for (ViewDescriptor viewDescriptor : viewDescriptors) {
		String semanticHint = viewDescriptor.getSemanticHint();
		if (ViewType.NOTE.equals(semanticHint) || ViewType.NOTEATTACHMENT.equals(semanticHint)
				|| ViewType.TEXT.equals(semanticHint)) {
			return UnexecutableCommand.INSTANCE;
		}
	}
	return super.getCreateCommand(request);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:18,代码来源:StateCompartmentCreationEditPolicy.java

示例2: createChangeConstraintCommand

@Override
protected Command createChangeConstraintCommand(EditPart child,
		Object constraint) {
	if (constraint instanceof TreeLayoutConstraint) {
		if (((TreeLayoutConstraint) constraint).isRoot()) {
			return UnexecutableCommand.INSTANCE;
		} else {
			return new ICommandProxy(new UpdateAnnotationsOnMoveCommand(
					getHost().getEditingDomain(),
					(IGraphicalEditPart) child,
					(TreeLayoutConstraint) constraint));
		}

	}
	return super.createChangeConstraintCommand(child, constraint);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:16,代码来源:TreeLayoutEditPolicy.java

示例3: getCommand

public Command getCommand(Request request) {
	Command cmd = null;
	final ChangeBoundsRequest req = (ChangeBoundsRequest) request;
	if (isDeleteRequest(req)) {
		cmd = getGuideEditPart().getRulerProvider().getDeleteGuideCommand(getHost().getModel());
	} else {
		int pDelta = 0;
		if (getGuideEditPart().isHorizontal()) {
			pDelta = req.getMoveDelta().y;
		} else {
			pDelta = req.getMoveDelta().x;
		}
		if (isMoveValid(getGuideEditPart().getZoomedPosition() + pDelta)) {
			ZoomManager zoomManager = getGuideEditPart().getZoomManager();
			if (zoomManager != null) {
				pDelta = (int) Math.round(pDelta / zoomManager.getZoom());
			}
			cmd = getGuideEditPart().getRulerProvider().getMoveGuideCommand(getHost().getModel(), pDelta);
		} else {
			cmd = UnexecutableCommand.INSTANCE;
		}
	}
	return cmd;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:JDDragGuidePolicy.java

示例4: getOrphanCommand

/**
 * Gets the orphan command.
 * 
 * @param parent
 *          the parent
 * @param child
 *          the child
 * @return the orphan command
 */
public static Command getOrphanCommand(ANode parent, ANode child) {
	ExtensionManager m = JaspersoftStudioPlugin.getExtensionManager();
	Command c = m.getOrphanCommand(parent, child);
	if (c != null)
		return c;

	if (child instanceof MField)
		return new NoActionCommand();
	if (child instanceof MParameterSystem)
		return new NoActionCommand();
	if (child instanceof MVariableSystem)
		return new NoActionCommand();
	if (child instanceof MStyle)
		return new NoActionCommand();

	if (child instanceof MGraphicElement)
		return new OrphanElementCommand(parent, (MGraphicElement) child);
	if (child instanceof MElementGroup)
		return new OrphanElementGroupCommand(parent, (MElementGroup) child);
	if (child instanceof MConditionalStyle)
		if (parent instanceof MStyle)
			return new OrphanConditionalStyleCommand((MStyle) parent, (MConditionalStyle) child);
	return UnexecutableCommand.INSTANCE;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:33,代码来源:OutlineTreeEditPartFactory.java

示例5: getCommand

/**
 * @generated
 */
protected Command getCommand(Request request) {
	List operationSet = getOperationSet();
	if (operationSet.isEmpty()) {
		return UnexecutableCommand.INSTANCE;
	}
	Iterator editParts = operationSet.iterator();
	CompositeTransactionalCommand command = new CompositeTransactionalCommand(
			getEditingDomain(), getCommandLabel());
	while (editParts.hasNext()) {
		EditPart editPart = (EditPart) editParts.next();
		Command curCommand = editPart.getCommand(request);
		if (curCommand != null) {
			command.compose(new CommandProxy(curCommand));
		}
	}
	if (command.isEmpty() || command.size() != operationSet.size()) {
		return UnexecutableCommand.INSTANCE;
	}
	return new ICommandProxy(command);
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:23,代码来源:DeleteElementAction.java

示例6: createMoveChildCommand

protected Command createMoveChildCommand( EditPart child, EditPart after )
{
	Object afterModel = null;
	if ( after != null )
	{
		afterModel = after.getModel( );
	}
	if(child.getParent( ).getModel( ) instanceof ReportItemHandle)
	{
		ReportItemHandle reportHandle = (ReportItemHandle)child.getParent( ).getModel( );
		if(reportHandle.getViews( ).contains( child.getModel( ) ))
		{
			return UnexecutableCommand.INSTANCE;
		}
	}
	FlowMoveChildCommand command = new FlowMoveChildCommand( child.getModel( ),
			afterModel,
			child.getParent( ).getModel( ) );
	return command;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:ReportFlowLayoutEditPolicy.java

示例7: getCommand

/**
 * @generated
 */
protected Command getCommand(Request request) {
    List operationSet = getOperationSet();
    if (operationSet.isEmpty()) {
        return UnexecutableCommand.INSTANCE;
    }
    Iterator editParts = operationSet.iterator();
    CompositeTransactionalCommand command = new CompositeTransactionalCommand(
            getEditingDomain(), getCommandLabel());
    while (editParts.hasNext()) {
        EditPart editPart = (EditPart) editParts.next();
        Command curCommand = editPart.getCommand(request);
        if (curCommand != null) {
            command.compose(new CommandProxy(curCommand));
        }
    }
    if (command.isEmpty() || command.size() != operationSet.size()) {
        return UnexecutableCommand.INSTANCE;
    }
    return new ICommandProxy(command);
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:23,代码来源:DeleteElementAction.java

示例8: createChangeConstraintCommand

@Override
protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
	AbstractLayoutCommand command = null;
	if (child instanceof VertexPart) {
		command = new VertexChangeLayoutCommand();
	}  
	if (command == null) {
		ResourceManager.logException(new Exception(""), "Dont know how to get comand for " + child.getClass().getName());
		return UnexecutableCommand.INSTANCE;
	}
	command.setModel(child.getModel());
	command.setConstraint((Rectangle) constraint);
	return command;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:14,代码来源:GW4EEditLayoutPolicy.java

示例9: createDeleteCommand

protected Command createDeleteCommand(GroupRequest deleteRequest) {
	if (getHost().getModel() instanceof Vertex) {
		VertexDeleteCommand command = new VertexDeleteCommand();
		command.setModel(getHost().getModel());
		return command;
	}
	 
	return UnexecutableCommand.INSTANCE;
	
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:GW4EVertexDeletePolicy.java

示例10: getConnectionCompleteCommand

@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
	LinkCreateCommand result = (LinkCreateCommand) request.getStartCommand();
	if (getHost().getModel() instanceof GraphElement) {
		GraphElement target = (GraphElement) getHost().getModel();
		result.setLink((GWLink) request.getNewObject());
		result.setTarget(target);
		return result;
	}
	return UnexecutableCommand.INSTANCE;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:11,代码来源:GW4ENodeGraphicalNodeEditPolicy.java

示例11: getConnectionCreateCommand

@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
	LinkCreateCommand result = new LinkCreateCommand();
	if (getHost().getModel() instanceof GraphElement) {
		result.setSource((GraphElement) getHost().getModel());
		
		result.setGraph(((GraphElement) getHost().getModel()).getGraph());
		request.setStartCommand(result);
		return result;
	}
	return UnexecutableCommand.INSTANCE;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:GW4ENodeGraphicalNodeEditPolicy.java

示例12: getReconnectSourceCommand

@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
	ConnectionReconnectCommand result = new ConnectionReconnectCommand();
	GWLink link = (GWLink) request.getConnectionEditPart().getModel();
	if (getHost().getModel() instanceof GraphElement) {
		result.setGraph(((GraphElement) getHost().getModel()).getGraph());
		result.setNewSource((GraphElement) getHost().getModel());
		result.setLink(link);
		return result;
	}
	return UnexecutableCommand.INSTANCE;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:GW4ENodeGraphicalNodeEditPolicy.java

示例13: getReconnectTargetCommand

@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
	ConnectionReconnectCommand result = new ConnectionReconnectCommand();
	GWLink link = (GWLink) request.getConnectionEditPart().getModel();
	if (getHost().getModel() instanceof GraphElement) {
		result.setGraph(((GraphElement) getHost().getModel()).getGraph());
		result.setNewTarget((GraphElement) getHost().getModel());
		result.setLink(link);
		return result;
	}
	return UnexecutableCommand.INSTANCE;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:GW4ENodeGraphicalNodeEditPolicy.java

示例14: getDirectEditCommand

@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
	String value = (String) request.getCellEditor().getValue();
	if(Constant.START_VERTEX_NAME.equalsIgnoreCase(value.trim())) {
		return UnexecutableCommand.INSTANCE;
	}
	GraphElementRenameCommand command = new GraphElementRenameCommand();
	command.setOldName(((Vertex) getHost().getModel()).getName());
	command.setModel((Vertex) getHost().getModel());
	command.setNewName(value);
	return command;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:GW4EVertexDirectEditPolicy.java

示例15: createDeleteCommand

protected Command createDeleteCommand(GroupRequest deleteRequest) {
	if (getHost().getModel() instanceof GWLink) {
		LinkDeleteCommand command = new LinkDeleteCommand();
		command.setModel(getHost().getModel());
		return command;
	}
	return UnexecutableCommand.INSTANCE;
	
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:9,代码来源:GW4EdgeDeletePolicy.java


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