本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}