-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
enhancementNew feature or requestNew feature or requestpriority:minorMinor loss of function, or other problem where easy workaround is presentMinor loss of function, or other problem where easy workaround is present
Description
Guillaume Boué opened MSHARED-687 and commented
We should provide a way to access programmatically the Color API, without being JAnsi specific. Read-only should suffice for now, as the styles can be changed through system properties. This would allow tools, like the Help Plugin, to interact with it without depending on the implementation.
- Refactor JAnsi specific code currently in
StyleintoAnsiMessageBuilder. - Make
Stylepart of public API, and add gettersboolean isBold(),boolean isBright(),String getColor(),boolean isBgBright()andString getBgColor(). - Document
Style.toString()to return a comma-separated list of the style components (e.g.bold,red). - Add a public
List<String> getAvailableColorNames()method toMessageUtils. Today, it would return the list of color names in the enumAnsi.Colorif JAnsi is present, otherwise an empty list.
With those changes, a consumer could for example do:
MessageUtils.buffer().success( Style.SUCCESS.toString() )in order to print the String representation of success with its own style, while not depending on JAnsi.
Affects: maven-shared-utils-3.2.1
Issue Links:
- MPH-122 add help:color-style goal to describe styles color
("is required by")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority:minorMinor loss of function, or other problem where easy workaround is presentMinor loss of function, or other problem where easy workaround is present