Skip to content

Commit

Permalink
[JENKINS-21295] - Project Description column configs for trim and width
Browse files Browse the repository at this point in the history
not correctly redisplaying
  • Loading branch information
fredg02 committed Feb 21, 2014
1 parent 2fecff5 commit 1738889
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
Expand Up @@ -34,14 +34,14 @@
public class BuildDescriptionColumn extends ListViewColumn {

private int columnWidth;
private boolean isForceWidth;
private boolean forceWidth;


@DataBoundConstructor
public BuildDescriptionColumn(int columnWidth, boolean isForceWidth) {
public BuildDescriptionColumn(int columnWidth, boolean forceWidth) {
super();
this.columnWidth = columnWidth;
this.isForceWidth = isForceWidth;
this.forceWidth = forceWidth;
}

public BuildDescriptionColumn() {
Expand All @@ -53,7 +53,7 @@ public int getColumnWidth() {
}

public boolean isForceWidth() {
return isForceWidth;
return forceWidth;
}

public String getBuildDescription(@SuppressWarnings("rawtypes") Job job) {
Expand Down
Expand Up @@ -29,7 +29,6 @@

import hudson.Extension;
import hudson.Util;
import hudson.model.Items;
import hudson.model.Job;
import hudson.views.ListViewColumn;
import hudson.views.ListViewColumnDescriptor;
Expand Down
Expand Up @@ -37,19 +37,19 @@ public class DescriptionColumn extends ListViewColumn {
private boolean trim;
private int displayLength; //numbers of lines to display
private int columnWidth;
private boolean isForceWidth;
private boolean forceWidth;

private final static String SEPARATOR = "<br/>";
private final static String SEPARATORS_REGEX = "(?i)<br\\s*/>|<br>";

@DataBoundConstructor
public DescriptionColumn(boolean displayName, boolean trim, int displayLength, int columnWidth, boolean isForceWidth) {
public DescriptionColumn(boolean displayName, boolean trim, int displayLength, int columnWidth, boolean forceWidth) {
super();
this.displayName = displayName;
this.trim = trim;
this.displayLength = displayLength;
this.columnWidth = columnWidth;
this.isForceWidth = isForceWidth;
this.forceWidth = forceWidth;
}

public DescriptionColumn() {
Expand All @@ -73,18 +73,18 @@ public int getColumnWidth() {
}

public boolean isForceWidth() {
return isForceWidth;
return forceWidth;
}

public String getToolTip(@SuppressWarnings("rawtypes") AbstractItem job) {
public String getToolTip(AbstractItem job) {
return formatDescription(job, false);
}

public String getDescription(@SuppressWarnings("rawtypes") AbstractItem job){
public String getDescription(AbstractItem job){
return formatDescription(job, isTrim());
}

private String formatDescription(@SuppressWarnings("rawtypes") AbstractItem job, boolean trimIt) {
private String formatDescription(AbstractItem job, boolean trimIt) {
if (job == null) {
return null;
}
Expand Down
Expand Up @@ -31,7 +31,7 @@
<tr>
<td colspan="3">${%This column shows the build description of the last build.}</td>
</tr>
<f:optionalBlock field="isForceWidth" title="${%Force column width}" inline="true">
<f:optionalBlock field="forceWidth" title="${%Force column width}" inline="true">
<f:entry title="${%Column width}">
<f:textbox field="columnWidth" default="80" />
</f:entry>
Expand Down
Expand Up @@ -41,7 +41,7 @@
<f:textbox field="displayLength" default="1" />
</f:entry>
</f:optionalBlock>
<f:optionalBlock field="isForceWidth" title="${%Force column width}" inline="true">
<f:optionalBlock field="forceWidth" title="${%Force column width}" inline="true">
<f:entry title="${%Column width}">
<f:textbox field="columnWidth" default="80" />
</f:entry>
Expand Down

0 comments on commit 1738889

Please sign in to comment.