/** * @see org.opencms.workplace.commons.A_CmsResourceCategoriesList#setColumns(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setColumns(CmsListMetadata metadata) { super.setColumns(metadata); metadata.getColumnDefinition(LIST_COLUMN_NAME).setFormatter(new I_CmsListFormatter() { /** * @see org.opencms.workplace.list.I_CmsListFormatter#format(java.lang.Object, java.util.Locale) */ public String format(Object data, Locale locale) { CmsListColumnDefinition listColumnDefinition = getList().getMetadata().getColumnDefinition( LIST_COLUMN_STATE); CmsListDirectAction stateAction = (CmsListDirectAction)listColumnDefinition.getDirectAction(LIST_ACTION_ADD); if (!stateAction.isEnabled()) { StringBuffer ret = new StringBuffer(); ret.append("<span style=\"color: graytext;\">"); ret.append(data); ret.append("</span>"); return ret.toString(); } return (String)data; } }); }
/** * @see org.opencms.workplace.commons.A_CmsResourceCategoriesList#setColumns(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setColumns(CmsListMetadata metadata) { super.setColumns(metadata); metadata.getColumnDefinition(LIST_COLUMN_NAME).setFormatter(new I_CmsListFormatter() { /** * @see org.opencms.workplace.list.I_CmsListFormatter#format(java.lang.Object, java.util.Locale) */ @Override public String format(Object data, Locale locale) { CmsListColumnDefinition listColumnDefinition = getList().getMetadata().getColumnDefinition( LIST_COLUMN_STATE); CmsListDirectAction stateAction = (CmsListDirectAction)listColumnDefinition.getDirectAction( LIST_ACTION_ADD); if (!stateAction.isEnabled()) { StringBuffer ret = new StringBuffer(); ret.append("<span style=\"color: graytext;\">"); ret.append(data); ret.append("</span>"); return ret.toString(); } return (String)data; } }); }
/** * Adds an "enabled" column.<p> * * @param metadata the list metadata * @param enable the list action for enabling * @param deactivate the list action for disabling */ private void addEnabledColumn( CmsListMetadata metadata, CmsListDirectAction enable, CmsListDirectAction deactivate) { // create column for activation/deactivation CmsListColumnDefinition enaCol = new CmsListColumnDefinition(LIST_COLUMN_ENABLED); enaCol.setName(Messages.get().container(Messages.GUI_USERS_LIST_COLS_ACTIVATE_0)); enaCol.setHelpText(Messages.get().container(Messages.GUI_USERS_LIST_COLS_ACTIVATE_HELP_0)); enaCol.setWidth("20"); enaCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER); enaCol.setFormatter(new I_CmsListFormatter() { public String format(Object data, Locale locale) { return ""; } }); enaCol.addDirectAction(enable); enaCol.addDirectAction(deactivate); enaCol.setVisible(false); // add it to the list definition metadata.addColumn(enaCol); }
nameCol.setSorteable(false); nameCol.setWidth("60%"); nameCol.setFormatter(new I_CmsListFormatter() { delDateCol.setSorteable(false); delDateCol.setWidth("20%"); delDateCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(delDateCol);
publishingDateCol.setName(Messages.get().container(Messages.GUI_PROJECTS_LIST_COLS_PUBLISHED_DATE_0)); publishingDateCol.setWidth("10%"); publishingDateCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(publishingDateCol); creationCol.setName(Messages.get().container(Messages.GUI_PROJECTS_LIST_COLS_CREATION_0)); creationCol.setWidth("10%"); creationCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(creationCol);
nameCol.setSorteable(false); nameCol.setWidth("60%"); nameCol.setFormatter(new I_CmsListFormatter() { delDateCol.setSorteable(false); delDateCol.setWidth("20%"); delDateCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(delDateCol);
lastLoginCol.setName(Messages.get().container(Messages.GUI_USERS_LIST_COLS_LASTLOGIN_0)); lastLoginCol.setWidth("20%"); lastLoginCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(lastLoginCol);
stateCol.setFormatter(new I_CmsListFormatter() { startCol.setName(Messages.get().container(Messages.GUI_PUBLISHQUEUE_COLS_INQUEUETIME_0)); startCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER); startCol.setFormatter( new CmsListDateMacroFormatter( Messages.get().container(Messages.GUI_LIST_DATE_FORMAT_WITH_SECONDS_1),
dateLastModCol.setName(org.opencms.workplace.explorer.Messages.get().container( org.opencms.workplace.explorer.Messages.GUI_INPUT_DATELASTMODIFIED_0)); dateLastModCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(dateLastModCol); dateCreateCol.setName(org.opencms.workplace.explorer.Messages.get().container( org.opencms.workplace.explorer.Messages.GUI_INPUT_DATECREATED_0)); dateCreateCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(dateCreateCol); dateReleaseCol.setName(org.opencms.workplace.explorer.Messages.get().container( org.opencms.workplace.explorer.Messages.GUI_INPUT_DATERELEASED_0)); dateReleaseCol.setFormatter(new CmsListDateMacroFormatter( Messages.get().container(Messages.GUI_LIST_DATE_FORMAT_1), new CmsMessageContainer(null, CmsTouch.DEFAULT_DATE_STRING), dateExpirationCol.setName(org.opencms.workplace.explorer.Messages.get().container( org.opencms.workplace.explorer.Messages.GUI_INPUT_DATEEXPIRED_0)); dateExpirationCol.setFormatter(new CmsListDateMacroFormatter( Messages.get().container(Messages.GUI_LIST_DATE_FORMAT_1), new CmsMessageContainer(null, CmsTouch.DEFAULT_DATE_STRING),
org.opencms.workplace.explorer.Messages.get().container( org.opencms.workplace.explorer.Messages.GUI_INPUT_DATELASTMODIFIED_0)); dateLastModCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(dateLastModCol); org.opencms.workplace.explorer.Messages.get().container( org.opencms.workplace.explorer.Messages.GUI_INPUT_DATECREATED_0)); dateCreateCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(dateCreateCol); org.opencms.workplace.explorer.Messages.get().container( org.opencms.workplace.explorer.Messages.GUI_INPUT_DATERELEASED_0)); dateReleaseCol.setFormatter( new CmsListDateMacroFormatter( Messages.get().container(Messages.GUI_LIST_DATE_FORMAT_1), org.opencms.workplace.explorer.Messages.get().container( org.opencms.workplace.explorer.Messages.GUI_INPUT_DATEEXPIRED_0)); dateExpirationCol.setFormatter( new CmsListDateMacroFormatter( Messages.get().container(Messages.GUI_LIST_DATE_FORMAT_1),
creationCol.setName(Messages.get().container(Messages.GUI_SESSIONS_LIST_COLS_CREATION_0)); creationCol.setWidth("16%"); creationCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(creationCol); inactiveCol.setName(Messages.get().container(Messages.GUI_SESSIONS_LIST_COLS_INACTIVE_0)); inactiveCol.setWidth("10%"); inactiveCol.setFormatter(new CmsListTimeIntervalFormatter()); metadata.addColumn(inactiveCol);
lastLoginCol.setName(Messages.get().container(Messages.GUI_USERS_LIST_COLS_LASTLOGIN_0)); lastLoginCol.setWidth("20%"); lastLoginCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(lastLoginCol);
startCol.setName(Messages.get().container(Messages.GUI_PERSONALQUEUE_COLS_STARTPUBLISHING_0)); startCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER); startCol.setFormatter( new CmsListDateMacroFormatter( Messages.get().container(Messages.GUI_LIST_DATE_FORMAT_WITH_SECONDS_1), endCol.setName(Messages.get().container(Messages.GUI_PERSONALQUEUE_COLS_STOPPUBLISHING_0)); endCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER); endCol.setFormatter( new CmsListDateMacroFormatter( Messages.get().container(Messages.GUI_LIST_DATE_FORMAT_WITH_SECONDS_1),
groupCol.setAlign(CmsListColumnAlignEnum.ALIGN_LEFT); CmsModulesListGroupFormatter groupFormatter = new CmsModulesListGroupFormatter(); groupCol.setFormatter(groupFormatter); metadata.addColumn(groupCol);
lastExecCol.setListItemComparator(new CmsListItemDefaultComparator()); lastExecCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(lastExecCol); nextExecCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(nextExecCol);
versionCol.setWidth("5%"); versionCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER); versionCol.setFormatter(new I_CmsListFormatter() {
versionCol.setWidth("5%"); versionCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER); versionCol.setFormatter(new I_CmsListFormatter() {
creationCol.setName(Messages.get().container(Messages.GUI_PROJECTS_LIST_COLS_CREATION_0)); creationCol.setWidth("14%"); creationCol.setFormatter(CmsListDateMacroFormatter.getDefaultDateFormatter()); metadata.addColumn(creationCol);