congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SizeFormatterFactory.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
ch.cyberduck.core.formatter.SizeFormatterFactory

Best Java code snippets using ch.cyberduck.core.formatter.SizeFormatterFactory.get (Showing top 10 results out of 315)

origin: iterate-ch/cyberduck

public Speedometer(final long timestamp, final boolean decimal) {
  this.timestamp = timestamp;
  this.sizeFormatter = SizeFormatterFactory.get(decimal);
}
origin: iterate-ch/cyberduck

public SizeTooltipService() {
  this(SizeFormatterFactory.get());
}
origin: iterate-ch/cyberduck

public static SizeFormatter get() {
  return SizeFormatterFactory.get(PreferencesFactory.get().getBoolean("browser.filesize.decimal"));
}
origin: iterate-ch/cyberduck

  b.append(", ");
b.append(SizeFormatterFactory.get(true).format(
    new BigDecimal(speed * 1000).setScale(0, RoundingMode.UP).longValue()));
b.append("/sec");
origin: iterate-ch/cyberduck

private void setSize(final Long size) {
  sizeField.setAttributedStringValue(NSAttributedString.attributedStringWithAttributes(
    SizeFormatterFactory.get().format(size, true),
    TRUNCATE_MIDDLE_ATTRIBUTES));
}
origin: iterate-ch/cyberduck

public void setDefaultDownloadThrottleCombobox(NSPopUpButton b) {
  this.defaultDownloadThrottleCombobox = b;
  this.defaultDownloadThrottleCombobox.setTarget(this.id());
  this.defaultDownloadThrottleCombobox.setAction(Foundation.selector("defaultDownloadThrottleComboboxClicked:"));
  int bandwidth = (int) preferences.getDouble("queue.download.bandwidth.bytes");
  final StringTokenizer options = new StringTokenizer(preferences.getProperty("queue.bandwidth.options"), ",");
  while(options.hasMoreTokens()) {
    final String bytes = options.nextToken();
    this.defaultDownloadThrottleCombobox.addItemWithTitle(SizeFormatterFactory.get().format(Integer.parseInt(bytes)) + "/s");
    this.defaultDownloadThrottleCombobox.lastItem().setRepresentedObject(bytes);
  }
  if(-1 == bandwidth) {
    this.defaultDownloadThrottleCombobox.selectItemWithTag(new NSInteger(-1));
  }
  else {
    this.defaultDownloadThrottleCombobox.selectItemAtIndex(
      this.defaultDownloadThrottleCombobox.menu().indexOfItemWithRepresentedObject(String.valueOf(bandwidth)));
  }
}
origin: iterate-ch/cyberduck

public void setDefaultUploadThrottleCombobox(NSPopUpButton b) {
  this.defaultUploadThrottleCombobox = b;
  this.defaultUploadThrottleCombobox.setTarget(this.id());
  this.defaultUploadThrottleCombobox.setAction(Foundation.selector("defaultUploadThrottleComboboxClicked:"));
  int bandwidth = (int) preferences.getDouble("queue.upload.bandwidth.bytes");
  final StringTokenizer options = new StringTokenizer(preferences.getProperty("queue.bandwidth.options"), ",");
  while(options.hasMoreTokens()) {
    final String bytes = options.nextToken();
    this.defaultUploadThrottleCombobox.addItemWithTitle(SizeFormatterFactory.get().format(Integer.parseInt(bytes)) + "/s");
    this.defaultUploadThrottleCombobox.lastItem().setRepresentedObject(bytes);
  }
  if(-1 == bandwidth) {
    this.defaultUploadThrottleCombobox.selectItemWithTag(new NSInteger(-1));
  }
  else {
    this.defaultUploadThrottleCombobox.selectItemAtIndex(
      this.defaultUploadThrottleCombobox.menu().indexOfItemWithRepresentedObject(String.valueOf(bandwidth)));
  }
}
origin: iterate-ch/cyberduck

protected NSObject objectValueForItem(final TransferItem file, final String identifier) {
  final TransferStatus status = this.getStatus(file);
  if(identifier.equals(Column.include.name())) {
    if(status.isRejected()) {
      return NSNumber.numberWithBoolean(false);
    }
    return NSNumber.numberWithBoolean(this.isSelected(file));
  }
  if(identifier.equals(Column.filename.name())) {
    return NSAttributedString.attributedStringWithAttributes(file.remote.getName(),
        TableCellAttributes.browserFontLeftAlignment());
  }
  if(identifier.equals(Column.size.name())) {
    return NSAttributedString.attributedStringWithAttributes(
        SizeFormatterFactory.get().format(status.getLength()),
        TableCellAttributes.browserFontRightAlignment());
  }
  if(identifier.equals(Column.warning.name())) {
    if(file.remote.isFile()) {
      if(status.getLength() == 0) {
        return IconCacheFactory.<NSImage>get().iconNamed("alert.tiff");
      }
    }
    return null;
  }
  throw new IllegalArgumentException(String.format("Unknown identifier %s", identifier));
}
origin: iterate-ch/cyberduck

while(options.hasMoreTokens()) {
  final String bytes = options.nextToken();
  final NSMenuItem m = bandwidthMenu.addItemWithTitle_action_keyEquivalent(SizeFormatterFactory.get().format(Integer.parseInt(bytes)) + "/s",
      bandwidth.action(), StringUtils.EMPTY);
origin: iterate-ch/cyberduck

  SizeFormatterFactory.get().format(item.local.attributes().getSize()),
  TRUNCATE_MIDDLE_ATTRIBUTES));
SizeFormatterFactory.get().format(status.getRemote().getSize()),
TRUNCATE_MIDDLE_ATTRIBUTES));
ch.cyberduck.core.formatterSizeFormatterFactoryget

Popular methods of SizeFormatterFactory

    Popular in Java

    • Parsing JSON documents to java classes using gson
    • getSharedPreferences (Context)
    • getResourceAsStream (ClassLoader)
    • notifyDataSetChanged (ArrayAdapter)
    • FlowLayout (java.awt)
      A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
    • Font (java.awt)
      The Font class represents fonts, which are used to render text in a visible way. A font provides the
    • InetAddress (java.net)
      An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
    • NoSuchElementException (java.util)
      Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
    • ReentrantLock (java.util.concurrent.locks)
      A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
    • XPath (javax.xml.xpath)
      XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
    • Best IntelliJ plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now