提交 912932f5 编写于 作者: K kohsuke

fixing display names by clearly distinguishing short display name vs full display name.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3590 71c3de6d-444a-0410-be80-ed276b4c234a
上级 5657f970
...@@ -40,7 +40,7 @@ public class MatrixRun extends Build<MatrixConfiguration,MatrixRun> { ...@@ -40,7 +40,7 @@ public class MatrixRun extends Build<MatrixConfiguration,MatrixRun> {
for( int i=1; i<ancs.size(); i++) { for( int i=1; i<ancs.size(); i++) {
if(ancs.get(i).getObject()==this) { if(ancs.get(i).getObject()==this) {
if(ancs.get(i-1).getObject() instanceof MatrixBuild) { if(ancs.get(i-1).getObject() instanceof MatrixBuild) {
return getParent().getCombination().toString(); return getParent().getCombination().toCompactString(getParent().getParent().getAxes());
} }
} }
} }
......
...@@ -95,6 +95,12 @@ public abstract class AbstractItem extends Actionable implements Item { ...@@ -95,6 +95,12 @@ public abstract class AbstractItem extends Actionable implements Item {
else return n+'/'+getName(); else return n+'/'+getName();
} }
public final String getFullDisplayName() {
String n = getParent().getFullDisplayName();
if(n.length()==0) return getDisplayName();
else return n+" \u00BB "+getDisplayName();
}
/** /**
* Called right after when a {@link Item} is loaded from disk. * Called right after when a {@link Item} is loaded from disk.
* This is an opporunity to do a post load processing. * This is an opporunity to do a post load processing.
......
...@@ -437,6 +437,10 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node ...@@ -437,6 +437,10 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
return ""; return "";
} }
public String getFullDisplayName() {
return "";
}
/** /**
* Gets just the immediate children of {@link Hudson}. * Gets just the immediate children of {@link Hudson}.
* *
......
...@@ -84,6 +84,13 @@ public interface Item extends PersistenceRoot, ModelObject { ...@@ -84,6 +84,13 @@ public interface Item extends PersistenceRoot, ModelObject {
*/ */
String getDisplayName(); String getDisplayName();
/**
* Works like {@link #getDisplayName()} but return
* the full path that includes all the display names
* of the ancestors.
*/
String getFullDisplayName();
/** /**
* Returns the URL of this item relative to the context root of the application. * Returns the URL of this item relative to the context root of the application.
* *
......
...@@ -17,6 +17,11 @@ public interface ItemGroup<T extends Item> extends PersistenceRoot, ModelObject ...@@ -17,6 +17,11 @@ public interface ItemGroup<T extends Item> extends PersistenceRoot, ModelObject
*/ */
String getFullName(); String getFullName();
/**
* @see Item#getFullDisplayName()
*/
String getFullDisplayName();
/** /**
* Gets all the items in this collection in a read-only view. * Gets all the items in this collection in a read-only view.
*/ */
......
...@@ -536,6 +536,11 @@ public class Queue { ...@@ -536,6 +536,11 @@ public class Queue {
*/ */
String getName(); String getName();
/**
* @see hudson.model.Item#getFullDisplayName()
*/
String getFullDisplayName();
/** /**
* Estimate of how long will it take to execute this task. * Estimate of how long will it take to execute this task.
* Measured in milliseconds. * Measured in milliseconds.
......
...@@ -344,7 +344,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run ...@@ -344,7 +344,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
} }
public String toString() { public String toString() {
return project.getName()+" #"+number; return project.getFullDisplayName()+" #"+number;
} }
public String getDisplayName() { public String getDisplayName() {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<tr> <tr>
<td class="pane" width="100%" tooltip="${item.why}"> <td class="pane" width="100%" tooltip="${item.why}">
<a href="${rootURL}/${item.task.url}"> <a href="${rootURL}/${item.task.url}">
${item.task.displayName} ${item.task.fullDisplayName}
</a> </a>
</td> </td>
<td class="pane" width="16" align="center" valign="middle"> <td class="pane" width="16" align="center" valign="middle">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册