@Test public void testSetProgressNoFile() { final WorkspaceIconService s = new WorkspaceIconService(); final Local file = new Local(PreferencesFactory.get().getProperty("tmp.dir"), UUID.randomUUID().toString()); assertFalse(s.update(file, NSImage.imageWithContentsOfFile("../../img/download0.icns"))); }
protected boolean update(final Local file, final NSImage icon) { synchronized(NSWorkspace.class) { 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; } }
WorkspaceIconService implements IconService { protected boolean update(final Local file, final NSImage icon) { synchronized(NSWorkspace.class) { 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; } } }
WorkspaceIconService implements IconService { protected boolean update(final Local file, final NSImage icon) { synchronized(NSWorkspace.class) { 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; } }  }
WorkspaceIconService implements IconService { protected boolean update(final Local file, final NSImage icon) { synchronized(NSWorkspace.class) { 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; } }  @Override boolean set(final Local file, final String image); @Override boolean set(final Local file, final TransferStatus status); @Override boolean remove(final Local file); }
WorkspaceIconService implements IconService { protected boolean update(final Local file, final NSImage icon) { synchronized(NSWorkspace.class) { 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; } }  @Override boolean set(final Local file, final String image); @Override boolean set(final Local file, final TransferStatus status); @Override boolean remove(final Local file);  }