Package org.odlabs.wiquery.core.options

Examples of org.odlabs.wiquery.core.options.Options


        "jquery.ui.dashboardstatustablemaster.js"));
  }

  @Override
  public JsStatement statement() {
    Options projectList = new Options();
    for (Project project : WicketApplication.get().getProjects()) {
      projectList.putLiteral(project.getCode(), project.getName());
    }

    Options options = new Options();
    options.putLiteral("dataUrl", dataResource.getCallbackUrl().toString());
    options.put("projects", projectList.getJavaScriptOptions().toString());
    options.put("secondsBetweenScroll", WicketApplication.get()
        .isDevelopment() ? 15 : 30);
    options.put("secondsBetweenRotate", WicketApplication.get()
        .isDevelopment() ? 5 : 10);
    JsQuery jsq = new JsQuery(projects);
    return jsq.$().chain("dashboardStatusTableMaster",
        options.getJavaScriptOptions());
  }
View Full Code Here


        AlertsPanel.class, "jquery.ui.dashboardalerts.js"));
  }

  @Override
  public JsStatement statement() {
    Options options = new Options();
    options.putLiteral("dataUrl", dataResource.getCallbackUrl().toString());
    JsQuery jsq = new JsQuery(this);
    return jsq.$().chain("dashboardAlerts", options.getJavaScriptOptions());
  }
View Full Code Here

        "jquery.ui.dashboardstatustable.js"));
  }

  @Override
  public JsStatement statement() {
    Options options = new Options();
    options.putLiteral("dataUrl", dataResource.getCallbackUrl().toString());
    List<String> conversions = new ArrayList<String>();
    List<String> htmlClasses = new ArrayList<String>();
    List<String> units = new ArrayList<String>();
    for (Class<? extends DataSource<?>> curDataSource : dataSources
        .getObject()) {
      DataSourceSettings settings = DataSourceAnnotationReader
          .getSettings(curDataSource);
      conversions.add(settings.conversion());
      htmlClasses.add(settings.htmlClass());
      units.add(settings.unit());
    }
    ObjectMapper mapper = new ObjectMapper();
    try {
      options.put("conversion", mapper.writeValueAsString(conversions));
      options.put("htmlClasses", mapper.writeValueAsString(htmlClasses));
      options.put("units", mapper.writeValueAsString(units));
    } catch (JsonGenerationException e) {
      throw new RuntimeException(e);
    } catch (JsonMappingException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    JsQuery jsq = new JsQuery(this);
    return jsq.$().chain("dashboardStatusTable",
        options.getJavaScriptOptions());
  }
View Full Code Here

        .getObject()) {
      dataSets.add(new BarDataSet(curDataSource, "color-" + count));
      count++;
    }

    Options options = new Options();
    options.put("secondsBetweenSwitch", WicketApplication.get()
        .isDevelopment() ? 30 : 60);
    try {
      options.put("dataSets", mapper.writeValueAsString(dataSets));
    } catch (JsonGenerationException e) {
      throw new RuntimeException(e);
    } catch (JsonMappingException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    JsQuery jsq = new JsQuery(this);
    return jsq.$().chain("dashboardBarGraphMaster",
        options.getJavaScriptOptions());
  }
View Full Code Here

    return (Project) getDefaultModelObject();
  }

  @Override
  public JsStatement statement() {
    Options options = new Options();
    options.putLiteral("projectName", getProject().getName());
    options.putLiteral("dataUrl", dataResource.getCallbackUrl().toString());
    JsQuery jsq = new JsQuery(this);
    return jsq.$().chain("dashboardBarGraph",
        options.getJavaScriptOptions());
  }
View Full Code Here

        EventsPanel.class, "jquery.ui.dashboardevents.js"));
  }

  @Override
  public JsStatement statement() {
    Options options = new Options();
    options.putLiteral("dataUrl", dataResource.getCallbackUrl().toString());
    JsQuery jsq = new JsQuery(this);
    return jsq.$().chain("dashboardEvents", options.getJavaScriptOptions());
  }
View Full Code Here

  public JsStatement statement() {
    DataSourceSettings settings = DataSourceAnnotationReader
        .getSettings(dataSource);
    KeyProperty keyProperty = DataSourceAnnotationReader
        .getKeyProperty(dataSource);
    Options options = new Options();
    options.putLiteral("dataUrl", dataResource.getCallbackUrl().toString());
    options.putLiteral("label",
        useKeyLabel ? key.getName() : settings.label());
    options.putLiteral("htmlClass", settings.htmlClass());
    options.putLiteral("conversion", settings.conversion());
    options.putLiteral("keyProperty", keyProperty.value());
    JsQuery jsq = new JsQuery(table);
    return jsq.$().chain("dashboardTable", options.getJavaScriptOptions());
  }
View Full Code Here

        PlotPanel.class, "jquery.ui.dashboardplot.js"));
  }

  @Override
  public JsStatement statement() {
    Options options = new Options();
    options.put("callback", updateBehavior.getCallbackScript().toString());
    JsQuery jsq = new JsQuery(this);
    return jsq.$().chain("dashboardPlot", options.getJavaScriptOptions());
  }
View Full Code Here

        StackedTablesPanel.class, "jquery.ui.dashboardstackedtables.js"));
  }

  @Override
  public JsStatement statement() {
    Options options = new Options();
    options.put("secondsBetweenSwitch", WicketApplication.get()
        .isDevelopment() ? 30 : 60);
    JsQuery jsq = new JsQuery(this);
    return jsq.$().chain("dashboardStackedTables",
        options.getJavaScriptOptions());
  }
View Full Code Here

TOP

Related Classes of org.odlabs.wiquery.core.options.Options

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.