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


Java IKeyLookup类代码示例

本文整理汇总了Java中org.eclipse.jface.bindings.keys.IKeyLookup的典型用法代码示例。如果您正苦于以下问题:Java IKeyLookup类的具体用法?Java IKeyLookup怎么用?Java IKeyLookup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IKeyLookup类属于org.eclipse.jface.bindings.keys包,在下文中一共展示了IKeyLookup类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sortModifierKeys

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
protected int[] sortModifierKeys(int modifierKeys) {
	final IKeyLookup lookup = KeyLookupFactory.getDefault();
	final int[] sortedKeys = new int[4];
	int index = 0;

	if ((modifierKeys & lookup.getAlt()) != 0) {
		sortedKeys[index++] = lookup.getAlt();
	}
	if ((modifierKeys & lookup.getCommand()) != 0) {
		sortedKeys[index++] = lookup.getCommand();
	}
	if ((modifierKeys & lookup.getCtrl()) != 0) {
		sortedKeys[index++] = lookup.getCtrl();
	}
	if ((modifierKeys & lookup.getShift()) != 0) {
		sortedKeys[index++] = lookup.getShift();
	}

	return sortedKeys;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:21,代码来源:EmacsKeyFormatter.java

示例2: sortModifierKeys

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
protected int[] sortModifierKeys(final int modifierKeys) {
	final IKeyLookup lookup = KeyLookupFactory.getDefault();
	final int[] sortedKeys = new int[4];
	int index = 0;

	if ((modifierKeys & lookup.getAlt()) != 0) {
		sortedKeys[index++] = lookup.getAlt();
	}
	if ((modifierKeys & lookup.getCommand()) != 0) {
		sortedKeys[index++] = lookup.getCommand();
	}
	if ((modifierKeys & lookup.getCtrl()) != 0) {
		sortedKeys[index++] = lookup.getCtrl();
	}
	if ((modifierKeys & lookup.getShift()) != 0) {
		sortedKeys[index++] = lookup.getShift();
	}

	return sortedKeys;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:21,代码来源:FormalKeyFormatter.java

示例3: countStrokes

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
/**
 * Returns the number of strokes in an array of triggers. It is assumed that
 * there is one natural key per trigger. The strokes are counted based on
 * the type of key. Natural keys are worth one; ctrl is worth two; shift is
 * worth four; and alt is worth eight.
 * 
 * @param triggers
 *            The triggers on which to count strokes; must not be
 *            <code>null</code>.
 * @return The value of the strokes in the triggers.
 * @since 3.2
 */
private final int countStrokes(final Trigger[] triggers) {
	int strokeCount = triggers.length;
	for (int i = 0; i < triggers.length; i++) {
		final Trigger trigger = triggers[i];
		if (trigger instanceof KeyStroke) {
			final KeyStroke keyStroke = (KeyStroke) trigger;
			final int modifierKeys = keyStroke.getModifierKeys();
			final IKeyLookup lookup = KeyLookupFactory.getDefault();
			if ((modifierKeys & lookup.getAlt()) != 0) {
				strokeCount += 8;
			}
			if ((modifierKeys & lookup.getCtrl()) != 0) {
				strokeCount += 2;
			}
			if ((modifierKeys & lookup.getShift()) != 0) {
				strokeCount += 4;
			}
			if ((modifierKeys & lookup.getCommand()) != 0) {
				strokeCount += 2;
			}
		} else {
			strokeCount += 99;
		}
	}

	return strokeCount;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:40,代码来源:BindingManager.java

示例4: format

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
/**
 * Formats an individual key into a human readable format. This converts the
 * key into a format similar to Xemacs.
 * 
 * @param key
 *            The key to format; must not be <code>null</code>.
 * @return The key formatted as a string; should not be <code>null</code>.
 */
public String format(final int key) {
	final IKeyLookup lookup = KeyLookupFactory.getDefault();
	if (lookup.isModifierKey(key)) {
		// String formattedName = Util.translateString(RESOURCE_BUNDLE,
		// lookup
		// .formalNameLookup(key), null);
		// if (formattedName != null) {
		// return formattedName;
		// }
	}

	return super.format(key).toLowerCase();
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:22,代码来源:EmacsKeyFormatter.java

示例5: format

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
/**
 * Formats an individual key into a human readable format. This uses an
 * internationalization resource bundle to look up the key. This does the
 * platform-specific formatting for Carbon.
 * 
 * @param key
 *            The key to format.
 * @return The key formatted as a string; should not be <code>null</code>.
 */
public final String format(final int key) {
	final IKeyLookup lookup = KeyLookupFactory.getDefault();
	final String name = lookup.formalNameLookup(key);

	// TODO consider platform-specific resource bundles
	if (Util.isMac()) {
		String formattedName = (String) CARBON_KEY_LOOK_UP.get(name);
		if (formattedName != null) {
			return formattedName;
		}
	}

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

示例6: format

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
public String format(final int key) {
	final IKeyLookup lookup = KeyLookupFactory.getDefault();
	final String name = lookup.formalNameLookup(key);

	if (resourceBundleKeys.contains(name)) {
		// return Util.translateString(RESOURCE_BUNDLE, name, name);
	}

	return name;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:11,代码来源:AbstractKeyFormatter.java

示例7: getEnterBinding

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
private static String getEnterBinding() {
	return KeyStroke.getInstance(KeyLookupFactory.getDefault().formalKeyLookup(IKeyLookup.CR_NAME)).format();
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:4,代码来源:RenameInformationPopup.java

示例8: shouldSkipNext

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
private boolean shouldSkipNext(int keyCode) {
	IKeyLookup lookUp = KeyLookupFactory.getDefault();
	return lookUp.getCommand() == keyCode || lookUp.getCtrl() == keyCode;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:5,代码来源:AbstractEditStrategy.java

示例9: getEnterBinding

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
protected static String getEnterBinding() {
	return KeyStroke.getInstance(KeyLookupFactory.getDefault().formalKeyLookup(IKeyLookup.CR_NAME)).format();
}
 
开发者ID:cplutte,项目名称:bts,代码行数:4,代码来源:RenameRefactoringPopup.java

示例10: sortModifierKeys

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
protected int[] sortModifierKeys(final int modifierKeys) {
	final IKeyLookup lookup = KeyLookupFactory.getDefault();
	final int[] sortedKeys = new int[4];
	int index = 0;

	if (Util.isWindows()) {
		if ((modifierKeys & lookup.getCtrl()) != 0) {
			sortedKeys[index++] = lookup.getCtrl();
		}
		if ((modifierKeys & lookup.getAlt()) != 0) {
			sortedKeys[index++] = lookup.getAlt();
		}
		if ((modifierKeys & lookup.getShift()) != 0) {
			sortedKeys[index++] = lookup.getShift();
		}

	} else if (Util.isGtk() || Util.isMotif()) {
		if ((modifierKeys & lookup.getShift()) != 0) {
			sortedKeys[index++] = lookup.getShift();
		}
		if ((modifierKeys & lookup.getCtrl()) != 0) {
			sortedKeys[index++] = lookup.getCtrl();
		}
		if ((modifierKeys & lookup.getAlt()) != 0) {
			sortedKeys[index++] = lookup.getAlt();
		}

	} else if (Util.isMac()) {
		if ((modifierKeys & lookup.getShift()) != 0) {
			sortedKeys[index++] = lookup.getShift();
		}
		if ((modifierKeys & lookup.getCtrl()) != 0) {
			sortedKeys[index++] = lookup.getCtrl();
		}
		if ((modifierKeys & lookup.getAlt()) != 0) {
			sortedKeys[index++] = lookup.getAlt();
		}
		if ((modifierKeys & lookup.getCommand()) != 0) {
			sortedKeys[index++] = lookup.getCommand();
		}

	}

	return sortedKeys;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:46,代码来源:NativeKeyFormatter.java

示例11: format

import org.eclipse.jface.bindings.keys.IKeyLookup; //导入依赖的package包/类
public String format(final int key) {
	final IKeyLookup lookup = KeyLookupFactory.getDefault();
	return lookup.formalNameLookup(key);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:5,代码来源:FormalKeyFormatter.java


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