public NSUIntegerByReference() { this(new NSUInteger(0L)); }
@Override public void log(final Type request, final String message) { invoke(new WindowMainAction(this) { @Override public void run() { responseField.textStorage().replaceCharactersInRange_withAttributedString( NSRange.NSMakeRange(responseField.textStorage().length(), new NSUInteger(0)), NSAttributedString.attributedStringWithAttributes(message + "\n", FIXED_WITH_FONT_ATTRIBUTES)); } }); }
public static NSMutableDictionary dictionary() { return CLASS.dictionaryWithCapacity(new NSUInteger(0)); }
@Override public Object readFrom(Memory buffer, Class<?> type) { return new NSUInteger(buffer.getNativeLong(0)); } @Override public Memory bufferForResult(Object methodCallResult) {
@Override public void selectionDidChange(final NSNotification notification) { updateHighlight(); updateSelection(); transferTable.noteHeightOfRowsWithIndexesChanged( NSIndexSet.indexSetWithIndexesInRange( NSRange.NSMakeRange(new NSUInteger(0), new NSUInteger(transferTable.numberOfRows())))); }
@Override public NSUInteger draggingSourceOperationMaskForLocal(boolean flag) { return new NSUInteger(NSDraggingInfo.NSDragOperationMove.intValue() | NSDraggingInfo.NSDragOperationCopy.intValue()); }
@Override public NSUInteger draggingSourceOperationMaskForLocal(boolean flag) { return new NSUInteger(NSDraggingInfo.NSDragOperationMove.intValue() | NSDraggingInfo.NSDragOperationCopy.intValue()); }
@Override public boolean outlineView_writeItems_toPasteboard(final NSOutlineView outlineView, final NSArray items, final NSPasteboard pboard) { final List<Path> selected = new ArrayList<Path>(); for(int i = 0; i < items.count().intValue(); i++) { selected.add(cache.lookup(new NSObjectPathReference(items.objectAtIndex(new NSUInteger(i))))); } return super.writeItemsToPasteBoard(outlineView, selected, pboard); } }
public NSUInteger getValue() { return new NSUInteger(getPointer().getNativeLong(0)); }
/** * @param local indicates that the candidate destination object (the window or view over which the dragged * image is currently poised) is in the same application as the source, while a NO value indicates that * the destination object is in a different application * @return A mask, created by combining the dragging operations listed in the NSDragOperation section of * NSDraggingInfo protocol reference using the C bitwise OR operator.If the source does not permit * any dragging operations, it should return NSDragOperationNone. * @see NSDraggingSource */ @Override public NSUInteger draggingSourceOperationMaskForLocal(final boolean local) { if(local) { return new NSUInteger(NSDraggingInfo.NSDragOperationMove.intValue() | NSDraggingInfo.NSDragOperationCopy.intValue()); } return new NSUInteger(NSDraggingInfo.NSDragOperationCopy.intValue() | NSDraggingInfo.NSDragOperationDelete.intValue()); }
public void setTabView(NSTabView view) { this.tabView = view; this.tabView.setAutoresizingMask(new NSUInteger(NSView.NSViewWidthSizable | NSView.NSViewHeightSizable)); this.tabView.setDelegate(this.id()); }
private void mark(NSMutableAttributedString text, PatternSyntaxException e) { if(null == e) { text.removeAttributeInRange( NSAttributedString.ForegroundColorAttributeName, NSRange.NSMakeRange(new NSUInteger(0), text.length())); return; } int index = e.getIndex(); //The approximate index in the pattern of the error NSRange range = null; if(-1 == index) { range = NSRange.NSMakeRange(new NSUInteger(0), text.length()); } if(index < text.length().intValue()) { //Initializes the NSRange with the range elements of location and length; range = NSRange.NSMakeRange(new NSUInteger(index), new NSUInteger(1)); } text.addAttributesInRange(RED_FONT, range); }
protected void _updateBookmarkCell() { final int size = preferences.getInteger("bookmark.icon.size"); final double width = size * 1.5; final NSTableColumn c = bookmarkTable.tableColumnWithIdentifier(BookmarkColumn.icon.name()); c.setMinWidth(width); c.setMaxWidth(width); c.setWidth(width); // Notify the table about the changed row height. bookmarkTable.noteHeightOfRowsWithIndexesChanged( NSIndexSet.indexSetWithIndexesInRange(NSRange.NSMakeRange(new NSUInteger(0), new NSUInteger(bookmarkTable.numberOfRows())))); }
protected boolean update(final Local file, final NSImage icon) { synchronized(NSWorkspace.class) { // Specify 0 if you want to generate icons in all available icon representation formats final NSWorkspace workspace = NSWorkspace.sharedWorkspace(); if(workspace.setIcon_forFile_options(icon, file.getAbsolute(), new NSUInteger(0))) { workspace.noteFileSystemChanged(new NFDNormalizer().normalize(file.getAbsolute()).toString()); return true; } return false; } }
@Action public void renameFileButtonClicked(final ID sender) { final NSTableView browser = this.getSelectedBrowserView(); browser.editRow(browser.columnWithIdentifier(BrowserColumn.filename.name()), browser.selectedRow(), true); final Path selected = this.getSelectedPath(); if(StringUtils.isNotBlank(selected.getExtension())) { NSText view = browser.currentEditor(); if(null == view) { return; } int index = selected.getName().indexOf(selected.getExtension()) - 1; if(index > 0) { view.setSelectedRange(NSRange.NSMakeRange(new NSUInteger(0), new NSUInteger(index))); } } }
@Override public void run() { responseField.textStorage().replaceCharactersInRange_withAttributedString( NSRange.NSMakeRange(responseField.textStorage().length(), new NSUInteger(0)), NSAttributedString.attributedStringWithAttributes(message + "\n", FIXED_WITH_FONT_ATTRIBUTES)); } });
@Override public void layoutManager_didCompleteLayoutForTextContainer_atEnd(NSLayoutManager layoutManager, NSObject textContainer, boolean finished) { if(finished && this.responseField.window().isVisible()) { this.responseField.scrollRangeToVisible( NSRange.NSMakeRange(this.responseField.textStorage().length(), new NSUInteger(0)) ); } }
private void write(final NSDictionary font, final String transcript) { logTextView.textStorage().appendAttributedString( NSAttributedString.attributedStringWithAttributes(transcript + "\n", font) ); logTextView.scrollRangeToVisible(NSRange.NSMakeRange(logTextView.textStorage().length(), new NSUInteger(0))); }
/** * Update highlighted rows */ private void updateHighlight() { final boolean main = window().isMainWindow(); final NSIndexSet set = transferTable.selectedRowIndexes(); for(int i = 0; i < transferTableModel.numberOfRowsInTableView(transferTable).intValue(); i++) { boolean highlighted = set.containsIndex(new NSUInteger(i)) && main; if(transferTableModel.isHighlighted(i) == highlighted) { continue; } transferTableModel.setHighlighted(i, highlighted); } }
protected void _updateBrowserAttributes(NSTableView tableView) { tableView.setUsesAlternatingRowBackgroundColors(preferences.getBoolean("browser.alternatingRows")); if(preferences.getBoolean("browser.horizontalLines") && preferences.getBoolean("browser.verticalLines")) { tableView.setGridStyleMask(new NSUInteger(NSTableView.NSTableViewSolidHorizontalGridLineMask.intValue() | NSTableView.NSTableViewSolidVerticalGridLineMask.intValue())); } else if(preferences.getBoolean("browser.verticalLines")) { tableView.setGridStyleMask(NSTableView.NSTableViewSolidVerticalGridLineMask); } else if(preferences.getBoolean("browser.horizontalLines")) { tableView.setGridStyleMask(NSTableView.NSTableViewSolidHorizontalGridLineMask); } else { tableView.setGridStyleMask(NSTableView.NSTableViewGridNone); } }