Package org.lazan.t5.stitch.demo.entities

Examples of org.lazan.t5.stitch.demo.entities.Item


 
  /**
   * 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

    for (int i = 0; i < fieldCount; ++ i) {
      String paramName = "observe" + i;
      contextValues.add(request.getParameter(paramName));
    }
    CaptureResultCallback<Object> callback = new CaptureResultCallback<Object>();
    EventContext eventContext = new StringEventContext(contextValues, valueEncoderSource);
    resources.triggerContextEvent(event, eventContext, callback);
    return callback.getResult();
  }
View Full Code Here

TOP

Related Classes of org.lazan.t5.stitch.demo.entities.Item

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.