本文整理汇总了Java中org.eclipse.core.commands.Command.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Command.getId方法的具体用法?Java Command.getId怎么用?Java Command.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.commands.Command
的用法示例。
在下文中一共展示了Command.getId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.core.commands.Command; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ViewEditor viewer = getViewEditor(event);
Command command = event.getCommand();
String optionId = command.getId();
// For now, simply flip this one state.
String value = viewer.getOption(optionId);
if (Strings.isNullOrEmpty(value)) {
value = StatsViewExtension.SHAPE_DEGREE_MODE_ID.getLabel();
} else {
value = null;
}
viewer.setOption(optionId, value);
return null;
}
示例2: execute
import org.eclipse.core.commands.Command; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ViewEditor viewer = getViewEditor(event);
Command command = event.getCommand();
String optionId = command.getId();
// For now, simply flip this one state.
String value = viewer.getOption(optionId);
if (Strings.isNullOrEmpty(value)) {
value = StatsViewExtension.COLOR_ROOT_MODE_ID.getLabel();
} else {
value = null;
}
viewer.setOption(optionId, value);
return null;
}
示例3: execute
import org.eclipse.core.commands.Command; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ViewEditor viewer = getViewEditor(event);
Command command = event.getCommand();
String optionId = command.getId();
// For now, simply flip this one state.
String value = viewer.getOption(optionId);
if (Strings.isNullOrEmpty(value)) {
value = StatsViewExtension.RATIO_DEGREE_MODE_ID.getLabel();
} else {
value = null;
}
viewer.setOption(optionId, value);
return null;
}
示例4: execute
import org.eclipse.core.commands.Command; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ViewEditor viewer = getViewEditor(event);
Command command = event.getCommand();
String optionId = command.getId();
// For now, simply flip this one state.
String value = viewer.getOption(optionId);
if (Strings.isNullOrEmpty(value)) {
value = StatsViewExtension.SIZE_DEGREE_MODE_ID.getLabel();
} else {
value = null;
}
viewer.setOption(optionId, value);
return null;
}
示例5: getKeyBindingStrings
import org.eclipse.core.commands.Command; //导入方法依赖的package包/类
/**
* Get the displayable key-binding information for the command
*
* @param com - the command
* @param activep - if true, return only active bindings
*
* @return a String array of binding sequence binding context information
*/
public static String[] getKeyBindingStrings(Command com, boolean activep) {
String id = com.getId();
TriggerSequence trigger;
// Get platform bindings for Command
Binding[] bindings = getBindings(com,activep);
List<String> bindingInfo = new ArrayList<String>();
ParameterizedCommand c;
for (Binding bind : bindings) {
c = bind.getParameterizedCommand();
if (c != null && c.getId().equals(id)) {
trigger = bind.getTriggerSequence();
bindingInfo.add(trigger.toString());
bindingInfo.add(bind.getContextId());
}
}
return bindingInfo.toArray(new String[0]);
}
示例6: execute
import org.eclipse.core.commands.Command; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ViewEditor viewer = getViewEditor(event);
Command command = event.getCommand();
String optionId = command.getId();
boolean value = viewer.isOptionChecked(optionId);
viewer.setBooleanOption(optionId, !value);
return null;
}
示例7: executeUniversal
import org.eclipse.core.commands.Command; //导入方法依赖的package包/类
/**
* If the Command accepts the universal-argument, then invoke it appropriately
* otherwise simply execute it with no arguments.
*
* To accept the universal-argument, the Command must either:
* 1) Have a parameter named "universalArg" [for Emacs+ commands] - or -
* 2) Be present in the universal command hash table [for pre-existing commands]
*
* @param editor
* @param count
* @param cmd
* @param isNumeric true if argument was entered as a number (rather than plain ^Us)
* - which we don't handle yet
* @throws NotDefinedException
* @throws ExecutionException
* @throws CommandException
*/
void executeUniversal(ITextEditor editor, Command cmd, Event event, int count, boolean isNumeric)
throws NotDefinedException, ExecutionException, CommandException {
// pass universal arg if non-default and cmd accepts it
String id = cmd.getId();
if (cmd.getParameter(UNIVERSAL) != null) {
EmacsPlusUtils.executeCommand(id, count, event, editor);
} else {
executeUniversal(editor, id, event, count, isNumeric);
}
}