Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// WARNING: This file was automatically generated. Do not edit it directly,
// or you will lose your changes.
/*
* 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.trinidad.component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import javax.el.MethodExpression;
import javax.faces.component.UIComponent;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.bean.PropertyKey;
import org.apache.myfaces.trinidad.event.FocusEvent;
import org.apache.myfaces.trinidad.event.RangeChangeEvent;
import org.apache.myfaces.trinidad.event.RangeChangeListener;
import org.apache.myfaces.trinidad.model.RowKeySet;
import org.apache.myfaces.trinidad.util.ComponentUtils;
/**
*
*
* The Apache Trinidad TreeTable is used to display data that is structured in a hierarchical format.
* This component displays a hierarchy
* in a UI similar to a Trinidad Table, and is more elaborate than the Tree component.
* TreeTable supports displaying columns of data per element in the hierarchy.
* Unlike the Tree component, TreeTable
* only supports single rooted hierarchies. The features of the TreeTable
* component include mechanisms for focusing in on subtrees (within the main
* tree), as well as expanding and collapsing elements in the hierarchy.
*
*
*
* Like the Table, the TreeTable's children must be Trinidad
* Column components. Like the Tree, the TreeTable has a "nodeStamp"
* facet which renders the "Object Name" Column.
*
* The "Object Name" Column contains the primary identifier of an element
* in the hierarchy. For example, in an organization chart of employees, the "Object Name"
* Column might be the employee name.
*
*
*
The expansion event is generated for a table when the detail facet of a row is expanded or collapsed. For tree or a treeTable, the expansion
event is generated when tree nodes are expanded or collapsed.
*
*
*
org.apache.myfaces.trinidad.event.SelectionEvent
*
Apply Request Values Invoke Application
*
The selection event is delivered when the table selection
changes.
*
*
*
org.apache.myfaces.trinidad.event.FocusEvent
*
Apply Request Values Invoke Application
*
Event delivered when user clicks to focus on (or zoom into) a particular element's subtree of children.
The TreeTable responds to this event by modifying the "focusPath" property appropriately.
Subsequently, any registered FocusListener instances are called.
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.
*
*
*/
public class UIXTreeTable extends UIXTree
{
static public final FacesBean.Type TYPE = new FacesBean.Type(
UIXTree.TYPE);
static public final PropertyKey ROOT_NODE_RENDERED_KEY =
TYPE.registerKey("rootNodeRendered", Boolean.class, Boolean.TRUE);
static public final PropertyKey ROWS_BY_DEPTH_KEY =
TYPE.registerKey("rowsByDepth", int[].class, null, 0, PropertyKey.Mutable.SOMETIMES);
static public final PropertyKey RANGE_CHANGE_LISTENER_KEY =
TYPE.registerKey("rangeChangeListener", MethodExpression.class);
static public final PropertyKey HEIGHT_KEY =
TYPE.registerKey("height", String.class);
static public final String COMPONENT_FAMILY =
"org.apache.myfaces.trinidad.TreeTable";
static public final String COMPONENT_TYPE =
"org.apache.myfaces.trinidad.TreeTable";
/**
* Construct an instance of the UIXTreeTable.
*/
public UIXTreeTable()
{
super("org.apache.myfaces.trinidad.BaseTreeTable");
}
/**
* Override to update the container client id cache before decode
*/
@Override
public void decode(FacesContext context)
{
_resetContainerClientIdCache();
super.decode(context);
}
/**
* Override to update the container client id cache before validations
*/
@Override
public void processValidators(FacesContext context)
{
_resetContainerClientIdCache();
super.processValidators(context);
}
/**
* Override to update the container client id cache before updates
*/
@Override
public void processUpdates(FacesContext context)
{
_resetContainerClientIdCache();
super.processUpdates(context);
}
/**
* Override to update the container client id cache before encode
*/
@Override
protected void __encodeBegin(FacesContext context) throws IOException
{
_resetContainerClientIdCache();
super.__encodeBegin(context);
}
/**
* Override to return clientd ids with no currency for items in header/footer facets
*/
@Override
public String getContainerClientId(FacesContext context, UIComponent child)
{
String id;
if (_containerClientIdCache == null || _isStampedChild(child))
{
// call the UIXCollection getContainerClientId, which attaches currency string to the client id
id = getContainerClientId(context);
}
else
{
// The target is not a stamped child, so return a client id with no currency string
id = getClientId(context);
}
return id;
}
@Deprecated
public void setRangeChangeListener(MethodBinding binding)
{
setRangeChangeListener(adaptMethodBinding(binding));
}
/**
* Gets the maximum number of rows to show.
* This changes depending on the depth of the current row in the tree
* hierarchy.
* The rows per depth is obtained from
* {@link #getRowsByDepth}.
* @return 0 if all rows must be shown at this level.
*/
@Override
public final int getRows()
{
int depth = getTreeModel().getDepth();
assert depth >= 0;
// the root element is selected when depth is zero:
if (depth==0)
return 1; // the treeTable only shows the first root node.
int[] rows = getRowsByDepth();
if ((rows == null) || (rows.length == 0))
return 0;
depth--;
// in a treeTable, the the first "rows" property affects how many
// children of the root element to show.
return (depth >= rows.length) ? rows[rows.length - 1] : rows[depth];
}
/**
* Gets the range start index for the current collection.
* The current collection is the children of the parent of the
* current rowData. ie: the current collection is the collection of
* siblings of the current rowData.
* @return zero based index of the row that must be displayed first.
* @see #getRowData()
*/
@Override
public final int getFirst()
{
// "first" does not change per path. It changes per parent path.
// this is because "first", "rows" and "rowCount" applies to the container
// element and not the current element:
Object container = _getContainerPath();
Integer first = _firstMap.get(container);
return (first != null) ? first.intValue() : 0;
}
/**
* Sets the range start index for the current collection.
* The current collection is the children of the parent of the
* current rowData. ie: the current collection is the collection of
* siblings of the current rowData.
* @param index zero based index of the row that must be displayed first.
* @see #getRowData()
*/
public void setFirst(int index)
{
// "first" does not change per path. It changes per parent path.
// this is because "first", "rows" and "rowCount" applies to the container
// element and not the current element:
Object container = _getContainerPath();
Map