コード例 #1
0
ファイル: ProjectNode.java プロジェクト: zhaog/buildship
 public ProjectNode getRootProjectNode() {
   ProjectNode root = this;
   while (root.getParentProjectNode() != null) {
     root = root.getParentProjectNode();
   }
   return root;
 }
コード例 #2
0
 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;
   }
 }
コード例 #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();
 }