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


Java SWT.CR属性代码示例

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


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

示例1: doExit

/**
 * {@inheritDoc}
 *
 * If the entered character is not a valid identifier part, it is processed after linked editing has been quit.
 * Exceptions are the {@link #exitCharacters} that have been passed into the constructor.
 */
@Override
public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) {
	if (event.character == '\0')
		return null;
	for (char c : exitCharacters) {
		if (event.character == c) {
			return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
		}
	}
	switch (event.character) {
	case SWT.CR:
		return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
	default: {
		if (!Character.isJavaIdentifierPart(event.character)) {
			return new ExitFlags(ILinkedModeListener.UPDATE_CARET, true);
		}
		return null;
	}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:26,代码来源:IdentifierExitPolicy.java

示例2: makeXPathKeyAccelerator

public KeyAccelerator makeXPathKeyAccelerator(final boolean overwrite) {
	return new KeyAccelerator() {
		public boolean doAction(TwsDomTree tree, KeyEvent e) {
			boolean doNext = true;
			if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
				if (tree.getSelection().length > 0) {
					Node node = (Node)tree.getSelection()[0].getData();
					if ((e.stateMask & SWT.SHIFT) == 0) {//without SHIFT > relative
						if (canGenerateSelectionXpath(overwrite, node)) {
							generateSelectionXpath(overwrite, tree);
							doNext = false;
						}
					} else {//with SHIFT > absolute
						generateAbsoluteXpath(overwrite, node);
						doNext = false;
					}
				}
			}
			return doNext;
		}
	};
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:22,代码来源:XpathEvaluatorComposite.java

示例3: doExit

@Override
public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) {

	if (event.character == fExitCharacter) {
		if (environment.anyPositionContains(offset))
			return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
		else
			return new ExitFlags(ILinkedModeListener.UPDATE_CARET, true);
	}

	switch (event.character) {
	case ';':
		return new ExitFlags(ILinkedModeListener.NONE, true);
	case SWT.CR:
		// when entering an anonymous class as a parameter, we don't
		// want
		// to jump after the parenthesis when return is pressed
		if (offset > 0) {
			try {
				if (fDocument.getChar(offset - 1) == '{')
					return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
			} catch (BadLocationException e) {
			}
		}
		return null;
	default:
		return null;
	}
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:29,代码来源:EditorConfigCompletionProposal.java

示例4: handleEvent

public void handleEvent(Event event) {
	switch (event.type) {
	case SWT.KeyDown:
		if (event.character == SWT.CR)
			controlChanged((Control) event.widget);
		break;
	case SWT.FocusOut:
		controlChanged((Control) event.widget);
		break;
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:11,代码来源:ControlChangeListener.java


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