本文整理汇总了Java中org.eclipse.gef.commands.Command.canExecute方法的典型用法代码示例。如果您正苦于以下问题:Java Command.canExecute方法的具体用法?Java Command.canExecute怎么用?Java Command.canExecute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.commands.Command
的用法示例。
在下文中一共展示了Command.canExecute方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateEnabled
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
Command cmd = createCopyCommand(getSelectedObjects());
if (cmd == null)
return false;
return cmd.canExecute();
}
示例2: run
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
public void run() {
Command cmd = createCopyCommand(getSelectedObjects());
if (cmd != null && cmd.canExecute()) {
cmd.execute();
}
}
示例3: calculateEnabled
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
Command command = createPasteCommand(false);
boolean status = command != null && command.canExecute();
ContributionItemManager.PASTE.setEnable(status);
return status;
}
示例4: run
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
public void run() {
Command cmd = createCopyCommand(getSelectedObjects());
if (cmd != null && cmd.canExecute()) {
cmd.execute();
pasteAction.setPasteCounter(1);
pasteAction.update();
}
}
示例5: run
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
public void run() {
Command cmd = createDeleteCommand(getSelectedObjects());
if (cmd != null && cmd.canExecute()) {
execute(cmd);
}
}
示例6: calculateEnabled
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
Command command = createClearEdgeBendpointLayoutCommand(getSelectedObjects());
return command!=null && command.canExecute();
}
示例7: run
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
public void run() {
Command command = createClearEdgeBendpointLayoutCommand(getSelectedObjects());
if (command!=null && command.canExecute())
execute(command);
}
示例8: calculateEnabled
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
Command command = createPasteCommand();
return command != null && command.canExecute();
}
示例9: run
import org.eclipse.gef.commands.Command; //导入方法依赖的package包/类
@Override
public void run() {
Command command = createPasteCommand();
if (command != null && command.canExecute())
execute(command);
}