本文整理汇总了Java中org.eclipse.gef.commands.UnexecutableCommand类的典型用法代码示例。如果您正苦于以下问题:Java UnexecutableCommand类的具体用法?Java UnexecutableCommand怎么用?Java UnexecutableCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnexecutableCommand类属于org.eclipse.gef.commands包,在下文中一共展示了UnexecutableCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAddCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
protected Command getAddCommand(ChangeBoundsRequest request) {
CompoundCommand command = new CompoundCommand();
List editparts = request.getEditParts();
int index = findIndexOfTreeItemAt(request.getLocation());
for (int i = 0; i < editparts.size(); i++) {
EditPart child = (EditPart) editparts.get(i);
if (GUIEditorPlugin.getComponentValidator().isAncestor((Element)child.getModel(),(Element)getHost().getModel()))
command.add(UnexecutableCommand.INSTANCE);
else {
TitaniumUIBoundedElement childModel = (TitaniumUIBoundedElement) child.getModel();
command.add(createCreateCommand(childModel,
new Rectangle(new org.eclipse.draw2d.geometry.Point(),
new Dimension(-1, -1)), index,
"Reparent LogicSubpart"));//$NON-NLS-1$
}
}
return command;
}
示例2: getMoveChildrenCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
protected Command getMoveChildrenCommand(ChangeBoundsRequest request) {
CompoundCommand command = new CompoundCommand();
List editparts = request.getEditParts();
List children = getHost().getChildren();
int newIndex = findIndexOfTreeItemAt(request.getLocation());
for (int i = 0; i < editparts.size(); i++) {
EditPart child = (EditPart) editparts.get(i);
int tempIndex = newIndex;
int oldIndex = children.indexOf(child);
if (tempIndex == -1 || oldIndex == tempIndex || oldIndex + 1 == tempIndex) {
command.add(UnexecutableCommand.INSTANCE);
return command;
} else if (oldIndex <= tempIndex) {
tempIndex--;
}
command.add(new MoveChildCommand((Element) child.getModel(),tempIndex));
}
return command;
}
示例3: getCreateCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
@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);
}
示例4: createChangeConstraintCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
@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);
}
示例5: getCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
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;
}
示例6: getOrphanCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
/**
* 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;
}
示例7: getAddCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
@Override
protected Command getAddCommand(ChangeBoundsRequest request) {
JSSCompoundCommand command = new JSSCompoundCommand(null);
List<?> editparts = request.getEditParts();
int index = findIndexOfTreeItemAt(request.getLocation());
for (int i = 0; i < editparts.size(); i++) {
EditPart child = (EditPart) editparts.get(i);
command.setReferenceNodeIfNull(child.getModel());
if (isAncestor(child, getHost())) {
command.add(UnexecutableCommand.INSTANCE);
} else {
ANode childModel = (ANode) child.getModel();
command.add(createCreateCommand(childModel, index));
}
}
return command;
}
示例8: getMoveChildrenCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
@Override
protected Command getMoveChildrenCommand(ChangeBoundsRequest request) {
JSSCompoundCommand command = new JSSCompoundCommand(null);
List<?> editparts = request.getEditParts();
List<?> children = getHost().getChildren();
int newIndex = findIndexOfTreeItemAt(request.getLocation());
for (int i = 0; i < editparts.size(); i++) {
EditPart child = (EditPart) editparts.get(i);
command.setReferenceNodeIfNull(child.getModel());
int tempIndex = newIndex;
int oldIndex = children.indexOf(child);
if (oldIndex == tempIndex || oldIndex + 1 == tempIndex) {
command.add(UnexecutableCommand.INSTANCE);
return command;
} else if (oldIndex <= tempIndex) {
tempIndex--;
}
command.add(OutlineTreeEditPartFactory.getReorderCommand((ANode) child.getModel(), (ANode) getHost().getModel(),
tempIndex));
}
return command;
}
示例9: getAddCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
protected Command getAddCommand(ChangeBoundsRequest request) {
JSSCompoundCommand command = new JSSCompoundCommand(null);
List<?> editparts = request.getEditParts();
int index = findIndexOfTreeItemAt(request.getLocation());
for (int i = 0; i < editparts.size(); i++) {
EditPart child = (EditPart) editparts.get(i);
command.setReferenceNodeIfNull(child.getModel());
if (isAncestor(child, getHost())) {
command.add(UnexecutableCommand.INSTANCE);
} else {
ANode childModel = (ANode) child.getModel();
command.add(createCreateCommand(childModel, index));
}
}
return command;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:JDStyleTreeContainerEditPolicy.java
示例10: getMoveChildrenCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
protected Command getMoveChildrenCommand(ChangeBoundsRequest request) {
JSSCompoundCommand command = new JSSCompoundCommand(null);
List<?> editparts = request.getEditParts();
List<?> children = getHost().getChildren();
int newIndex = findIndexOfTreeItemAt(request.getLocation());
for (int i = 0; i < editparts.size(); i++) {
EditPart child = (EditPart) editparts.get(i);
command.setReferenceNodeIfNull(child.getModel());
int tempIndex = newIndex;
int oldIndex = children.indexOf(child);
if (oldIndex == tempIndex || oldIndex + 1 == tempIndex) {
command.add(UnexecutableCommand.INSTANCE);
return command;
} else if (oldIndex <= tempIndex) {
tempIndex--;
}
command.add(OutlineTreeEditPartFactory.getReorderCommand((ANode) child.getModel(), (ANode) getHost().getModel(),
tempIndex));
}
return command;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:JDStyleTreeContainerEditPolicy.java
示例11: getCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
protected Command getCommand() {
CompoundCommand command = new CompoundCommand();
Iterator iter = ((List) TreeViewerTransfer.getInstance().getObject())
.iterator();
Request request = getTargetRequest();
request.setType(isMove() ? RequestConstants.REQ_MOVE
: RequestConstants.REQ_ORPHAN);
while (iter.hasNext()) {
EditPart editPart = (EditPart) iter.next();
command.add(editPart.getCommand(request));
}
// If reparenting, add all editparts to target editpart.
if (!isMove()) {
request.setType(RequestConstants.REQ_ADD);
if (getTargetEditPart() == null)
command.add(UnexecutableCommand.INSTANCE);
else
command.add(getTargetEditPart().getCommand(getTargetRequest()));
}
return command;
}
示例12: getCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
public Command getCommand(Request request) {
Command cmd;
final ChangeBoundsRequest req = (ChangeBoundsRequest) request;
if (isDeleteRequest(req)) {
cmd = getGuideEditPart().getRulerProvider().getDeleteGuideCommand(
getHost().getModel());
} else {
int pDelta;
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;
}
示例13: getCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
/**
* @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);
}
示例14: createEditPolicies
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的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( ) );
}
示例15: createMoveChildCommand
import org.eclipse.gef.commands.UnexecutableCommand; //导入依赖的package包/类
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;
}