NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(key == 0 ? "" : String.valueOf ((char)key)); nsItem.setKeyEquivalent (nsstring.lowercaseString ());
long /*int*/ attributedSubstringFromRange (long /*int*/ id, long /*int*/ sel, long /*int*/ rangePtr) { Event event = new Event (); event.detail = SWT.COMPOSITION_SELECTION; sendEvent (SWT.ImeComposition, event); NSRange range = new NSRange (); OS.memmove (range, rangePtr, NSRange.sizeof); int start = (int)/*64*/range.location; int end = (int)/*64*/(range.location + range.length); if (event.start <= start && start <= event.end && event.start <= end && end <= event.end) { NSString str = (NSString) new NSString().alloc(); str = str.initWithString(event.text.substring(start - event.start, end - event.start)); NSAttributedString attriStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString(str, null); str.release(); attriStr.autorelease (); return attriStr.id; } return 0; }
void tableViewColumnDidMove (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) { NSNotification notification = new NSNotification (aNotification); NSDictionary userInfo = notification.userInfo (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSOldColumn"); //$NON-NLS-1$ id nsOldIndex = userInfo.valueForKey (nsstring); nsstring.release(); nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSNewColumn"); //$NON-NLS-1$ id nsNewIndex = userInfo.valueForKey (nsstring); nsstring.release(); int oldIndex = new NSNumber (nsOldIndex).intValue (); int newIndex = new NSNumber (nsNewIndex).intValue (); NSTableView tableView = (NSTableView)view; int startIndex = Math.min (oldIndex, newIndex); int endIndex = Math.max (oldIndex, newIndex); NSArray nsColumns = tableView.tableColumns (); for (int i = startIndex; i <= endIndex; i++) { id columnId = nsColumns.objectAtIndex (i); TableColumn column = getColumn (columnId); if (column != null) { column.sendEvent (SWT.Move); if (isDisposed ()) return; } } headerView.setNeedsDisplay(true); }
void outlineViewColumnDidMove (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) { NSNotification notification = new NSNotification (aNotification); NSDictionary userInfo = notification.userInfo (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSOldColumn"); //$NON-NLS-1$ id nsOldIndex = userInfo.valueForKey (nsstring); nsstring.release(); nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSNewColumn"); //$NON-NLS-1$ id nsNewIndex = userInfo.valueForKey (nsstring); nsstring.release(); int oldIndex = new NSNumber (nsOldIndex).intValue (); int newIndex = new NSNumber (nsNewIndex).intValue (); NSOutlineView outlineView = (NSOutlineView)view; int startIndex = Math.min (oldIndex, newIndex); int endIndex = Math.max (oldIndex, newIndex); NSArray nsColumns = outlineView.tableColumns (); for (int i = startIndex; i <= endIndex; i++) { id columnId = nsColumns.objectAtIndex (i); TreeColumn column = getColumn (columnId); if (column != null) { column.sendEvent (SWT.Move); if (isDisposed ()) return; } } headerView.setNeedsDisplay(true); }
int virtualKey = keyChar (key); String string = virtualKey != 0 ? (char)virtualKey + "" : (char)key + ""; NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(string); nsItem.setKeyEquivalent (nsstring.lowercaseString());
NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(String.valueOf(++NEXT_ID)); nsColumn = nsColumn.initWithIdentifier(nsstring);
NSString label = (NSString) new NSString().alloc(); label = label.initWithString(text); if(submenu != null && (parent.getStyle () & SWT.BAR) != 0) {
NSString str = ((NSString)new NSString().alloc()).initWithCharacters(chars, length); NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString(str, dict); dict.release();
} else { cell.setFont (font.handle); NSString str = (NSString) new NSString().alloc(); str = str.initWithString(text); cell.setTitle (str);
NSString str = NSString.string(); nsColumn = (NSTableColumn) new NSTableColumn ().alloc (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(String.valueOf(++NEXT_ID)); nsColumn = nsColumn.initWithIdentifier(nsstring);
} else { cell.setFont (font.handle); NSString str = (NSString) new NSString().alloc(); str = str.initWithString(text); cell.setTitle (str);
void outlineViewColumnDidResize (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) { NSNotification notification = new NSNotification (aNotification); NSDictionary userInfo = notification.userInfo (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSTableColumn"); //$NON-NLS-1$ id columnId = userInfo.valueForKey (nsstring); nsstring.release(); TreeColumn column = getColumn (columnId); if (column == null) return; /* either CHECK column or firstColumn in 0-column Tree */ column.sendEvent (SWT.Resize); if (isDisposed ()) return; NSOutlineView outlineView = (NSOutlineView)view; int index = indexOf (column.nsColumn); if (index == -1) return; /* column was disposed in Resize callback */ NSArray nsColumns = outlineView.tableColumns (); int columnCount = (int)/*64*/outlineView.numberOfColumns (); for (int i = index + 1; i < columnCount; i++) { columnId = nsColumns.objectAtIndex (i); column = getColumn (columnId); if (column != null) { column.sendEvent (SWT.Move); if (isDisposed ()) return; } } }
void tableViewColumnDidResize (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) { NSNotification notification = new NSNotification (aNotification); NSDictionary userInfo = notification.userInfo (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString("NSTableColumn"); //$NON-NLS-1$ id columnId = userInfo.valueForKey (nsstring); nsstring.release(); TableColumn column = getColumn (columnId); if (column == null) return; /* either CHECK column or firstColumn in 0-column Table */ column.sendEvent (SWT.Resize); if (isDisposed ()) return; NSTableView tableView = (NSTableView)view; int index = indexOf (column.nsColumn); if (index == -1) return; /* column was disposed in Resize callback */ NSArray nsColumns = tableView.tableColumns (); int columnCount = (int)/*64*/tableView.numberOfColumns (); for (int i = index + 1; i < columnCount; i++) { columnId = nsColumns.objectAtIndex (i); column = getColumn (columnId); if (column != null) { column.sendEvent (SWT.Move); if (isDisposed ()) return; } } }
string.getChars (0, chars.length, chars, 0); if (mnemonics) length = fixMnemonic (chars); NSString str = ((NSString)new NSString().alloc()).initWithCharacters(chars, length); NSAttributedString attribStr = ((NSAttributedString) new NSAttributedString ().alloc ()).initWithString (str, dict); str.release();
} else { cell.setFont (font.handle); NSString str = (NSString) new NSString().alloc(); str = str.initWithString(text != null ? text : ""); cell.setTitle (str);
NSString label = (NSString) new NSString().alloc(); label = label.initWithString(accelText); NSMutableDictionary dict = ((NSMutableDictionary)new NSMutableDictionary().alloc()).initWithCapacity(1);
} else { cell.setFont (font.handle); NSString str = (NSString) new NSString().alloc(); str = str.initWithString(text != null ? text : ""); cell.setTitle (str);
if ((style & SWT.CHECK) != 0) { checkColumn = (NSTableColumn)new NSTableColumn().alloc(); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(String.valueOf(++NEXT_ID)); checkColumn = checkColumn.initWithIdentifier(nsstring); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(String.valueOf(++NEXT_ID)); firstColumn = firstColumn.initWithIdentifier(nsstring);
if ((style & SWT.CHECK) != 0) { checkColumn = (NSTableColumn) new NSTableColumn ().alloc (); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(String.valueOf(++NEXT_ID)); checkColumn = checkColumn.initWithIdentifier(nsstring); NSString nsstring = (NSString) new NSString().alloc(); nsstring = nsstring.initWithString(String.valueOf(++NEXT_ID)); firstColumn = firstColumn.initWithIdentifier(nsstring);
char[] chars = new char[segmentsText.length()]; segmentsText.getChars(0, chars.length, chars, 0); NSString str = (NSString) new NSString().alloc(); str = str.initWithCharacters(chars, chars.length); buffer[j] = '\uFFFC'; NSString string = (NSString) new NSString().alloc(); string = string.initWithCharacters(buffer, buffer.length); attrStr.replaceCharactersInRange(range, string);