You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/07/03 23:58:25 UTC
svn commit: r673833 [4/18] - in /myfaces/tomahawk/trunk:
core/src/main/java/org/apache/myfaces/component/
core/src/main/java/org/apache/myfaces/component/html/ext/
core/src/main/java/org/apache/myfaces/component/html/util/
core/src/main/java/org/apache...
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectitems/AbstractUISelectItems.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectitems/AbstractUISelectItems.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectitems/AbstractUISelectItems.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectitems/AbstractUISelectItems.java Thu Jul 3 14:58:05 2008
@@ -46,7 +46,7 @@
* @version $Revision$ $Date$
*/
public abstract class AbstractUISelectItems extends javax.faces.component.UISelectItems {
-
+
public static final String COMPONENT_TYPE = "org.apache.myfaces.UISelectItems";
/**
@@ -54,86 +54,86 @@
*
* @JSFProperty
*/
- public abstract String getVar();
-
- /**
- * name of the selectitem
- *
- * @JSFProperty
- */
- public abstract Object getItemLabel();
+ public abstract String getVar();
+
+ /**
+ * name of the selectitem
+ *
+ * @JSFProperty
+ */
+ public abstract Object getItemLabel();
/**
* value of the selectitem
*
* @JSFProperty
*/
- public abstract Object getItemValue();
+ public abstract Object getItemValue();
public Object getValue() {
- Object value = super.getValue();
- return createSelectItems(value);
+ Object value = super.getValue();
+ return createSelectItems(value);
}
- private SelectItem[] createSelectItems(Object value) {
- List items = new ArrayList();
-
- if (value instanceof SelectItem[]) {
- return (SelectItem[]) value;
- }
- else if (value instanceof Collection) {
- Collection collection = (Collection) value;
- for (Iterator iter = collection.iterator(); iter.hasNext();) {
- Object currentItem = (Object) iter.next();
- if (currentItem instanceof SelectItemGroup) {
- SelectItemGroup itemGroup = (SelectItemGroup) currentItem;
- SelectItem[] itemsFromGroup = itemGroup.getSelectItems();
- for (int i = 0; i < itemsFromGroup.length; i++) {
- items.add(itemsFromGroup[i]);
- }
- }
- else {
- putIteratorToRequestParam(currentItem);
- SelectItem selectItem = createSelectItem();
- removeIteratorFromRequestParam();
- items.add(selectItem);
- }
- }
- }
- else if (value instanceof Map) {
- Map map = (Map) value;
- for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
- Entry currentItem = (Entry) iter.next();
- putIteratorToRequestParam(currentItem.getValue());
- SelectItem selectItem = createSelectItem();
- removeIteratorFromRequestParam();
- items.add(selectItem);
- }
- }
-
- return (SelectItem[]) items.toArray(new SelectItem[0]);
- }
+ private SelectItem[] createSelectItems(Object value) {
+ List items = new ArrayList();
+
+ if (value instanceof SelectItem[]) {
+ return (SelectItem[]) value;
+ }
+ else if (value instanceof Collection) {
+ Collection collection = (Collection) value;
+ for (Iterator iter = collection.iterator(); iter.hasNext();) {
+ Object currentItem = (Object) iter.next();
+ if (currentItem instanceof SelectItemGroup) {
+ SelectItemGroup itemGroup = (SelectItemGroup) currentItem;
+ SelectItem[] itemsFromGroup = itemGroup.getSelectItems();
+ for (int i = 0; i < itemsFromGroup.length; i++) {
+ items.add(itemsFromGroup[i]);
+ }
+ }
+ else {
+ putIteratorToRequestParam(currentItem);
+ SelectItem selectItem = createSelectItem();
+ removeIteratorFromRequestParam();
+ items.add(selectItem);
+ }
+ }
+ }
+ else if (value instanceof Map) {
+ Map map = (Map) value;
+ for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
+ Entry currentItem = (Entry) iter.next();
+ putIteratorToRequestParam(currentItem.getValue());
+ SelectItem selectItem = createSelectItem();
+ removeIteratorFromRequestParam();
+ items.add(selectItem);
+ }
+ }
+
+ return (SelectItem[]) items.toArray(new SelectItem[0]);
+ }
- private SelectItem createSelectItem() {
- SelectItem item = null;
- Object value = getItemValue();
- String label = getItemLabel() != null ? getItemLabel().toString() : null;
-
- if(label != null)
- item = new SelectItem(value, label);
- else
- item = new SelectItem(value);
-
- return item;
- }
-
- private void putIteratorToRequestParam(Object object) {
- FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(getVar(), object);
- }
-
- private void removeIteratorFromRequestParam() {
- FacesContext.getCurrentInstance().getExternalContext().getRequestMap().remove(getVar());
- }
-
+ private SelectItem createSelectItem() {
+ SelectItem item = null;
+ Object value = getItemValue();
+ String label = getItemLabel() != null ? getItemLabel().toString() : null;
+
+ if(label != null)
+ item = new SelectItem(value, label);
+ else
+ item = new SelectItem(value);
+
+ return item;
+ }
+
+ private void putIteratorToRequestParam(Object object) {
+ FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(getVar(), object);
+ }
+
+ private void removeIteratorFromRequestParam() {
+ FacesContext.getCurrentInstance().getExternalContext().getRequestMap().remove(getVar());
+ }
+
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/subform/AbstractSubForm.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/subform/AbstractSubForm.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/subform/AbstractSubForm.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/subform/AbstractSubForm.java Thu Jul 3 14:58:05 2008
@@ -80,7 +80,7 @@
private static final String PARTIAL_ENABLED = "org.apache.myfaces.IsPartialPhaseExecutionEnabled";
private boolean _submitted;
- public AbstractSubForm()
+ public AbstractSubForm()
{
super.setRendererType(DEFAULT_RENDERER_TYPE);
}
@@ -107,43 +107,43 @@
* @JSFProperty
* @return
*/
- public abstract Boolean getPreserveSubmittedValues();
+ public abstract Boolean getPreserveSubmittedValues();
- public void processDecodes(FacesContext context)
- {
- super.processDecodes(context);
- if (!isRendered()) return;
-
- if (!_submitted && Boolean.FALSE.equals(getPreserveSubmittedValues()))
- {
- // didn't find any better way as we do not know if we are submitted before the
- // decode phase, but then all the other components have the submitted value
- // set already.
- // so lets reset them again ... boring hack.
- resetSubmittedValues(this, context);
- }
- }
-
- public void processValidators(FacesContext context)
- {
- if (context == null) throw new NullPointerException("context");
- if (!isRendered()) return;
-
- boolean partialEnabled = isPartialEnabled(context, PhaseId.PROCESS_VALIDATIONS);
-
- if(partialEnabled || (_submitted && isEmptyList(context)))
- {
- for (Iterator it = getFacetsAndChildren(); it.hasNext(); )
- {
- UIComponent childOrFacet = (UIComponent)it.next();
- childOrFacet.processValidators(context);
- }
- }
- else
- {
- processSubFormValidators(this,context);
- }
+ public void processDecodes(FacesContext context)
+ {
+ super.processDecodes(context);
+ if (!isRendered()) return;
+
+ if (!_submitted && Boolean.FALSE.equals(getPreserveSubmittedValues()))
+ {
+ // didn't find any better way as we do not know if we are submitted before the
+ // decode phase, but then all the other components have the submitted value
+ // set already.
+ // so lets reset them again ... boring hack.
+ resetSubmittedValues(this, context);
+ }
+ }
+
+ public void processValidators(FacesContext context)
+ {
+ if (context == null) throw new NullPointerException("context");
+ if (!isRendered()) return;
+
+ boolean partialEnabled = isPartialEnabled(context, PhaseId.PROCESS_VALIDATIONS);
+
+ if(partialEnabled || (_submitted && isEmptyList(context)))
+ {
+ for (Iterator it = getFacetsAndChildren(); it.hasNext(); )
+ {
+ UIComponent childOrFacet = (UIComponent)it.next();
+ childOrFacet.processValidators(context);
+ }
+ }
+ else
+ {
+ processSubFormValidators(this,context);
+ }
}
public void processUpdates(FacesContext context)
@@ -167,27 +167,27 @@
}
}
- private static void resetSubmittedValues(UIComponent comp, FacesContext context)
- {
- for (Iterator it = comp.getFacetsAndChildren(); it.hasNext(); )
- {
- UIComponent childOrFacet = (UIComponent)it.next();
- if (childOrFacet instanceof AbstractSubForm)
- {
- // we are not responsible for this subForm, are we?
- continue;
- }
-
- if (childOrFacet instanceof EditableValueHolder)
- {
- ((EditableValueHolder) childOrFacet).setSubmittedValue(null);
- }
-
- resetSubmittedValues(childOrFacet, context);
- }
- }
+ private static void resetSubmittedValues(UIComponent comp, FacesContext context)
+ {
+ for (Iterator it = comp.getFacetsAndChildren(); it.hasNext(); )
+ {
+ UIComponent childOrFacet = (UIComponent)it.next();
+ if (childOrFacet instanceof AbstractSubForm)
+ {
+ // we are not responsible for this subForm, are we?
+ continue;
+ }
+
+ if (childOrFacet instanceof EditableValueHolder)
+ {
+ ((EditableValueHolder) childOrFacet).setSubmittedValue(null);
+ }
+
+ resetSubmittedValues(childOrFacet, context);
+ }
+ }
- private static void processSubFormUpdates(UIComponent comp, FacesContext context)
+ private static void processSubFormUpdates(UIComponent comp, FacesContext context)
{
for (Iterator it = comp.getFacetsAndChildren(); it.hasNext(); )
{
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/subform/SubFormRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/subform/SubFormRenderer.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/subform/SubFormRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/subform/SubFormRenderer.java Thu Jul 3 14:58:05 2008
@@ -47,7 +47,7 @@
private static final String SUBMIT_FUNCTION_SUFFIX = "_submit";
private static final String HIDDEN_PARAM_NAME = "org.apache.myfaces.custom.subform.submittedId";
-
+
public void encodeBegin(FacesContext context, UIComponent component) throws IOException
{
super.encodeBegin(context, component);
@@ -58,7 +58,7 @@
writer.startElement(HTML.SCRIPT_ELEM, null);
writer.writeAttribute(org.apache.myfaces.shared_tomahawk.renderkit.html.HTML.SCRIPT_TYPE_ATTR, org.apache.myfaces.shared_tomahawk.renderkit.html.HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
- FormInfo parentFormInfo = RendererUtils.findNestingForm(component,context);
+ FormInfo parentFormInfo = RendererUtils.findNestingForm(component,context);
if(parentFormInfo!=null)
{
writer.writeText(createPartialSubmitJS(component.getId(), parentFormInfo.getFormName()), null);
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRenderer.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRenderer.java Thu Jul 3 14:58:05 2008
@@ -450,8 +450,8 @@
String onclickEvent = tab.getAttributes().get(HTML.ONCLICK_ATTR) != null ? (String) tab.getAttributes().get(HTML.ONCLICK_ATTR) : "";
writer.writeAttribute(HTML.ONCLICK_ATTR,
- onclickEvent
- + "return myFaces_showPanelTab("
+ onclickEvent
+ + "return myFaces_showPanelTab("
+tabIndex+",'"+getTabIndexSubmitFieldIDAndName(tabbedPane, facesContext)+"',"
+'\''+getHeaderCellID(tab, facesContext)+"','"+tab.getClientId(facesContext) + TAB_DIV_SUFFIX +"',"
+getHeaderCellsIDsVar(tabbedPane,facesContext)+','+getTabsIDsVar(tabbedPane,facesContext)+','
@@ -494,17 +494,17 @@
classes.append(SUB_HEADER_CELL_CLASS_FIRST);
}
if( renderedIndex == visibleTabCount ){
- classes.append(' ');
- classes.append(SUB_HEADER_CELL_CLASS_LAST);
+ classes.append(' ');
+ classes.append(SUB_HEADER_CELL_CLASS_LAST);
}
if( renderedIndex == visibleTabSelectedIndex ){
- if( activeSubStyleUserClass != null ){
- classes.append(' ');
- classes.append(activeSubStyleUserClass);
- }
+ if( activeSubStyleUserClass != null ){
+ classes.append(' ');
+ classes.append(activeSubStyleUserClass);
+ }
}else if( inactiveSubStyleUserClass != null ){
- classes.append(' ');
- classes.append(inactiveSubStyleUserClass);
+ classes.append(' ');
+ classes.append(inactiveSubStyleUserClass);
}
classes.append(' ');
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java Thu Jul 3 14:58:05 2008
@@ -230,7 +230,7 @@
{
if (walker.next())
{
- encodeTree(context, out, tree, walker);
+ encodeTree(context, out, tree, walker);
}
}
}
@@ -288,7 +288,7 @@
{
if (walker.next())
{
- encodeTree(context, out, tree, walker);
+ encodeTree(context, out, tree, walker);
}
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/TreeModelBase.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/TreeModelBase.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/TreeModelBase.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/TreeModelBase.java Thu Jul 3 14:58:05 2008
@@ -123,8 +123,8 @@
public TreeNode getNodeById(String nodeId)
{
- if (nodeId == null)
- return null;
+ if (nodeId == null)
+ return null;
TreeNode node = null;
StringTokenizer st = new StringTokenizer(nodeId, SEPARATOR);
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/TreeNodeChecked.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/TreeNodeChecked.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/TreeNodeChecked.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/TreeNodeChecked.java Thu Jul 3 14:58:05 2008
@@ -29,38 +29,38 @@
*/
public class TreeNodeChecked extends TreeNodeBase
{
- private static final long serialVersionUID = -3319932828983347196L;
- private boolean checked;
+ private static final long serialVersionUID = -3319932828983347196L;
+ private boolean checked;
- public TreeNodeChecked() {
- super();
- }
-
- public TreeNodeChecked(String type, String description, boolean leaf) {
- super(type, description, leaf);
- }
-
- public TreeNodeChecked(String type, String description, String identifier, boolean leaf) {
- super(type, description, identifier, leaf);
- }
-
- public TreeNodeChecked(String type, String description, boolean checked, boolean leaf) {
- super(type, description, leaf);
- this.checked = checked;
- }
-
- public TreeNodeChecked(String type, String description, String identifier, boolean checked, boolean leaf) {
- super(type, description, identifier, leaf);
- this.checked = checked;
- }
-
-
- public boolean isChecked() {
- return checked;
- }
-
- public void setChecked(boolean checked) {
- this.checked = checked;
- }
+ public TreeNodeChecked() {
+ super();
+ }
+
+ public TreeNodeChecked(String type, String description, boolean leaf) {
+ super(type, description, leaf);
+ }
+
+ public TreeNodeChecked(String type, String description, String identifier, boolean leaf) {
+ super(type, description, identifier, leaf);
+ }
+
+ public TreeNodeChecked(String type, String description, boolean checked, boolean leaf) {
+ super(type, description, leaf);
+ this.checked = checked;
+ }
+
+ public TreeNodeChecked(String type, String description, String identifier, boolean checked, boolean leaf) {
+ super(type, description, identifier, leaf);
+ this.checked = checked;
+ }
+
+
+ public boolean isChecked() {
+ return checked;
+ }
+
+ public void setChecked(boolean checked) {
+ this.checked = checked;
+ }
}
\ No newline at end of file
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTag.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTag.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTag.java Thu Jul 3 14:58:05 2008
@@ -147,9 +147,9 @@
public void release()
{
- _property = null;
- _converter = null;
- _value = null;
+ _property = null;
+ _converter = null;
+ _value = null;
}
}
\ No newline at end of file
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/DateFormatSymbols.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/DateFormatSymbols.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/DateFormatSymbols.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/DateFormatSymbols.java Thu Jul 3 14:58:05 2008
@@ -36,60 +36,60 @@
*/
public class DateFormatSymbols
{
- String[] eras = {"BC", "AD"};
+ String[] eras = {"BC", "AD"};
- String[] months = {
- "January", "February", "March", "April",
+ String[] months = {
+ "January", "February", "March", "April",
"May", "June", "July", "August", "September", "October",
"November", "December", "Undecimber"
};
- String[] shortMonths = {
- "Jan", "Feb", "Mar", "Apr",
+ String[] shortMonths = {
+ "Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep", "Oct",
"Nov", "Dec", "Und"
};
- String[] weekdays = {
- "Sunday", "Monday", "Tuesday",
+ String[] weekdays = {
+ "Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday"
};
- String[] shortWeekdays = {
- "Sun", "Mon", "Tue",
+ String[] shortWeekdays = {
+ "Sun", "Mon", "Tue",
"Wed", "Thu", "Fri", "Sat"
};
- String[] ampms = { "AM", "PM" };
+ String[] ampms = { "AM", "PM" };
- String[] zoneStrings = {
- null, "long-name", "short-name"
- };
+ String[] zoneStrings = {
+ null, "long-name", "short-name"
+ };
- // TODO: move these vars out of this "constant" class.
- Date threshold;
- Date twoDigitYearStart;
+ // TODO: move these vars out of this "constant" class.
+ Date threshold;
+ Date twoDigitYearStart;
- public DateFormatSymbols()
- {
+ public DateFormatSymbols()
+ {
threshold = new Date();
threshold.setYear(threshold.getYear()-80);
this.twoDigitYearStart = threshold;
- }
+ }
- public DateFormatSymbols(Locale l)
- {
- this();
-
- java.text.DateFormatSymbols src = new java.text.DateFormatSymbols(l);
- this.eras = src.getEras();
- this.months = src.getMonths();
- this.shortMonths = src.getShortMonths();
- this.weekdays = src.getWeekdays();
- this.shortWeekdays = src.getShortWeekdays();
- this.ampms = src.getAmPmStrings();
+ public DateFormatSymbols(Locale l)
+ {
+ this();
+
+ java.text.DateFormatSymbols src = new java.text.DateFormatSymbols(l);
+ this.eras = src.getEras();
+ this.months = src.getMonths();
+ this.shortMonths = src.getShortMonths();
+ this.weekdays = src.getWeekdays();
+ this.shortWeekdays = src.getShortWeekdays();
+ this.ampms = src.getAmPmStrings();
- // zoneStrings ??
- }
+ // zoneStrings ??
+ }
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/ParserContext.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/ParserContext.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/ParserContext.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/ParserContext.java Thu Jul 3 14:58:05 2008
@@ -27,95 +27,95 @@
*/
public class ParserContext
{
- /**
- * Set during various string-parsing operations to indicate the
- * offset of the next unparsed character.
- */
- int newIndex;
-
- /**
- * Set during string-parsing operations if a parsing error occurred.
- * Normally, an error status is also returned from the method.
- */
- boolean invalid = false;
-
- /**
- * Controls how "weekYear" and "weekOfWeekYear" map to ymd dates.
- * <p>
- * Values are 0=sunday, 1=monday, 6=saturday (the java.util.Date
- * return values for getDay). Note that java.util.Calendar uses
- * 1=sunday, 2=monday, 7=saturday.
- * <p>
- * This value is a mandatory parameter to the constructor of
- * this class. Normally, callers will pass 1 (the ISO standard).
- */
- int firstDayOfWeek;
-
- /**
- * Set to true if the input string had a year specifier of less
- * than 4 digits, meaning we have to guess the century.
- */
- boolean ambiguousYear;
-
- /**
- * Set to true if the input string had a weekYear specifier of less
- * than 4 digits, meaning we have to guess the century.
- */
- boolean ambiguousWeekYear;
-
- // --------------------------------------------------
- // standard properties parsed out of the input string
- // --------------------------------------------------
-
- /**
- * Year is relative to 0AD, unless ambiguousYear is set.
- */
- int year;
-
- /** Month is in range 0..11 */
- int month;
-
- /** Day is in range 1..31 */
- int day = 1;
-
- /** mon=1, sun=7 */
- int dayOfWeek;
-
- /** The hour value used for formatter "H", in range 00-23. */
- int hour;
-
- /**
- * The hour value used for "h" formatter; in range 1..12.
- * <ul>
- * <li>00:00 is 12:00 am (this field is 12)
- * <li>01:00 is 01:00 am (this field is 1)
- * <li>11:59 is 11:59 am (this field is 11)
- * <li>12:00 is 12:00 pm (this field is 12)
- * <li>13:00 is 01:00 pm (this field is 1)
- * <li>23:59 is 11:59 pm (this field is 11)
- * </ul>
- */
- int hourAmpm;
-
- /** minutes in range 0-59 */
- int min;
-
- /** seconds in range 0-59 */
- int sec;
-
- /** 0 = am, 1 = pm (index into ampm strings in symbols class) */
- int ampm;
-
- /**
- * The year in which the weekOfWeekYear value lies.
- * Note that date yyyy-01-01 may be week 5n of the previous year.
- */
- int weekYear;
-
- /** The week number (1..53). */
- int weekOfWeekYear;
-
- public ParserContext(int dow) {
- firstDayOfWeek = dow;
- }
+ /**
+ * Set during various string-parsing operations to indicate the
+ * offset of the next unparsed character.
+ */
+ int newIndex;
+
+ /**
+ * Set during string-parsing operations if a parsing error occurred.
+ * Normally, an error status is also returned from the method.
+ */
+ boolean invalid = false;
+
+ /**
+ * Controls how "weekYear" and "weekOfWeekYear" map to ymd dates.
+ * <p>
+ * Values are 0=sunday, 1=monday, 6=saturday (the java.util.Date
+ * return values for getDay). Note that java.util.Calendar uses
+ * 1=sunday, 2=monday, 7=saturday.
+ * <p>
+ * This value is a mandatory parameter to the constructor of
+ * this class. Normally, callers will pass 1 (the ISO standard).
+ */
+ int firstDayOfWeek;
+
+ /**
+ * Set to true if the input string had a year specifier of less
+ * than 4 digits, meaning we have to guess the century.
+ */
+ boolean ambiguousYear;
+
+ /**
+ * Set to true if the input string had a weekYear specifier of less
+ * than 4 digits, meaning we have to guess the century.
+ */
+ boolean ambiguousWeekYear;
+
+ // --------------------------------------------------
+ // standard properties parsed out of the input string
+ // --------------------------------------------------
+
+ /**
+ * Year is relative to 0AD, unless ambiguousYear is set.
+ */
+ int year;
+
+ /** Month is in range 0..11 */
+ int month;
+
+ /** Day is in range 1..31 */
+ int day = 1;
+
+ /** mon=1, sun=7 */
+ int dayOfWeek;
+
+ /** The hour value used for formatter "H", in range 00-23. */
+ int hour;
+
+ /**
+ * The hour value used for "h" formatter; in range 1..12.
+ * <ul>
+ * <li>00:00 is 12:00 am (this field is 12)
+ * <li>01:00 is 01:00 am (this field is 1)
+ * <li>11:59 is 11:59 am (this field is 11)
+ * <li>12:00 is 12:00 pm (this field is 12)
+ * <li>13:00 is 01:00 pm (this field is 1)
+ * <li>23:59 is 11:59 pm (this field is 11)
+ * </ul>
+ */
+ int hourAmpm;
+
+ /** minutes in range 0-59 */
+ int min;
+
+ /** seconds in range 0-59 */
+ int sec;
+
+ /** 0 = am, 1 = pm (index into ampm strings in symbols class) */
+ int ampm;
+
+ /**
+ * The year in which the weekOfWeekYear value lies.
+ * Note that date yyyy-01-01 may be week 5n of the previous year.
+ */
+ int weekYear;
+
+ /** The week number (1..53). */
+ int weekOfWeekYear;
+
+ public ParserContext(int dow) {
+ firstDayOfWeek = dow;
+ }
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/SimpleDateFormatter.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/SimpleDateFormatter.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/SimpleDateFormatter.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/SimpleDateFormatter.java Thu Jul 3 14:58:05 2008
@@ -791,7 +791,7 @@
{
// TODO: maybe this adjustment could be made while parsing?
- context.year += 1900;
+ context.year += 1900;
Date date = createDateFromContext(context);
Date threshold = symbols.twoDigitYearStart;
if (date.getTime() < threshold.getTime())
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/WeekDate.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/WeekDate.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/WeekDate.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/WeekDate.java Thu Jul 3 14:58:05 2008
@@ -35,11 +35,11 @@
public int getYear()
{
- return year;
+ return year;
}
public int getWeek()
{
- return week;
+ return week;
}
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonRenderer.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonRenderer.java Thu Jul 3 14:58:05 2008
@@ -40,19 +40,19 @@
extends ExtendedHtmlButtonRenderer
{
protected void addHiddenCommandParameter(FacesContext facesContext, UIComponent nestingForm, String hiddenFieldName)
- {
- if (nestingForm != null)
+ {
+ if (nestingForm != null)
{
- super.addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
+ super.addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
}
- else
- {
+ else
+ {
DummyFormUtils.addDummyFormParameter(facesContext, hiddenFieldName);
- }
- }
+ }
+ }
protected FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
{
- return DummyFormUtils.findNestingForm(uiComponent, facesContext);
+ return DummyFormUtils.findNestingForm(uiComponent, facesContext);
}
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlGroupRenderer.java Thu Jul 3 14:58:05 2008
@@ -44,8 +44,8 @@
public class HtmlGroupRenderer
extends HtmlGroupRendererBase
{
-
- public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+
+ public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
boolean span = false;
String element = getHtmlElement(component);
@@ -74,14 +74,14 @@
writer.endElement(element);
}
}
-
- private String getHtmlElement(UIComponent component) {
- if (component instanceof HtmlPanelGroup) {
- HtmlPanelGroup group = (HtmlPanelGroup) component;
- if (HtmlPanelGroup.BLOCK_LAYOUT.equals(group.getLayout())) {
- return HTML.DIV_ELEM;
- }
- }
- return HTML.SPAN_ELEM;
- }
+
+ private String getHtmlElement(UIComponent component) {
+ if (component instanceof HtmlPanelGroup) {
+ HtmlPanelGroup group = (HtmlPanelGroup) component;
+ if (HtmlPanelGroup.BLOCK_LAYOUT.equals(group.getLayout())) {
+ return HTML.DIV_ELEM;
+ }
+ }
+ return HTML.SPAN_ELEM;
+ }
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlImageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlImageRenderer.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlImageRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlImageRenderer.java Thu Jul 3 14:58:05 2008
@@ -34,7 +34,7 @@
public class HtmlImageRenderer
extends HtmlImageRendererBase
{
-
-
-
+
+
+
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/jsf/ExtendedHtmlButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/jsf/ExtendedHtmlButtonRenderer.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/jsf/ExtendedHtmlButtonRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/jsf/ExtendedHtmlButtonRenderer.java Thu Jul 3 14:58:05 2008
@@ -36,19 +36,19 @@
extends HtmlButtonRendererBase
{
protected void addHiddenCommandParameter(FacesContext facesContext, UIComponent nestingForm, String hiddenFieldName)
- {
- if (nestingForm != null)
+ {
+ if (nestingForm != null)
{
- super.addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
+ super.addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
}
- else
- {
+ else
+ {
DummyFormUtils.addDummyFormParameter(facesContext, hiddenFieldName);
- }
- }
+ }
+ }
protected FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
{
- return DummyFormUtils.findNestingForm(uiComponent, facesContext);
+ return DummyFormUtils.findNestingForm(uiComponent, facesContext);
}
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/jsf/ExtendedHtmlLinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/jsf/ExtendedHtmlLinkRenderer.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/jsf/ExtendedHtmlLinkRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/jsf/ExtendedHtmlLinkRenderer.java Thu Jul 3 14:58:05 2008
@@ -34,20 +34,20 @@
public class ExtendedHtmlLinkRenderer
extends HtmlLinkRendererBase
{
- protected void addHiddenCommandParameter(FacesContext facesContext, UIComponent nestingForm, String hiddenFieldName)
- {
- if (nestingForm != null)
- {
- super.addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
- }
- else
- {
- DummyFormUtils.addDummyFormParameter(facesContext, hiddenFieldName);
- }
- }
-
- protected FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
- {
- return DummyFormUtils.findNestingForm(uiComponent, facesContext);
- }
+ protected void addHiddenCommandParameter(FacesContext facesContext, UIComponent nestingForm, String hiddenFieldName)
+ {
+ if (nestingForm != null)
+ {
+ super.addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
+ }
+ else
+ {
+ DummyFormUtils.addDummyFormParameter(facesContext, hiddenFieldName);
+ }
+ }
+
+ protected FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
+ {
+ return DummyFormUtils.findNestingForm(uiComponent, facesContext);
+ }
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResource.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResource.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResource.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResource.java Thu Jul 3 14:58:05 2008
@@ -35,11 +35,11 @@
*/
public interface AddResource
{
- public static final ResourcePosition HEADER_BEGIN = new ResourcePosition(0);
+ public static final ResourcePosition HEADER_BEGIN = new ResourcePosition(0);
- public static final ResourcePosition BODY_END = new ResourcePosition(1);
+ public static final ResourcePosition BODY_END = new ResourcePosition(1);
- public static final ResourcePosition BODY_ONLOAD = new ResourcePosition(2);
+ public static final ResourcePosition BODY_ONLOAD = new ResourcePosition(2);
// Methods to add resources
@@ -179,7 +179,7 @@
* @deprecated just to help to workaround a dojo bug
*/
public void addJavaScriptAtPositionPlain(FacesContext context, ResourcePosition position,
- Class myfacesCustomComponent, String resourceName);
+ Class myfacesCustomComponent, String resourceName);
/**
* Adds the given Style Sheet at the specified document position.
@@ -294,17 +294,17 @@
/**
* return true if you require the complete response buffered
*/
- public boolean requiresBuffer();
+ public boolean requiresBuffer();
- /**
- * called when the response start
- */
- public void responseStarted();
-
- /**
- * called when the response has finished
- */
- public void responseFinished();
+ /**
+ * called when the response start
+ */
+ public void responseStarted();
+
+ /**
+ * called when the response has finished
+ */
+ public void responseFinished();
/**
* check there is something to write to the header
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java Thu Jul 3 14:58:05 2008
@@ -53,145 +53,145 @@
*/
public class AddResourceFactory
{
- public static class RequestMapWrapper implements Map
- {
- private final HttpServletRequest request;
-
- public RequestMapWrapper(final HttpServletRequest request)
- {
- this.request = request;
- }
-
- public int size()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isEmpty()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean containsKey(Object key)
- {
- if (key == null)
- {
- throw new UnsupportedOperationException(
- "'null' key not supported");
- }
- return request.getAttribute(key.toString()) != null;
- }
-
- public boolean containsValue(Object value)
- {
- throw new UnsupportedOperationException();
- }
-
- public Object get(Object key)
- {
- if (key == null)
- {
- throw new UnsupportedOperationException(
- "'null' key not supported");
- }
- return request.getAttribute(key.toString());
- }
-
- public Object put(Object key, Object value)
- {
- if (key == null)
- {
- throw new UnsupportedOperationException(
- "'null' key not supported");
- }
-
- Object old = request.getAttribute(key.toString());
- request.setAttribute(key.toString(), value);
- return old;
- }
-
- public Object remove(Object key)
- {
- if (key == null)
- {
- throw new UnsupportedOperationException(
- "'null' key not supported");
- }
-
- Object old = request.getAttribute(key.toString());
- request.removeAttribute(key.toString());
- return old;
- }
-
- public void putAll(Map arg)
- {
- throw new UnsupportedOperationException();
- }
-
- public void clear()
- {
- throw new UnsupportedOperationException();
- }
-
- public Set keySet()
- {
- throw new UnsupportedOperationException();
- }
-
- public Collection values()
- {
- throw new UnsupportedOperationException();
- }
-
- public Set entrySet()
- {
- throw new UnsupportedOperationException();
- }
-
- }
-
- protected static final Log log = LogFactory
- .getLog(AddResourceFactory.class);
-
- private final static String CACHE_MAP_KEY = "org.apache.myfaces.AddResourceFactory.CACHE_MAP_KEY";
- private final static String ENV_CHECKED_KEY = "org.apache.myfaces.AddResourceFactory.ENV_CHECKED_KEY";
-
- /**
- * Internal factory method. <p/> Return an instance of AddResource keyed by
- * context path, or create one if no such instance already exists. The
- * instance will be cached using the given Map, most likely this will the
- * the request map of your servlet request. Therefore every request uses its
- * own AddResource instance.
- * </p>
- * <p/> Note that this method is package-scope for the purposes of
- * unit-testing only. This method should be treated as private by non-test
- * code.
- * </p>
- *
- * @param cacheMap
- * the map used for caching of the instance. if null, a new
- * instance will be created all the time (for tests)
- * @param contextPath
- * context path of your web-app
- * @param addResourceClassName
- * class name of a class implementing the
- * @link AddResource interface
- */
- static AddResource getInstance(Object context, Map cacheMap, String contextPath,
- String addResourceClassName)
- {
- AddResource instance = null;
-
- if (cacheMap != null)
- {
- instance = (AddResource) cacheMap.get(CACHE_MAP_KEY);
- }
-
- if (instance == null)
- {
- if (addResourceClassName == null)
- {
- // For efficiency don't use reflection unless it is necessary
+ public static class RequestMapWrapper implements Map
+ {
+ private final HttpServletRequest request;
+
+ public RequestMapWrapper(final HttpServletRequest request)
+ {
+ this.request = request;
+ }
+
+ public int size()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isEmpty()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean containsKey(Object key)
+ {
+ if (key == null)
+ {
+ throw new UnsupportedOperationException(
+ "'null' key not supported");
+ }
+ return request.getAttribute(key.toString()) != null;
+ }
+
+ public boolean containsValue(Object value)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object get(Object key)
+ {
+ if (key == null)
+ {
+ throw new UnsupportedOperationException(
+ "'null' key not supported");
+ }
+ return request.getAttribute(key.toString());
+ }
+
+ public Object put(Object key, Object value)
+ {
+ if (key == null)
+ {
+ throw new UnsupportedOperationException(
+ "'null' key not supported");
+ }
+
+ Object old = request.getAttribute(key.toString());
+ request.setAttribute(key.toString(), value);
+ return old;
+ }
+
+ public Object remove(Object key)
+ {
+ if (key == null)
+ {
+ throw new UnsupportedOperationException(
+ "'null' key not supported");
+ }
+
+ Object old = request.getAttribute(key.toString());
+ request.removeAttribute(key.toString());
+ return old;
+ }
+
+ public void putAll(Map arg)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set keySet()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Collection values()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set entrySet()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ }
+
+ protected static final Log log = LogFactory
+ .getLog(AddResourceFactory.class);
+
+ private final static String CACHE_MAP_KEY = "org.apache.myfaces.AddResourceFactory.CACHE_MAP_KEY";
+ private final static String ENV_CHECKED_KEY = "org.apache.myfaces.AddResourceFactory.ENV_CHECKED_KEY";
+
+ /**
+ * Internal factory method. <p/> Return an instance of AddResource keyed by
+ * context path, or create one if no such instance already exists. The
+ * instance will be cached using the given Map, most likely this will the
+ * the request map of your servlet request. Therefore every request uses its
+ * own AddResource instance.
+ * </p>
+ * <p/> Note that this method is package-scope for the purposes of
+ * unit-testing only. This method should be treated as private by non-test
+ * code.
+ * </p>
+ *
+ * @param cacheMap
+ * the map used for caching of the instance. if null, a new
+ * instance will be created all the time (for tests)
+ * @param contextPath
+ * context path of your web-app
+ * @param addResourceClassName
+ * class name of a class implementing the
+ * @link AddResource interface
+ */
+ static AddResource getInstance(Object context, Map cacheMap, String contextPath,
+ String addResourceClassName)
+ {
+ AddResource instance = null;
+
+ if (cacheMap != null)
+ {
+ instance = (AddResource) cacheMap.get(CACHE_MAP_KEY);
+ }
+
+ if (instance == null)
+ {
+ if (addResourceClassName == null)
+ {
+ // For efficiency don't use reflection unless it is necessary
if(context instanceof PortletContext) {
instance = new NonBufferingAddResource();
instance.setContextPath(contextPath);
@@ -201,105 +201,105 @@
instance.setContextPath(contextPath);
}
}
- else
- {
- try
- {
- Class addResourceClass = ClassUtils
- .classForName(addResourceClassName);
-
- if (AddResource.class.isAssignableFrom(addResourceClass))
- {
- AddResource tmpInstance = (AddResource) addResourceClass
- .newInstance();
- tmpInstance.setContextPath(contextPath);
-
- // only use a fully initialized instance
- instance = tmpInstance;
- }
- else
- {
- log
- .error("Invalid AddResource class ("
- + addResourceClass.getName()
- + "). Must implement the AddResource interface.");
- }
- }
- catch (ClassNotFoundException e)
- {
- log
- .error(
- "AddResource class not found. Using default class instead",
- e);
- }
- catch (IllegalArgumentException e)
- {
- // This should not happen as the constructor has been
- // checked
- log.error(e);
- }
- catch (InstantiationException e)
- {
- log.error(
- "Invalid AddResource class. Must be non-abstract", e);
- }
- catch (IllegalAccessException e)
- {
- log.error("Could not access AddResource class", e);
- }
- finally
- {
- // Ensure there is always an AddResource object available
- if (instance == null)
- {
- instance = new DefaultAddResource();
- instance.setContextPath(contextPath);
- }
- }
- }
-
- if (cacheMap != null)
- {
- cacheMap.put(CACHE_MAP_KEY, instance);
- }
- }
+ else
+ {
+ try
+ {
+ Class addResourceClass = ClassUtils
+ .classForName(addResourceClassName);
+
+ if (AddResource.class.isAssignableFrom(addResourceClass))
+ {
+ AddResource tmpInstance = (AddResource) addResourceClass
+ .newInstance();
+ tmpInstance.setContextPath(contextPath);
+
+ // only use a fully initialized instance
+ instance = tmpInstance;
+ }
+ else
+ {
+ log
+ .error("Invalid AddResource class ("
+ + addResourceClass.getName()
+ + "). Must implement the AddResource interface.");
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ log
+ .error(
+ "AddResource class not found. Using default class instead",
+ e);
+ }
+ catch (IllegalArgumentException e)
+ {
+ // This should not happen as the constructor has been
+ // checked
+ log.error(e);
+ }
+ catch (InstantiationException e)
+ {
+ log.error(
+ "Invalid AddResource class. Must be non-abstract", e);
+ }
+ catch (IllegalAccessException e)
+ {
+ log.error("Could not access AddResource class", e);
+ }
+ finally
+ {
+ // Ensure there is always an AddResource object available
+ if (instance == null)
+ {
+ instance = new DefaultAddResource();
+ instance.setContextPath(contextPath);
+ }
+ }
+ }
+
+ if (cacheMap != null)
+ {
+ cacheMap.put(CACHE_MAP_KEY, instance);
+ }
+ }
- return instance;
- }
+ return instance;
+ }
- public static AddResource getInstance(FacesContext context)
- {
+ public static AddResource getInstance(FacesContext context)
+ {
ExternalContext externalContext = context
- .getExternalContext();
+ .getExternalContext();
AddResource addResource = getInstance(externalContext.getContext(), externalContext.getRequestMap(),
externalContext.getRequestContextPath(), MyfacesConfig
- .getCurrentInstance(externalContext)
- .getAddResourceClass());
- checkEnvironment(context, addResource);
- return addResource;
- }
-
- /**
- * @deprecated use getInstance(HttpServletRequest request, ServletContext servletContext) instead
- */
- public static AddResource getInstance(HttpServletRequest request)
- {
- ServletContext servletContext = request
- .getSession().getServletContext();
- Map requestMap = new RequestMapWrapper(request);
- AddResource addResource = getInstance(servletContext, requestMap, request
- .getContextPath(), MyfacesConfig
- .getAddResourceClassFromServletContext(servletContext));
- //
- // this will be called by the ExtensionsFilter itself, so no need to
- // check the environment
- //
- return addResource;
- }
-
- public static AddResource getInstance(HttpServletRequest request, ServletContext servletContext)
- {
+ .getCurrentInstance(externalContext)
+ .getAddResourceClass());
+ checkEnvironment(context, addResource);
+ return addResource;
+ }
+
+ /**
+ * @deprecated use getInstance(HttpServletRequest request, ServletContext servletContext) instead
+ */
+ public static AddResource getInstance(HttpServletRequest request)
+ {
+ ServletContext servletContext = request
+ .getSession().getServletContext();
+ Map requestMap = new RequestMapWrapper(request);
+ AddResource addResource = getInstance(servletContext, requestMap, request
+ .getContextPath(), MyfacesConfig
+ .getAddResourceClassFromServletContext(servletContext));
+ //
+ // this will be called by the ExtensionsFilter itself, so no need to
+ // check the environment
+ //
+ return addResource;
+ }
+
+ public static AddResource getInstance(HttpServletRequest request, ServletContext servletContext)
+ {
Map requestMap = new RequestMapWrapper(request);
AddResource addResource = getInstance(servletContext, requestMap, request
.getContextPath(), MyfacesConfig
@@ -308,22 +308,22 @@
// this will be called by the ExtensionsFilter itself, so no need to
// check the environment
//
- return addResource;
- }
+ return addResource;
+ }
- /**
- * check if the extensionsFilter has been correctly setup.
- */
- private static void checkEnvironment(FacesContext context, AddResource addResource)
- {
- ExternalContext extctx = context.getExternalContext();
+ /**
+ * check if the extensionsFilter has been correctly setup.
+ */
+ private static void checkEnvironment(FacesContext context, AddResource addResource)
+ {
+ ExternalContext extctx = context.getExternalContext();
//a check for a servlet-filter only makes sense in a servlet-environment....
//attention: checking for servlet-response doesn't work here - quite often, the portlet-response
//is implemented as a servlet-response, and therefore the check is implemented inversely
-
- //if(extctx.getResponse() instanceof PortletResponse) {
- if(ExternalContextUtils.getRequestType(extctx).isPortlet()) {
+
+ //if(extctx.getResponse() instanceof PortletResponse) {
+ if(ExternalContextUtils.getRequestType(extctx).isPortlet()) {
return;
}
@@ -373,20 +373,20 @@
}
protected static boolean checkFilterPattern(ExternalContext extCtxt, FilterMapping filterMapping)
- {
- if (filterMapping.getUrlPattern() != null &&
+ {
+ if (filterMapping.getUrlPattern() != null &&
("/faces/*".equals(filterMapping.getUrlPattern()) ||
(MyfacesConfig.getCurrentInstance(extCtxt).getResourceVirtualPath()+"/*").equals(filterMapping.getUrlPattern())))
- {
- return true;
- }
-
- return false;
- }
-
- private static void throwExtensionsFilterMissing(String detailReason)
- {
- throw new IllegalStateException(
- "ExtensionsFilter not correctly configured. " + detailReason + " Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html");
- }
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private static void throwExtensionsFilterMissing(String detailReason)
+ {
+ throw new IllegalStateException(
+ "ExtensionsFilter not correctly configured. " + detailReason + " Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html");
+ }
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java Thu Jul 3 14:58:05 2008
@@ -39,9 +39,9 @@
public class AutoScrollPhaseListener
implements PhaseListener
{
- private static final long serialVersionUID = -1087143949215838058L;
+ private static final long serialVersionUID = -1087143949215838058L;
- public PhaseId getPhaseId()
+ public PhaseId getPhaseId()
{
return PhaseId.RESTORE_VIEW;
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultResourceProvider.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultResourceProvider.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultResourceProvider.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultResourceProvider.java Thu Jul 3 14:58:05 2008
@@ -32,41 +32,41 @@
*/
public class DefaultResourceProvider implements ResourceProvider
{
- private final Class clazz;
+ private final Class clazz;
- public DefaultResourceProvider(Class clazz)
- {
- this.clazz = clazz;
- }
-
- protected URL getResource(String resource)
- {
- resource = "resource/" + resource;
- return clazz.getResource(resource);
- }
-
- public boolean exists(ServletContext context, String resource)
- {
- return getResource(resource) != null;
- }
-
- public long getLastModified(ServletContext context, String resource) throws IOException
- {
- return getResource(resource).openConnection().getLastModified();
- }
-
- public int getContentLength(ServletContext context, String resource) throws IOException
- {
- return getResource(resource).openConnection().getContentLength();
- }
-
- public InputStream getInputStream(ServletContext context, String resource) throws IOException
- {
- return getResource(resource).openConnection().getInputStream();
- }
-
- public String getEncoding(ServletContext context, String resource) throws IOException
- {
- return null; //Tomahawk-877, this has to be null for now to avoid encoding issues
- }
+ public DefaultResourceProvider(Class clazz)
+ {
+ this.clazz = clazz;
+ }
+
+ protected URL getResource(String resource)
+ {
+ resource = "resource/" + resource;
+ return clazz.getResource(resource);
+ }
+
+ public boolean exists(ServletContext context, String resource)
+ {
+ return getResource(resource) != null;
+ }
+
+ public long getLastModified(ServletContext context, String resource) throws IOException
+ {
+ return getResource(resource).openConnection().getLastModified();
+ }
+
+ public int getContentLength(ServletContext context, String resource) throws IOException
+ {
+ return getResource(resource).openConnection().getContentLength();
+ }
+
+ public InputStream getInputStream(ServletContext context, String resource) throws IOException
+ {
+ return getResource(resource).openConnection().getInputStream();
+ }
+
+ public String getEncoding(ServletContext context, String resource) throws IOException
+ {
+ return null; //Tomahawk-877, this has to be null for now to avoid encoding issues
+ }
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ExtensionsPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ExtensionsPhaseListener.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ExtensionsPhaseListener.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ExtensionsPhaseListener.java Thu Jul 3 14:58:05 2008
@@ -123,9 +123,9 @@
* @throws IOException Exception if writing to the output-stream fails.
*/
public static void writeCodeBeforeBodyEnd(FacesContext facesContext) throws IOException
- {
- ResponseWriter writer = facesContext.getResponseWriter();
-
+ {
+ ResponseWriter writer = facesContext.getResponseWriter();
+
MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(facesContext.getExternalContext());
if (myfacesConfig.isDetectJavascript())
{
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java Thu Jul 3 14:58:05 2008
@@ -109,7 +109,7 @@
public void serveResource(ServletContext context, HttpServletRequest request,
HttpServletResponse response, String resourceUri) throws IOException
{
- String[] uriParts = resourceUri.split("/", 2);
+ String[] uriParts = resourceUri.split("/", 2);
String component = uriParts[0];
if (component == null || component.trim().length() == 0)
@@ -143,34 +143,34 @@
try
{
- ResourceProvider resourceProvider;
- if (ResourceProvider.class.isAssignableFrom(componentClass))
- {
- try
- {
- resourceProvider = (ResourceProvider) componentClass.newInstance();
- }
- catch (InstantiationException e)
- {
- response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Unable to instantiate resource provider for resource "
- + resource + " for component " + component);
- log.error("Unable to instantiate resource provider for resource " + resource + " for component " + component, e);
- return;
- }
- catch (IllegalAccessException e)
- {
- response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Unable to instantiate resource provider for resource "
- + resource + " for component " + component);
- log.error("Unable to instantiate resource provider for resource " + resource + " for component " + component, e);
- return;
- }
- }
- else
- {
- resourceProvider = new DefaultResourceProvider(componentClass);
- }
+ ResourceProvider resourceProvider;
+ if (ResourceProvider.class.isAssignableFrom(componentClass))
+ {
+ try
+ {
+ resourceProvider = (ResourceProvider) componentClass.newInstance();
+ }
+ catch (InstantiationException e)
+ {
+ response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Unable to instantiate resource provider for resource "
+ + resource + " for component " + component);
+ log.error("Unable to instantiate resource provider for resource " + resource + " for component " + component, e);
+ return;
+ }
+ catch (IllegalAccessException e)
+ {
+ response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Unable to instantiate resource provider for resource "
+ + resource + " for component " + component);
+ log.error("Unable to instantiate resource provider for resource " + resource + " for component " + component, e);
+ return;
+ }
+ }
+ else
+ {
+ resourceProvider = new DefaultResourceProvider(componentClass);
+ }
- if (!resourceProvider.exists(context, resource))
+ if (!resourceProvider.exists(context, resource))
{
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unable to find resource "
+ resource + " for component " + component
@@ -182,49 +182,49 @@
}
else
{
- // URLConnection con = url.openConnection();
+ // URLConnection con = url.openConnection();
- long lastModified = resourceProvider.getLastModified(context, resource);
- if (lastModified < 1)
- {
- // fallback
- lastModified = getLastModified();
- }
-
- long browserDate = request.getDateHeader("If-Modified-Since");
- if (browserDate > -1)
- {
- // normalize to seconds - this should work with any os
- lastModified = (lastModified / 1000) * 1000;
- browserDate = (browserDate / 1000) * 1000;
-
- if (lastModified == browserDate)
- {
- // the browser already has the correct version
-
- response.setStatus(HttpURLConnection.HTTP_NOT_MODIFIED);
- return;
- }
- }
+ long lastModified = resourceProvider.getLastModified(context, resource);
+ if (lastModified < 1)
+ {
+ // fallback
+ lastModified = getLastModified();
+ }
+
+ long browserDate = request.getDateHeader("If-Modified-Since");
+ if (browserDate > -1)
+ {
+ // normalize to seconds - this should work with any os
+ lastModified = (lastModified / 1000) * 1000;
+ browserDate = (browserDate / 1000) * 1000;
+
+ if (lastModified == browserDate)
+ {
+ // the browser already has the correct version
+
+ response.setStatus(HttpURLConnection.HTTP_NOT_MODIFIED);
+ return;
+ }
+ }
- int contentLength = resourceProvider.getContentLength(context, resource);
- String contentEncoding = resourceProvider.getEncoding(context, resource);
+ int contentLength = resourceProvider.getContentLength(context, resource);
+ String contentEncoding = resourceProvider.getEncoding(context, resource);
- is = resourceProvider.getInputStream(context, resource);
+ is = resourceProvider.getInputStream(context, resource);
- defineContentHeaders(request, response, resource, contentLength, contentEncoding);
+ defineContentHeaders(request, response, resource, contentLength, contentEncoding);
defineCaching(request, response, resource, lastModified);
writeResource(request, response, is);
}
}
finally
{
- // nothing to do here..
+ // nothing to do here..
}
}
- /**
+ /**
* Copy the content of the specified input stream to the servlet response.
*/
protected void writeResource(HttpServletRequest request, HttpServletResponse response,
@@ -238,28 +238,28 @@
{
out.write(buffer, 0, size);
}
- out.flush();
+ out.flush();
}
catch(IOException e)
{
- // This happens sometimes with Microsft Internet Explorer. It would
- // appear (guess) that when javascript creates multiple dom nodes
- // referring to the same remote resource then IE stupidly opens
- // multiple sockets and requests that resource multiple times. But
- // when the first request completes, it then realises its stupidity
- // and forcibly closes all the other sockets. But here we are trying
- // to service those requests, and so get a "broken pipe" failure
- // on write. The only thing to do here is to silently ignore the issue,
- // ie suppress the exception. Note that it is also possible for the
- // above code to succeed (ie this exception clause is not run) but
- // for a later flush to get the "broken pipe"; this is either due
- // just to timing, or possibly IE is closing sockets after receiving
- // a complete file for some types (gif?) rather than waiting for the
- // server to close it. We throw a special exception here to inform
- // callers that they should NOT flush anything - though that is
- // dangerous no matter what IOException subclass is thrown.
- log.debug("Unable to send resource data to client", e);
- throw new ResourceLoader.ClosedSocketException();
+ // This happens sometimes with Microsft Internet Explorer. It would
+ // appear (guess) that when javascript creates multiple dom nodes
+ // referring to the same remote resource then IE stupidly opens
+ // multiple sockets and requests that resource multiple times. But
+ // when the first request completes, it then realises its stupidity
+ // and forcibly closes all the other sockets. But here we are trying
+ // to service those requests, and so get a "broken pipe" failure
+ // on write. The only thing to do here is to silently ignore the issue,
+ // ie suppress the exception. Note that it is also possible for the
+ // above code to succeed (ie this exception clause is not run) but
+ // for a later flush to get the "broken pipe"; this is either due
+ // just to timing, or possibly IE is closing sockets after receiving
+ // a complete file for some types (gif?) rather than waiting for the
+ // server to close it. We throw a special exception here to inform
+ // callers that they should NOT flush anything - though that is
+ // dangerous no matter what IOException subclass is thrown.
+ log.debug("Unable to send resource data to client", e);
+ throw new ResourceLoader.ClosedSocketException();
}
}
@@ -281,9 +281,9 @@
expires.add(Calendar.DAY_OF_YEAR, 7);
response.setDateHeader("Expires", expires.getTimeInMillis());
- //12 hours: 43200 = 60s * 60 * 12
- response.setHeader("Cache-Control", "max-age=43200");
- response.setHeader("Pragma", "");
+ //12 hours: 43200 = 60s * 60 * 12
+ response.setHeader("Cache-Control", "max-age=43200");
+ response.setHeader("Pragma", "");
}
/**
@@ -291,24 +291,24 @@
* The mime-type output is determined by the resource filename suffix.
*/
protected void defineContentHeaders(HttpServletRequest request, HttpServletResponse response,
- String resource, int contentLength, String contentEncoding)
+ String resource, int contentLength, String contentEncoding)
{
- String charset = "";
- if (contentEncoding != null)
- {
- charset = "; charset=" + contentEncoding;
- }
- if (contentLength > -1)
- {
- response.setContentLength(contentLength);
- }
+ String charset = "";
+ if (contentEncoding != null)
+ {
+ charset = "; charset=" + contentEncoding;
+ }
+ if (contentLength > -1)
+ {
+ response.setContentLength(contentLength);
+ }
- if (resource.endsWith(".js"))
+ if (resource.endsWith(".js"))
response.setContentType(
- org.apache.myfaces.shared_tomahawk.renderkit.html.HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT + charset);
+ org.apache.myfaces.shared_tomahawk.renderkit.html.HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT + charset);
else if (resource.endsWith(".css"))
response.setContentType(
- org.apache.myfaces.shared_tomahawk.renderkit.html.HTML.STYLE_TYPE_TEXT_CSS + charset);
+ org.apache.myfaces.shared_tomahawk.renderkit.html.HTML.STYLE_TYPE_TEXT_CSS + charset);
else if (resource.endsWith(".gif"))
response.setContentType("image/gif");
else if (resource.endsWith(".png"))
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/NonBufferingAddResource.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/NonBufferingAddResource.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/NonBufferingAddResource.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/NonBufferingAddResource.java Thu Jul 3 14:58:05 2008
@@ -455,7 +455,7 @@
*/
protected long getCacheKey(FacesContext context)
{
- // cache key is hold in application scope so it is recreated on redeploying the webapp.
+ // cache key is hold in application scope so it is recreated on redeploying the webapp.
Map applicationMap = context.getExternalContext().getApplicationMap();
Long cacheKey = (Long) applicationMap.get(RESOURCES_CACHE_KEY);
if (cacheKey == null)
@@ -555,8 +555,8 @@
}
catch (ResourceLoader.ClosedSocketException e)
{
- // The ResourceLoader was unable to send the data because the client closed
- // the socket on us; just ignore.
+ // The ResourceLoader was unable to send the data because the client closed
+ // the socket on us; just ignore.
}
catch (ClassNotFoundException e)
{
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ReducedHTMLParser.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ReducedHTMLParser.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ReducedHTMLParser.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ReducedHTMLParser.java Thu Jul 3 14:58:05 2008
@@ -294,11 +294,11 @@
}
else
{
- if (escaping)
- {
+ if (escaping)
+ {
stringBuf.append('\\');
- escaping = false;
- }
+ escaping = false;
+ }
stringBuf.append(c);
}
@@ -634,7 +634,7 @@
int maxLength = 30;
int end = _seq.length();
if (end - _offset > maxLength) {
- end = _offset + maxLength;
+ end = _offset + maxLength;
}
return _seq.subSequence(_offset, end).toString();
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourceLoader.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourceLoader.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourceLoader.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourceLoader.java Thu Jul 3 14:58:05 2008
@@ -33,16 +33,16 @@
*/
public interface ResourceLoader
{
- /**
- * Define an exception for reporting when a client requests a resource, but
- * then closes its socket before we finish sending it. In this case, the normal
- * behaviour is to not report an error; there is nothing wrong on this end.
- */
- public static class ClosedSocketException extends IOException
- {
- }
+ /**
+ * Define an exception for reporting when a client requests a resource, but
+ * then closes its socket before we finish sending it. In this case, the normal
+ * behaviour is to not report an error; there is nothing wrong on this end.
+ */
+ public static class ClosedSocketException extends IOException
+ {
+ }
- /**
+ /**
* Called by AddResource to render external resource data
* @param context TODO
* @param request the request
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourcePosition.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourcePosition.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourcePosition.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourcePosition.java Thu Jul 3 14:58:05 2008
@@ -20,8 +20,8 @@
public class ResourcePosition
{
-
- private final int _pos;
+
+ private final int _pos;
protected ResourcePosition(int pos)
{
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourceProvider.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourceProvider.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourceProvider.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ResourceProvider.java Thu Jul 3 14:58:05 2008
@@ -30,28 +30,28 @@
*/
public interface ResourceProvider
{
- /**
- * check if the resource exists
- */
- public boolean exists(ServletContext context, String resource);
+ /**
+ * check if the resource exists
+ */
+ public boolean exists(ServletContext context, String resource);
- /**
- * get the content length of the resource
- */
- public int getContentLength(ServletContext context, String resource) throws IOException;
+ /**
+ * get the content length of the resource
+ */
+ public int getContentLength(ServletContext context, String resource) throws IOException;
- /**
- * get the last modified time of the resource
- */
- public long getLastModified(ServletContext context, String resource) throws IOException;
+ /**
+ * get the last modified time of the resource
+ */
+ public long getLastModified(ServletContext context, String resource) throws IOException;
- /**
- * get the input stream of the resource
- */
- public InputStream getInputStream(ServletContext context, String resource) throws IOException;
+ /**
+ * get the input stream of the resource
+ */
+ public InputStream getInputStream(ServletContext context, String resource) throws IOException;
- /**
- * get resource encoding
- */
- public String getEncoding(ServletContext context, String resource) throws IOException;
+ /**
+ * get resource encoding
+ */
+ public String getEncoding(ServletContext context, String resource) throws IOException;
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java Thu Jul 3 14:58:05 2008
@@ -84,11 +84,11 @@
/** the orientation of the newspaper table - horizontal/vertical */
private String _newspaperOrientation = null;
- private String _embedded = null;
- private String _detailStampExpandedDefault = null;
- private String _detailStampLocation = null;
+ private String _embedded = null;
+ private String _detailStampExpandedDefault = null;
+ private String _detailStampLocation = null;
- public void release()
+ public void release()
{
super.release();
@@ -130,10 +130,10 @@
_bodyStyle = null;
_bodyStyleClass = null;
- _embedded = null;
- _detailStampExpandedDefault = null;
- _detailStampLocation = null;
- }
+ _embedded = null;
+ _detailStampExpandedDefault = null;
+ _detailStampLocation = null;
+ }
protected void setProperties(UIComponent component)
{
@@ -177,9 +177,9 @@
setIntegerProperty(component, HtmlDataTable.NEWSPAPER_COLUMNS_PROPERTY, _newspaperColumns);
setStringProperty(component, HtmlDataTable.NEWSPAPER_ORIENTATION_PROPERTY, _newspaperOrientation);
- setBooleanProperty(component, "embedded", _embedded);
- setBooleanProperty(component, "detailStampExpandedDefault", _detailStampExpandedDefault);
- setStringProperty(component, "detailStampLocation", _detailStampLocation);
+ setBooleanProperty(component, "embedded", _embedded);
+ setBooleanProperty(component, "detailStampExpandedDefault", _detailStampExpandedDefault);
+ setStringProperty(component, "detailStampLocation", _detailStampLocation);
}
public void setPreserveDataModel(String preserveDataModel)
@@ -328,12 +328,12 @@
}
public String getVarDetailToggler() {
- return _varDetailToggler;
- }
+ return _varDetailToggler;
+ }
- public void setVarDetailToggler(String varDetailToggler) {
- _varDetailToggler = varDetailToggler;
- }
+ public void setVarDetailToggler(String varDetailToggler) {
+ _varDetailToggler = varDetailToggler;
+ }
public void setNewspaperColumns(String newspaperColumns) {
this._newspaperColumns = newspaperColumns;
@@ -344,8 +344,8 @@
}
public String getBodyStyle() {
- return _bodyStyle;
- }
+ return _bodyStyle;
+ }
public void setBodyStyle(String bodyStyle) {
_bodyStyle = bodyStyle;
@@ -357,35 +357,35 @@
public void setBodyStyleClass(String bodyStyleClass) {
_bodyStyleClass = bodyStyleClass;
- }
+ }
+
+ public String getEmbedded()
+ {
+ return _embedded;
+ }
+
+ public void setEmbedded(String embedded)
+ {
+ this._embedded = embedded;
+ }
- public String getEmbedded()
- {
- return _embedded;
- }
-
- public void setEmbedded(String embedded)
- {
- this._embedded = embedded;
- }
-
- public String getDetailStampExpandedDefault()
- {
- return _detailStampExpandedDefault;
- }
-
- public void setDetailStampExpandedDefault(String detailStampExpandedDefault)
- {
- this._detailStampExpandedDefault = detailStampExpandedDefault;
- }
-
- public String getDetailStampLocation()
- {
- return _detailStampLocation;
- }
-
- public void setDetailStampLocation(String detailStampLocation)
- {
- this._detailStampLocation = detailStampLocation;
- }
+ public String getDetailStampExpandedDefault()
+ {
+ return _detailStampExpandedDefault;
+ }
+
+ public void setDetailStampExpandedDefault(String detailStampExpandedDefault)
+ {
+ this._detailStampExpandedDefault = detailStampExpandedDefault;
+ }
+
+ public String getDetailStampLocation()
+ {
+ return _detailStampLocation;
+ }
+
+ public void setDetailStampLocation(String detailStampLocation)
+ {
+ this._detailStampLocation = detailStampLocation;
+ }
}
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlPanelGridTag.java Thu Jul 3 14:58:05 2008
@@ -46,8 +46,8 @@
private String _visibleOnUserRole;
private String _displayValueOnly;
- private String _displayValueOnlyStyle;
- private String _displayValueOnlyStyleClass;
+ private String _displayValueOnlyStyle;
+ private String _displayValueOnlyStyleClass;
public void release() {
super.release();
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlPanelGroupTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlPanelGroupTag.java?rev=673833&r1=673832&r2=673833&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlPanelGroupTag.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/taglib/html/ext/HtmlPanelGroupTag.java Thu Jul 3 14:58:05 2008
@@ -34,7 +34,7 @@
{
private static final String LAYOUT_ATTR = "layout";
- public String getComponentType()
+ public String getComponentType()
{
return HtmlPanelGroup.COMPONENT_TYPE;
}
@@ -48,10 +48,10 @@
private String _visibleOnUserRole;
private String _displayValueOnly;
- private String _displayValueOnlyStyle;
- private String _displayValueOnlyStyleClass;
-
- private String _layout;
+ private String _displayValueOnlyStyle;
+ private String _displayValueOnlyStyleClass;
+
+ private String _layout;
private String _colspan;
@@ -106,7 +106,7 @@
public void setLayout(String layout)
{
- _layout = layout;
+ _layout = layout;
}
public void setColspan(String colspan)
{