Package org.gwtoolbox.commons.util.client.template

Examples of org.gwtoolbox.commons.util.client.template.Template$Model


     * this.setModel(model); </code>
     *
     *
     */
    public Model createAndSetModel() {
        Model newValue = new Model();
        this.setModel(newValue);
        return newValue;
    }
View Full Code Here


  public boolean acceptFeature(Feature feature) {
    return this.styleFilter.match(feature);
  }

  public Model getKmlModel(Feature feature, Point point) {
    Model kmlModel = KmlFactory.createModel()
        .withId(feature.getName().toString())
        .withAltitudeMode(getAltitudeMode(feature, point));
    kmlModel.createAndSetLocation().withLongitude(point.getCoordinate().x)
        .withLatitude(point.getCoordinate().y)
        .withAltitude(getAltitude(feature, point));
    kmlModel.createAndSetOrientation()
        .withHeading(
            getGenericRotationValue(feature, model.getHeading()))
        .withTilt(getGenericRotationValue(feature, model.getTilt()))
        .withRoll(getGenericRotationValue(feature, model.getRoll()));
    kmlModel.createAndSetLink()
        .withHref(
            styleFilter.getExpressionValue(model.getHref(), feature))
        .withRefreshMode(RefreshMode.ON_CHANGE);
    return kmlModel;
  }
View Full Code Here

  public Kml getKml() {
    return kml;
  }

  private void addPoint(Feature feature, Point point, List<KmlModel> kmlModels) {
    Model kmlModel = getKmlModel(feature, point, kmlModels);
    if (kmlModel != null) {
      Placemark placemark = new Placemark().withName(feature.getName()
          .toString());
      placemark.createAndSetLookAt()
          .withLongitude(point.getCoordinate().x)
View Full Code Here

    /**
     * Find the Model of a ressource (UML2 Model)
     */
    public static Model findModel(final UML2Resource resource)
    {
        Model model = (Model)EcoreUtil.getObjectByType(
                resource.getContents(),
                EcorePackage.eINSTANCE.getEObject());
        if (logger.isDebugEnabled())
        {
            logger.debug("Model found: " + model);
View Full Code Here

            null);
        final ModelAccessFacade modelFacade = repository.getModel();
        assertNotNull(modelFacade);
        assertNotNull(modelFacade.getModel());
        assertTrue(modelFacade.getModel() instanceof UML2Resource);
        Model model = (Model)EcoreUtil.getObjectByType(
            ((UML2Resource)repository.getModel().getModel()).getContents(),
            EcorePackage.eINSTANCE.getEObject());
        assertEquals(
            "Test Model",
            model.getName());
        Collection elements = UML2Util.findNamedElements(
                model.eResource(),
                "Test Model::testPackage::Top",
                true);
        org.eclipse.uml2.Class umlClass = (org.eclipse.uml2.Class)elements.iterator().next();
        assertEquals(
            "Top",
View Full Code Here

    }
    return null;
  }

  private Package addPackage(String name, ModelAccessFacade model) {
    Model m = (Model) ((UML2Resource) model.getModel()).getContents()
        .get(0);
    return m.createNestedPackage(name);
  }
View Full Code Here

*/
public abstract class HtmlFieldsRenderer implements FieldsRenderer {

    public Widget render(HasFields fields) {
        String html = getHtmlTemplate();
        Template template = Template.compile(html);
        html = template.render(new Template.Model() {
            public String resolve(String parameter) {
                return "<div id=\"" + parameter + "\"><div>";
            }
        });
        HTMLPanel panel = new HTMLPanel(html);
View Full Code Here

        MapModel model = new MapModel() {{
            set("label", label);
            set("color", color);
            set("message", message);
        }};
        Template template = Template.compile("<span style=\"color:${color}\">${label}:</span>&nbsp;${message}");
        HTML html = new HTML(template.render(model));
        GWT.log(template.render(model), null);
        main.add(html);
    }
View Full Code Here

TOP

Related Classes of org.gwtoolbox.commons.util.client.template.Template$Model

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.