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