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


Java TriggerSequence.format方法代码示例

本文整理汇总了Java中org.eclipse.jface.bindings.TriggerSequence.format方法的典型用法代码示例。如果您正苦于以下问题:Java TriggerSequence.format方法的具体用法?Java TriggerSequence.format怎么用?Java TriggerSequence.format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.bindings.TriggerSequence的用法示例。


在下文中一共展示了TriggerSequence.format方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getColumnText

import org.eclipse.jface.bindings.TriggerSequence; //导入方法依赖的package包/类
public String getColumnText(Object element, int index) {
	BindingElement bindingElement = ((BindingElement) element);
	switch (index) {
	case COMMAND_NAME_COLUMN: {// name
		String name = bindingElement.getName();
		if (name != null && name.endsWith("()")) {
			name = name.substring(0, name.length() - 2);
		}
		return name;
	}
	case KEY_SEQUENCE_COLUMN: // keys
		TriggerSequence seq = bindingElement.getTrigger();
		return seq == null ? Util.ZERO_LENGTH_STRING : seq.format();
	case CATEGORY_COLUMN: // category
		String id = bindingElement.getId();
		if (id.equalsIgnoreCase("net.heartsome.cat.ts.command.preference")) {
			return Messages.getString("preferencepage.KeysPreferencePage.toolCategory");
		} else if (id.equalsIgnoreCase("org.eclipse.ui.window.lockToolBar")) {
			return Messages.getString("preferencepage.KeysPreferencePage.toolbarCategory");
		} else if (id.equalsIgnoreCase("org.eclipse.ui.window.showKeyAssist")) {
			return Messages.getString("preferencepage.KeysPreferencePage.helpCategory");
		}
		return bindingElement.getCategory();
	}
	return null;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:27,代码来源:KeysPreferencePage.java

示例2: getValue

import org.eclipse.jface.bindings.TriggerSequence; //导入方法依赖的package包/类
@Override
protected Object getValue(Object element) {
	// System.out.println(element);
	BindingElement bindingElement = ((BindingElement) element);
	TriggerSequence seq = bindingElement.getTrigger();
	return seq == null ? Util.ZERO_LENGTH_STRING : seq.format();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:8,代码来源:KeysPreferencePage.java

示例3: getAcceleratorText

import org.eclipse.jface.bindings.TriggerSequence; //导入方法依赖的package包/类
/**
 * @see org.eclipse.jface.action.ExternalActionManager.ICallback#getAcceleratorText(String)
 */
public final String getAcceleratorText(final String commandId) {
	final TriggerSequence triggerSequence = bindingManager
			.getBestActiveBindingFor(commandId);
	if (triggerSequence == null) {
		return null;
	}

	return triggerSequence.format();
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:13,代码来源:ExternalActionManager.java

示例4: getBestBinding

import org.eclipse.jface.bindings.TriggerSequence; //导入方法依赖的package包/类
/**
 * Get the best binding (as determined by Eclipse) for the Command
 * 
 * @param cmd
 * @return the binding or null
 */
public static String getBestBinding(Command cmd) {
	String result = null;
	IBindingService binder = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
	TriggerSequence bindingFor = binder.getBestActiveBindingFor(cmd.getId());
	if (bindingFor != null) {
		result = bindingFor.format(); 
	}
	return result;
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:16,代码来源:CommandHelp.java

示例5: getColumnText

import org.eclipse.jface.bindings.TriggerSequence; //导入方法依赖的package包/类
@Override
public String getColumnText(final Object inElement, final int inIndex) {
	final BindingElement bindingElement = ((BindingElement) inElement);
	switch (inIndex) {
	case COMMAND_NAME_COLUMN: // name
		return bindingElement.getName();
	case KEY_SEQUENCE_COLUMN: // keys
		final TriggerSequence lSequence = bindingElement.getTrigger();
		return lSequence == null ? ZERO_LENGTH_STRING
		        : lSequence.format();
	case CONTEXT_COLUMN: // when
		final ModelElement lContext = bindingElement.getContext();
		return lContext == null ? ZERO_LENGTH_STRING
		        : lContext.getName();
	case CATEGORY_COLUMN: // category
		return bindingElement.getCategory();
	case USER_DELTA_COLUMN: // user
		if (bindingElement.getUserDelta().intValue() == Binding.USER) {
			if (bindingElement.getConflict().equals(Boolean.TRUE)) {
				return "CU"; //$NON-NLS-1$
			}
			return " U"; //$NON-NLS-1$
		}
		if (bindingElement.getConflict().equals(Boolean.TRUE)) {
			return "C "; //$NON-NLS-1$
		}
		return "  "; //$NON-NLS-1$
	}
	return null;
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:31,代码来源:RelationsKeysPreferencePage.java

示例6: getIterationGesture

import org.eclipse.jface.bindings.TriggerSequence; //导入方法依赖的package包/类
private String getIterationGesture() {
    TriggerSequence binding = KeyBindingHelper.getContentAssistProposalBinding();
    return binding != null ? binding.format() : "completion key";
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:5,代码来源:DefaultContentAssist.java


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