Skip to content

Commit

Permalink
make displayname of HistoryWidget configurable for alternate text (#8740
Browse files Browse the repository at this point in the history
)

make displayname of HistoryWidget configurable

for use with customizable-build-now plugin
make the placeholder for the history filter less specific, the title
already explains what this shows so just `Filter...` should be enough.
  • Loading branch information
mawinter69 authored Dec 4, 2023
1 parent dc983d0 commit c637d41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion core/src/main/java/hudson/widgets/HistoryWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import hudson.model.ModelObject;
import hudson.model.Queue;
import hudson.model.Run;
import hudson.util.AlternativeUiTextProvider;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -61,6 +62,12 @@
* @author Kohsuke Kawaguchi
*/
public class HistoryWidget<O extends ModelObject, T> extends Widget {

/**
* Replaceable title for describing the kind of tasks this history shows. Defaults to "Build History".
*/
public static final AlternativeUiTextProvider.Message<HistoryWidget<?, ?>> DISPLAY_NAME = new AlternativeUiTextProvider.Message<>();

/**
* The given data model of records. Newer ones first.
*/
Expand Down Expand Up @@ -115,7 +122,7 @@ protected String getOwnerUrl() {
* Title of the widget.
*/
public String getDisplayName() {
return Messages.BuildHistoryWidget_DisplayName();
return AlternativeUiTextProvider.get(DISPLAY_NAME, this, Messages.BuildHistoryWidget_DisplayName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
find=Filter builds...
find=Filter...

0 comments on commit c637d41

Please sign in to comment.