ch.cyberduck.core.Protocol.icon()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中ch.cyberduck.core.Protocol.icon()方法的一些代码示例,展示了Protocol.icon()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.icon()方法的具体详情如下:
包路径:ch.cyberduck.core.Protocol
类名称:Protocol
方法名:icon

Protocol.icon介绍

暂无

代码示例

代码示例来源:origin: iterate-ch/cyberduck

@Override
public String icon() {
  if(null == icon) {
    return parent.icon();
  }
  // Temporary file
  return icon.getAbsolute();
}

代码示例来源:origin: iterate-ch/cyberduck

private void addProtocol(final Protocol protocol) {
  final String title = protocol.getDescription();
  this.protocolPopup.addItemWithTitle(title);
  this.protocolPopup.lastItem().setRepresentedObject(String.valueOf(protocol.hashCode()));
  this.protocolPopup.lastItem().setImage(IconCacheFactory.<NSImage>get().iconNamed(protocol.icon(), 16));
}

代码示例来源:origin: iterate-ch/cyberduck

private void addProtocol(final Protocol protocol) {
  final String title = protocol.getDescription();
  protocolCombobox.addItemWithTitle(title);
  protocolCombobox.lastItem().setRepresentedObject(String.valueOf(protocol.hashCode()));
  protocolCombobox.lastItem().setImage(IconCacheFactory.<NSImage>get().iconNamed(protocol.icon(), 16));
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
public NSToolbarItem toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(final NSToolbar toolbar, final String identifier, final boolean flag) {
  NSToolbarItem item = super.toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(toolbar, identifier, flag);
  switch(InfoToolbarItem.valueOf(identifier)) {
    case distribution:
      if(session.getFeature(DistributionConfiguration.class) != null) {
        // Give icon and label of the given session
        item.setImage(IconCacheFactory.<NSImage>get().iconNamed(session.getHost().getProtocol().icon(), 32));
      }
      else {
        // CloudFront is the default for custom distributions
        item.setImage(IconCacheFactory.<NSImage>get().iconNamed(new S3Protocol().icon(), 32));
      }
      break;
    case s3:
      // Set icon of cloud service provider
      item.setLabel(session.getHost().getProtocol().getName());
      item.setImage(IconCacheFactory.<NSImage>get().iconNamed(session.getHost().getProtocol().icon(), 32));
      break;
    case metadata:
      item.setImage(IconCacheFactory.<NSImage>get().iconNamed("pencil.tiff", 32));
      break;
    case acl:
      item.setImage(IconCacheFactory.<NSImage>get().iconNamed("permissions.tiff", 32));
      break;
  }
  return item;
}

代码示例来源:origin: iterate-ch/cyberduck

bookmarksPopup.lastItem().setImage(IconCacheFactory.<NSImage>get().iconNamed(b.getProtocol().icon(), 16));
bookmarksPopup.lastItem().setRepresentedObject(b.getUuid());
if(b.equals(open)) {

代码示例来源:origin: iterate-ch/cyberduck

public void setDefaultBookmarkCombobox(NSPopUpButton b) {
  this.defaultBookmarkCombobox = b;
  this.defaultBookmarkCombobox.setToolTip(LocaleFactory.localizedString("Bookmarks", "Preferences"));
  this.defaultBookmarkCombobox.removeAllItems();
  this.defaultBookmarkCombobox.addItemWithTitle(LocaleFactory.localizedString("None"));
  this.defaultBookmarkCombobox.selectItem(this.defaultBookmarkCombobox.lastItem());
  this.defaultBookmarkCombobox.menu().addItem(NSMenuItem.separatorItem());
  for(Host bookmark : FolderBookmarkCollection.favoritesCollection()) {
    this.defaultBookmarkCombobox.addItemWithTitle(BookmarkNameProvider.toString(bookmark));
    this.defaultBookmarkCombobox.lastItem().setImage(
      IconCacheFactory.<NSImage>get().iconNamed(bookmark.getProtocol().icon(), 16));
    this.defaultBookmarkCombobox.lastItem().setRepresentedObject(bookmark.getUuid());
    if(bookmark.getUuid().equals(preferences.getProperty("browser.open.bookmark.default"))) {
      this.defaultBookmarkCombobox.selectItem(this.defaultBookmarkCombobox.lastItem());
    }
  }
  FolderBookmarkCollection.favoritesCollection().addListener(bookmarkCollectionListener);
  this.defaultBookmarkCombobox.setTarget(this.id());
  final Selector action = Foundation.selector("defaultBookmarkComboboxClicked:");
  this.defaultBookmarkCombobox.setAction(action);
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
public boolean menuUpdateItemAtIndex(NSMenu menu, NSMenuItem item, NSInteger index, boolean cancel) {
  if(collection.size() == 0) {
    item.setTitle(LocaleFactory.localizedString("None"));
    item.setTarget(null);
    item.setAction(null);
    item.setImage(null);
    item.setEnabled(false);
  }
  else {
    final Host h = this.itemForIndex(index);
    item.setTitle(BookmarkNameProvider.toString(h));
    item.setTarget(this.id());
    item.setEnabled(true);
    item.setImage(IconCacheFactory.<NSImage>get().iconNamed(h.getProtocol().icon(), preferences.getInteger("bookmark.menu.icon.size")));
    item.setTarget(this.id());
    item.setAction(this.getDefaultAction());
    item.setRepresentedObject(h.getUuid());
  }
  return super.menuUpdateItemAtIndex(menu, item, index, cancel);
}

代码示例来源:origin: iterate-ch/cyberduck

item.setRepresentedObject(h.getUuid());
item.setEnabled(true);
item.setImage(IconCacheFactory.<NSImage>get().iconNamed(h.getProtocol().icon(), preferences.getInteger("bookmark.menu.icon.size")));
final NSMutableAttributedString title = NSMutableAttributedString.create(String.format("%s ", BookmarkNameProvider.toString(h)));
final Date timestamp = h.getTimestamp();

代码示例来源:origin: iterate-ch/cyberduck

@Override
public boolean menuUpdateItemAtIndex(NSMenu menu, NSMenuItem item, NSInteger row, boolean cancel) {
  if(row.intValue() == index) {
    item.setEnabled(true);
    item.setTitle(LocaleFactory.get().localize("History", "Localizable"));
    item.setImage(IconCacheFactory.<NSImage>get().iconNamed("history.tiff", 16));
    item.setTarget(this.id());
    item.setAction(Foundation.selector("historyMenuClicked:"));
    item.setSubmenu(historyMenu);
  }
  if(row.intValue() == index + 1) {
    item.setEnabled(true);
    item.setTitle(LocaleFactory.get().localize("Bonjour", "Main"));
    item.setImage(IconCacheFactory.<NSImage>get().iconNamed("rendezvous.tiff", 16));
    item.setSubmenu(rendezvousMenu);
  }
  if(row.intValue() == index + 2) {
    menu.removeItemAtIndex(row);
    menu.insertItem_atIndex(this.seperator(), row);
  }
  if(row.intValue() > index + 2) {
    Host h = this.itemForIndex(row);
    item.setTitle(BookmarkNameProvider.toString(h));
    item.setTarget(this.id());
    item.setImage(IconCacheFactory.<NSImage>get().iconNamed(h.getProtocol().icon(), preferences.getInteger("bookmark.menu.icon.size")));
    item.setAction(this.getDefaultAction());
    item.setRepresentedObject(h.getUuid());
  }
  return super.menuUpdateItemAtIndex(menu, item, row, cancel);
}

相关文章