Package com.puppetlabs.geppetto.pp.dsl.adapters

Examples of com.puppetlabs.geppetto.pp.dsl.adapters.ResourceDocumentationAdapter


  public List<INode> getDocumentation(EObject semantic) {
    Resource r = semantic.eResource();
    if(r == null)
      return null;
    ResourceDocumentationAdapter adapter = ResourceDocumentationAdapterFactory.eINSTANCE.adapt(r);
    return adapter != null
        ? adapter.get(semantic)
        : null;

  }
View Full Code Here


  /**
   * @param o
   * @return
   */
  private String getPPDocumentation(EObject o) {
    ResourceDocumentationAdapter adapter = ResourceDocumentationAdapterFactory.eINSTANCE.adapt(o.eResource());
    List<INode> nodes = adapter.get(o);
    if(nodes != null && nodes.size() > 0) {
      // rip text from the nodes
      CharSequence result = CharSequences.empty();
      for(INode n : nodes)
        result = CharSequences.concatenate(result, n.getText());
View Full Code Here

  private void associateDocumentation(EObject semantic, List<INode> commentSequence) {
    StringBuffer buf = new StringBuffer();
    for(INode n : commentSequence)
      buf.append(n.getText());

    ResourceDocumentationAdapter adapter = ResourceDocumentationAdapterFactory.eINSTANCE.adapt(semantic.eResource());
    adapter.put(semantic, commentSequence);

  }
View Full Code Here

  private void clearDocumentation(EObject model) {
    Resource r = model.eResource();
    if(r == null)
      return;
    ResourceDocumentationAdapter adapter = ResourceDocumentationAdapterFactory.eINSTANCE.adapt(r);
    if(adapter != null)
      adapter.clear();

  }
View Full Code Here

      return;
    for(PPTask task : taskList) {
      acceptor.addPosition(task.getOffset(), task.getLength(), PPHighlightConfiguration.TASK_ID);
    }

    ResourceDocumentationAdapter docAdapter = ResourceDocumentationAdapterFactory.eINSTANCE.adapt(resource);
    if(docAdapter != null) {
      Map<EObject, List<INode>> associations = docAdapter.getAssociations();
      for(List<INode> sequence : associations.values()) {
        List<DocNode> docNodes = docParser.parse(sequence);
        for(DocNode dn : docNodes) {
          acceptor.addPosition(dn.getOffset(), dn.getLength(), highlightIDForDocStyle(dn.getStyle()));
        }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.pp.dsl.adapters.ResourceDocumentationAdapter

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.