modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java | 17 +++++++--- 1 file changed, 13 insertions(+), 4 deletions(-)
New commits: commit 5ef481fe24f2a468ade1ca50eccce7f1a606916e Author: John Mazzitelli mazz@redhat.com Date: Thu Mar 24 12:00:41 2011 -0400
be able to not specify a width. this isn't used today, but can be in the future - just pass in a negative width
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java index e28dab2..2393132 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java @@ -341,11 +341,20 @@ public abstract class AncestryUtil { Map<Integer, ResourceType> types = ((MapWrapper) record.getAttributeAsObject(RESOURCE_ANCESTRY_TYPES)).getMap(); Integer resourceTypeId = record.getAttributeAsInt(RESOURCE_TYPE_ID); ResourceType type = types.get(resourceTypeId); - width = (width <= 0) ? 500 : width;
- StringBuilder sb = new StringBuilder("<p style='width:"); - sb.append(width); - sb.append("px'>"); + // note: if width is negative, we do not explicitly define a width in the HTML, thus enabling auto-resizing. + Integer widthObj = null; + if (width >= 0) { + widthObj = (width == 0) ? Integer.valueOf(500) : Integer.valueOf(width); + } + + StringBuilder sb = new StringBuilder("<p"); + if (widthObj != null) { + sb.append(" style='width:"); + sb.append(widthObj.toString()); + sb.append("px'"); + } + sb.append(">");
sb.append(getResourceLongName(resourceName, type));
rhq-commits@lists.fedorahosted.org