You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2008/10/24 21:16:41 UTC
svn commit: r707725 [4/5] - in /myfaces/tobago/trunk:
core/src/main/java/org/apache/myfaces/tobago/
core/src/main/java/org/apache/myfaces/tobago/ajax/api/
core/src/main/java/org/apache/myfaces/tobago/component/
core/src/main/java/org/apache/myfaces/tob...
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,16 +24,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_INLINE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectManyCheckbox;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.renderkit.SelectManyRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
+import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.NamingContainer;
@@ -68,7 +67,7 @@
}
String id = selectMany.getClientId(facesContext);
- boolean inline = ComponentUtil.getBooleanAttribute(selectMany, ATTR_INLINE);
+ boolean inline = ComponentUtil.getBooleanAttribute(selectMany, Attributes.INLINE);
String title = HtmlRendererUtil.getTitleFromTipAndMessages(facesContext, selectMany);
if (!inline) {
writer.startElement(HtmlConstants.TABLE, selectMany);
@@ -104,7 +103,7 @@
String formattedValue = RenderUtil.getFormattedValue(facesContext, selectMany, item.getValue());
writer.writeAttribute(HtmlAttributes.VALUE, formattedValue, true);
writer.writeAttribute(HtmlAttributes.DISABLED, item.isDisabled());
- if (ComponentUtil.getBooleanAttribute(selectMany, ATTR_READONLY)) {
+ if (ComponentUtil.getBooleanAttribute(selectMany, Attributes.READONLY)) {
writer.writeAttribute(HtmlAttributes.READONLY, true);
if (checked) {
writer.writeAttribute(HtmlAttributes.ONCLICK, "this.checked=true", false);
@@ -144,7 +143,7 @@
// Application application = tobagoContext.getApplication();
// UIOutput label = (UIOutput)
// application.createComponent(TobagoConstants.COMPONENT_TYPE_OUTPUT);
-// label.getAttributes().put(TobagoConstants.ATTR_FOR, itemId);
+// label.getAttributes().put(Attributes.FOR, itemId);
// label.setValue( item.getLabel() );
// label.setRendererType("Label");
// label.setRendered(true);
@@ -172,7 +171,7 @@
UISelectManyCheckbox selectMany = (UISelectManyCheckbox) component;
int heightPerRow = super.getFixedHeight(facesContext, selectMany);
- if (ComponentUtil.getBooleanAttribute(selectMany, ATTR_INLINE)) {
+ if (ComponentUtil.getBooleanAttribute(selectMany, Attributes.INLINE)) {
return heightPerRow;
} else {
List<SelectItem> items = RenderUtil.getItemsToRender(selectMany);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,16 +24,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_HEIGHT;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectManyListbox;
import org.apache.myfaces.tobago.renderkit.SelectManyRendererBase;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.UIComponent;
@@ -61,7 +59,7 @@
public int getFixedHeight(FacesContext facesContext, UIComponent component) {
int fixedHeight = -1;
- String height = (String) component.getAttributes().get(ATTR_HEIGHT);
+ String height = (String) component.getAttributes().get(Attributes.HEIGHT);
if (height != null) {
try {
fixedHeight = Integer.parseInt(height.replaceAll("\\D", ""));
@@ -97,8 +95,8 @@
String clientId = selectMany.getClientId(facesContext);
writer.writeNameAttribute(clientId);
writer.writeIdAttribute(clientId);
- boolean renderDisabled = ComponentUtil.getBooleanAttribute(selectMany, ATTR_DISABLED)
- || ComponentUtil.getBooleanAttribute(selectMany, ATTR_READONLY);
+ boolean renderDisabled = ComponentUtil.getBooleanAttribute(selectMany, Attributes.DISABLED)
+ || ComponentUtil.getBooleanAttribute(selectMany, Attributes.READONLY);
writer.writeAttribute(HtmlAttributes.DISABLED, renderDisabled);
Integer tabIndex = selectMany.getTabIndex();
if (tabIndex != null) {
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,16 +24,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectOneChoice;
import org.apache.myfaces.tobago.renderkit.HtmlUtils;
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.UIComponent;
@@ -68,8 +67,8 @@
String title = HtmlRendererUtil.getTitleFromTipAndMessages(facesContext, selectOne);
boolean disabled = items.size() == 0
- || ComponentUtil.getBooleanAttribute(selectOne, ATTR_DISABLED)
- || ComponentUtil.getBooleanAttribute(selectOne, ATTR_READONLY);
+ || ComponentUtil.getBooleanAttribute(selectOne, Attributes.DISABLED)
+ || ComponentUtil.getBooleanAttribute(selectOne, Attributes.READONLY);
writer.startElement(HtmlConstants.SELECT, selectOne);
writer.writeNameAttribute(selectOne.getClientId(facesContext));
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,16 +24,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_HEIGHT;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_REQUIRED;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectOneListbox;
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.UIComponent;
@@ -56,7 +54,7 @@
public int getFixedHeight(FacesContext facesContext, UIComponent component) {
int fixedHeight = -1;
- String height = (String) component.getAttributes().get(ATTR_HEIGHT);
+ String height = (String) component.getAttributes().get(Attributes.HEIGHT);
if (height != null) {
try {
fixedHeight = Integer.parseInt(height.replaceAll("\\D", ""));
@@ -87,7 +85,7 @@
String clientId = selectOne.getClientId(facesContext);
writer.writeNameAttribute(clientId);
writer.writeIdAttribute(clientId);
- writer.writeAttribute(HtmlAttributes.DISABLED, ComponentUtil.getBooleanAttribute(selectOne, ATTR_DISABLED));
+ writer.writeAttribute(HtmlAttributes.DISABLED, ComponentUtil.getBooleanAttribute(selectOne, Attributes.DISABLED));
Integer tabIndex = selectOne.getTabIndex();
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
@@ -96,7 +94,7 @@
writer.writeClassAttribute();
HtmlRendererUtil.renderTip(selectOne, writer);
writer.writeAttribute(HtmlAttributes.SIZE, 2); // should be greater 1
- if (!ComponentUtil.getBooleanAttribute(selectOne, ATTR_REQUIRED)) {
+ if (!ComponentUtil.getBooleanAttribute(selectOne, Attributes.REQUIRED)) {
writer.writeAttribute(HtmlAttributes.ONCHANGE, "Tobago.selectOneListboxChange(this)", false);
writer.writeAttribute(HtmlAttributes.ONCLICK, "Tobago.selectOneListboxClick(this)", false);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,10 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_INLINE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_REQUIRED;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectOneRadio;
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
@@ -86,7 +83,7 @@
List<SelectItem> items = RenderUtil.getItemsToRender(selectOne);
- boolean inline = ComponentUtil.getBooleanAttribute(selectOne, ATTR_INLINE);
+ boolean inline = ComponentUtil.getBooleanAttribute(selectOne, Attributes.INLINE);
String title = HtmlRendererUtil.getTitleFromTipAndMessages(facesContext, selectOne);
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
@@ -103,8 +100,8 @@
}
}
- boolean disabled = ComponentUtil.getBooleanAttribute(selectOne, ATTR_DISABLED);
- boolean readonly = ComponentUtil.getBooleanAttribute(selectOne, ATTR_READONLY);
+ boolean disabled = ComponentUtil.getBooleanAttribute(selectOne, Attributes.DISABLED);
+ boolean readonly = ComponentUtil.getBooleanAttribute(selectOne, Attributes.READONLY);
Object value = selectOne.getValue();
List<String> clientIds = new ArrayList<String>();
for (SelectItem item : items) {
@@ -138,10 +135,10 @@
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
HtmlRendererUtil.renderTip(selectOne, writer);
- if (!ComponentUtil.getBooleanAttribute(selectOne, ATTR_REQUIRED) || readonly) {
+ if (!ComponentUtil.getBooleanAttribute(selectOne, Attributes.REQUIRED) || readonly) {
writer.writeAttribute(HtmlAttributes.ONCLICK,
"Tobago.selectOneRadioClick(this, '" + clientId + "',"
- + ComponentUtil.getBooleanAttribute(selectOne, ATTR_REQUIRED) + " , " + readonly + ")", false);
+ + ComponentUtil.getBooleanAttribute(selectOne, Attributes.REQUIRED) + " , " + readonly + ")", false);
}
writer.endElement(HtmlConstants.INPUT);
@@ -172,7 +169,7 @@
// Application application = tobagoContext.getApplication();
// UIOutput label = (UIOutput)
// application.createComponent(TobagoConstants.COMPONENT_TYPE_OUTPUT);
-// label.getAttributes().put(TobagoConstants.ATTR_FOR, itemId);
+// label.getAttributes().put(Attributes.FOR, itemId);
// label.setValue( item.getLabel() );
// label.setRendererType("Label");
// label.setRendered(true);
@@ -195,7 +192,7 @@
public int getFixedHeight(FacesContext facesContext, UIComponent component) {
int heightPerRow = super.getFixedHeight(facesContext, component);
- if (ComponentUtil.getBooleanAttribute(component, ATTR_INLINE)) {
+ if (ComponentUtil.getBooleanAttribute(component, Attributes.INLINE)) {
return heightPerRow;
} else {
List<SelectItem> items = RenderUtil.getItemsToRender((UISelectOneRadio) component);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectReferenceRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectReferenceRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectReferenceRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectReferenceRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,11 +24,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_FOR;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_RENDER_RANGE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_RENDER_RANGE_EXTERN;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -42,15 +40,15 @@
UIComponent component)
throws IOException {
String referenceId = (String)
- component.getAttributes().get(ATTR_FOR);
+ component.getAttributes().get(Attributes.FOR);
UIComponent reference = component.findComponent(referenceId);
- reference.getAttributes().put(ATTR_RENDER_RANGE_EXTERN,
- component.getAttributes().get(ATTR_RENDER_RANGE));
+ reference.getAttributes().put(Attributes.RENDER_RANGE_EXTERN,
+ component.getAttributes().get(Attributes.RENDER_RANGE));
RenderUtil.encode(facesContext, reference);
- reference.getAttributes().remove(ATTR_RENDER_RANGE_EXTERN);
+ reference.getAttributes().remove(Attributes.RENDER_RANGE_EXTERN);
}
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Fri Oct 24 12:16:37 2008
@@ -25,31 +25,6 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_ONCLICK;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALIGN;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DIRECT_LINK_COUNT;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_FOOTER_HEIGHT;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_FORCE_VERTICAL_SCROLLBAR;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMAGE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_INLINE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_INNER_WIDTH;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_HEIGHT;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_WIDTH;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_MENU_POPUP;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_MENU_POPUP_TYPE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SELECTED_LIST_STRING;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SHOW_DIRECT_LINKS;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SHOW_PAGE_RANGE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SHOW_ROW_RANGE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SORTABLE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_BODY;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_HEADER;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH_LIST;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH_LIST_STRING;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_LINK;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_MENUBAR;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_MENUCOMMAND;
@@ -57,12 +32,12 @@
import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
import org.apache.myfaces.tobago.ajax.api.AjaxRenderer;
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.UIColumnEvent;
import org.apache.myfaces.tobago.component.UIColumnSelector;
import org.apache.myfaces.tobago.component.UICommand;
import org.apache.myfaces.tobago.component.UIData;
-import static org.apache.myfaces.tobago.component.UIData.ATTR_SCROLL_POSITION;
import static org.apache.myfaces.tobago.component.UIData.NONE;
import org.apache.myfaces.tobago.component.UILayout;
import org.apache.myfaces.tobago.component.UIMenu;
@@ -136,7 +111,7 @@
HtmlRendererUtil.createHeaderAndBodyStyles(facesContext, data);
final String sheetId = data.getClientId(facesContext);
- HtmlStyleMap sheetStyle = (HtmlStyleMap) data.getAttributes().get(ATTR_STYLE);
+ HtmlStyleMap sheetStyle = (HtmlStyleMap) data.getAttributes().get(Attributes.STYLE);
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
@@ -212,8 +187,8 @@
String unchecked = contextPath + resourceManager.getImage(viewRoot, "image/sheetUnchecked.gif");
Map attributes = data.getAttributes();
- HtmlStyleMap sheetStyle = (HtmlStyleMap) attributes.get(ATTR_STYLE);
- //HtmlStyleMap headerStyle = (HtmlStyleMap) attributes.get(ATTR_STYLE_HEADER);
+ HtmlStyleMap sheetStyle = (HtmlStyleMap) attributes.get(Attributes.STYLE);
+ //HtmlStyleMap headerStyle = (HtmlStyleMap) attributes.get(STYLE_HEADER);
// String sheetWidthString = LayoutUtil.getStyleAttributeValue(sheetStyle,
// "width");
Integer sheetHeight = HtmlRendererUtil.getStyleAttributeIntValue(sheetStyle, "height");
@@ -222,8 +197,8 @@
LOG.error("no height in parent container, setting to 100");
sheetHeight = 100;
}
- //HtmlStyleMap bodyStyle = (HtmlStyleMap) attributes.get(ATTR_STYLE_BODY);
- int footerHeight = (Integer) attributes.get(ATTR_FOOTER_HEIGHT);
+ //HtmlStyleMap bodyStyle = (HtmlStyleMap) attributes.get(STYLE_BODY);
+ int footerHeight = (Integer) attributes.get(Attributes.FOOTER_HEIGHT);
String selectable = data.getSelectable();
@@ -271,7 +246,7 @@
writer.startElement(HtmlConstants.DIV, null);
writer.writeIdAttribute(sheetId + "_header_div");
writer.writeClassAttribute("tobago-sheet-header-div");
- HtmlStyleMap headerStyle = (HtmlStyleMap) attributes.get(ATTR_STYLE_HEADER);
+ HtmlStyleMap headerStyle = (HtmlStyleMap) attributes.get(Attributes.STYLE_HEADER);
if (headerStyle != null) {
writer.writeStyleAttribute(headerStyle);
}
@@ -307,8 +282,8 @@
}
// BEGIN RENDER BODY CONTENT
- HtmlStyleMap bodyStyle = (HtmlStyleMap) attributes.get(ATTR_STYLE_BODY);
- HtmlRendererUtil.replaceStyleAttribute(data, ATTR_STYLE_BODY, "height", (sheetHeight - footerHeight));
+ HtmlStyleMap bodyStyle = (HtmlStyleMap) attributes.get(Attributes.STYLE_BODY);
+ HtmlRendererUtil.replaceStyleAttribute(data, Attributes.STYLE_BODY, "height", (sheetHeight - footerHeight));
writer.startElement(HtmlConstants.DIV, null);
writer.writeIdAttribute(sheetId + "_data_div");
writer.writeClassAttribute("tobago-sheet-body-div ");
@@ -395,7 +370,7 @@
writer.startElement(HtmlConstants.TD, column);
writer.writeClassAttribute(tdClass.toString());
- final String align = (String) column.getAttributes().get(ATTR_ALIGN);
+ final String align = (String) column.getAttributes().get(Attributes.ALIGN);
if (align != null) {
writer.writeStyleAttribute(HtmlRendererUtil.toStyleString("text-align", align));
}
@@ -411,7 +386,7 @@
if (column instanceof UIColumnSelector) {
final boolean disabled
- = ComponentUtil.getBooleanAttribute(column, ATTR_DISABLED);
+ = ComponentUtil.getBooleanAttribute(column, Attributes.DISABLED);
writer.startElement(HtmlConstants.IMG, null);
if (disabled) {
writer.writeAttribute(HtmlAttributes.SRC, selectorDisabled, false);
@@ -424,7 +399,7 @@
} else {
for (UIComponent grandkid : data.getRenderedChildrenOf(column)) {
// set height to 0 to prevent use of layoutheight from parent
- grandkid.getAttributes().put(ATTR_LAYOUT_HEIGHT, HEIGHT_0);
+ grandkid.getAttributes().put(Attributes.LAYOUT_HEIGHT, HEIGHT_0);
RenderUtil.prepareRendererAll(facesContext, grandkid);
RenderUtil.encode(facesContext, grandkid);
}
@@ -462,11 +437,11 @@
final String showRowRange
- = getPagingAttribute(data, ATTR_SHOW_ROW_RANGE);
+ = getPagingAttribute(data, Attributes.SHOW_ROW_RANGE);
final String showPageRange
- = getPagingAttribute(data, ATTR_SHOW_PAGE_RANGE);
+ = getPagingAttribute(data, Attributes.SHOW_PAGE_RANGE);
final String showDirectLinks
- = getPagingAttribute(data, ATTR_SHOW_DIRECT_LINKS);
+ = getPagingAttribute(data, Attributes.SHOW_DIRECT_LINKS);
if (isValidPagingValue(showRowRange)
|| isValidPagingValue(showPageRange)
@@ -610,7 +585,7 @@
if (requestParameterMap.containsKey(key)) {
String widths = (String) requestParameterMap.get(key);
if (widths.trim().length() > 0) {
- component.getAttributes().put(ATTR_WIDTH_LIST_STRING,
+ component.getAttributes().put(Attributes.WIDTH_LIST_STRING,
widths);
}
}
@@ -630,7 +605,7 @@
}
component.getAttributes().put(
- ATTR_SELECTED_LIST_STRING, selectedRows);
+ Attributes.SELECTED_LIST_STRING, selectedRows);
}
key = component.getClientId(facesContext) + SCROLL_POSTFIX;
@@ -639,7 +614,7 @@
Integer[] scrollPosition = SheetState.parseScrollPosition(value);
if (scrollPosition != null) {
//noinspection unchecked
- component.getAttributes().put(ATTR_SCROLL_POSITION, scrollPosition);
+ component.getAttributes().put(Attributes.SCROLL_POSITION, scrollPosition);
}
}
@@ -650,7 +625,7 @@
// this when calculating column width's
final Object forceScroolbar
- = data.getAttributes().get(ATTR_FORCE_VERTICAL_SCROLLBAR);
+ = data.getAttributes().get(Attributes.FORCE_VERTICAL_SCROLLBAR);
if (forceScroolbar != null) {
if ("true".equals(forceScroolbar)) {
return true;
@@ -662,7 +637,7 @@
}
}
- HtmlStyleMap style = (HtmlStyleMap) data.getAttributes().get(ATTR_STYLE);
+ HtmlStyleMap style = (HtmlStyleMap) data.getAttributes().get(Attributes.STYLE);
Integer height = HtmlRendererUtil.getStyleAttributeIntValue(style, "height");
if (height != null) {
int first = data.getFirst();
@@ -689,15 +664,15 @@
private void storeFooterHeight(FacesContext facesContext,
UIComponent component) {
- component.getAttributes().put(ATTR_FOOTER_HEIGHT,
+ component.getAttributes().put(Attributes.FOOTER_HEIGHT,
getFooterHeight(facesContext, component));
}
private int getFooterHeight(FacesContext facesContext, UIComponent component) {
int footerHeight;
- if (isValidPagingAttribute((UIData) component, ATTR_SHOW_ROW_RANGE)
- || isValidPagingAttribute((UIData) component, ATTR_SHOW_PAGE_RANGE)
- || isValidPagingAttribute((UIData) component, ATTR_SHOW_DIRECT_LINKS)) {
+ if (isValidPagingAttribute((UIData) component, Attributes.SHOW_ROW_RANGE)
+ || isValidPagingAttribute((UIData) component, Attributes.SHOW_PAGE_RANGE)
+ || isValidPagingAttribute((UIData) component, Attributes.SHOW_DIRECT_LINKS)) {
footerHeight =
getConfiguredValue(facesContext, component, "footerHeight");
} else {
@@ -739,7 +714,7 @@
private List<Integer> getSelectedRows(UIData data, SheetState state) {
List<Integer> selected = (List<Integer>)
- data.getAttributes().get(ATTR_SELECTED_LIST_STRING);
+ data.getAttributes().get(Attributes.SELECTED_LIST_STRING);
if (selected == null && state != null) {
selected = state.getSelectedRows();
}
@@ -786,14 +761,14 @@
String sheetId = component.getClientId(facesContext);
Application application = facesContext.getApplication();
- List columnWidths = (List) component.getAttributes().get(ATTR_WIDTH_LIST);
+ List columnWidths = (List) component.getAttributes().get(Attributes.WIDTH_LIST);
String divWidth = "width: " + columnWidths.get(columnIndex) + "px;";
writer.startElement(HtmlConstants.DIV, null);
writer.writeIdAttribute(sheetId + "_header_box_" + columnIndex);
writer.writeClassAttribute("tobago-sheet-header-box");
writer.writeAttribute(HtmlAttributes.STYLE, divWidth, false);
- String tip = (String) column.getAttributes().get(ATTR_TIP);
+ String tip = (String) column.getAttributes().get(Attributes.TIP);
if (tip == null) {
tip = "";
}
@@ -804,7 +779,7 @@
String sorterImage = null;
String sorterClass = "";
String sortTitle = null;
- boolean sortable = ComponentUtil.getBooleanAttribute(column, ATTR_SORTABLE);
+ boolean sortable = ComponentUtil.getBooleanAttribute(column, Attributes.SORTABLE);
if (sortable && !(column instanceof UIColumnSelector)) {
UICommand sortCommand = (UICommand) column.getFacet(Facets.SORTER);
if (sortCommand == null) {
@@ -842,7 +817,7 @@
writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
- String align = (String) column.getAttributes().get(ATTR_ALIGN);
+ String align = (String) column.getAttributes().get(Attributes.ALIGN);
writer.startElement(HtmlConstants.DIV, null);
writer.writeIdAttribute(sheetId + "_header_outer_" + columnIndex);
@@ -910,9 +885,9 @@
menu.setId("selectorMenu");
column.getFacets().put(Facets.MENUPOPUP, menu);
menu.setRendererType(RENDERER_TYPE_MENUBAR);
- menu.getAttributes().put(ATTR_MENU_POPUP, Boolean.TRUE);
- menu.getAttributes().put(ATTR_MENU_POPUP_TYPE, "SheetSelector");
- menu.getAttributes().put(ATTR_IMAGE, "image/sheetSelectorMenu.gif");
+ menu.getAttributes().put(Attributes.MENU_POPUP, Boolean.TRUE);
+ menu.getAttributes().put(Attributes.MENU_POPUP_TYPE, "SheetSelector");
+ menu.getAttributes().put(Attributes.IMAGE, "image/sheetSelectorMenu.gif");
String sheetId = column.getParent().getClientId(facesContext);
@@ -952,8 +927,8 @@
UIMenuCommand menuItem
= (UIMenuCommand) application.createComponent(UIMenuCommand.COMPONENT_TYPE);
menuItem.setRendererType(RENDERER_TYPE_MENUCOMMAND);
- menuItem.getAttributes().put(ATTR_ACTION_ONCLICK, action);
- menuItem.getAttributes().put(ATTR_LABEL, label);
+ menuItem.getAttributes().put(Attributes.ONCLICK, action);
+ menuItem.getAttributes().put(Attributes.LABEL, label);
return menuItem;
}
@@ -962,10 +937,10 @@
int sortMarkerWidth, String align,
String image1x1) throws IOException {
String label
- = (String) column.getAttributes().get(ATTR_LABEL);
+ = (String) column.getAttributes().get(Attributes.LABEL);
if (label != null) {
writer.writeText(label, null);
- if (ComponentUtil.getBooleanAttribute(column, ATTR_SORTABLE) && "right".equals(align)) {
+ if (ComponentUtil.getBooleanAttribute(column, Attributes.SORTABLE) && "right".equals(align)) {
writer.startElement(HtmlConstants.IMG, null);
writer.writeAttribute(HtmlAttributes.SRC, image1x1, false);
writer.writeAttribute(HtmlAttributes.ALT, "", false);
@@ -994,7 +969,7 @@
String onclick = new CommandRendererHelper(facesContext, pagerCommand).getOnclickDoubleQuoted();
String hrefPostfix = "', '" + onclick + "');";
- int linkCount = ComponentUtil.getIntAttribute(data, ATTR_DIRECT_LINK_COUNT);
+ int linkCount = ComponentUtil.getIntAttribute(data, Attributes.DIRECT_LINK_COUNT);
linkCount--; // current page needs no link
ArrayList<Integer> prevs = new ArrayList<Integer>(linkCount);
int page = data.getPage();
@@ -1083,8 +1058,8 @@
link.setRendererType(SheetPageCommandRenderer.PAGE_RENDERER_TYPE);
link.setRendered(true);
link.setId(command.getToken());
- link.getAttributes().put(ATTR_INLINE, Boolean.TRUE);
- link.getAttributes().put(ATTR_DISABLED, disabled);
+ link.getAttributes().put(Attributes.INLINE, Boolean.TRUE);
+ link.getAttributes().put(Attributes.DISABLED, disabled);
return link;
}
@@ -1187,7 +1162,7 @@
widthListString = state.getColumnWidths();
}
if (widthListString == null) {
- widthListString = (String) attributes.get(ATTR_WIDTH_LIST_STRING);
+ widthListString = (String) attributes.get(Attributes.WIDTH_LIST_STRING);
}
if (widthListString != null) {
@@ -1302,8 +1277,8 @@
UIComponent child = (UIComponent) column.getChildren().get(0);
int cellPaddingWidth = getConfiguredValue(facesContext, data, "cellPaddingWidth");
child.getAttributes().put(
- ATTR_LAYOUT_WIDTH, width - cellPaddingWidth);
- child.getAttributes().remove(ATTR_INNER_WIDTH);
+ Attributes.LAYOUT_WIDTH, width - cellPaddingWidth);
+ child.getAttributes().remove(Attributes.INNER_WIDTH);
} else {
LOG.warn("More or less than 1 child in column! "
+ "Can't set width for column " + i + " to " + width);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,19 +24,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_HEIGHT;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMAGE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_HEIGHT;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_WIDTH;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ONCLICK;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SELECTED_INDEX;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_BODY;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_CLASS;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_HEADER;
import org.apache.myfaces.tobago.ajax.api.AjaxRenderer;
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
import org.apache.myfaces.tobago.compat.FacesUtils;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.UICommand;
import org.apache.myfaces.tobago.component.UIPanelBase;
@@ -165,10 +156,10 @@
writer.writeIdAttribute(clientId);
HtmlRendererUtil.renderDojoDndItem(component, writer, false);
//TODO writer.writeClassAttribute("dojoDndItem");
- StyleClasses classes = (StyleClasses) component.getAttributes().get(ATTR_STYLE_CLASS);
+ StyleClasses classes = (StyleClasses) component.getAttributes().get(Attributes.STYLE_CLASS);
writer.writeClassAttribute(classes);
renderTabGroupView(facesContext, writer, component, virtualTab,
- (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE),
+ (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE),
switchType, image1x1, navigationBarWidth, currentWidth, tabList);
writer.endElement(HtmlConstants.DIV);
@@ -256,8 +247,8 @@
// resetting index to 0
closestRenderedTabIndex = 0;
}
- if (FacesUtils.hasValueBindingOrValueExpression(tabGroup, ATTR_SELECTED_INDEX)) {
- FacesUtils.setValueOfBindingOrExpression(context, closestRenderedTabIndex, tabGroup, ATTR_SELECTED_INDEX);
+ if (FacesUtils.hasValueBindingOrValueExpression(tabGroup, Attributes.SELECTED_INDEX)) {
+ FacesUtils.setValueOfBindingOrExpression(context, closestRenderedTabIndex, tabGroup, Attributes.SELECTED_INDEX);
} else {
tabGroup.setSelectedIndex(closestRenderedTabIndex);
}
@@ -280,7 +271,7 @@
writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);
writer.startElement(HtmlConstants.TD, null);
- HtmlStyleMap headerStyle = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE_HEADER);
+ HtmlStyleMap headerStyle = (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE_HEADER);
headerStyle.put("position", "relative");
headerStyle.put("width", headerStyle.getInt("width"));
int width = headerStyle.getInt("width");
@@ -304,7 +295,7 @@
writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
- headerStyle = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE_HEADER);
+ headerStyle = (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE_HEADER);
writer.writeStyleAttribute(headerStyle);
writer.startElement(HtmlConstants.COLGROUP, null);
@@ -326,28 +317,28 @@
scrollLeft.setId(component.getId() + "__" + virtualTab + "__" + "previous");
//scrollLeft.setId(facesContext.getViewRoot().createUniqueId());
scrollLeft.setRendererType(null);
- scrollLeft.getAttributes().put(ATTR_IMAGE, "image/tabPrev.gif");
+ scrollLeft.getAttributes().put(Attributes.IMAGE, "image/tabPrev.gif");
if (tabList.isFirst(virtualTab)) {
scrollLeft.setDisabled(true);
}
if (!(TobagoConfig.getInstance(facesContext).isAjaxEnabled() && SWITCH_TYPE_RELOAD_TAB.equals(switchType))) {
- scrollLeft.getAttributes().put(ATTR_ONCLICK, "tobago_previousTab('" + switchType + "','" + clientId + "',"
+ scrollLeft.getAttributes().put(Attributes.ONCLICK, "tobago_previousTab('" + switchType + "','" + clientId + "',"
+ component.getChildCount() + ')');
} else {
- scrollLeft.getAttributes().put(ATTR_ONCLICK, "javascript:false");
+ scrollLeft.getAttributes().put(Attributes.ONCLICK, "javascript:false");
}
UICommand scrollRight = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
scrollRight.setId(component.getId() + "__" + virtualTab + "__" + "next");
scrollRight.setRendererType(null);
- scrollRight.getAttributes().put(ATTR_IMAGE, "image/tabNext.gif");
+ scrollRight.getAttributes().put(Attributes.IMAGE, "image/tabNext.gif");
if (tabList.isLast(virtualTab)) {
scrollRight.setDisabled(true);
}
if (!(TobagoConfig.getInstance(facesContext).isAjaxEnabled() && SWITCH_TYPE_RELOAD_TAB.equals(switchType))) {
- scrollRight.getAttributes().put(ATTR_ONCLICK, "tobago_nextTab('" + switchType + "','" + clientId + "',"
+ scrollRight.getAttributes().put(Attributes.ONCLICK, "tobago_nextTab('" + switchType + "','" + clientId + "',"
+ component.getChildCount() + ')');
} else {
- scrollRight.getAttributes().put(ATTR_ONCLICK, "javascript:false");
+ scrollRight.getAttributes().put(Attributes.ONCLICK, "javascript:false");
}
/*UICommand commandList = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
commandList.setId(facesContext.getViewRoot().createUniqueId());
@@ -451,13 +442,13 @@
menuItem.setId(component.getId() + "__" + virtualTab + "__" + index + "__" + "menu");
menuItem.setRendererType("MenuCommand");
if (onclick != null) {
- menuItem.getAttributes().put(ATTR_ONCLICK, onclick);
+ menuItem.getAttributes().put(ONCLICK, onclick);
} else {
- menuItem.getAttributes().put(ATTR_ONCLICK, "javascript:false");
+ menuItem.getAttributes().put(ONCLICK, "javascript:false");
}
- Object label2 = tab.getAttributes().get(ATTR_LABEL);
+ Object label2 = tab.getAttributes().get(LABEL);
if (label2 != null) {
- menuItem.getAttributes().put(ATTR_LABEL, label2);
+ menuItem.getAttributes().put(LABEL, label2);
}
menu.getChildren().add(menuItem);*/
@@ -519,7 +510,7 @@
throws IOException {
HtmlStyleMap bodyStyle = (HtmlStyleMap)
- activeTab.getParent().getAttributes().get(ATTR_STYLE_BODY);
+ activeTab.getParent().getAttributes().get(Attributes.STYLE_BODY);
writer.startElement(HtmlConstants.TR, null);
writer.startElement(HtmlConstants.TD, null);
StyleClasses classes = new StyleClasses();
@@ -540,7 +531,7 @@
int currentWidth = getCurrentWidth(tabList, index);
renderTabGroupView(context, HtmlRendererUtil.getTobagoResponseWriter(context),
(UITabGroup) component, index,
- (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE), SWITCH_TYPE_RELOAD_TAB,
+ (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE), SWITCH_TYPE_RELOAD_TAB,
ResourceManagerUtil.getImageWithPath(context, "image/1x1.gif"),
getConfiguredValue(context, component, "navigationBarWidth"), currentWidth, tabList);
}
@@ -548,7 +539,7 @@
public int getFixedHeight(FacesContext facesContext, UIComponent uiComponent) {
UITabGroup component = (UITabGroup) uiComponent;
int height =
- ComponentUtil.getIntAttribute(component, ATTR_HEIGHT, -1);
+ ComponentUtil.getIntAttribute(component, Attributes.HEIGHT, -1);
int fixedHeight;
if (height != -1) {
@@ -570,9 +561,9 @@
private void layoutTabs(FacesContext facesContext, UITabGroup component) {
Object layoutWidth =
- component.getAttributes().get(ATTR_LAYOUT_WIDTH);
+ component.getAttributes().get(Attributes.LAYOUT_WIDTH);
Object layoutHeight =
- component.getAttributes().get(ATTR_LAYOUT_HEIGHT);
+ component.getAttributes().get(Attributes.LAYOUT_HEIGHT);
for (UIComponent tab : (List<UIComponent>) component.getChildren()) {
if (tab instanceof UIPanelBase && tab.isRendered()) {
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,9 +24,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_HEIGHT;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -38,7 +38,7 @@
public int getFixedHeight(FacesContext facesContext, UIComponent component) {
int height =
- ComponentUtil.getIntAttribute(component, ATTR_HEIGHT, -1);
+ ComponentUtil.getIntAttribute(component, Attributes.HEIGHT, -1);
if (height == -1) {
height = PanelRenderer.getFixedHeightForPanel(component, facesContext);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,11 +24,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ROWS;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
import org.apache.myfaces.tobago.component.AbstractUIGridConstraints;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UITextarea;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.HtmlUtils;
@@ -66,14 +63,14 @@
writer.startElement(HtmlConstants.TEXTAREA, input);
writer.writeNameAttribute(clientId);
writer.writeIdAttribute(clientId);
- writer.writeAttribute(HtmlAttributes.ROWS, null, ATTR_ROWS);
+ writer.writeAttribute(HtmlAttributes.ROWS, null, Attributes.ROWS);
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
writer.writeAttribute(HtmlAttributes.READONLY,
- ComponentUtil.getBooleanAttribute(input, ATTR_READONLY));
+ ComponentUtil.getBooleanAttribute(input, Attributes.READONLY));
writer.writeAttribute(HtmlAttributes.DISABLED,
- ComponentUtil.getBooleanAttribute(input, ATTR_DISABLED));
+ ComponentUtil.getBooleanAttribute(input, Attributes.DISABLED));
Integer tabIndex = input.getTabIndex();
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
@@ -81,7 +78,7 @@
HtmlRendererUtil.renderDojoDndItem(component, writer, true);
// LAYOUT Begin
- HtmlStyleMap style = (HtmlStyleMap) input.getAttributes().get(ATTR_STYLE);
+ HtmlStyleMap style = (HtmlStyleMap) input.getAttributes().get(Attributes.STYLE);
Measure width = ((AbstractUIGridConstraints) input.getConstraints()).getWidth();
if (width != null) {
style.put("width", width.toString());
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,19 +24,17 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CALENDAR_DATE_INPUT_ID;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UITimeInput;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
+import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.util.DateFormatUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -140,8 +138,8 @@
writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtil.getImageWithPath(facesContext, imageSrc), true);
writer.writeAttribute(HtmlAttributes.ALT, "", false); // TODO: tip
- if (!(ComponentUtil.getBooleanAttribute(input, ATTR_DISABLED)
- || ComponentUtil.getBooleanAttribute(input, ATTR_READONLY))) {
+ if (!(ComponentUtil.getBooleanAttribute(input, Attributes.DISABLED)
+ || ComponentUtil.getBooleanAttribute(input, Attributes.READONLY))) {
writer.writeAttribute(HtmlAttributes.ONCLICK, "tbgIncTime(this)", false);
writer.writeAttribute(HtmlAttributes.ONMOUSEOVER,
"Tobago.imageMouseover('" + imageId + "')", null);
@@ -159,8 +157,8 @@
+ (hasSeconds ? " tobago-time-image-seconds" : ""));
writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtil.getImageWithPath(facesContext, imageSrc), true);
writer.writeAttribute(HtmlAttributes.ALT, "", false); // TODO: tip
- if (!(ComponentUtil.getBooleanAttribute(input, ATTR_DISABLED)
- || ComponentUtil.getBooleanAttribute(input, ATTR_READONLY))) {
+ if (!(ComponentUtil.getBooleanAttribute(input, Attributes.DISABLED)
+ || ComponentUtil.getBooleanAttribute(input, Attributes.READONLY))) {
writer.writeAttribute(HtmlAttributes.ONCLICK, "tbgDecTime(this)", false);
writer.writeAttribute(HtmlAttributes.ONMOUSEOVER,
"Tobago.imageMouseover('" + imageId + "')", null);
@@ -182,7 +180,7 @@
writer.writeAttribute(HtmlAttributes.VALUE, hour + ":" + minute + ":" + second, false);
writer.endElement(HtmlConstants.INPUT);
- String dateTextBoxId = (String) input.getAttributes().get(ATTR_CALENDAR_DATE_INPUT_ID);
+ String dateTextBoxId = (String) input.getAttributes().get(Attributes.DATE_INPUT_ID);
if (dateTextBoxId != null) {
String[] cmds = {"tbgInitTimeParse('" + id + "', '" + dateTextBoxId + "');"};
@@ -214,10 +212,10 @@
//styleClasses.updateClassAttributeAndMarkup(input, "time");
styleClasses.addClass("time", "input");
writer.writeClassAttribute(styleClasses);
- writer.writeAttribute(HtmlAttributes.READONLY, ComponentUtil.getBooleanAttribute(input, ATTR_READONLY));
- writer.writeAttribute(HtmlAttributes.DISABLED, ComponentUtil.getBooleanAttribute(input, ATTR_DISABLED));
- if (!(ComponentUtil.getBooleanAttribute(input, ATTR_DISABLED)
- || ComponentUtil.getBooleanAttribute(input, ATTR_READONLY))) {
+ writer.writeAttribute(HtmlAttributes.READONLY, ComponentUtil.getBooleanAttribute(input, Attributes.READONLY));
+ writer.writeAttribute(HtmlAttributes.DISABLED, ComponentUtil.getBooleanAttribute(input, Attributes.DISABLED));
+ if (!(ComponentUtil.getBooleanAttribute(input, Attributes.DISABLED)
+ || ComponentUtil.getBooleanAttribute(input, Attributes.READONLY))) {
writer.writeAttribute(HtmlAttributes.ONFOCUS, "tbgTimerInputFocus(this, " + hourMode + ")", false);
writer.writeAttribute(HtmlAttributes.ONBLUR, "tbgTimerInputBlur(this)", false);
writer.writeAttribute(HtmlAttributes.ONKEYUP, "tbgTimerKeyUp(this, event)", false);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java Fri Oct 24 12:16:37 2008
@@ -19,17 +19,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ICON_SIZE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMAGE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL_POSITION;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_MENU_POPUP;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_MENU_POPUP_TYPE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_VALUE;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_MENUBAR;
import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.CreateComponentUtils;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.UIMenu;
@@ -74,11 +66,11 @@
}
protected String getLabelPosition(UIComponent component) {
- return (String) component.getAttributes().get(ATTR_LABEL_POSITION);
+ return (String) component.getAttributes().get(Attributes.LABEL_POSITION);
}
protected String getIconSize(UIComponent component) {
- return (String) component.getAttributes().get(ATTR_ICON_SIZE);
+ return (String) component.getAttributes().get(Attributes.ICON_SIZE);
}
public void encodeEnd(FacesContext context, UIComponent uiComponent) throws IOException {
@@ -150,7 +142,7 @@
for (SelectItem item : items) {
final String labelText = item.getLabel();
if (labelText != null) {
- command.getAttributes().put(ATTR_LABEL, labelText);
+ command.getAttributes().put(Attributes.LABEL, labelText);
} else {
LOG.warn("Menu item has label=null. UICommand.getClientId()="
+ command.getClientId(facesContext));
@@ -165,10 +157,10 @@
if (image == null) {
image = "image/1x1.gif";
}
- command.getAttributes().put(ATTR_IMAGE, image);
+ command.getAttributes().put(Attributes.IMAGE, image);
if (item.getDescription() != null) {
- command.getAttributes().put(ATTR_TIP, item.getDescription());
+ command.getAttributes().put(Attributes.TIP, item.getDescription());
}
@@ -201,7 +193,7 @@
checkbox.setId(facesContext.getViewRoot().createUniqueId());
}
- final boolean checked = ComponentUtil.getBooleanAttribute(checkbox, ATTR_VALUE);
+ final boolean checked = ComponentUtil.getBooleanAttribute(checkbox, Attributes.VALUE);
String onClick = createOnClick(facesContext, command);
@@ -223,7 +215,7 @@
}
final String clientId = command.getClientId(facesContext);
- final boolean disabled = ComponentUtil.getBooleanAttribute(command, ATTR_DISABLED);
+ final boolean disabled = ComponentUtil.getBooleanAttribute(command, Attributes.DISABLED);
final LabelWithAccessKey label = new LabelWithAccessKey(command);
final UIComponent popupMenu = command.getFacet(Facets.MENUPOPUP);
@@ -231,7 +223,7 @@
String iconSize = getIconSize(command.getParent());
- String iconName = (String) command.getAttributes().get(ATTR_IMAGE);
+ String iconName = (String) command.getAttributes().get(Attributes.IMAGE);
String image = getImage(facesContext, iconName, iconSize, disabled, selected);
String graphicId = clientId + SUBCOMPONENT_SEP + "icon";
@@ -470,15 +462,15 @@
writer.writeClassAttribute("tobago-toolBar-button-menu-background-image");
writer.endElement(HtmlConstants.IMG);
writer.endElement(HtmlConstants.DIV);
- popupMenu.getAttributes().put(ATTR_MENU_POPUP, Boolean.TRUE);
- popupMenu.getAttributes().put(ATTR_MENU_POPUP_TYPE, "ToolBarButton");
+ popupMenu.getAttributes().put(Attributes.MENU_POPUP, Boolean.TRUE);
+ popupMenu.getAttributes().put(Attributes.MENU_POPUP_TYPE, "ToolBarButton");
popupMenu.setRendererType(RENDERER_TYPE_MENUBAR);
if (popupMenu instanceof UIMenu) {
((UIMenu) popupMenu).setLabel(null);
} else {
- popupMenu.getAttributes().remove(ATTR_LABEL);
+ popupMenu.getAttributes().remove(Attributes.LABEL);
}
- popupMenu.getAttributes().put(ATTR_IMAGE, "image/toolbarButtonMenu.gif");
+ popupMenu.getAttributes().put(Attributes.IMAGE, "image/toolbarButtonMenu.gif");
RenderUtil.encode(facesContext, popupMenu);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxBoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxBoxRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxBoxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxBoxRenderer.java Fri Oct 24 12:16:37 2008
@@ -19,9 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_NAME;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SELECTABLE;
import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UITreeListbox;
import org.apache.myfaces.tobago.component.UITreeListboxBox;
import org.apache.myfaces.tobago.component.UITreeOldNode;
@@ -63,7 +62,7 @@
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
final boolean siblingMode
- = "siblingLeafOnly".equals(tree.getAttributes().get(ATTR_SELECTABLE));
+ = "siblingLeafOnly".equals(tree.getAttributes().get(Attributes.SELECTABLE));
String listboxId = treeId + SUBCOMPONENT_SEP + "cont_" + level;
String onChange = "tbgTreeListboxChange(this, '" + treeId + "')";
@@ -95,7 +94,7 @@
writer.writeAttribute(HtmlAttributes.SELECTED, true);
}
HtmlRendererUtil.renderTip(treeNode, writer);
- writer.writeText(treeNode.getAttributes().get(ATTR_NAME), null);
+ writer.writeText(treeNode.getAttributes().get(Attributes.NAME), null);
if (node.getChildCount() > 0) {
writer.writeText(" \u2192");
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxRenderer.java Fri Oct 24 12:16:37 2008
@@ -34,9 +34,9 @@
import javax.faces.context.ResponseWriter;
import javax.swing.tree.DefaultMutableTreeNode;
import java.io.IOException;
+import java.util.Arrays;
import java.util.List;
import java.util.Set;
-import java.util.Arrays;
/*
* Created 07.02.2003 16:00:00.
@@ -165,7 +165,7 @@
// writer.writeAttribute(HtmlAttributes.CELLSPACING, "0", null);
// writer.writeAttribute(HtmlAttributes.BORDER, "0", null);
// writer.writeAttribute(HtmlAttributes.SUMMARY, "", null);
-// writer.writeComponentClass(ATTR_STYLE_CLASS);
+// writer.writeComponentClass(STYLE_CLASS);
// writer.startElement(HtmlConstants.TR, null);
//
//
@@ -240,7 +240,7 @@
// writer.writeAttribute(HtmlAttributes.SELECTED, "selected", null);
// }
//
-// writer.writeText(treeNode.getAttributes().get(ATTR_NAME), null);
+// writer.writeText(treeNode.getAttributes().get(NAME), null);
// if (node.getChildCount() > 0) {
// writer.writeText(" -->", null);
// }
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java Fri Oct 24 12:16:37 2008
@@ -25,9 +25,9 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
import org.apache.myfaces.tobago.component.AbstractUITree;
import org.apache.myfaces.tobago.component.AbstractUITreeNode;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.UITree;
import org.apache.myfaces.tobago.component.UITreeNode;
@@ -162,7 +162,7 @@
// div style (width)
Integer width = null;
- HtmlStyleMap style = (HtmlStyleMap) root.getAttributes().get(ATTR_STYLE);
+ HtmlStyleMap style = (HtmlStyleMap) root.getAttributes().get(Attributes.STYLE);
if (style != null) {
width = style.getInt("width");
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeOldNodeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeOldNodeRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeOldNodeRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeOldNodeRenderer.java Fri Oct 24 12:16:37 2008
@@ -21,14 +21,13 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.TobagoConstants;
-import org.apache.myfaces.tobago.util.ComponentUtil;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UITreeOld;
import org.apache.myfaces.tobago.component.UITreeOldNode;
import org.apache.myfaces.tobago.model.TreeState;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.component.NamingContainer;
import javax.faces.component.UICommand;
@@ -181,7 +180,7 @@
writer.writeText(jsClientId, null);
writer.writeText(" = new TreeOldNode('", null);
// label
- Object name = treeNode.getAttributes().get(TobagoConstants.ATTR_NAME);
+ Object name = treeNode.getAttributes().get(Attributes.NAME);
if (LOG.isDebugEnabled()) {
debuging += name + " : ";
}
@@ -193,7 +192,7 @@
writer.writeText("',", null);
// tip
- Object tip = treeNode.getAttributes().get(TobagoConstants.ATTR_TIP);
+ Object tip = treeNode.getAttributes().get(Attributes.TIP);
if (tip != null) {
tip = StringEscapeUtils.escapeJavaScript(tip.toString());
writer.writeText("'", null);
@@ -224,7 +223,7 @@
writer.writeText(rootId, null);
writer.writeText("',", null);
String selectable = ComponentUtil.getStringAttribute(root,
- TobagoConstants.ATTR_SELECTABLE);
+ Attributes.SELECTABLE);
if (selectable != null
&& (!(selectable.equals("multi") || selectable.equals("multiLeafOnly")
|| selectable.equals("single") || selectable.equals("singleLeafOnly")
@@ -240,7 +239,7 @@
}
writer.writeText(",", null);
writer.writeText(Boolean.toString(ComponentUtil.getBooleanAttribute(root,
- TobagoConstants.ATTR_MUTABLE)), null);
+ Attributes.MUTABLE)), null);
writer.writeText(",'", null);
writer.writeText(
ComponentUtil.findPage(facesContext, component).getFormId(facesContext), null);
@@ -278,7 +277,7 @@
// disabled
writer.writeText(ComponentUtil.getBooleanAttribute(treeNode,
- TobagoConstants.ATTR_DISABLED), null);
+ Attributes.DISABLED), null);
// resources
writer.writeText(",treeResourcesHelp", null);
@@ -313,7 +312,7 @@
// width
Integer width = null;
- HtmlStyleMap style = (HtmlStyleMap) root.getAttributes().get(ATTR_STYLE);
+ HtmlStyleMap style = (HtmlStyleMap) root.getAttributes().get(Attributes.STYLE);
if (style != null) {
width = style.getInt("width");
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeOldRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeOldRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeOldRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeOldRenderer.java Fri Oct 24 12:16:37 2008
@@ -17,8 +17,7 @@
* limitations under the License.
*/
-import org.apache.myfaces.tobago.TobagoConstants;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UITreeOld;
import org.apache.myfaces.tobago.component.UITreeOldNode;
import org.apache.myfaces.tobago.config.TobagoConfig;
@@ -26,11 +25,12 @@
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.model.TreeState;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
-import org.apache.myfaces.tobago.renderkit.html.util.CommandRendererHelper;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.util.CommandRendererHelper;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.util.FastStringWriter;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -89,7 +89,7 @@
if (isSelectable(tree)) {
state.clearSelection();
}
- if (ComponentUtil.getBooleanAttribute(tree, TobagoConstants.ATTR_MUTABLE)) {
+ if (ComponentUtil.getBooleanAttribute(tree, Attributes.MUTABLE)) {
state.setMarker(null);
}
// scroll position
@@ -174,7 +174,7 @@
}
writer.endElement(HtmlConstants.INPUT);
- if (ComponentUtil.getBooleanAttribute(tree, TobagoConstants.ATTR_MUTABLE)) {
+ if (ComponentUtil.getBooleanAttribute(tree, Attributes.MUTABLE)) {
// writer.startElement(HtmlConstants.DIV, null);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/VerbatimRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/VerbatimRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/VerbatimRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/VerbatimRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,10 +24,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ESCAPE;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -50,7 +50,7 @@
return;
}
- if (ComponentUtil.getBooleanAttribute(component, ATTR_ESCAPE)) {
+ if (ComponentUtil.getBooleanAttribute(component, Attributes.ESCAPE)) {
writer.writeText(value, null);
} else {
writer.write(value);
Modified: myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,12 +24,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL_POSITION;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
import org.apache.myfaces.tobago.ajax.api.AjaxRenderer;
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.SupportsMarkup;
import org.apache.myfaces.tobago.component.UIToolBar;
@@ -65,7 +63,7 @@
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
- HtmlStyleMap style = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE);
+ HtmlStyleMap style = (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE);
if (style != null) {
Integer styleHeight = style.getInt("height");
@@ -132,7 +130,7 @@
writer.startElement(HtmlConstants.SPAN, null);
writer.writeClassAttribute("tobago-box-header-label");
String labelString
- = (String) component.getAttributes().get(ATTR_LABEL);
+ = (String) component.getAttributes().get(Attributes.LABEL);
if (label != null) {
RenderUtil.encode(facesContext, label);
} else if (labelString != null) {
@@ -163,7 +161,7 @@
FacesContext facesContext, TobagoResponseWriter writer, UIPanel toolbar) throws IOException {
final Map attributes = toolbar.getAttributes();
String className = "tobago-box-header-toolbar-div";
- if (UIToolBar.LABEL_OFF.equals(attributes.get(ATTR_LABEL_POSITION))) {
+ if (UIToolBar.LABEL_OFF.equals(attributes.get(Attributes.LABEL_POSITION))) {
className += " tobago-box-header-toolbar-label_off";
}
writer.startElement(HtmlConstants.DIV, null);
Modified: myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java Fri Oct 24 12:16:37 2008
@@ -24,13 +24,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_BODY;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UITab;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
+import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.context.FacesContext;
@@ -46,7 +46,7 @@
FacesContext facesContext, UITab activeTab) throws IOException {
HtmlStyleMap bodyStyle = (HtmlStyleMap)
- activeTab.getParent().getAttributes().get(ATTR_STYLE_BODY);
+ activeTab.getParent().getAttributes().get(Attributes.STYLE_BODY);
writer.startElement(HtmlConstants.TR, null);
writer.startElement(HtmlConstants.TD, null);
if (bodyStyle != null) {
Modified: myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java?rev=707725&r1=707724&r2=707725&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java Fri Oct 24 12:16:37 2008
@@ -19,14 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_LINK;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_ONCLICK;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DEFAULT_COMMAND;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_POPUP_CLOSE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TARGET;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TRANSITION;
import org.apache.myfaces.tobago.component.AbstractUICommand;
+import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.UIPopup;
import org.apache.myfaces.tobago.context.ClientProperties;
@@ -66,7 +60,7 @@
private void initOnclick(FacesContext facesContext, UICommand command, Tag tag) {
- disabled = ComponentUtil.getBooleanAttribute(command, ATTR_DISABLED);
+ disabled = ComponentUtil.getBooleanAttribute(command, Attributes.DISABLED);
href = getEmptyHref(facesContext);
if (disabled) {
@@ -82,20 +76,20 @@
}
String clientId = command.getClientId(facesContext);
- boolean defaultCommand = ComponentUtil.getBooleanAttribute(command, ATTR_DEFAULT_COMMAND);
- boolean transition = ComponentUtil.getBooleanAttribute(command, ATTR_TRANSITION);
+ boolean defaultCommand = ComponentUtil.getBooleanAttribute(command, Attributes.DEFAULT_COMMAND);
+ boolean transition = ComponentUtil.getBooleanAttribute(command, Attributes.TRANSITION);
- if (command.getAttributes().get(ATTR_ACTION_LINK) != null) {
+ if (command.getAttributes().get(Attributes.LINK) != null) {
String url = generateUrl(facesContext, command);
if (tag == Tag.ANCHOR) {
onclick = null;
href = url;
- target = ComponentUtil.getStringAttribute(command, ATTR_TARGET);
+ target = ComponentUtil.getStringAttribute(command, Attributes.TARGET);
} else {
// TODO target
onclick = "Tobago.navigateToUrl('" + url + "');";
}
- } else if (command.getAttributes().get(ATTR_ACTION_ONCLICK) != null) {
+ } else if (command.getAttributes().get(Attributes.ONCLICK) != null) {
onclick = prepareOnClick(facesContext, command);
} else if (command instanceof AbstractUICommand
&& ((AbstractUICommand) command).getRenderedPartially().length > 0) {
@@ -120,7 +114,7 @@
ComponentUtil.findPage(facesContext, command).setDefaultActionId(clientId);
onclick = null;
} else {
- String target = ComponentUtil.getStringAttribute(command, ATTR_TARGET);
+ String target = ComponentUtil.getStringAttribute(command, Attributes.TARGET);
if (target == null) {
onclick = "Tobago.submitAction(this, '" + clientId + "', " + transition + ");";
} else {
@@ -128,9 +122,9 @@
}
}
- if (command.getAttributes().get(ATTR_POPUP_CLOSE) != null
+ if (command.getAttributes().get(Attributes.POPUP_CLOSE) != null
&& ComponentUtil.isInPopup(command)) {
- String value = (String) command.getAttributes().get(ATTR_POPUP_CLOSE);
+ String value = (String) command.getAttributes().get(Attributes.POPUP_CLOSE);
if (value.equals("immediate")) {
onclick = "Tobago.closePopup(this);";
} else if (value.equals("afterSubmit")
@@ -152,7 +146,7 @@
private String prepareOnClick(FacesContext facesContext, UIComponent component) {
String onclick;
- onclick = (String) component.getAttributes().get(ATTR_ACTION_ONCLICK);
+ onclick = (String) component.getAttributes().get(Attributes.ONCLICK);
if (onclick.contains("@autoId")) {
onclick = onclick.replace("@autoId", component.getClientId(facesContext));
}
@@ -179,7 +173,7 @@
Application application = facesContext.getApplication();
ViewHandler viewHandler = application.getViewHandler();
- String link = (String) component.getAttributes().get(ATTR_ACTION_LINK);
+ String link = (String) component.getAttributes().get(Attributes.LINK);
if (link.startsWith("/")) { // internal URL
url = viewHandler.getActionURL(facesContext, link);
} else { // external URL