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


Java Command.getId方法代码示例

本文整理汇总了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;
}
 
开发者ID:google,项目名称:depan,代码行数:19,代码来源:StatsShapeOptionHandler.java

示例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;
}
 
开发者ID:google,项目名称:depan,代码行数:19,代码来源:StatsRootOptionHandler.java

示例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;
}
 
开发者ID:google,项目名称:depan,代码行数:19,代码来源:StatsRatioOptionHandler.java

示例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;
}
 
开发者ID:google,项目名称:depan,代码行数:19,代码来源:StatsSizeOptionHandler.java

示例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]);
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:28,代码来源:CommandHelp.java

示例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;
}
 
开发者ID:google,项目名称:depan,代码行数:11,代码来源:ViewEditorOptionHandler.java

示例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);
	}

}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:29,代码来源:EmacsPlusCmdHandler.java


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