Package org.lazan.t5.stitch.demo.pages

Examples of org.lazan.t5.stitch.demo.pages.ObserveDemo$Phone


  }
 
  void onValidateFromGenericField(String value) {
    if (value == null || !value.toLowerCase().startsWith("a")) {
      String fieldName = getFieldName(genericField.getControlName());
      Field fieldSnapshot = new FieldSnapshot(genericField);
      form.recordError(fieldSnapshot, fieldName + " must start with 'a'");
    }
  }
View Full Code Here


    }
    return new CollectionGridDataSource(allRecords);
  }
 
  public PagerModel getPagerModel() {
    return new DefaultPagerModel(2, 1, 2);
  }
View Full Code Here

  /**
   * Set the background color of every cell
   */
  public GridCellDecorator getCellDecorator() {
    return new GridCellDecorator() {
      public void decorate(Element cellElement, Object rowObject, int rowIndex, String propertyName, int colIndex) {
        String color;
        if (rowIndex % 2 == 0) {
          color = colIndex % 2 == 0 ? YELLOW : RED;
        } else {
View Full Code Here

 
  /**
   * Display an alert when any row is clicked
   */
  public GridRowDecorator getRowDecorator() {
    return new GridRowDecorator() {
      public void decorate(Element element, Object rowValue, int rowIndex) {
        Item item = (Item) rowValue;
        String script = String.format("alert('value=%s, rowIndex=%s')", item.value, rowIndex);
        element.attribute("onclick", script);
      }
View Full Code Here

  public BeanModel<Object> getPeopleModel() {
    // initially construct a BeanModel for object (no properties)
    BeanModel<Object> beanModel = beanModelSource.createDisplayModel(Object.class, messages);
   
    // add MapPropertyConduits for each map entry
    beanModel.add("firstName", new MapPropertyConduit("firstName", String.class));
    beanModel.add("lastName", new MapPropertyConduit("lastName", String.class));
    beanModel.add("age", new MapPropertyConduit("age", int.class));
   
    return beanModel;
  }
View Full Code Here

  Object onAjaxEvent() {
    return captureBlock;
  }
 
  public MarkupHandler getCountToTenHandler() {
    return new MarkupHandler() {
     
      // fired as the captureBlock renders
      public void handle(String markup) {
        jss.addScript("alert('%s')", markup.trim());
      }
View Full Code Here

   *
   * @param taskId The id of the task submitted by a previous call to add(ProgressTask)
   * @return The progress value
   */
  public float getProgress(int taskId) {
    ProgressTask progressTask = executingTasks.get(taskId);
    return progressTask == null ? 1f : progressTask.getProgress();
  }
View Full Code Here

  }

  public Syntax getSyntax(Asset source) {
    String name = source.getResource().getFile();
    int dotIndex = name.lastIndexOf('.');
    Syntax syntax = null;
    if (dotIndex != -1) {
      String suffix = name.substring(dotIndex + 1);
      syntax = syntaxBySuffix.get(suffix);
    }
    return syntax == null ? Syntax.AUTO_DETECT : syntax;
View Full Code Here

  @Property
  private String currentName;

  void setup() {
    tabModels = new LinkedHashMap<String, TabModel>();
    TabGroupModel tabGroupModel = new TabGroupModel() {
      public void addTab(String name, String label, Block body) {
        tabModels.put(name, new TabModel(name, label, body));
      }
    };
    request.setAttribute(ATTRIBUTE_MODEL, tabGroupModel);
View Full Code Here

  @Inject
  private ComponentResources resources;
 
  @BeforeRenderBody
  boolean beforeRenderBody(MarkupWriter writer) {
    TabGroupModel tabModel = (TabGroupModel) request.getAttribute(TabGroup.ATTRIBUTE_MODEL);
    if (tabModel == null) {
      throw new IllegalStateException("Tab must be nested inside a TabGroup");
    }
    tabModel.addTab(name, label, resources.getBody());
   
    // don't render the body, it will be rendered by the TabGroup
    return false;
  }
View Full Code Here

TOP

Related Classes of org.lazan.t5.stitch.demo.pages.ObserveDemo$Phone

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.