本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例6: getIterationGesture
import org.eclipse.jface.bindings.TriggerSequence; //导入方法依赖的package包/类
private String getIterationGesture() {
TriggerSequence binding = KeyBindingHelper.getContentAssistProposalBinding();
return binding != null ? binding.format() : "completion key";
}