/** * Returns if the column with the given property id is visible and not collapsed.<p> * * @param propertyId the property id * * @return <code>true</code> if the column is visible */ public boolean isColumnVisible(CmsResourceTableProperty propertyId) { return Arrays.asList(m_fileTable.getVisibleColumns()).contains(propertyId) && !m_fileTable.isColumnCollapsed(propertyId); }
/** * Sets the list of collapsed columns.<p> * * @param collapsedColumns the list of collapsed columns */ public void setCollapsedColumns(Object... collapsedColumns) { Set<Object> collapsedSet = Sets.newHashSet(); for (Object collapsed : collapsedColumns) { collapsedSet.add(collapsed); } for (Object key : m_fileTable.getVisibleColumns()) { m_fileTable.setColumnCollapsed(key, collapsedSet.contains(key)); } }
/** * Sets the I18N values for the Table itself, and also iterates the visible columns for column ids which are I18NKeys, and translates those as well * * @param table * the table to process * @param annotationValues * the values to apply * @param annotationInfo * used primarily for the Field name */ protected void processTable(Table table, AnnotationValues annotationValues, AnnotationInfo annotationInfo) { // Table columns need special treatment applyAnnotationValues(table, annotationValues, annotationInfo); // do the column headers Object[] columns = table.getVisibleColumns(); Locale locale = annotationValues.locale.isPresent() ? annotationValues.locale.get() : currentLocale.getLocale(); List<String> headers = new ArrayList<>(); for (Object column : columns) { if (column instanceof I18NKey) { I18NKey columnKey = (I18NKey) column; String header = translate.from(columnKey, locale); headers.add(header); } else { headers.add(column.toString()); } } String headerArray[] = headers.toArray(new String[headers.size()]); table.setColumnHeaders(headerArray); }
Object[] visibleColumns = getTable().getVisibleColumns(); if (visibleColumns != null && visibleColumns.length > 0) { List<P> properties = new ArrayList<>(visibleColumns.length);
/** * Sets the table state.<p> * * @param state the table state */ public void setTableState(CmsFileExplorerSettings state) { if (state != null) { m_fileTable.setSortContainerPropertyId(state.getSortColumnId()); m_fileTable.setSortAscending(state.isSortAscending()); Object[] visibleCols = m_fileTable.getVisibleColumns(); for (int i = 0; i < visibleCols.length; i++) { m_fileTable.setColumnCollapsed(visibleCols[i], state.getCollapsedColumns().contains(visibleCols[i])); } } }
/** * Returns the current table state.<p> * * @return the table state */ public CmsFileExplorerSettings getTableSettings() { CmsFileExplorerSettings fileTableState = new CmsFileExplorerSettings(); fileTableState.setSortAscending(m_fileTable.isSortAscending()); fileTableState.setSortColumnId((CmsResourceTableProperty)m_fileTable.getSortContainerPropertyId()); List<CmsResourceTableProperty> collapsedCollumns = new ArrayList<CmsResourceTableProperty>(); Object[] visibleCols = m_fileTable.getVisibleColumns(); for (int i = 0; i < visibleCols.length; i++) { if (m_fileTable.isColumnCollapsed(visibleCols[i])) { collapsedCollumns.add((CmsResourceTableProperty)visibleCols[i]); } } fileTableState.setCollapsedColumns(collapsedCollumns); return fileTableState; }
Object[] cols = m_fileTable.getVisibleColumns(); List<CmsResourceTableProperty> expandCols = Lists.newArrayList(); int nonExpandWidth = 0;
Object[] visibleCols = m_fileTable.getVisibleColumns(); for (int i = 0; i < visibleCols.length; i++) { if (CmsResourceTableProperty.PROPERTY_RESOURCE_NAME.equals(visibleCols[i])) {
table.setSelectable(true); for (Object o : table.getVisibleColumns()) { table.setColumnHeader(o, getMessage("processdata.comments.comment.table." + o));
for (Object o : table.getVisibleColumns()) { table.setColumnHeader(o, getMessage("awf.basewidgets.process-history." + o));