當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。