/** * Create a Java NSClass representing the Objective-C class with ocClassName */ public static <T extends ObjCClass> T createClass(String ocClassName, Class<T> type) { return wrap(Foundation.getClass(ocClassName), type, false); }
public _Class call() throws Exception { return Rococoa.wrap(Foundation.getClass("QTMovie"), _Class.class); //$NON-NLS-1$ } });
private static <T extends ObjCObject> T create(String ocClassName, Class<T> javaClass, String ocFactoryName, boolean retain, Object... args) { if (logging.isTraceEnabled()) { logging.trace("creating [{} ({})].{}({})", new Object[] {ocClassName, javaClass.getName(), ocFactoryName, new VarArgsUnpacker(args)}); } ID ocClass = Foundation.getClass(ocClassName); ID ocInstance = Foundation.send(ocClass, ocFactoryName, ID.class, args); int initialRetainCount = Foundation.cfGetRetainCount(ocInstance); T result = wrap(ocInstance, javaClass, retain); checkRetainCount(ocInstance, retain ? initialRetainCount + 1 : initialRetainCount); return result; }
@Override public void tableView_willDisplayCell_forTableColumn_row(final NSTableView view, final NSTextFieldCell cell, final NSTableColumn tableColumn, final NSInteger row) { final Path file = browserListModel.get(BrowserController.this.workdir()).get(row.intValue()); if(cell.isKindOfClass(Foundation.getClass(NSTextFieldCell.class.getSimpleName()))) { if(!BrowserController.this.isConnected() || !SearchFilterFactory.HIDDEN_FILTER.accept(file)) { cell.setTextColor(NSColor.disabledControlTextColor()); } else { cell.setTextColor(NSColor.controlTextColor()); } } }
public void outlineView_willDisplayCell_forTableColumn_item(final NSOutlineView view, final NSCell cell, final NSTableColumn column, final NSObject item) { final String identifier = column.identifier(); final TransferItem file = cache.lookup(new NSObjectTransferItemReference(item)); final TransferStatus status = browserModel.getStatus(file); if(identifier.equals(TransferPromptDataSource.Column.include.name())) { cell.setEnabled(!status.isRejected() && status.isExists()); } if(identifier.equals(TransferPromptDataSource.Column.filename.name())) { (Rococoa.cast(cell, OutlineCell.class)).setIcon(IconCacheFactory.<NSImage>get().fileIcon(file.remote, 16)); } if(cell.isKindOfClass(Foundation.getClass(NSTextFieldCell.class.getSimpleName()))) { if(status.isRejected()) { Rococoa.cast(cell, NSTextFieldCell.class).setTextColor(NSColor.disabledControlTextColor()); } else { Rococoa.cast(cell, NSTextFieldCell.class).setTextColor(NSColor.controlTextColor()); } } } }).id());