@Override public NSImage image() { final NSImage image = IconCacheFactory.<NSImage>get().iconNamed(String.format("%s.tiff", "outline"), 16); image.setTemplate(true); return image; } },
public NSImage image() { final NSImage image = IconCacheFactory.<NSImage>get().iconNamed(String.format("%s.tiff", name()), 16); image.setTemplate(true); return image; } }
private NSImage convert(final String name, final NSImage icon, final Integer width, final Integer height) { if(StringUtils.endsWith(name, "pdf")) { icon.setTemplate(true); } if(null == width || null == height) { log.debug(String.format("Return default size for %s", icon.name())); return icon; } // Cache sized image icon.setName(String.format("%d-%s", width, name)); icon.setSize(new NSSize(width, height)); return icon; } }
@Action public void setAddBookmarkButton(NSButton addBookmarkButton) { this.addBookmarkButton = addBookmarkButton; this.addBookmarkButton.setTarget(this.id()); this.addBookmarkButton.setAction(Foundation.selector("addBookmarkButtonClicked:")); this.addBookmarkButton.image().setTemplate(true); }
@Action public void setDeleteBookmarkButton(NSButton deleteBookmarkButton) { this.deleteBookmarkButton = deleteBookmarkButton; this.deleteBookmarkButton.setEnabled(false); this.deleteBookmarkButton.setTarget(this.id()); this.deleteBookmarkButton.setAction(Foundation.selector("deleteBookmarkButtonClicked:")); this.deleteBookmarkButton.image().setTemplate(true); }
@Action public void setEditBookmarkButton(NSButton editBookmarkButton) { this.editBookmarkButton = editBookmarkButton; this.editBookmarkButton.setEnabled(false); this.editBookmarkButton.setTarget(this.id()); this.editBookmarkButton.setAction(Foundation.selector("editBookmarkButtonClicked:")); this.editBookmarkButton.image().setTemplate(true); }
@Action public void setUpButton(NSSegmentedControl upButton) { this.upButton = upButton; this.upButton.setTarget(this.id()); this.upButton.setAction(Foundation.selector("upButtonClicked:")); this.upButton.setImage_forSegment(IconCacheFactory.<NSImage>get().iconNamed("nav-up.tiff"), NavigationSegment.up.position()); this.upButton.imageForSegment(NavigationSegment.up.position()).setTemplate(true); }
@Action public void setNavigationButton(NSSegmentedControl navigationButton) { this.navigationButton = navigationButton; this.navigationButton.setTarget(this.id()); this.navigationButton.setAction(Foundation.selector("navigationButtonClicked:")); final NSSegmentedCell cell = Rococoa.cast(this.navigationButton.cell(), NSSegmentedCell.class); this.navigationButton.setImage_forSegment(IconCacheFactory.<NSImage>get().iconNamed("nav-backward.tiff"), NavigationSegment.back.position()); this.navigationButton.imageForSegment(NavigationSegment.back.position()).setTemplate(true); cell.setToolTip_forSegment(LocaleFactory.localizedString("Back", "Main"), NavigationSegment.back.position()); this.navigationButton.setImage_forSegment(IconCacheFactory.<NSImage>get().iconNamed("nav-forward.tiff"), NavigationSegment.forward.position()); this.navigationButton.imageForSegment(NavigationSegment.forward.position()).setTemplate(true); cell.setToolTip_forSegment(LocaleFactory.localizedString("Forward", "Main"), NavigationSegment.forward.position()); }
image.setTemplate(true); m.setImage(image); m.setRepresentedObject(bytes);