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

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


  private void associateTasks(EObject model, List<PPTask> tasks) {
    Resource r = model.eResource();
    if(r == null)
      return; // not in a resource, sorry.
    ResourcePropertiesAdapter adapter = ResourcePropertiesAdapterFactory.eINSTANCE.adapt(r);
    adapter.put(PPDSLConstants.RESOURCE_PROPERTY__TASK_LIST, tasks);
  }
View Full Code Here


*
*/
public class PPBuilderParticipant implements IXtextBuilderParticipant {

  private static List<PPTask> getTaskList(Resource r) {
    ResourcePropertiesAdapter adapter = ResourcePropertiesAdapterFactory.eINSTANCE.adapt(r);
    @SuppressWarnings("unchecked")
    List<PPTask> tasks = (List<PPTask>) adapter.get(PPDSLConstants.RESOURCE_PROPERTY__TASK_LIST);
    if(tasks == null)
      return Collections.emptyList();
    return tasks;

  }
View Full Code Here

   *
   * @param descriptors
   * @return
   */
  private String visibleResourceList(Resource r, List<IEObjectDescription> descriptors) {
    ResourcePropertiesAdapter adapter = ResourcePropertiesAdapterFactory.eINSTANCE.adapt(r);
    URI root = (URI) adapter.get(PPDSLConstants.RESOURCE_PROPERTY__ROOT_URI);

    // collect the (unique) resource paths
    List<String> resources = Lists.newArrayList();
    for(IEObjectDescription d : descriptors) {
      URI uri = EcoreUtil.getURI(d.getEObjectOrProxy());
View Full Code Here

    if(root == null)
      throw new IllegalArgumentException("root can not be null");
    if(r == null)
      throw new IllegalArgumentException("resource can not be null");
    URI uri = URI.createFileURI(root.getAbsolutePath());
    ResourcePropertiesAdapter adapter = ResourcePropertiesAdapterFactory.eINSTANCE.adapt(r);
    adapter.put(PPDSLConstants.RESOURCE_PROPERTY__ROOT_URI, uri);
  }
View Full Code Here

      }
    }
  }

  protected void provideResourceLevelHighlighting(XtextResource resource, IHighlightedPositionAcceptor acceptor) {
    ResourcePropertiesAdapter adapter = ResourcePropertiesAdapterFactory.eINSTANCE.adapt(resource);
    @SuppressWarnings("unchecked")
    List<PPTask> taskList = (List<PPTask>) adapter.get(PPDSLConstants.RESOURCE_PROPERTY__TASK_LIST);
    if(taskList == null)
      return;
    for(PPTask task : taskList) {
      acceptor.addPosition(task.getOffset(), task.getLength(), PPHighlightConfiguration.TASK_ID);
    }
View Full Code Here

TOP

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

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.