/** * Set name of key in menu item */ protected void updateLicenseMenu() { final License key = LicenseFactory.find(); if(key.isReceipt()) { this.applicationMenu.removeItemAtIndex(new NSInteger(5)); this.applicationMenu.removeItemAtIndex(new NSInteger(4)); } else { this.applicationMenu.itemAtIndex(new NSInteger(5)).setAttributedTitle( NSAttributedString.attributedStringWithAttributes(key.toString(), MENU_HELP_FONT_ATTRIBUTES) ); } }
private void setMenuHighlighted(boolean highlighted) { for(int i = 0; i < filesPopup.numberOfItems().intValue(); i++) { filesPopup.itemAtIndex(new NSInteger(i)).setAttributedTitle( NSAttributedString.attributedStringWithAttributes(filesPopup.itemAtIndex(new NSInteger(i)).title(), highlighted ? HIGHLIGHTED_FONT_ATTRIBUTES : NORMAL_FONT_ATTRIBUTES) ); } }
item.setAttributedTitle(NSAttributedString.attributedStringWithAttributes( StringUtils.join(target, '\n'), BundleController.MENU_HELP_FONT_ATTRIBUTES));
public void setActionPopup(final NSPopUpButton actionPopup) { this.actionPopup = actionPopup; this.actionPopup.removeAllItems(); this.actionPopup.setAutoenablesItems(false); final TransferAction defaultAction = TransferAction.forName(preferences.getProperty(String.format("queue.prompt.%s.action.default", transfer.getType().name()))); for(TransferAction action : TransferAction.forTransfer(transfer.getType())) { this.actionPopup.addItemWithTitle(action.getTitle()); this.actionPopup.lastItem().setRepresentedObject(action.name()); if(action.equals(defaultAction)) { this.actionPopup.selectItem(actionPopup.lastItem()); } this.actionPopup.addItemWithTitle(action.getDescription()); this.actionPopup.lastItem().setAttributedTitle(NSAttributedString.attributedStringWithAttributes(action.getDescription(), MENU_HELP_FONT_ATTRIBUTES)); this.actionPopup.lastItem().setEnabled(false); } this.actionPopup.setTarget(this.id()); this.actionPopup.setAction(Foundation.selector("actionPopupClicked:")); }
public void setDuplicateDownloadCombobox(NSPopUpButton b) { this.duplicateDownloadCombobox = b; this.duplicateDownloadCombobox.setAutoenablesItems(false); this.duplicateDownloadCombobox.setTarget(this.id()); this.duplicateDownloadCombobox.setAction(Foundation.selector("duplicateDownloadComboboxClicked:")); this.duplicateDownloadCombobox.removeAllItems(); for(TransferAction action : new TransferAction[]{ TransferAction.callback, TransferAction.overwrite, TransferAction.resume, TransferAction.rename, TransferAction.renameexisting, TransferAction.comparison, TransferAction.skip}) { this.duplicateDownloadCombobox.addItemWithTitle(action.getTitle()); this.duplicateDownloadCombobox.lastItem().setRepresentedObject(action.name()); this.duplicateDownloadCombobox.addItemWithTitle(action.getDescription()); this.duplicateDownloadCombobox.lastItem().setAttributedTitle(NSAttributedString.attributedStringWithAttributes(action.getDescription(), MENU_HELP_FONT_ATTRIBUTES)); this.duplicateDownloadCombobox.lastItem().setEnabled(false); } this.duplicateDownloadCombobox.selectItemWithTitle( TransferAction.forName(preferences.getProperty("queue.download.action")).getTitle()); }
public void setDuplicateUploadCombobox(NSPopUpButton b) { this.duplicateUploadCombobox = b; this.duplicateUploadCombobox.setAutoenablesItems(false); this.duplicateUploadCombobox.setTarget(this.id()); this.duplicateUploadCombobox.setAction(Foundation.selector("duplicateUploadComboboxClicked:")); this.duplicateUploadCombobox.removeAllItems(); for(TransferAction action : new TransferAction[]{ TransferAction.callback, TransferAction.overwrite, TransferAction.resume, TransferAction.rename, TransferAction.renameexisting, TransferAction.comparison, TransferAction.skip}) { this.duplicateUploadCombobox.addItemWithTitle(action.getTitle()); this.duplicateUploadCombobox.lastItem().setRepresentedObject(action.name()); this.duplicateUploadCombobox.addItemWithTitle(action.getDescription()); this.duplicateUploadCombobox.lastItem().setAttributedTitle(NSAttributedString.attributedStringWithAttributes(action.getDescription(), MENU_HELP_FONT_ATTRIBUTES)); this.duplicateUploadCombobox.lastItem().setEnabled(false); } this.duplicateUploadCombobox.selectItemWithTitle( TransferAction.forName(preferences.getProperty("queue.upload.action")).getTitle()); }
LocaleFactory.localizedString("Unknown"), BundleController.MENU_HELP_FONT_ATTRIBUTES)); item.setAttributedTitle(title);