public void setHighlighted(final boolean h) { highlighted = h; statusField.setTextColor(h ? NSColor.alternateSelectedControlTextColor() : NSColor.controlTextColor()); progressField.setTextColor(h ? NSColor.alternateSelectedControlTextColor() : NSColor.controlTextColor()); messageField.setTextColor(h ? NSColor.alternateSelectedControlTextColor() : NSColor.controlTextColor()); this.setMenuHighlighted(h); }
@Action public void downloadSkipButtonClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; downloadSkipRegexField.setSelectable(enabled); downloadSkipRegexField.setEditable(enabled); downloadSkipRegexField.setTextColor(enabled ? NSColor.controlTextColor() : NSColor.disabledControlTextColor()); preferences.setProperty("queue.download.skip.enable", enabled); }
public void setStatusField(final NSTextField f) { this.statusField = f; this.statusField.setEditable(false); this.statusField.setSelectable(false); this.statusField.setTextColor(NSColor.controlTextColor()); }
public static NSColor systemGrayColor() { if(Rococoa.cast(CLASS, NSObject.class).respondsToSelector(Foundation.selector("systemGrayColor"))) { return CLASS.systemGrayColor(); } return NSColor.darkGrayColor(); }
/** * @param value Existing attributes * @param hyperlink URL * @return Clickable and underlined string to put into text field. */ private static NSAttributedString create(final NSMutableAttributedString value, final String hyperlink) { final NSRange range = NSRange.NSMakeRange(new NSUInteger(0), value.length()); value.beginEditing(); value.addAttributeInRange(NSMutableAttributedString.LinkAttributeName, hyperlink, range); // make the text appear in blue value.addAttributeInRange(NSMutableAttributedString.ForegroundColorAttributeName, NSColor.blueColor(), range); // system font value.addAttributeInRange(NSMutableAttributedString.FontAttributeName, NSFont.systemFontOfSize(NSFont.smallSystemFontSize()), range); // next make the text appear with an underline value.addAttributeInRange(NSMutableAttributedString.UnderlineStyleAttributeName, NSNumber.numberWithInt(NSMutableAttributedString.SingleUnderlineStyle), range); value.endEditing(); return value; } }
public void setMessageField(final NSTextField f) { this.messageField = f; this.messageField.setEditable(false); this.messageField.setSelectable(false); this.messageField.setTextColor(NSColor.controlTextColor()); }
@Action public void uploadSkipButtonClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; uploadSkipRegexField.setSelectable(enabled); uploadSkipRegexField.setEditable(enabled); uploadSkipRegexField.setTextColor(enabled ? NSColor.controlTextColor() : NSColor.disabledControlTextColor()); preferences.setProperty("queue.upload.skip.enable", enabled); }
public void setProgressField(final NSTextField f) { this.progressField = f; this.progressField.setEditable(false); this.progressField.setSelectable(false); this.progressField.setTextColor(NSColor.controlTextColor()); this.progressField.setFont(NSFont.monospacedDigitSystemFontOfSize(NSFont.smallSystemFontSize())); }
public void tableView_willDisplayCell_forTableColumn_row(NSTableView view, NSTextFieldCell cell, NSTableColumn c, NSInteger row) { if(c.identifier().equals(AclColumn.GRANTEE.name())) { final Acl.UserAndRole grant = acl.get(row.intValue()); cell.setPlaceholderString(grant.getUser().getPlaceholder()); if(grant.getUser().isEditable()) { cell.setTextColor(NSColor.controlTextColor()); } else { // Group Grantee identifier is not editable cell.setTextColor(NSColor.disabledControlTextColor()); } } }
@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()); } } }
/** * @see NSOutlineView.Delegate */ @Override public void outlineView_willDisplayCell_forTableColumn_item(final NSOutlineView view, final NSTextFieldCell cell, final NSTableColumn tableColumn, final NSObject item) { if(null == item) { return; } final Path file = cache.lookup(new NSObjectPathReference(item)); if(null == file) { return; } if(tableColumn.identifier().equals(BrowserColumn.filename.name())) { (Rococoa.cast(cell, OutlineCell.class)).setIcon(browserOutlineModel.iconForPath(file)); } 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());