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

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


  /**
   * Creates standard traits for tag file entity from CMDocument metadata
   * @param ns
   */
  protected void createTagfileTraits(final Namespace ns) {
    Model model = getMergedModel();

    createSimpleStringEntityTraitIfNecessary(model, "display-label", getNamespaceDisplayLabel()); //$NON-NLS-1$
    createSimpleStringEntityTraitIfNecessary(model, "description", getNamespaceDescription()); //$NON-NLS-1$
    createSimpleStringEntityTraitIfNecessary(model, "default-prefix", getNamespaceDefaultPrefix()); //$NON-NLS-1$
    createSimpleBooleanObjectEntityTraitIfNecessary(model, "expert", getNamespaceExpert()); //$NON-NLS-1$
View Full Code Here


  /**
   * @return a model of all entities and traits
   */
  protected Model getMergedModel() {
    Model model = (Model)_assistant.getMergedModel().getRoot();
    if (model == null){
      //need to create model key object
      Model tld = createTLDModel();
      _assistant.getMergedModel().setRoot(tld);
      model = (Model)_assistant.getMergedModel().getRoot();
    }
    return model;
  }
View Full Code Here

  /**
   * @return new model
   */
  protected Model createTLDModel() {
    final Model entity = getFactory().createModel();
    entity.setId(_assistant.getMergedModel().getModelContext().getModelIdentifier());
    return entity;
 
View Full Code Here

   */
  private Entity getTag(String tagName) {
    if (_tag == null){
      //rely on PaletteInfos objects being inside a Model trait only     
      try {
        Model model = (Model)this.eContainer().eContainer().eContainer();
        //we could probably do better than this... oh well
                //FIXME: C.B: this is really bad! We could probably do better than
                // write code that expects to throw ClassCastExceptions and then hides them?  I hope so!
        _tag = findTag(model, tagName);
      } catch (ClassCastException e) {   
View Full Code Here

//      IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context);
//      if (resolver != null) {
      if (file != null) {
        final IMetaDataDomainContext mdcontext = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(file);
        final ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(mdcontext);
        final Model m = query.findTagLibraryModel(uri);
        final Trait t = query.findTrait(m, "isTagDir"); //$NON-NLS-1$
        return TraitValueHelper.getValueAsBoolean(t);
      }
    }
    return false;
View Full Code Here

   
    /**
     * @return flag indicating that jsf component
     */
    public boolean isJSFComponent() {     
      Model model = null;
      Trait t = null;
      if (_modelContext != null) {
        model = getQuery().findTagLibraryModel(_modelContext.getModelIdentifier());
          t = getQuery().findTrait(model, "is-jsf-component-library"); //$NON-NLS-1$
      } else {
View Full Code Here

    static TagCreationInfo createCreationInfo(
            final IMetaDataModelContext metaDataContext,
            final String id, final String tagName)
    {
      final ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(metaDataContext);
        final Model model = query.findTagLibraryModel(metaDataContext.getModelIdentifier());
        if (model != null)
        {
            Trait trait = query.findTrait(model,
                    PaletteInfos.TRAIT_ID);
            if (trait != null)
View Full Code Here

  }
 
  private Image getImage(final IMetaDataDomainContext context, final String nsUri, final String tagName, boolean getSmallImage) {
    Image image = null;
    final ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
    Model model = getModel(query, nsUri);
    if (model != null){
      ImageDescriptor imgDesc = getIconImageDescriptor(query, model, tagName, getSmallImage);
      image = getOrCreateImage(imgDesc);
    }
   
View Full Code Here

      return category;
   

    final ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper
        .createMetaDataModelContext(manager.getTagRegistryIdentifier().getProject(), tldURI);
    final Model model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
    category = createTaglibPaletteDrawer(manager, doc, model);

    if (category != null) {
      loadTags(category, doc, model);
      sortTags(category.getChildren());
View Full Code Here

      return category;

    final IProject project = manager.getTagRegistryIdentifier().getProject();
    final ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper
        .createMetaDataModelContext(project, ns.getNSUri());
    final Model model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
    category = createTaglibPaletteDrawer(manager,  ns, model);

    if (category != null) {
      loadTags(category, ns, model);
      sortTags(category.getChildren());
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsf.common.metadata.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.