Examples of BooleanAttribute


Examples of org.geomajas.layer.feature.attribute.BooleanAttribute

    Map<String, Attribute> attributes = new HashMap<String, Attribute>();
    attributes.put(PARAM_TEXT_ATTR, new StringAttribute("new name"));
    attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(5f));
    Calendar c = Calendar.getInstance();
    attributes.put(PARAM_DATE_ATTR, new DateAttribute(c.getTime()));
    attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(false));

    layer.getFeatureModel().setAttributes(detached, attributes);
    layer.saveOrUpdate(detached);

    feature = layer.read(f1.getId().toString());
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.BooleanAttribute

    Map<String, Attribute> attributes = new HashMap<String, Attribute>();
    attributes.put(PARAM_TEXT_ATTR, new StringAttribute("new name"));
    attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(5f));
    Calendar c = Calendar.getInstance();
    attributes.put(PARAM_DATE_ATTR, new DateAttribute(c.getTime()));
    attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(false));

    // Set a ManyToOne attribute without an ID (a new one)
    attributes.put(PARAM_MANY_TO_ONE, HibernateTestManyToOne.getDefaultAttributeInstance1(null));

    layer.getFeatureModel().setAttributes(detached, attributes);
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.BooleanAttribute

    Map<String, Attribute> attributes = new HashMap<String, Attribute>();
    attributes.put(PARAM_TEXT_ATTR, new StringAttribute("new name"));
    attributes.put(PARAM_INT_ATTR, new IntegerAttribute(5));
    attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(5.0f));
    attributes.put(PARAM_DOUBLE_ATTR, new DoubleAttribute(5.0));
    attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(false));
    attributes.put(PARAM_DATE_ATTR, new DateAttribute(date));
    featureModel.setAttributes(feature1, attributes);
    Assert.assertEquals("new name", featureModel.getAttribute(feature1, PARAM_TEXT_ATTR).getValue());
    Assert.assertEquals(5, featureModel.getAttribute(feature1, PARAM_INT_ATTR).getValue());
    Assert.assertEquals(5.0f, featureModel.getAttribute(feature1, PARAM_FLOAT_ATTR).getValue());
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.BooleanAttribute

  }

  public static ManyToOneAttribute getDefaultAttributeInstance1(Long id) {
     Map<String, PrimitiveAttribute<?>> attributes = new HashMap<String, PrimitiveAttribute<?>>();
    attributes.put("textAttr", new StringAttribute("manyToOne-1"));
    attributes.put("booleanAttr", new BooleanAttribute(true));
    attributes.put("intAttr", new IntegerAttribute(100));
    attributes.put("floatAttr", new FloatAttribute(100.0f));
    attributes.put("doubleAttr", new DoubleAttribute(100.0));
   
    DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.BooleanAttribute

   */
  public static PrimitiveAttribute<?> createEmptyPrimitiveAttribute(PrimitiveAttributeInfo info) {
    PrimitiveAttribute<?> attribute = null;
    switch (info.getType()) {
      case BOOLEAN:
        attribute = new BooleanAttribute();
        break;
      case SHORT:
        attribute = new ShortAttribute();
        break;
      case INTEGER:
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.BooleanAttribute

  }

  private PrimitiveAttribute<?> createPrimitiveAttribute(PrimitiveAttributeInfo primInfo) {
    switch (primInfo.getType()) {
      case BOOLEAN:
        return new BooleanAttribute();
      case CURRENCY:
        return new CurrencyAttribute();
      case DATE:
        return new DateAttribute();
      case DOUBLE:
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.BooleanAttribute

    Attribute newAttribute() {
      if (attribute instanceof PrimitiveAttribute<?>) {
        PrimitiveAttribute<?> p = (PrimitiveAttribute<?>) attribute;
        switch (p.getType()) {
          case BOOLEAN:
            return new BooleanAttribute();
          case SHORT:
            return new ShortAttribute();
          case INTEGER:
            return new IntegerAttribute();
          case LONG:
View Full Code Here

Examples of org.jasig.portal.portlets.BooleanAttribute

    for (IChannelParameter param : def.getParameters()) {
      if (def.isPortlet() && param.getName().startsWith("PORTLET.")) {
        this.portletPreferences.put(param.getName(),
            new StringListAttribute(new String[]{ param.getValue() }));
        this.portletParameterOverrides.put(param.getName(),
            new BooleanAttribute(param.getOverride()));
      } else {
        this.parameters.put(param.getName(),
            new Attribute(param.getValue()));
        this.parameterOverrides.put(param.getName(),
            new BooleanAttribute(param.getOverride()));
      }
    }
   
    if (def.isPortlet()) {
            final IPortletPreferences prefs = portletDef.getPortletPreferences();
            for (IPortletPreference pref : prefs.getPortletPreferences()) {
        List<Attribute> attributes = new ArrayList<Attribute>();
        for (String value : pref.getValues()) {
          attributes.add(new Attribute(value));
        }
        this.portletPreferences.put(pref.getName(), new StringListAttribute(pref.getValues()));
        this.portletParameterOverrides.put(pref.getName(), new BooleanAttribute(!pref.isReadOnly()));
      }
    }
  }
View Full Code Here

Examples of org.jasig.portal.portlets.BooleanAttribute

            }
           
            // set parameter override value
            if (param.getModify().equals("subscribe")) {
              this.parameterOverrides.put(param.getName(),
                  new BooleanAttribute(true));
            } else {
              this.parameterOverrides.put(param.getName(),
                  new BooleanAttribute(false));
            }
          }
        }
      }
      if (step.getPreferences() != null) {
        for (CPDPreference pref : step.getPreferences()) {
          // if this parameter doesn't currently have a value, check
          // for a default in the CPD
          if (!this.portletPreferences.containsKey(pref.getName())
              || this.portletPreferences.get(pref.getName()).getValue().size() == 0
              || (this.portletPreferences.get(pref.getName()).getValue().size() == 1 && this.portletPreferences.get(pref.getName()).getValue().get(0).trim().equals(""))) {
           
            if (!this.portletPreferences.containsKey(pref.getName())) {
              this.portletPreferences.put(pref.getName(), new StringListAttribute());
            }
           
            // use the default value if one exists
            if (pref.getDefaultValues() != null && pref.getDefaultValues().size() > 0) {
              for (String value : pref.getDefaultValues()) {
                this.portletPreferences.get(pref.getName()).getValue().add(value);
              }
            }
             
            // otherwise look for a default in the type restriction 
            else if (pref.getType() != null
                && pref.getType().getRestriction() != null
                && pref.getType().getRestriction().getDefaultValues() != null
                && pref.getType().getRestriction().getDefaultValues().size() > 0) {
              for (String value : pref.getType().getRestriction().getDefaultValues()) {
                this.portletPreferences.get(pref.getName()).getValue().add(value);
              }
            }
           
            // set parameter override value
            if (pref.getModify().equals("subscribe")) {
              this.parameterOverrides.put(pref.getName(),
                  new BooleanAttribute(true));
            } else {
              this.parameterOverrides.put(pref.getName(),
                  new BooleanAttribute(false));
            }
          }
        }
      }
    }
View Full Code Here

Examples of org.jasig.portal.portlets.BooleanAttribute

      List<Attribute> attributes = new ArrayList<Attribute>();
      for (String value : pref.getValues()) {
        attributes.add(new Attribute(value));
      }
      this.portletPreferences.put(pref.getName(), new StringListAttribute(pref.getValues()));
            this.portletPreferenceReadOnly.put(pref.getName(), new BooleanAttribute(pref.isReadOnly()));
    }
           
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.