Package jfix.zk

Examples of jfix.zk.View


      return parameter.getKey();
    case 1:
      String value = parameter.getValue();
      int index = value.indexOf("\n");
      if (index != -1) {
        return new View(value, new Label(value.substring(0, index)
            + " [...]"));
      } else {
        return parameter.getValue();
      }
    }
View Full Code Here


import org.apache.commons.io.FileUtils;

public class NodeViews {

  public static View asType(Node node) {
    return new View(node.getType(), new Row(new Image(JeaseSession
        .getConfig().getIcon(node)), new Label(node.getType())));
  }
View Full Code Here

 
  public static View asIcon(Node node) {
    Image image = new Image();
    image.setSrc(JeaseSession.getConfig().getIcon(node));
    image.setTooltiptext(node.getType());
    return new View(node.getType(), image);
  }
View Full Code Here

  public static View asCheckbox(boolean state, final ActionListener action) {
    final Checkbox checkbox = new Checkbox();
    checkbox.setChecked(state);
    checkbox.addCheckListener(action);
    return new View(state ? I18N.get("Yes") : I18N.get("No"), checkbox);
  }
View Full Code Here

  public static View asSize(Node node) {
    if (node.isContainer()) {
      long items = node.getChildren().length;
      String text = String.format(" %s %s", items,
          items == 1 ? I18N.get("Item") : I18N.get("Items"));
      return new View(text, new Label(text));
    } else {
      long size = node.getSize();
      String text = FileUtils.byteCountToDisplaySize(size);
      return new View(size, new Label(text));
    }
  }
View Full Code Here

TOP

Related Classes of jfix.zk.View

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.