You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/02/12 22:40:34 UTC
svn commit: r1730114 - in /myfaces/tobago/branches/tobago-3.0.x:
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/
tobago-theme/tobago-theme-scarboroug...
Author: lofwyr
Date: Fri Feb 12 21:40:33 2016
New Revision: 1730114
URL: http://svn.apache.org/viewvc?rev=1730114&view=rev
Log:
Preparation of TOBAGO-1524
* jsf.ajax.request needs to have a rendered element for <tc:columnEvent>
Added:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnBase.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnEvent.java
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumn.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ColumnEventTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumn.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumn.java?rev=1730114&r1=1730113&r2=1730114&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumn.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumn.java Fri Feb 12 21:40:33 2016
@@ -21,15 +21,9 @@ package org.apache.myfaces.tobago.intern
import org.apache.myfaces.tobago.component.Visual;
-import javax.faces.component.UIColumn;
-
-public abstract class AbstractUIColumn extends UIColumn implements Visual {
+public abstract class AbstractUIColumn extends AbstractUIColumnBase implements Visual {
// public abstract Measure getWidth();
- public boolean isResizable() {
- return false;
- }
-
public abstract String getLabel();
}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnBase.java?rev=1730114&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnBase.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnBase.java Fri Feb 12 21:40:33 2016
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package org.apache.myfaces.tobago.internal.component;
+
+import javax.faces.component.UIColumn;
+
+public class AbstractUIColumnBase extends UIColumn {
+
+ public boolean isResizable() {
+ return false;
+ }
+
+}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnEvent.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnEvent.java?rev=1730114&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnEvent.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnEvent.java Fri Feb 12 21:40:33 2016
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+package org.apache.myfaces.tobago.internal.component;
+
+public class AbstractUIColumnEvent extends AbstractUIColumnBase {
+}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java?rev=1730114&r1=1730113&r2=1730114&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java Fri Feb 12 21:40:33 2016
@@ -324,23 +324,23 @@ public abstract class AbstractUISheet ex
state = (SheetState) values[1];
}
- public List<AbstractUIColumn> getAllColumns() {
- ArrayList<AbstractUIColumn> result = new ArrayList<AbstractUIColumn>();
+ public List<AbstractUIColumnBase> getAllColumns() {
+ ArrayList<AbstractUIColumnBase> result = new ArrayList<AbstractUIColumnBase>();
findColumns(this, result, true);
return result;
}
- public List<AbstractUIColumn> getRenderedColumns() {
- ArrayList<AbstractUIColumn> result = new ArrayList<AbstractUIColumn>();
+ public List<AbstractUIColumnBase> getRenderedColumns() {
+ ArrayList<AbstractUIColumnBase> result = new ArrayList<AbstractUIColumnBase>();
findColumns(this, result, false);
return result;
}
- private void findColumns(final UIComponent component, final List<AbstractUIColumn> result, final boolean all) {
+ private void findColumns(final UIComponent component, final List<AbstractUIColumnBase> result, final boolean all) {
for (final UIComponent child : component.getChildren()) {
if (all || child.isRendered()) {
- if (child instanceof AbstractUIColumn) {
- result.add((AbstractUIColumn) child);
+ if (child instanceof AbstractUIColumnBase) {
+ result.add((AbstractUIColumnBase) child);
} else if (child instanceof AbstractUIData){
// ignore columns of nested sheets
} else {
@@ -403,10 +403,10 @@ public abstract class AbstractUISheet ex
private void ensureColumnWidthList() {
- final List<AbstractUIColumn> allColumns = getAllColumns();
+ final List<AbstractUIColumnBase> allColumns = getAllColumns();
final List<Integer> currentWidthList = new ArrayList<Integer>(allColumns.size() + 1);
for (int i = 0; i < allColumns.size(); i++) {
- final AbstractUIColumn column = allColumns.get(i);
+ final AbstractUIColumnBase column = allColumns.get(i);
currentWidthList.add(null);
}
@@ -420,8 +420,8 @@ public abstract class AbstractUISheet ex
return;
}
final LayoutTokens columns = new LayoutTokens();
- final List<AbstractUIColumn> renderedColumns = getRenderedColumns();
- for (final AbstractUIColumn ignored : renderedColumns) {
+ final List<AbstractUIColumnBase> renderedColumns = getRenderedColumns();
+ for (final AbstractUIColumnBase ignored : renderedColumns) {
columns.addToken(RelativeLayoutToken.DEFAULT_INSTANCE);
}
final LayoutTokens rows = new LayoutTokens();
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ColumnEventTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ColumnEventTagDeclaration.java?rev=1730114&r1=1730113&r2=1730114&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ColumnEventTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ColumnEventTagDeclaration.java Fri Feb 12 21:40:33 2016
@@ -31,7 +31,7 @@ import org.apache.myfaces.tobago.interna
@Tag(name = "columnEvent")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UIColumnEvent",
- uiComponentBaseClass = "javax.faces.component.UIColumn",
+ uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIColumnEvent",
uiComponentFacesClass = "javax.faces.component.UIColumn",
interfaces = "org.apache.myfaces.tobago.component.ColumnEvent")
public interface ColumnEventTagDeclaration extends HasIdBindingAndRendered {
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?rev=1730114&r1=1730113&r2=1730114&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Fri Feb 12 21:40:33 2016
@@ -31,6 +31,7 @@ import org.apache.myfaces.tobago.context
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.event.PageAction;
import org.apache.myfaces.tobago.internal.component.AbstractUIColumn;
+import org.apache.myfaces.tobago.internal.component.AbstractUIColumnBase;
import org.apache.myfaces.tobago.internal.util.StringUtils;
import org.apache.myfaces.tobago.layout.ShowPosition;
import org.apache.myfaces.tobago.layout.TextAlign;
@@ -99,7 +100,7 @@ public class SheetRenderer extends Rende
final UISheet sheet = (UISheet) component;
final String clientId = sheet.getClientId(facesContext);
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- final List<AbstractUIColumn> columns = sheet.getRenderedColumns();
+ final List<AbstractUIColumnBase> columns = sheet.getRenderedColumns();
final Selectable selectable = sheet.getSelectable();
final List<Integer> selectedRows = getSelectedRows(sheet);
@@ -152,11 +153,11 @@ public class SheetRenderer extends Rende
writer.startElement(HtmlElements.THEAD);
writer.startElement(HtmlElements.TR);
- for (AbstractUIColumn column : columns) {
+ for (AbstractUIColumnBase column : columns) {
writer.startElement(HtmlElements.TH);
writer.writeIdAttribute(column.getClientId(facesContext));
if (column instanceof UIColumn) {
- writer.writeText(column.getLabel());
+ writer.writeText(((UIColumn)column).getLabel());
} else if (column instanceof UIColumnSelector && selectable.isMulti()) {
writer.writeClassAttribute(Classes.create(sheet, "selectorDropdown"));
@@ -208,7 +209,7 @@ public class SheetRenderer extends Rende
final UISheet sheet = (UISheet) component;
final String clientId = sheet.getClientId(facesContext);
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- final List<AbstractUIColumn> columns = sheet.getRenderedColumns();
+ final List<AbstractUIColumnBase> columns = sheet.getRenderedColumns();
final boolean hasClickAction = HtmlRendererUtils.renderSheetCommands(sheet, facesContext, writer);
final List<Integer> selectedRows = getSelectedRows(sheet);
@@ -249,31 +250,34 @@ public class SheetRenderer extends Rende
}
writer.writeClassAttribute(Classes.create(sheet, "row", rowMarkup), selected ? BootstrapClass.INFO : null);
- for (AbstractUIColumn column : columns) {
+ for (AbstractUIColumnBase column : columns) {
writer.startElement(HtmlElements.TD);
- Markup markup = column.getMarkup();
- if (markup == null) {
- markup = Markup.NULL;
- }
- if (hasClickAction) {
- markup = markup.add(Markup.CLICKABLE);
- }
- final String textAlign = ComponentUtils.getStringAttribute(column, Attributes.align);
- if (textAlign != null) {
- switch (TextAlign.valueOf(textAlign)) {
- case right:
- markup = markup.add(Markup.RIGHT);
- break;
- case center:
- markup = markup.add(Markup.CENTER);
- break;
- case justify:
- markup = markup.add(Markup.JUSTIFY);
- break;
- default:
- // nothing to do
+ Markup markup = Markup.NULL;
+ if (column instanceof AbstractUIColumn) {
+ final Markup markup1 = ((AbstractUIColumn) column).getMarkup();
+ if (markup1 != null) {
+ markup = markup1;
+ }
+ if (hasClickAction) {
+ markup = markup.add(Markup.CLICKABLE);
+ }
+ final String textAlign = ComponentUtils.getStringAttribute(column, Attributes.align);
+ if (textAlign != null) {
+ switch (TextAlign.valueOf(textAlign)) {
+ case right:
+ markup = markup.add(Markup.RIGHT);
+ break;
+ case center:
+ markup = markup.add(Markup.CENTER);
+ break;
+ case justify:
+ markup = markup.add(Markup.JUSTIFY);
+ break;
+ default:
+ // nothing to do
+ }
}
}
writer.writeClassAttribute(Classes.create(sheet, "cell", markup));
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java?rev=1730114&r1=1730113&r2=1730114&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java Fri Feb 12 21:40:33 2016
@@ -29,8 +29,6 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlRoleValues;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1730114&r1=1730113&r2=1730114&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java Fri Feb 12 21:40:33 2016
@@ -33,7 +33,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.event.PageAction;
-import org.apache.myfaces.tobago.internal.component.AbstractUIColumn;
+import org.apache.myfaces.tobago.internal.component.AbstractUIColumnBase;
import org.apache.myfaces.tobago.internal.component.AbstractUIColumnNode;
import org.apache.myfaces.tobago.internal.component.AbstractUIData;
import org.apache.myfaces.tobago.internal.component.AbstractUIMenu;
@@ -110,9 +110,9 @@ public class SheetRenderer extends Rende
if (header == null) {
header = CreateComponentUtils.createComponent(facesContext, UIPanel.COMPONENT_TYPE, null, "_header");
header.setTransient(true);
- final List<AbstractUIColumn> columns = sheet.getAllColumns();
+ final List<AbstractUIColumnBase> columns = sheet.getAllColumns();
int i = 0;
- for (final AbstractUIColumn column : columns) {
+ for (final AbstractUIColumnBase column : columns) {
final AbstractUIOut out = (AbstractUIOut) CreateComponentUtils.createComponent(
facesContext, UIOut.COMPONENT_TYPE, RendererTypes.Out, "_col" + i);
out.setTransient(true);
@@ -180,7 +180,7 @@ public class SheetRenderer extends Rende
final List<Integer> columnWidths = sheet.getWidthList();
final List<Integer> selectedRows = getSelectedRows(sheet, state);
- final List<AbstractUIColumn> renderedColumnList = sheet.getRenderedColumns();
+ final List<AbstractUIColumnBase> renderedColumnList = sheet.getRenderedColumns();
writer.startElement(HtmlElements.INPUT);
writer.writeIdAttribute(sheetId + WIDTHS);
@@ -765,7 +765,7 @@ public class SheetRenderer extends Rende
private void renderColumnHeaders(
final FacesContext facesContext, final UISheet sheet, final TobagoResponseWriter writer,
- final List<AbstractUIColumn> renderedColumnList)
+ final List<AbstractUIColumnBase> renderedColumnList)
throws IOException {
final Selectable selectable = sheet.getSelectable();
@@ -817,7 +817,7 @@ public class SheetRenderer extends Rende
writer.startElement(HtmlElements.DIV);
writer.writeClassAttribute(Classes.create(sheet, "headerCell"));
writer.startElement(HtmlElements.SPAN);
- final AbstractUIColumn column = renderedColumnList.get(j);
+ final AbstractUIColumnBase column = renderedColumnList.get(j);
Icons sorterIcon = null;
Markup markup = Markup.NULL;
String tip = ComponentUtils.getStringAttribute(column, Attributes.tip);