Improve output window captions #27

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@basiliscus

My apologies, I have one more improvement for consideration :)

The goal of the improvement is to provide descriptive (and possibly short) captions of the output windows.

The first of the commits (1b0efde) concerns the custom tasks only.
Suppose, all gradle task names of a custom task are fully qualified (start with colon). In this case the name of the project, on which the custom task is being executed, is redundant. More importantly, the project name in the caption would be confusing, so it is better to omit it.
That is what the commit does: if all task names start with colon, it removes the project name from the caption. Overwise, the behavior is almost the same as before. I say "almost" because there will be no brackets surrounding the task names, is that a problem?

The second commit (39deae6) is slightly more risky. It expands the same approach to the built-in tasks.
If the default "run" or "debug" tasks have not been overridden, the behavior will be the same as before the change: the caption will take form of " - run" or " - debug".
However, if the built-in tasks are overridden, the corresponding gradle task names will be listed. And again, if all of the gradle tasks start with colon, the project name will be omitted.

Please let me know if there is anything wrong with the changes, I'll gladly correct them.
Thanks.

@kelemen
Owner

Replacing captions with task names

The output windows are managed by their caption so renaming these windows will leave you with more output windows. I don't want to decide that it is bad or good but it should be at least configurable in the global settings (the current behaviour is what the Maven plugin seems to do). Adding new global settings is relatively straightforward: First you have to create a new property in GlobalGradleSettings, then the gui must be updated: GradleSettingsPanel. So, please add a new option to allow the user to stay with the current behaviour.

fully qualified names

It is not necessarily redundant if you run the task of the root project (there is no project name on it). I admit however, that the current behaviour is not the best. So, I suggest that when only fully qualified names are used, use the name of the root project. Though it is not directly accessible from the code, it is the name of the directory of where the settings.gradle is located (if there is none then the project is the only project and so the root project): NbGradleModel .getSettingsFile() returns the settings.gradle, null if there is none. Maybe a property in NbGradleModel defining the name of the root project wouldn't hurt.

Anyway, changing this has the benefit of having the same output window for these tasks no matter from which project they are being executed.

ps.: Of course, I have no love for brackets, it was just more simple this way and I didn't care. Actually, I think they are better without brackets.

@kelemen
Owner

I have just adjusted the caption of the output tabs (also the progress bar). Now the reusing of tabs is no longer determined by their caption, so more tweaking will be more simple. The current behaviour for the output tab is the following:

  • For Run, Debug, non-blocking tasks (like build and custom tasks marked so), the behaviour remains the same.
  • For blocking saved custom tasks, the caption is the name of the custom task.
  • For unsaved blocking custom tasks, the behaviour is the same as before.

Given these changes, I can no longer merge this pull request.

@kelemen kelemen closed this Oct 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment