You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/04/02 21:37:18 UTC
svn commit: r644014 [3/10] - in /myfaces/tobago/trunk: ./ core/
core/src/main/faces-config/
core/src/main/java/org/apache/myfaces/tobago/ajax/api/
core/src/main/java/org/apache/myfaces/tobago/application/
core/src/main/java/org/apache/myfaces/tobago/co...
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java Wed Apr 2 12:36:26 2008
@@ -38,6 +38,7 @@
import org.apache.myfaces.tobago.event.DatePickerController;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.TobagoConstants;
+import org.apache.myfaces.tobago.OnComponentCreated;
import javax.faces.component.UIComponent;
import javax.faces.component.UIGraphic;
@@ -81,7 +82,7 @@
public String getFor() {
if ("@auto".equals(forComponent)) {
UIComponent component = getUIDateInput(getParent());
- if (component == null && getParent() instanceof UIForm) {
+ if (component == null && getParent() instanceof AbstractUIForm) {
component = getUIDateInput(getParent().getParent());
}
if (component != null) {
@@ -94,7 +95,7 @@
public UIComponent getForComponent() {
if ("@auto".equals(forComponent)) {
UIComponent component = getUIDateInput(getParent());
- if (component == null && getParent() instanceof UIForm) {
+ if (component == null && getParent() instanceof AbstractUIForm) {
component = getUIDateInput(getParent().getParent());
}
return component;
@@ -109,7 +110,7 @@
public void broadcast(FacesEvent facesEvent) {
FacesContext facesContext = FacesContext.getCurrentInstance();
- UIPopup popup = (UIPopup) getFacets().get(FACET_PICKER_POPUP);
+ UIComponent popup = (UIComponent) getFacets().get(FACET_PICKER_POPUP);
String clientId = getForComponent().getClientId(facesContext);
UIComponent box = popup.findComponent("box");
UIComponent calendar = box.findComponent("calendar");
@@ -134,7 +135,7 @@
link.setImmediate(true);
String linkId = link.getId();
UIHiddenInput hidden =
- (UIHiddenInput) ComponentUtil.createComponent(facesContext,
+ (UIHiddenInput) CreateComponentUtils.createComponent(facesContext,
UIHiddenInput.COMPONENT_TYPE, RENDERER_TYPE_HIDDEN);
if (linkId != null) {
hidden.setId(linkId + "hidden");
@@ -144,8 +145,8 @@
link.getChildren().add(hidden);
// create popup
- final UIPopup popup =
- (UIPopup) ComponentUtil.createComponent(facesContext, UIPopup.COMPONENT_TYPE,
+ final AbstractUIPopup popup =
+ (AbstractUIPopup) CreateComponentUtils.createComponent(facesContext, UIPopup.COMPONENT_TYPE,
RENDERER_TYPE_POPUP);
if (linkId != null) {
popup.setId(linkId + "popup");
@@ -162,21 +163,21 @@
attributes.put(ATTR_POPUP_RESET, Boolean.TRUE);
//int popupHeight = ThemeConfig.getValue(facesContext, link, "CalendarPopupHeight");
//attributes.put(ATTR_HEIGHT, String.valueOf(popupHeight));
- final UIComponent box = ComponentUtil.createComponent(
+ final UIComponent box = CreateComponentUtils.createComponent(
facesContext, UIBox.COMPONENT_TYPE, RENDERER_TYPE_BOX);
popup.getChildren().add(box);
box.setId("box");
// TODO: set string resources in renderer
box.getAttributes().put(ATTR_LABEL, ResourceManagerUtil.getPropertyNotNull(
facesContext, "tobago", "datePickerTitle"));
- UIComponent layout = ComponentUtil.createComponent(
+ UIComponent layout = CreateComponentUtils.createComponent(
facesContext, UIGridLayout.COMPONENT_TYPE, RENDERER_TYPE_GRID_LAYOUT);
box.getFacets().put(FACET_LAYOUT, layout);
layout.setId("layout");
layout.getAttributes().put(ATTR_ROWS, "*;fixed;fixed");
// layout.getAttributes().put(TobagoConstants.ATTR_BORDER, "1");
- final UIComponent calendar = ComponentUtil.createComponent(
+ final UIComponent calendar = CreateComponentUtils.createComponent(
facesContext, javax.faces.component.UIOutput.COMPONENT_TYPE,
RENDERER_TYPE_CALENDAR);
@@ -184,37 +185,37 @@
box.getChildren().add(calendar);
// add time input
- final UIComponent timePanel = ComponentUtil.createComponent(
+ final UIComponent timePanel = CreateComponentUtils.createComponent(
facesContext, UIPanel.COMPONENT_TYPE, RENDERER_TYPE_PANEL);
timePanel.setId("timePanel");
box.getChildren().add(timePanel);
- layout = ComponentUtil.createComponent(
+ layout = CreateComponentUtils.createComponent(
facesContext, UIGridLayout.COMPONENT_TYPE, RENDERER_TYPE_GRID_LAYOUT);
timePanel.getFacets().put(FACET_LAYOUT, layout);
layout.setId("timePanelLayout");
layout.getAttributes().put(ATTR_COLUMNS, "1*;fixed;1*");
- UIComponent cell = ComponentUtil.createComponent(
+ UIComponent cell = CreateComponentUtils.createComponent(
facesContext, UIPanel.COMPONENT_TYPE, RENDERER_TYPE_PANEL);
cell.setId("cell1");
timePanel.getChildren().add(cell);
- final UIComponent time = ComponentUtil.createComponent(
+ final UIComponent time = CreateComponentUtils.createComponent(
facesContext,
- org.apache.myfaces.tobago.component.UITimeInput.COMPONENT_TYPE,
+ UITimeInput.COMPONENT_TYPE,
RENDERER_TYPE_TIME);
timePanel.getChildren().add(time);
time.setId("time");
- cell = ComponentUtil.createComponent(
+ cell = CreateComponentUtils.createComponent(
facesContext, UIPanel.COMPONENT_TYPE, RENDERER_TYPE_PANEL);
cell.setId("cell2");
timePanel.getChildren().add(cell);
- UIComponent buttonPanel = ComponentUtil.createComponent(
+ UIComponent buttonPanel = CreateComponentUtils.createComponent(
facesContext, UIPanel.COMPONENT_TYPE, RENDERER_TYPE_PANEL);
buttonPanel.setId("buttonPanel");
- layout = ComponentUtil.createComponent(
+ layout = CreateComponentUtils.createComponent(
facesContext, UIGridLayout.COMPONENT_TYPE, RENDERER_TYPE_GRID_LAYOUT);
layout.setId("buttonPanelLayout");
buttonPanel.getFacets().put(FACET_LAYOUT, layout);
@@ -224,7 +225,7 @@
box.getChildren().add(buttonPanel);
final UICommand okButton =
- (UICommand) ComponentUtil.createComponent(facesContext,
+ (UICommand) CreateComponentUtils.createComponent(facesContext,
org.apache.myfaces.tobago.component.UIButtonCommand.COMPONENT_TYPE,
RENDERER_TYPE_BUTTON);
buttonPanel.getChildren().add(okButton);
@@ -234,7 +235,7 @@
facesContext, "tobago", "datePickerOk"));
final UICommand cancelButton =
- (UICommand) ComponentUtil.createComponent(facesContext,
+ (UICommand) CreateComponentUtils.createComponent(facesContext,
org.apache.myfaces.tobago.component.UIButtonCommand.COMPONENT_TYPE,
RENDERER_TYPE_BUTTON);
buttonPanel.getChildren().add(cancelButton);
@@ -244,7 +245,7 @@
cancelButton.setId(DatePickerController.CLOSE_POPUP);
// create image
- UIGraphic image = (UIGraphic) ComponentUtil.createComponent(
+ UIGraphic image = (UIGraphic) CreateComponentUtils.createComponent(
facesContext, UIGraphic.COMPONENT_TYPE, RENDERER_TYPE_IMAGE);
image.setRendered(true);
if (linkId != null) {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java Wed Apr 2 12:36:26 2008
@@ -40,7 +40,7 @@
public static synchronized UIDefaultLayout getInstance() {
if (instance == null) {
instance = (UIDefaultLayout)
- ComponentUtil.createComponent(COMPONENT_TYPE, RENDERER_TYPE_DEFAULT_LAYOUT);
+ CreateComponentUtils.createComponent(COMPONENT_TYPE, RENDERER_TYPE_DEFAULT_LAYOUT);
instance.setId("UIDefaultLayout");
}
return instance;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java Wed Apr 2 12:36:26 2008
@@ -19,140 +19,16 @@
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_PASSWORD;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TAB_INDEX;
import org.apache.myfaces.tobago.ajax.api.AjaxComponent;
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.ValueBinding;
import java.io.IOException;
-public class UIInputBase extends javax.faces.component.UIInput implements AjaxComponent, SupportsMarkup, InputSuggest {
+public abstract class UIInputBase extends javax.faces.component.UIInput implements AjaxComponent, SupportsMarkup {
private static final Log LOG = LogFactory.getLog(UIInputBase.class);
- public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Input";
-
- private Boolean readonly;
- private Boolean disabled;
- private Boolean password;
- private String[] markup;
- private javax.faces.el.MethodBinding suggestMethod;
- private Integer tabIndex;
-
- public void restoreState(FacesContext context, Object state) {
- Object[] values = (Object[]) state;
- super.restoreState(context, values[0]);
- suggestMethod = (MethodBinding) restoreAttachedState(context, values[1]);
- readonly = (Boolean) values[2];
- password = (Boolean) values[3];
- markup = (String[]) values[4];
- disabled = (Boolean) values[5];
- tabIndex = (Integer) values[6];
- }
-
- public Object saveState(FacesContext context) {
- Object[] values = new Object[7];
- values[0] = super.saveState(context);
- values[1] = saveAttachedState(context, suggestMethod);
- values[2] = readonly;
- values[3] = password;
- values[4] = markup;
- values[5] = disabled;
- values[6] = tabIndex;
- return values;
- }
-
- public String[] getMarkup() {
- if (markup != null) {
- return markup;
- }
- return ComponentUtil.getMarkupBinding(getFacesContext(), this);
- }
-
- public void setMarkup(String[] markup) {
- this.markup = markup;
- }
-
- public boolean isReadonly() {
- if (readonly != null) {
- return readonly;
- }
- ValueBinding vb = getValueBinding(ATTR_READONLY);
- if (vb != null) {
- return (Boolean.TRUE.equals(vb.getValue(getFacesContext())));
- } else {
- return false;
- }
- }
-
- public void setReadonly(boolean readonly) {
- this.readonly = readonly;
- }
-
- public boolean isDisabled() {
- if (disabled != null) {
- return disabled;
- }
- ValueBinding vb = getValueBinding(ATTR_DISABLED);
- if (vb != null) {
- return (Boolean.TRUE.equals(vb.getValue(getFacesContext())));
- } else {
- return false;
- }
- }
-
- public void setDisabled(boolean disabled) {
- this.disabled = disabled;
- }
-
-
- public boolean isPassword() {
- if (password != null) {
- return password;
- }
- ValueBinding vb = getValueBinding(ATTR_PASSWORD);
- if (vb != null) {
- return (Boolean.TRUE.equals(vb.getValue(getFacesContext())));
- } else {
- return false;
- }
- }
-
-
- public void setPassword(boolean password) {
- this.password = password;
- }
-
-
- public MethodBinding getSuggestMethod() {
- return suggestMethod;
- }
-
- public void setSuggestMethod(MethodBinding suggestMethod) {
- this.suggestMethod = suggestMethod;
- }
-
- public Integer getTabIndex() {
- if (tabIndex != null) {
- return tabIndex;
- }
- ValueBinding vb = getValueBinding(ATTR_TAB_INDEX);
- if (vb != null) {
- Number number = (Number) vb.getValue(getFacesContext());
- if (number != null) {
- return Integer.valueOf(number.intValue());
- }
- }
- return null;
- }
-
- public void setTabIndex(Integer tabIndex) {
- this.tabIndex = tabIndex;
- }
// TODO can this removed?
public void updateModel(FacesContext facesContext) {
@@ -170,5 +46,7 @@
public int encodeAjax(FacesContext facesContext) throws IOException {
return AjaxUtils.encodeAjaxComponent(facesContext, this);
}
+
+ public abstract Integer getTabIndex();
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java Wed Apr 2 12:36:26 2008
@@ -185,7 +185,7 @@
int depth = getRoot().getTreeNode().getDepth();
boxes = new ArrayList<UITreeListboxBox>(depth);
for (int i = 0; i < depth; i++) {
- UITreeListboxBox box = (UITreeListboxBox) ComponentUtil.createComponent(
+ UITreeListboxBox box = (UITreeListboxBox) CreateComponentUtils.createComponent(
facesContext, UITreeListboxBox.COMPONENT_TYPE,
UITreeListboxBox.RENDERER_TYPE);
getFacets().put(BOXES_PREFIX + i, box);
@@ -266,7 +266,7 @@
public UILayout provideLayout() {
UILayout layout = (UILayout) getFacet(FACET_LAYOUT_DEFAULT);
if (layout == null) {
- layout = (UILayout) ComponentUtil.createComponent(
+ layout = (UILayout) CreateComponentUtils.createComponent(
UIGridLayout.COMPONENT_TYPE,
RENDERER_TYPE_GRID_LAYOUT);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java Wed Apr 2 12:36:26 2008
@@ -23,9 +23,9 @@
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TAB_INDEX;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
import org.apache.myfaces.tobago.model.TreeState;
-import org.apache.myfaces.tobago.taglib.component.ToolBarTag;
import org.apache.myfaces.tobago.util.MessageFactory;
import org.apache.myfaces.tobago.util.StringUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.application.FacesMessage;
import javax.faces.component.ActionSource;
@@ -95,6 +95,12 @@
private String mode;
private Integer tabIndex;
+ private String idReference;
+ private String nameReference;
+ private Boolean mutable;
+ private String tipReference;
+ private String selectable;
+ private String disabledReference;
public UITreeOld() {
treeCommands = new UITreeOld.Command[]{
@@ -180,11 +186,11 @@
// TODO move this to renderkit
public void createDefaultToolbar(FacesContext facesContext) {
- UIComponent toolbar = ComponentUtil.createComponent(
+ UIComponent toolbar = CreateComponentUtils.createComponent(
facesContext, UIPanel.COMPONENT_TYPE,
TobagoConstants.RENDERER_TYPE_TOOL_BAR);
- toolbar.getAttributes().put(TobagoConstants.ATTR_ICON_SIZE, ToolBarTag.ICON_SMALL);
- toolbar.getAttributes().put(TobagoConstants.ATTR_LABEL_POSITION, ToolBarTag.LABEL_OFF);
+ toolbar.getAttributes().put(TobagoConstants.ATTR_ICON_SIZE, AbstractUIToolBar.ICON_SMALL);
+ toolbar.getAttributes().put(TobagoConstants.ATTR_LABEL_POSITION, AbstractUIToolBar.LABEL_OFF);
ActionListener[] handlers = getActionListeners();
if ((handlers == null || handlers.length == 0) && getActionListener() == null) {
@@ -193,7 +199,7 @@
UITreeOld.Command[] commands = getCommands();
for (int i = 0; i < commands.length; i++) {
- UICommand command = (UICommand) ComponentUtil.createComponent(
+ UICommand command = (UICommand) CreateComponentUtils.createComponent(
facesContext, UICommand.COMPONENT_TYPE,
TobagoConstants.RENDERER_TYPE_LINK);
toolbar.getChildren().add(command);
@@ -312,7 +318,7 @@
if (isRequired() && getState().getSelection().size() == 0) {
setValid(false);
FacesMessage facesMessage = MessageFactory.createFacesMessage(context,
- UISelectOne.MESSAGE_VALUE_REQUIRED, FacesMessage.SEVERITY_ERROR);
+ AbstractUISelectOne.MESSAGE_VALUE_REQUIRED, FacesMessage.SEVERITY_ERROR);
context.addMessage(getClientId(context), facesMessage);
}
@@ -358,7 +364,7 @@
}
public Object saveState(FacesContext context) {
- Object[] state = new Object[8];
+ Object[] state = new Object[14];
state[0] = super.saveState(context);
state[1] = saveAttachedState(context, actionListenerBinding);
state[2] = showJunctionsSet ? showJunctions : null;
@@ -367,6 +373,12 @@
state[5] = showRootJunctionSet ? showRootJunction : null;
state[6] = mode;
state[7] = tabIndex;
+ state[8] = idReference;
+ state[9] = nameReference;
+ state[10] = mutable;
+ state[11] = tipReference;
+ state[12] = selectable;
+ state[13] = disabledReference;
return state;
}
@@ -392,6 +404,12 @@
}
mode = (String) values[6];
tabIndex = (Integer) values[7];
+ idReference = (String) values[8];
+ nameReference = (String) values[9];
+ mutable = (Boolean) values[10];
+ tipReference = (String) values[11];
+ selectable = (String) values[12];
+ disabledReference = (String) values[13];
}
public UITreeOld.Command[] getCommands() {
@@ -487,6 +505,102 @@
public void setShowRootJunction(boolean showRootJunction) {
this.showRootJunction = showRootJunction;
this.showRootJunctionSet = true;
+ }
+
+ public void setIdReference(String idReference) {
+ this.idReference = idReference;
+ }
+
+ public String getIdReference() {
+ if (idReference != null) {
+ return idReference;
+ }
+ ValueBinding vb = getValueBinding(TobagoConstants.ATTR_ID_REFERENCE);
+ if (vb != null) {
+ return (String) vb.getValue(getFacesContext());
+ }
+ return null;
+ }
+
+
+ public void setNameReference(String nameReference) {
+ this.nameReference = nameReference;
+ }
+
+ public String getNameReference() {
+ if (nameReference != null) {
+ return nameReference;
+ }
+ ValueBinding vb = getValueBinding(TobagoConstants.ATTR_NAME_REFERENCE);
+ if (vb != null) {
+ return (String) vb.getValue(getFacesContext());
+ }
+ return null;
+ }
+
+
+ public void setMutable(Boolean mutable) {
+ this.mutable = mutable;
+ }
+
+ public boolean isMutable() {
+ if (mutable != null) {
+ return mutable;
+ }
+ ValueBinding vb = getValueBinding(TobagoConstants.ATTR_MUTABLE);
+ if (vb != null) {
+ return (!Boolean.FALSE.equals(vb.getValue(getFacesContext())));
+ } else {
+ return false;
+ }
+ }
+
+ public void setTipReference(String tipReference) {
+ this.tipReference = tipReference;
+ }
+
+ public String getTipReference() {
+ if (tipReference != null) {
+ return tipReference;
+ }
+ ValueBinding vb = getValueBinding(TobagoConstants.ATTR_TIP_REFERENCE);
+ if (vb != null) {
+ return (String) vb.getValue(getFacesContext());
+ }
+ return null;
+ }
+
+ public void setSelectable(String selectable) {
+ this.selectable = selectable;
+ }
+
+ public String getSelectable() {
+ if (selectable != null) {
+ return selectable;
+ }
+ ValueBinding vb = getValueBinding(TobagoConstants.ATTR_SELECTABLE);
+ if (vb != null) {
+ String str = (String) vb.getValue(getFacesContext());
+ if (str != null) {
+ return str;
+ }
+ }
+ return "off";
+ }
+
+ public void setDisabledReference(String disabledReference) {
+ this.disabledReference = disabledReference;
+ }
+
+ public String getDisabledReference() {
+ if (disabledReference != null) {
+ return disabledReference;
+ }
+ ValueBinding vb = getValueBinding(TobagoConstants.ATTR_DISABLED_REFERENCE);
+ if (vb != null) {
+ return (String) vb.getValue(getFacesContext());
+ }
+ return null;
}
public static class Command implements Serializable {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Window.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Window.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Window.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Window.java Wed Apr 2 12:36:26 2008
@@ -54,7 +54,7 @@
this.top = y;
}
- public void activate(UIPage page) {
+ public void activate(AbstractUIPage page) {
page.getScriptFiles().add("script/popup.js");
FacesContext facesContext = FacesContext.getCurrentInstance();
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java Wed Apr 2 12:36:26 2008
@@ -21,7 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_IN;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.context.ClientProperties;
import org.apache.myfaces.tobago.context.ResourceManager;
import org.apache.myfaces.tobago.context.ResourceManagerFactory;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java Wed Apr 2 12:36:26 2008
@@ -17,8 +17,6 @@
* limitations under the License.
*/
-import org.apache.myfaces.tobago.renderkit.html.CommandRendererHelper;
-
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import java.util.ArrayList;
@@ -137,16 +135,5 @@
String name = image.substring(0, dotIndex);
String postfix = image.substring(dotIndex);
return getImageWithPath(facesContext, name + "Disabled" + postfix, true);
- }
-
- public static String getImageWithPath(FacesContext facesContext, String image, CommandRendererHelper helper) {
- String imageWithPath = null;
- if (helper.isDisabled()) {
- imageWithPath = getDisabledImageWithPath(facesContext, image);
- }
- if (imageWithPath == null) {
- imageWithPath = getImageWithPath(facesContext, image);
- }
- return imageWithPath;
}
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DatePickerController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DatePickerController.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DatePickerController.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DatePickerController.java Wed Apr 2 12:36:26 2008
@@ -24,7 +24,7 @@
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TOP;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH;
import static org.apache.myfaces.tobago.TobagoConstants.FACET_PICKER_POPUP;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.config.ThemeConfig;
import javax.faces.component.UICommand;
@@ -87,7 +87,7 @@
int popupTop = ComponentUtil.getIntAttribute(
popup, ATTR_TOP, -1);
- final Map<String, String> attributes = popup.getAttributes();
+ final Map<String, Object> attributes = popup.getAttributes();
if (popupWidth == -1) {
popupWidth = ThemeConfig.getValue(
facesContext, popup, "CalendarPopupWidth");
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java Wed Apr 2 12:36:26 2008
@@ -17,9 +17,9 @@
* limitations under the License.
*/
-import org.apache.myfaces.tobago.component.UIData;
import javax.faces.event.ActionEvent;
+import javax.faces.component.UIComponent;
public class PageActionEvent extends ActionEvent {
@@ -29,7 +29,7 @@
private PageAction action;
private int value;
- public PageActionEvent(UIData component, PageAction action) {
+ public PageActionEvent(UIComponent component, PageAction action) {
super(component);
this.action = action;
}
@@ -53,10 +53,4 @@
return value;
}
- /**
- * Convenience method to get the UIData Component.
- */
- public UIData getSheet() {
- return (UIData) getComponent();
- }
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/PopupActionListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/PopupActionListener.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/PopupActionListener.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/PopupActionListener.java Wed Apr 2 12:36:26 2008
@@ -17,7 +17,7 @@
* limitations under the License.
*/
-import org.apache.myfaces.tobago.component.UIPopup;
+import org.apache.myfaces.tobago.component.AbstractUIPopup;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -47,7 +47,7 @@
}
}
- public PopupActionListener(UIPopup popup) {
+ public PopupActionListener(AbstractUIPopup popup) {
this.popupId = ":" + popup.getClientId(FacesContext.getCurrentInstance());
if (LOG.isDebugEnabled()) {
LOG.debug("Add ActionListener: " + popupId);
@@ -55,7 +55,7 @@
}
public void processAction(ActionEvent actionEvent) throws AbortProcessingException {
- UIPopup popup = (UIPopup) actionEvent.getComponent().findComponent(popupId);
+ AbstractUIPopup popup = (AbstractUIPopup) actionEvent.getComponent().findComponent(popupId);
if (popup != null) {
if (LOG.isDebugEnabled()) {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java Wed Apr 2 12:36:26 2008
@@ -17,9 +17,8 @@
* limitations under the License.
*/
-import org.apache.myfaces.tobago.component.UIData;
-
import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
import javax.faces.event.ActionEvent;
import javax.faces.event.PhaseId;
@@ -29,7 +28,7 @@
private transient UIColumn column;
- public SortActionEvent(UIData sheet, UIColumn column) {
+ public SortActionEvent(UIComponent sheet, UIColumn column) {
super(sheet);
this.column = column;
setPhaseId(PhaseId.INVOKE_APPLICATION);
@@ -42,12 +41,5 @@
*/
public UIColumn getColumn() {
return column;
- }
-
- /**
- * Convenience method to get the UIData Component.
- */
- public UIData getSheet() {
- return (UIData) getComponent();
}
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TagUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TagUtils.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TagUtils.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TagUtils.java Wed Apr 2 12:36:26 2008
@@ -19,13 +19,12 @@
import org.apache.myfaces.tobago.event.SheetStateChangeSource;
import org.apache.myfaces.tobago.event.SortActionSource;
-import org.apache.myfaces.tobago.component.UIPage;
-import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.component.UIMessages;
-import org.apache.myfaces.tobago.component.UIInputBase;
-import org.apache.myfaces.tobago.component.UIPopup;
-import org.apache.myfaces.tobago.TobagoConstants;
+import org.apache.myfaces.tobago.event.TabChangeSource;
+import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.AbstractUIMessages;
+import org.apache.myfaces.tobago.component.InputSuggest;
import org.apache.myfaces.tobago.el.ConstantMethodBinding;
+import org.apache.myfaces.tobago.TobagoConstants;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -34,7 +33,6 @@
import javax.faces.component.EditableValueHolder;
import javax.faces.component.ActionSource;
import javax.faces.component.ValueHolder;
-import javax.faces.component.UIGraphic;
import javax.faces.webapp.UIComponentTag;
import javax.faces.el.ValueBinding;
import javax.faces.el.MethodBinding;
@@ -52,22 +50,19 @@
if (UIComponentTag.isValueReference(value)) {
component.setValueBinding(name, createValueBinding(value));
} else {
- if ((component instanceof UIPage || component instanceof UIGraphic || component instanceof UIPopup)
+ if ((component instanceof org.apache.myfaces.tobago.component.AbstractUIPage
+ || component instanceof javax.faces.component.UIGraphic
+ || component instanceof org.apache.myfaces.tobago.component.AbstractUIPopup)
&& (TobagoConstants.ATTR_WIDTH.equals(name) || TobagoConstants.ATTR_HEIGHT.equals(name))) {
- value = removePx(value);
+ if (value.endsWith("px")) {
+ value = value.substring(0, value.length() - 2);
+ }
}
component.getAttributes().put(name, new Integer(value));
}
}
}
- private static String removePx(String value) {
- if (value != null && value.endsWith("px")) {
- value = value.substring(0, value.length() - 2);
- }
- return value;
- }
-
public static void setBooleanProperty(UIComponent component, String name, String value) {
if (value != null) {
if (UIComponentTag.isValueReference(value)) {
@@ -135,7 +130,7 @@
public static void setSuggestMethodMethodBinding(UIComponent component, String value, Class[] args) {
if (value != null && UIComponentTag.isValueReference(value)) {
MethodBinding methodBinding = FacesContext.getCurrentInstance().getApplication().createMethodBinding(value, args);
- ((UIInputBase) component).setSuggestMethod(methodBinding);
+ ((InputSuggest) component).setSuggestMethod(methodBinding);
}
}
@@ -172,6 +167,13 @@
}
}
+ public static void setTabChangeListenerMethodBinding(UIComponent component, String value, Class[] args) {
+ if (value != null && UIComponentTag.isValueReference(value)) {
+ MethodBinding methodBinding = FacesContext.getCurrentInstance().getApplication().createMethodBinding(value, args);
+ ((TabChangeSource) component).setTabChangeListener(methodBinding);
+ }
+ }
+
public static void setStringArrayProperty(UIComponent component, String name, String value) {
if (value != null) {
if (UIComponentTag.isValueReference(value)) {
@@ -203,7 +205,7 @@
if (UIComponentTag.isValueReference(value)) {
component.setValueBinding(name, createValueBinding(value));
} else {
- component.getAttributes().put(name, UIMessages.OrderBy.parse(value));
+ component.getAttributes().put(name, AbstractUIMessages.OrderBy.parse(value));
}
}
}
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoBodyTag.java (from r638966, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoBodyTag.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoBodyTag.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoBodyTag.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoBodyTag.java&r1=638966&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoBodyTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoBodyTag.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.taglib.component;
+package org.apache.myfaces.tobago.internal.taglib;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -30,7 +30,7 @@
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTag;
-public abstract class TobagoBodyTag extends TobagoTag implements TobagoBodyTagDeclaration {
+public abstract class TobagoBodyTag extends TobagoTag implements BodyTag {
private static final Log LOG = LogFactory.getLog(TobagoBodyTag.class);
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoBodyTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoBodyTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoTag.java (from r638966, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoTag.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoTag.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoTag.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoTag.java&r1=638966&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoTag.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.taglib.component;
+package org.apache.myfaces.tobago.internal.taglib;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -17,158 +17,16 @@
* limitations under the License.
*/
-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_HIDDEN;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_INLINE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TITLE;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH;
+import org.apache.commons.lang.StringUtils;
import static org.apache.myfaces.tobago.TobagoConstants.TOBAGO_COMPONENT_CREATED;
-import org.apache.myfaces.tobago.component.OnComponentCreated;
-import org.apache.myfaces.tobago.internal.taglib.TagUtils;
+import org.apache.myfaces.tobago.OnComponentCreated;
import javax.faces.component.UIComponent;
import javax.faces.webapp.UIComponentTag;
import javax.servlet.jsp.JspException;
-public abstract class TobagoTag extends UIComponentTag
- implements TobagoTagDeclaration {
+public abstract class TobagoTag extends UIComponentTag {
- private static final Log LOG = LogFactory.getLog(TobagoTag.class);
-
- private String label;
- private String title;
- private String width;
- private String height;
- private String hidden;
- private String readonly;
- private String disabled;
- private String inline;
-
- @Override
- public int doStartTag() throws JspException {
- if (LOG.isDebugEnabled()) {
- LOG.debug("doStartTag() rendererType " + getRendererType());
- LOG.debug("doStartTag() componentType " + getComponentType());
- }
- return super.doStartTag();
- }
-
- @Override
- public String getRendererType() {
- String name = getClass().getName();
- int beginIndex = name.lastIndexOf('.');
- if (beginIndex < 0) {
- beginIndex = 0;
- } else {
- beginIndex++;
- }
- int endIndex = name.length() - 3; // 3 = "Tag".length()
- return name.substring(beginIndex, endIndex);
- }
-
- @Override
- public void release() {
- super.release();
- hidden = null;
- readonly = null;
- disabled = null;
- inline = null;
- label = null;
- title = null;
- width = null;
- height = null;
- }
-
- @Override
- protected void setProperties(UIComponent component) {
- super.setProperties(component);
-
- TagUtils.setStringProperty(component, ATTR_LABEL, label);
- TagUtils.setStringProperty(component, ATTR_TITLE, title);
-
- TagUtils.setBooleanProperty(component, ATTR_DISABLED, disabled);
- TagUtils.setBooleanProperty(component, ATTR_READONLY, readonly);
- TagUtils.setBooleanProperty(component, ATTR_HIDDEN, hidden);
- TagUtils.setBooleanProperty(component, ATTR_INLINE, inline);
-
- if (width != null) {
- LOG.warn("the width attribute is deprecated, please use a layout manager. (" + getClass().getSimpleName() + ")");
- }
- TagUtils.setStringProperty(component, ATTR_WIDTH, width);
- if (height != null) {
- LOG.warn("the height attribute is deprecated, please use a layout manager. (" + getClass().getSimpleName() + ")");
- }
- TagUtils.setStringProperty(component, ATTR_HEIGHT, height);
- }
-
- public String getDisabled() {
- return disabled;
- }
-
- public void setDisabled(String disabled) {
- this.disabled = disabled;
- }
-
- public String getHeight() {
- return height;
- }
-
- public void setHeight(String height) {
- this.height = height;
- }
-
- public String getHidden() {
- return hidden;
- }
-
- public void setHidden(String hidden) {
- this.hidden = hidden;
- }
-
- public String getInline() {
- return inline;
- }
-
- public void setInline(String inline) {
- this.inline = inline;
- }
-
- public String getLabel() {
- return label;
- }
-
- public void setLabel(String label) {
- this.label = label;
- }
-
- public String getReadonly() {
- return readonly;
- }
-
- public void setReadonly(String readonly) {
- this.readonly = readonly;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public String getWidth() {
- return width;
- }
-
- public void setWidth(String width) {
- this.width = width;
- }
public int doEndTag() throws JspException {
@@ -179,5 +37,9 @@
((OnComponentCreated) component).onComponentCreated();
}
return super.doEndTag();
+ }
+
+ public String[] splitList(String renderers) {
+ return StringUtils.split(renderers, ", ");
}
}
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/taglib/TobagoTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/FixedLayoutToken.java (from r643878, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/FixedLayoutToken.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/FixedLayoutToken.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/FixedLayoutToken.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/FixedLayoutToken.java&r1=643878&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/FixedLayoutToken.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/FixedLayoutToken.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,6 @@
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.layout;
+
+import org.apache.myfaces.tobago.layout.LayoutToken;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/FixedLayoutToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/FixedLayoutToken.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/HideLayoutToken.java (from r643878, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/HideLayoutToken.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/HideLayoutToken.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/HideLayoutToken.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/HideLayoutToken.java&r1=643878&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/HideLayoutToken.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/HideLayoutToken.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,6 @@
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.layout;
+
+import org.apache.myfaces.tobago.layout.LayoutToken;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/HideLayoutToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/HideLayoutToken.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutToken.java (from r643793, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/LayoutToken.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutToken.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutToken.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/LayoutToken.java&r1=643793&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/LayoutToken.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutToken.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.layout;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutToken.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java (from r643878, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/LayoutTokens.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/LayoutTokens.java&r1=643878&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/LayoutTokens.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.layout;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/MinimumLayoutToken.java (from r643878, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/MinimumLayoutToken.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/MinimumLayoutToken.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/MinimumLayoutToken.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/MinimumLayoutToken.java&r1=643878&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/MinimumLayoutToken.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/MinimumLayoutToken.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,6 @@
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.layout;
+
+import org.apache.myfaces.tobago.layout.LayoutToken;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/MinimumLayoutToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/MinimumLayoutToken.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PercentLayoutToken.java (from r643878, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/PercentLayoutToken.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PercentLayoutToken.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PercentLayoutToken.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/PercentLayoutToken.java&r1=643878&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/PercentLayoutToken.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PercentLayoutToken.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.layout;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PercentLayoutToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PercentLayoutToken.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelLayoutToken.java (from r643878, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/PixelLayoutToken.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelLayoutToken.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelLayoutToken.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/PixelLayoutToken.java&r1=643878&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/PixelLayoutToken.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelLayoutToken.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.layout;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelLayoutToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelLayoutToken.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/RelativeLayoutToken.java (from r643878, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/RelativeLayoutToken.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/RelativeLayoutToken.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/RelativeLayoutToken.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/RelativeLayoutToken.java&r1=643878&r2=644014&rev=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/RelativeLayoutToken.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/RelativeLayoutToken.java Wed Apr 2 12:36:26 2008
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.layout;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/RelativeLayoutToken.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/RelativeLayoutToken.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java Wed Apr 2 12:36:26 2008
@@ -19,7 +19,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.LayoutTokens;
+import org.apache.myfaces.tobago.layout.LayoutTokens;
import org.apache.myfaces.tobago.layout.LayoutComponent;
import org.apache.myfaces.tobago.layout.LayoutContainer;
import org.apache.myfaces.tobago.layout.LayoutManager;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/ApplyRequestValuesExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/ApplyRequestValuesExecutor.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/ApplyRequestValuesExecutor.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/ApplyRequestValuesExecutor.java Wed Apr 2 12:36:26 2008
@@ -20,8 +20,8 @@
import static javax.faces.event.PhaseId.APPLY_REQUEST_VALUES;
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
-import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.component.UIPage;
+import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.AbstractUIPage;
import org.apache.myfaces.tobago.component.UIViewRoot;
import org.apache.myfaces.tobago.util.ApplyRequestValuesCallback;
import org.apache.myfaces.tobago.compat.FacesUtils;
@@ -58,7 +58,7 @@
= AjaxUtils.parseAndStoreComponents(facesContext);
if (ajaxComponents != null) {
// first decode the page
- UIPage page = ComponentUtil.findPage(facesContext);
+ AbstractUIPage page = ComponentUtil.findPage(facesContext);
page.decode(facesContext);
page.markSubmittedForm(facesContext);
@@ -83,7 +83,7 @@
return false;
}
- private void decodeActionComponent(FacesContext facesContext, UIPage page, Map<String, UIComponent> ajaxComponents) {
+ private void decodeActionComponent(FacesContext facesContext, AbstractUIPage page, Map<String, UIComponent> ajaxComponents) {
String actionId = page.getActionId();
UIComponent actionComponent = null;
if (actionId != null) {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/RestoreViewExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/RestoreViewExecutor.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/RestoreViewExecutor.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/RestoreViewExecutor.java Wed Apr 2 12:36:26 2008
@@ -23,7 +23,7 @@
import org.apache.commons.logging.LogFactory;
import static org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.VIEW_ROOT_KEY;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.FacesException;
import javax.faces.application.Application;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/TobagoLifecycle.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/TobagoLifecycle.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/TobagoLifecycle.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/lifecycle/TobagoLifecycle.java Wed Apr 2 12:36:26 2008
@@ -29,8 +29,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.ComponentUtil;
import org.apache.myfaces.tobago.util.RequestUtils;
+import org.apache.myfaces.tobago.util.DebugUtils;
/**
* Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
@@ -144,7 +144,7 @@
}
if (LOG.isTraceEnabled()) {
- LOG.trace(ComponentUtil.toString(facesContext.getViewRoot(), 0));
+ LOG.trace(DebugUtils.toString(facesContext.getViewRoot(), 0));
}
if (LOG.isTraceEnabled()) {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java Wed Apr 2 12:36:26 2008
@@ -18,7 +18,6 @@
*/
import org.apache.myfaces.tobago.component.SupportsMarkup;
-import org.apache.myfaces.tobago.component.UISelectItem;
/*
* Date: Apr 5, 2005
@@ -34,13 +33,7 @@
public SelectItem() {
super();
}
-
- public SelectItem(UISelectItem component) {
- this(component.getItemValue() == null ? "" : component.getItemValue(),
- component.getItemLabel(), component.getItemDescription(),
- component.isItemDisabled(), component.getItemImage(), component.getMarkup());
- }
-
+
public SelectItem(Object value) {
super(value);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRenderer.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRenderer.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRenderer.java Wed Apr 2 12:36:26 2008
@@ -19,7 +19,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.util.LayoutUtil;
import javax.faces.component.UIComponent;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/BoxRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/BoxRendererBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/BoxRendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/BoxRendererBase.java Wed Apr 2 12:36:26 2008
@@ -26,7 +26,7 @@
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.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import org.apache.myfaces.tobago.component.UILayout;
import org.apache.myfaces.tobago.util.LayoutUtil;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java Wed Apr 2 12:36:26 2008
@@ -19,7 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.context.ResourceManagerUtil;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -47,6 +48,17 @@
}
component.queueEvent(new ActionEvent(component));
}
+ }
+
+ public String getImageWithPath(FacesContext facesContext, String image, boolean disabled) {
+ String imageWithPath = null;
+ if (disabled) {
+ imageWithPath = ResourceManagerUtil.getDisabledImageWithPath(facesContext, image);
+ }
+ if (imageWithPath == null) {
+ imageWithPath = ResourceManagerUtil.getImageWithPath(facesContext, image);
+ }
+ return imageWithPath;
}
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java Wed Apr 2 12:36:26 2008
@@ -19,7 +19,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutableRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutableRendererBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutableRendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutableRendererBase.java Wed Apr 2 12:36:26 2008
@@ -20,26 +20,18 @@
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_ONCLICK;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH;
import static org.apache.myfaces.tobago.TobagoConstants.FACET_MENUBAR;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.component.UICell;
-import org.apache.myfaces.tobago.component.UICommand;
-import org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.component.Cell;
import org.apache.myfaces.tobago.util.LayoutUtil;
-import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import java.awt.Dimension;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
-import java.util.Map;
public abstract class LayoutableRendererBase
extends RendererBase implements LayoutableRenderer {
@@ -102,7 +94,7 @@
int fixedSpace = 0;
- if (component instanceof UICell) {
+ if (component instanceof Cell) {
List children = LayoutUtil.addChildren(new ArrayList(), component);
for (Object aChildren : children) {
UIComponent child = (UIComponent) aChildren;
@@ -150,62 +142,7 @@
}
}
- protected void checkForCommandFacet(UIComponent component, FacesContext facesContext, TobagoResponseWriter writer)
- throws IOException {
- checkForCommandFacet(component, Arrays.asList(component.getClientId(facesContext)), facesContext, writer);
- }
-
- protected void checkForCommandFacet(UIComponent component, List<String> clientIds, FacesContext facesContext,
- TobagoResponseWriter writer) throws IOException {
- if (ComponentUtil.getBooleanAttribute(component, ATTR_READONLY)
- || ComponentUtil.getBooleanAttribute(component, ATTR_DISABLED)) {
- return;
- }
- Map<String, UIComponent> facets = component.getFacets();
- for (Map.Entry<String, UIComponent> entry : facets.entrySet()) {
- if (entry.getValue() instanceof UICommand) {
- addCommandFacet(clientIds, entry, facesContext, writer);
- }
- }
- }
-
- // TODO create HtmlRendererBase
- private void addCommandFacet(List<String> clientIds, Map.Entry<String, UIComponent> facetEntry,
- FacesContext facesContext, TobagoResponseWriter writer) throws
- IOException {
- for (String clientId : clientIds) {
- writeScriptForClientId(clientId, facetEntry, facesContext, writer);
- }
- }
- private void writeScriptForClientId(String clientId, Map.Entry<String, UIComponent> facetEntry,
- FacesContext facesContext, TobagoResponseWriter writer) throws IOException {
- if (facetEntry.getValue() instanceof UICommand
- && ((UICommand) facetEntry.getValue()).getRenderedPartially().length > 0) {
- String script =
- "var element = Tobago.element(\"" + clientId + "\");\n"
- + "if (element) {\n"
- + " Tobago.addEventListener(element, \"" + facetEntry.getKey()
- + "\", function(){Tobago.reloadComponent('"
- + HtmlRendererUtil.getComponentIds(facesContext, facetEntry.getValue(),
- ((UICommand) facetEntry.getValue()).getRenderedPartially()) + "','"
- + facetEntry.getValue().getClientId(facesContext) + "', {})});\n"
- + "}";
- writer.writeJavascript(script);
- } else {
- UIComponent facetComponent = facetEntry.getValue();
- String facetAction = (String) facetComponent.getAttributes().get(ATTR_ONCLICK);
- if (facetAction == null) {
- facetAction = "Tobago.submitAction('" + facetComponent.getClientId(facesContext) + "')";
- }
- String script =
- "var element = Tobago.element(\"" + clientId + "\");\n"
- + "if (element) {\n"
- + " Tobago.addEventListener(element, \"" + facetEntry.getKey() + "\", function(){"
- + facetAction + "});\n}";
- writer.writeJavascript(script);
- }
- }
public void layoutBegin(FacesContext context, UIComponent component) throws IOException {
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/PageRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/PageRendererBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/PageRendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/PageRendererBase.java Wed Apr 2 12:36:26 2008
@@ -20,7 +20,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
-import org.apache.myfaces.tobago.component.UIPage;
+import org.apache.myfaces.tobago.component.AbstractUIPage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -30,8 +30,8 @@
private static final Log LOG = LogFactory.getLog(PageRendererBase.class);
public void decode(FacesContext facesContext, UIComponent component) {
- if (component instanceof UIPage) {
- UIPage page = (UIPage) component;
+ if (component instanceof AbstractUIPage) {
+ AbstractUIPage page = (AbstractUIPage) component;
String name = page.getClientId(facesContext)
+ SUBCOMPONENT_SEP + "form-action";
String newActionId = (String) facesContext.getExternalContext()
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java Wed Apr 2 12:36:26 2008
@@ -100,9 +100,37 @@
String currentValue = null;
Object currentObj = getValue(component);
if (currentObj != null) {
- currentValue = RenderUtil.getFormattedValue(facesContext, component, currentObj);
+ currentValue = getFormattedValue(facesContext, component, currentObj);
}
return currentValue;
+ }
+
+ protected String getFormattedValue(FacesContext context, UIComponent component, Object currentValue)
+ throws ConverterException {
+
+ if (currentValue == null) {
+ return "";
+ }
+
+ if (!(component instanceof ValueHolder)) {
+ return currentValue.toString();
+ }
+
+ Converter converter = ((ValueHolder) component).getConverter();
+
+ if (converter == null) {
+ if (currentValue instanceof String) {
+ return (String) currentValue;
+ }
+ Class converterType = currentValue.getClass();
+ converter = context.getApplication().createConverter(converterType);
+ }
+
+ if (converter == null) {
+ return currentValue.toString();
+ } else {
+ return converter.getAsString(context, component, currentValue);
+ }
}
protected Object getValue(UIComponent component) {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java Wed Apr 2 12:36:26 2008
@@ -19,7 +19,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectOneRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectOneRendererBase.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectOneRendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectOneRendererBase.java Wed Apr 2 12:36:26 2008
@@ -19,7 +19,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import javax.faces.component.UIComponent;
import javax.faces.component.UISelectOne;
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SheetUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SheetUtils.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SheetUtils.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SheetUtils.java Wed Apr 2 12:36:26 2008
@@ -20,8 +20,7 @@
import org.apache.myfaces.tobago.event.PageActionEvent;
import org.apache.myfaces.tobago.event.PageAction;
import org.apache.myfaces.tobago.event.PageActionUtil;
-import org.apache.myfaces.tobago.component.UIData;
-import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -59,7 +58,7 @@
LOG.error("Illegal value for PageAction :" + component.getId());
return;
}
- PageActionEvent event = new PageActionEvent((UIData) component.getParent(), action);
+ PageActionEvent event = new PageActionEvent(component.getParent(), action);
switch (action) {
case TO_PAGE:
Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/AttributeTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/AttributeTag.java?rev=644014&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/AttributeTag.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/AttributeTag.java Wed Apr 2 12:36:26 2008
@@ -0,0 +1,154 @@
+package org.apache.myfaces.tobago.taglib.component;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.TobagoConstants;
+import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.internal.taglib.TagUtils;
+import org.apache.myfaces.tobago.apt.annotation.BodyContent;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.component.SupportsRenderedPartially;
+
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.webapp.UIComponentTag;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+/*
+ * Date: Oct 14, 2006
+ * Time: 1:47:13 PM
+ */
+
+/**
+ * Add an attribute on the UIComponent
+ * associated with the closest parent UIComponent custom action.
+ */
+@Tag(name = "attribute", bodyContent = BodyContent.EMPTY)
+public class AttributeTag extends TagSupport {
+
+ private static final long serialVersionUID = 6231531736083277631L;
+
+ /**
+ * <p>The name of the attribute</p>
+ */
+ private String name;
+
+ /**
+ * <p>The value of the attribute</p>
+ */
+ private String value;
+
+ /**
+ * The name of a attribute.
+ *
+ * @param name A attribute name
+ */
+ @TagAttribute(required = true)
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * The value of a attribute
+ *
+ * @param value A attribute value
+ */
+ @TagAttribute(required = true)
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * @throws javax.servlet.jsp.JspException if a JSP error occurs
+ */
+ public int doStartTag() throws JspException {
+
+ // Locate our parent UIComponentTag
+ UIComponentTag tag =
+ UIComponentTag.getParentUIComponentTag(pageContext);
+ if (tag == null) {
+ // TODO Message resource i18n
+ throw new JspException("Not nested in faces tag");
+ }
+
+ if (!tag.getCreated()) {
+ return (SKIP_BODY);
+ }
+
+ UIComponent component = tag.getComponentInstance();
+ if (component == null) {
+ // TODO Message resource i18n
+ throw new JspException("Component Instance is null");
+ }
+ String attributeName = name;
+
+ if (UIComponentTag.isValueReference(name)) {
+ ValueBinding valueBinding = TagUtils.createValueBinding(name);
+ if (valueBinding != null) {
+ attributeName = (String) valueBinding.getValue(FacesContext.getCurrentInstance());
+ } else {
+ // TODO Message resource i18n
+ throw new JspException("Can not get ValueBinding for attribute name " + name);
+ }
+ }
+ if (component instanceof EditableValueHolder
+ && TobagoConstants.ATTR_VALIDATOR.equals(attributeName)) {
+ ComponentUtil.setValidator((EditableValueHolder) component, value);
+ } else if (component instanceof ValueHolder
+ && TobagoConstants.ATTR_CONVERTER.equals(attributeName)) {
+ ComponentUtil.setConverter((ValueHolder) component, value);
+ } else if (TobagoConstants.ATTR_STYLE_CLASS.equals(attributeName)) {
+ ComponentUtil.setStyleClasses(component, value);
+ } else if (TobagoConstants.ATTR_RENDERED_PARTIALLY.equals(attributeName)
+ && component instanceof SupportsRenderedPartially) {
+ if (UIComponentTag.isValueReference(value)) {
+ component.setValueBinding(TobagoConstants.ATTR_RENDERED_PARTIALLY, ComponentUtil.createValueBinding(value));
+ } else {
+ String[] components = ComponentUtil.splitList(value);
+ ((SupportsRenderedPartially) component).setRenderedPartially(components);
+ }
+ } else if (UIComponentTag.isValueReference(value)) {
+ ValueBinding valueBinding = TagUtils.createValueBinding(value);
+ if (valueBinding != null) {
+ component.setValueBinding(name, valueBinding);
+ } else {
+ // TODO Message resource i18n
+ throw new JspException("Can not get ValueBinding for attribute value " + value);
+ }
+ } else {
+ component.getAttributes().put(attributeName, value);
+ }
+
+ return (SKIP_BODY);
+ }
+
+
+ /**
+ * <p>Release references to any acquired resources.
+ */
+ public void release() {
+ super.release();
+ this.name = null;
+ this.value = null;
+ }
+}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/BoxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/BoxTagDeclaration.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/BoxTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/BoxTagDeclaration.java Wed Apr 2 12:36:26 2008
@@ -34,8 +34,8 @@
uiComponent = "org.apache.myfaces.tobago.component.UIBox",
uiComponentBaseClass = "org.apache.myfaces.tobago.component.UIPanel",
componentType = "org.apache.myfaces.tobago.Box",
+ interfaces = "org.apache.myfaces.tobago.ajax.api.AjaxComponent",
rendererType = "Box",
- isAjaxEnabled = true,
facets = {
@Facet(name="toolBar", description = "Contains an instance of UIToolBar",
allowedChildComponenents = "org.apache.myfaces.tobago.ToolBar"),
@@ -43,8 +43,7 @@
allowedChildComponenents = "org.apache.myfaces.tobago.GridLayout")})
-public interface BoxTagDeclaration extends TobagoBodyTagDeclaration,
- HasIdBindingAndRendered, HasDeprecatedDimension, HasLabel {
+public interface BoxTagDeclaration extends HasIdBindingAndRendered, HasDeprecatedDimension, HasLabel {
/**
* Indicate markup of this component.
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java Wed Apr 2 12:36:26 2008
@@ -33,6 +33,7 @@
import org.apache.myfaces.tobago.taglib.decl.IsDefaultCommand;
import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
import org.apache.myfaces.tobago.taglib.decl.IsInline;
+import org.apache.myfaces.tobago.taglib.decl.AbstractCommandTagDeclaration;
/*
* Date: 10.02.2006
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java Wed Apr 2 12:36:26 2008
@@ -38,13 +38,13 @@
uiComponent = "org.apache.myfaces.tobago.component.UICalendar",
uiComponentBaseClass = "javax.faces.component.UIOutput",
rendererType = "Calendar")
-public interface CalendarTagDeclaration extends TobagoTagDeclaration, HasIdBindingAndRendered {
+public interface CalendarTagDeclaration extends HasIdBindingAndRendered {
/**
* The current value of this component.
*/
@TagAttribute
- @UIComponentTagAttribute(type = {"java.util.Calendar",
- "java.util.Date"}, expression= DynamicExpression.VALUE_BINDING_REQUIRED)
+ @UIComponentTagAttribute(type = {"java.util.Calendar", "java.util.Date"},
+ expression = DynamicExpression.VALUE_BINDING_REQUIRED)
void setValue(String value);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTagDeclaration.java?rev=644014&r1=644013&r2=644014&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTagDeclaration.java Wed Apr 2 12:36:26 2008
@@ -36,10 +36,10 @@
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UICell",
uiComponentBaseClass = "org.apache.myfaces.tobago.component.UIPanelBase",
+ interfaces = "org.apache.myfaces.tobago.component.Cell",
componentType = "org.apache.myfaces.tobago.Cell",
rendererType = "Panel")
-public interface CellTagDeclaration extends TobagoBodyTagDeclaration,
- HasIdBindingAndRendered {
+public interface CellTagDeclaration extends HasIdBindingAndRendered {
/**
* Count of layout columns to span over.