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

    • Making http post requests using okhttp
    • runOnUiThread (Activity)
    • getResourceAsStream (ClassLoader)
    • onCreateOptionsMenu (Activity)
    • Pointer (com.sun.jna)
      An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
    • Container (java.awt)
      A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
    • Cipher (javax.crypto)
      This class provides access to implementations of cryptographic ciphers for encryption and decryption
    • Notification (javax.management)
    • BoxLayout (javax.swing)
    • Base64 (org.apache.commons.codec.binary)
      Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
    • PhpStorm for WordPress
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

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