Package org.eclipse.jst.jsf.common.metadata

Examples of org.eclipse.jst.jsf.common.metadata.Trait


   */
  public List<IMetaDataEnabledFeature> getAttributeValueRuntimeTypeFeatureProcessors(
      Class featureType, IStructuredDocumentContext sdContext,
      Entity attrEntity) {

    Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(attrEntity,
        ATTRIBUTE_VALUE_RUNTIME_TYPE_PROP_NAME);

    if (trait == null) {
      return Collections.EMPTY_LIST;
    }
View Full Code Here


   *
   * @param traitName property name
   * @return String value
   */
  protected String getTraitValueAsString(final String traitName){ 
    Trait t = getTraitForEntityUsingContext(traitName);
    if (t != null){
      return TraitValueHelper.getValueAsString(t);
    }
       
    return null;
View Full Code Here

   *
   * @param traitName trait name
   * @return List of String values
   */
  protected List getTraitValueAsListOfStrings(final String traitName){
    Trait t = getTraitForEntityUsingContext(traitName);
    if (t != null){
      return TraitValueHelper.getValueAsListOfStrings(t);
    }
     
    return Collections.EMPTY_LIST;
View Full Code Here

   *
   * @param traitName property name
   * @return boolean value.  Returns false if trait was not located.
   */
  protected boolean getTraitValueAsBoolean(final String traitName){ 
    Trait t = getTraitForEntityUsingContext(traitName);
    if (t != null){
      return TraitValueHelper.getValueAsBoolean(t);
    }
       
    return false;
View Full Code Here

    final String smallIcon = getSmallIcon();
    if (smallIcon == null)
      return null;
   
    try {
      Trait t = getMetaDataContext().getTrait();
      IMetaDataSourceModelProvider provider = t.getSourceModelProvider();
      IImageDescriptorProvider ip = (IImageDescriptorProvider)provider.getAdapter(IImageDescriptorProvider.class);
      if (ip != null){
        return ip.getImageDescriptor(smallIcon);
      }
    } catch (RuntimeException e) {   
View Full Code Here

//                        .getProject(), uri);
        final Entity entity = query.getQueryHelper().getEntity(
                uri, tagName);
        if (entity != null)
        {
            final Trait trait = query.findTrait(
                    entity, "containment-constraint"); //$NON-NLS-1$

            if (trait != null)
            {
                final ContainsTagConstraint tagConstraint = (ContainsTagConstraint) trait
                        .getValue();

                final String algorithm = tagConstraint.getSetGenerator()
                        .getAlgorithm();
View Full Code Here

   * @param key
   * @param value
   */
  protected void createSimpleStringEntityTraitIfNecessary(final Entity entity, final String key,
      final String value) {
    Trait t = findTraitOnEntityById(entity, key);
    if (t == null){
      t = internalCreateTrait(entity, key);

      StringValue val = TraitTypesFactory.eINSTANCE.createStringValue();     
      val.setValue(value);
     
      t.setValue(val);
    }
  }
View Full Code Here

   * @param value
   */
  protected void createSimpleBooleanObjectEntityTraitIfNecessary(final Entity entity,
      String key, boolean value) {
   
    Trait t = findTraitOnEntityById(entity, key);
    if (t == null){
      t = internalCreateTrait(entity, key);

      BooleanValue val = TraitTypesFactory.eINSTANCE.createBooleanValue();   
      val.setTrue(value);
     
      t.setValue(val);
    }
   
  }
View Full Code Here

   * @param entity
   * @param key
   * @return Trait
   */
  protected Trait internalCreateTrait(final Entity entity, final String key) {
    Trait t = MetadataFactory.eINSTANCE.createTrait();
    t.setId(key);
    t.setSourceModelProvider(_assistant.getSourceModelProvider());
    entity.getTraits().add(t);
    return t;
  }
View Full Code Here

   * @param key
   * @return Trait
   */
  protected Trait findTraitOnEntityById(final Entity entity, final String key) {
    for (Iterator it=entity.getTraits().iterator();it.hasNext();){
      Trait t = (Trait)it.next();
      if (key.equals(t.getId()))
        return t;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsf.common.metadata.Trait

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.