| ||
docx | DOC |
|
xlsx | XLS |
|
xml | XML |
|
csv | CSV |
|
txt | TXT |
|
jpg | JPG |
|
png | PNG |
|
heic | HEIC |
|
svg | SVG |
|
zip | ZIP |
|
eml | EML |
|
unknown | Unknown |
|
Symbolizer
The jtp:smbolizer is able to show the related graphic for every class which is implementing EjbWithGraphic<G>
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:j="http://www.jeesl.org/jsf"
xmlns:jp="http://jsf.jeesl.org/prototype"
xmlns:jtp="http://jsf.jeesl.org/prototype/tag">
<p:dataTable styleClass="jeesl-datatable"
var="t" value="#{iconSymbolizerBean.types}" rowIndexVar="index">
<p:column>
<f:facet name="header"><jtp:label entity="IoFileType" code="code"/></f:facet>
<h:outputText value="#{t.code}"/>
</p:column>
<p:column styleClass="jeeslCenter">
<f:facet name="header"><jtp:label entity="IoFileType" code="name"/></f:facet>
<h:outputText value="#{t.name[localeCode].lang}"/>
</p:column>
<h:form id="fTableSize">
<p:dataTable styleClass="jeesl-datatable"
var="size" value="#{iconClickBean.sizes}">
<f:facet name="header">
<j:dtHeader title="Table with different sizes"/>
</f:facet>
<p:column headerText="Size" styleClass="jeeslCenter">
<h:outputText value="#{size}"/>
</p:column>
<p:column headerText="j:svg" styleClass="jeeslCenter">
<j:svg type="jeeslSearch" height="#{size}"/>
</p:column>
<p:column headerText="jp:icon" styleClass="jeeslCenter">
<jp:icon value="#{iconSymbolizerBean.icon}" height="#{size}"/>
</p:column>
<p:column headerText="jtp:symbolizer" styleClass="jeeslCenter">
<jtp:symbolizer value="#{iconSymbolizerBean.type}" height="#{size}"/>
</p:column>
</p:dataTable>
</h:form>
<h:form id="fTable">
<p:dataTable id="dtSectors" widgetVar="wvDtSectors" styleClass="jeesl-datatable"
var="row" value="#{iconSymbolizerBean.list}" rowKey="#{sp.id}"
rows="10" rowsPerPageTemplate="#{appSettingsBean.rowsPerPageTemplate}" paginator="true" paginatorPosition="bottom" paginatorTemplate="#{appSettingsBean.paginatorTemplate}">
<f:facet name="header"><j:dtHeader title="Test"/></f:facet>
<p:ajax event="rowSelect" listener="#{iconSymbolizerBean.selectRow()}" update=":fTable"/>
<p:column>
<ui:remove>
<h:outputText value="#{row[0].code}"/>
</ui:remove>
<jtp:symbolizer value="#{row[0]}"/>
</p:column>
<p:column>
<ui:remove>
<h:outputText value="#{row[1].code}"/>
</ui:remove>
<jtp:symbolizer value="#{row[1]}"/>
</p:column>
<p:column>
<ui:remove>
<h:outputText value="#{row[2].code}"/>
</ui:remove>
<jtp:symbolizer value="#{row[2]}"/>
</p:column>
<p:column>
<ui:remove>
<h:outputText value="#{row[3].code}"/>
</ui:remove>
<jtp:symbolizer value="#{row[3]}"/>
</p:column>
<p:column>
<ui:remove>
<h:outputText value="#{row[4].code}"/>
</ui:remove>
<jtp:symbolizer value="#{row[4]}"/>
</p:column>
</p:dataTable>
</h:form>
@Named @ViewScoped
public class IconSymbolizerBean extends AbstractJeeBean implements Serializable
{
final static Logger logger = LoggerFactory.getLogger(IconSymbolizerBean.class);
private static final long serialVersionUID = 1L;
private List<IoFileType> types; public List<IoFileType> getTypes() {return types;}
private List<List<IoFileType>> list; public List<List<IoFileType>> getList() {return list;}
private List<IoFileType> selection; public List<IoFileType> getSelection() {return selection;}
public void setSelection(List<IoFileType> selection) {this.selection = selection;}
private IoIcon icon; public IoIcon getIcon() {return icon;}
private IoFileType type; public IoFileType getType() {return type;}
@PostConstruct public void init()
{
ProcessingTimeTracker ptt = ProcessingTimeTracker.instance().start();
super.initSecurity();
types = fUtils.allOrderedPosition(IoFileType.class);
icon = fUtils.fByEnum(IoIcon.class,JeeslIcon.Code.jeeslWorkflow);
type = fUtils.fByEnum(IoFileType.class,JeeslFileType.Code.pdf);
Random rnd = new Random();
list = new ArrayList<>();
for(int i=0;i<1000;i++)
{
List<IoFileType> row = new ArrayList<>();
for(int j=0;j<5;j++)
{
row.add(types.get(rnd.nextInt(types.size())));
}
list.add(row);
}
logger.info(JeeLogMessage.postConstruct(ptt));
}
}