/** * Returns the number of lines. * * @return the number of lines in the widget * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getLineCount () { checkWidget (); if ((style & SWT.SINGLE) != 0) return 1; NSTextStorage storage = ((NSTextView) view).textStorage (); int count = (int)/*64*/storage.paragraphs ().count (); NSString string = storage.string(); long /*int*/ length = string.length(), c; if (length == 0 || (c = string.characterAtIndex(length - 1)) == '\n' || c == '\r') { count++; } return count; }
if (event.keyCode == 0 || (SWT.KEYPAD_MULTIPLY <= event.keyCode && event.keyCode <= SWT.KEYPAD_CR)) { NSString chars = nsEvent.characters (); if (chars != null && chars.length() > 0) event.character = (char)chars.characterAtIndex (0); if (unmodifiedChars.length() > 0) event.keyCode = (char)unmodifiedChars.characterAtIndex(0);
long /*int*/ keyEquiv = 0; if (keyEquivString != null) { keyEquiv = keyEquivString.characterAtIndex(0); if ((keyMask & OS.NSCommandKeyMask) != 0) keyEquiv |= SWT.COMMAND; if ((keyMask & OS.NSAlternateKeyMask) != 0) keyEquiv |= SWT.ALT;
int firstChar = (int)/*64*/chars.characterAtIndex(0);