org.primefaces.component.subtable.SubTable Maven / Gradle / Ivy
/*
* Generated, Do Not Modify
*/
/*
* Copyright 2009-2013 PrimeTek.
*
* Licensed 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.primefaces.component.subtable;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
import javax.faces.component.UINamingContainer;
import javax.el.ValueExpression;
import javax.el.MethodExpression;
import javax.faces.render.Renderer;
import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.event.AbortProcessingException;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import java.util.List;
import java.util.ArrayList;
import org.primefaces.component.column.Column;
import org.primefaces.component.columngroup.ColumnGroup;
@ResourceDependencies({
})
public class SubTable extends UIData {
public static final String COMPONENT_TYPE = "org.primefaces.component.SubTable";
public static final String COMPONENT_FAMILY = "org.primefaces.component";
private static final String DEFAULT_RENDERER = "org.primefaces.component.SubTableRenderer";
protected enum PropertyKeys {
;
String toString;
PropertyKeys(String toString) {
this.toString = toString;
}
PropertyKeys() {}
public String toString() {
return ((this.toString != null) ? this.toString : super.toString());
}
}
public SubTable() {
setRendererType(DEFAULT_RENDERER);
}
public String getFamily() {
return COMPONENT_FAMILY;
}
public List columns;
public List getColumns() {
if(columns == null) {
columns = new ArrayList();
for(UIComponent child : this.getChildren()) {
if(child.isRendered() && child instanceof Column) {
columns.add((Column) child);
}
}
}
return columns;
}
public ColumnGroup getColumnGroup(String target) {
for(UIComponent child : this.getChildren()) {
if(child instanceof ColumnGroup) {
ColumnGroup colGroup = (ColumnGroup) child;
String type = colGroup.getType();
if(type != null && type.equals(target)) {
return colGroup;
}
}
}
return null;
}
}