Skip to content

Commit

Permalink
Adjust task enablement
Browse files Browse the repository at this point in the history
  • Loading branch information
donat committed Aug 2, 2017
1 parent f2e3dc6 commit 783953b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ public static NodeSelection empty() {
return EMPTY;
}

public static NodeSelection single(Object object) {
return new NodeSelection(ImmutableList.of(object));
}

/**
* Creates a new instance reflecting the given {@link IStructuredSelection} instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.buildship.ui.PluginImage;
import org.eclipse.buildship.ui.PluginImage.ImageState;
import org.eclipse.buildship.ui.PluginImages;
import org.eclipse.buildship.ui.util.nodeselection.NodeSelection;

/**
* Styled label provider for the task name column in the TaskView.
Expand Down Expand Up @@ -138,6 +139,6 @@ private Image getTaskSelectorImage(TaskSelectorNode taskSelector) {
}

private ImageState getImageState(TaskNode taskNode) {
return taskNode.getParentProjectNode().isIncludedProject() ? ImageState.DISABLED : ImageState.ENABLED;
return TaskViewActionStateRules.taskScopedTaskExecutionActionsEnablement(NodeSelection.single(taskNode)).asBoolean() ? ImageState.ENABLED: ImageState.DISABLED;
}
}

0 comments on commit 783953b

Please sign in to comment.