Exemplo n.º 1
0
 public ProjectNode getRootProjectNode() {
   ProjectNode root = this;
   while (root.getParentProjectNode() != null) {
     root = root.getParentProjectNode();
   }
   return root;
 }
 protected Object getTaskViewElement(Object element) {
   // 'convert' ProjectNode to IProject in order to render the Gradle project decorators like in
   // all other Eclipse views
   if (element instanceof ProjectNode) {
     ProjectNode projectNode = (ProjectNode) element;
     Optional<IProject> workspaceProject = projectNode.getWorkspaceProject();
     return workspaceProject.isPresent() ? workspaceProject.get() : projectNode;
   } else {
     return element;
   }
 }
Exemplo n.º 3
0
 private Optional<File> getBuildScriptFor(ProjectNode projectNode) {
   Maybe<OmniGradleScript> buildScript = projectNode.getGradleProject().getBuildScript();
   return buildScript.isPresent()
       ? Optional.fromNullable(buildScript.get().getSourceFile())
       : Optional.<File>absent();
 }