jford 2005/01/28 13:11:12
Modified: taglibs/treecontrol/src/java/org/apache/jetspeed/portlets/tags
PortletTreeControlTag.java
taglibs/treecontrol/src/java/org/apache/webapp/admin
TreeControlNode.java
Log:
Added ability to set a css class per node
Added title to link, allowing hover
Revision Changes Path
1.7 +5 -1
jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/jetspeed/portlets/tags/PortletTreeControlTag.java
Index: PortletTreeControlTag.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/jetspeed/portlets/tags/PortletTreeControlTag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PortletTreeControlTag.java 28 Jan 2005 02:51:39 -0000 1.6
+++ PortletTreeControlTag.java 28 Jan 2005 21:11:12 -0000 1.7
@@ -274,7 +274,7 @@
// Render the label for this node (if any)
if (node.getLabel() != null) {
- String labelStyle = null;
+ String labelStyle = node.getCSSClass();
if (node.isSelected() && (styleSelected != null))
labelStyle = styleSelected;
else if (!node.isSelected() && (styleUnselected != null))
@@ -297,6 +297,10 @@
out.print("\"");
}
+ out.print(" title=\"");
+ out.print(node.getLabel());
+ out.print("\"");
+
/* Invalid, not used, and not usefull
// to refresh the tree in the same 'self' frame
out.print(" onclick=\"");
1.3 +50 -5
jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/webapp/admin/TreeControlNode.java
Index: TreeControlNode.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/webapp/admin/TreeControlNode.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TreeControlNode.java 21 Jan 2005 23:38:47 -0000 1.2
+++ TreeControlNode.java 28 Jan 2005 21:11:12 -0000 1.3
@@ -54,12 +54,40 @@
* hyperlink's results will be displayed, or <code>null</code> for
* the current window
* @param expanded Should this node be expanded?
+ * @param domain Identifier for the kind of node.
*/
public TreeControlNode(String name,
String icon, String label,
String action, String target,
boolean expanded, String domain) {
- this(name, icon, label, action, target, expanded, domain,
false);
+ this(name, icon, label, action, target, expanded, domain, null,
false);
+ }
+
+ /**
+ * Construct a new TreeControlNode with the specified parameters.
+ *
+ * @param name Internal name of this node (must be unique within
+ * the entire tree)
+ * @param icon Pathname of the image file for the icon to be displayed
+ * when this node is visible, relative to the image directory
+ * for our images
+ * @param label The label that will be displayed to the user if
+ * this node is visible
+ * @param action The hyperlink to be selected if the user
+ * selects this node, or <code>null</code> if this node's label should
+ * not be a hyperlink
+ * @param target The window target in which the <code>action</code>
+ * hyperlink's results will be displayed, or <code>null</code> for
+ * the current window
+ * @param expanded Should this node be expanded?
+ * @param domain Identifier for the kind of node.
+ * @param CSSClass The css class to apply to the node
+ */
+ public TreeControlNode(String name,
+ String icon, String label,
+ String action, String target,
+ boolean expanded, String domain, String CSSClass) {
+ this(name, icon, label, action, target, expanded, domain,
CSSClass, false);
}
/**
@@ -79,12 +107,14 @@
* hyperlink's results will be displayed, or <code>null</code> for
* the current window
* @param expanded Should this node be expanded?
+ * @param domain Identifier for the kind of node.
+ * @param CSSClass The css class to apply to the node
* @param lazy Is this node's children lazy loaded?
*/
public TreeControlNode(String name,
String icon, String label,
String action, String target,
- boolean expanded, String domain,
+ boolean expanded, String domain, String CSSClass,
boolean lazy) {
super();
@@ -95,6 +125,7 @@
this.target = target;
this.expanded = expanded;
this.domain = domain;
+ this.CSSClass = CSSClass;
this.lazy = lazy;
this.loaded = false;
}
@@ -302,6 +333,22 @@
public int getWidth() {
return (this.width);
}
+
+ protected String CSSClass;
+
+ /**
+ * @return Returns the cSSClass.
+ */
+ public String getCSSClass() {
+ return CSSClass;
+ }
+ /**
+ * @param class1 The cSSClass to set.
+ */
+ public void setCSSClass(String CSSClass) {
+ this.CSSClass = CSSClass;
+ }
+
// --------------------------------------------------------- Public
Methods
@@ -424,6 +471,4 @@
}
}
-
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]