/** * @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.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; }
/** * @see org.opencms.workplace.list.A_CmsListDialog#actionDialog() */ @Override public void actionDialog() throws JspException, ServletException, IOException { // set selected type I_CmsListDirectAction action = getList().getMetadata().getColumnDefinition(LIST_COLUMN_SELECT).getDirectAction( LIST_ACTION_SEL); if (action != null) { String selected = getParamSelectedType(); if (selected != null) { ((CmsListItemSelectionAction)action).setSelectedItemId(selected); } } super.actionDialog(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#actionDialog() */ @Override public void actionDialog() throws JspException, ServletException, IOException { // set selected type I_CmsListDirectAction action = getList().getMetadata().getColumnDefinition(LIST_COLUMN_SELECT).getDirectAction( LIST_ACTION_SEL); if (action != null) { String selected = getParamSelectedType(); if (selected != null) { ((CmsListItemSelectionAction)action).setSelectedItemId(selected); } } super.actionDialog(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#setColumns(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setColumns(CmsListMetadata metadata) { super.setColumns(metadata); // add column uri CmsListColumnDefinition uriCol = new CmsListColumnDefinition(LIST_COLUMN_URI); uriCol.setName(Messages.get().container(Messages.GUI_NEWRESOURCE_LIST_COLS_URI_0)); uriCol.setVisible(false); metadata.addColumn(uriCol); CmsListItemSelectionCustomAction action = (CmsListItemSelectionCustomAction)metadata.getColumnDefinition( LIST_COLUMN_SELECT).getDirectAction(LIST_ACTION_SEL); action.setFieldName(PARAM_NEWRESOURCEURI); action.setColumn(LIST_COLUMN_URI); action.setAttributes(" onclick=\"enableButton();\""); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#setColumns(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setColumns(CmsListMetadata metadata) { super.setColumns(metadata); // add column uri CmsListColumnDefinition uriCol = new CmsListColumnDefinition(LIST_COLUMN_URI); uriCol.setName(Messages.get().container(Messages.GUI_NEWRESOURCE_LIST_COLS_URI_0)); uriCol.setVisible(false); metadata.addColumn(uriCol); CmsListItemSelectionCustomAction action = (CmsListItemSelectionCustomAction)metadata.getColumnDefinition( LIST_COLUMN_SELECT).getDirectAction(LIST_ACTION_SEL); action.setFieldName(PARAM_NEWRESOURCEURI); action.setColumn(LIST_COLUMN_URI); action.setAttributes(" onclick=\"enableButton();\""); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#setColumns(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setColumns(CmsListMetadata metadata) { super.setColumns(metadata); // create default overview action CmsListDefaultAction defOverviewAction = new CmsListDefaultAction(LIST_DEFACTION_OVERVIEW); defOverviewAction.setName(Messages.get().container(Messages.GUI_ROLEEDIT_LIST_DEFACTION_OVERVIEW_NAME_0)); defOverviewAction.setHelpText(Messages.get().container(Messages.GUI_ROLEEDIT_LIST_DEFACTION_OVERVIEW_HELP_0)); metadata.getColumnDefinition(LIST_COLUMN_NAME).addDefaultAction(defOverviewAction); // activate icon action and set a more descriptive help text metadata.getColumnDefinition(LIST_COLUMN_ICON).getDirectAction(LIST_ACTION_ICON).setEnabled(true); metadata.getColumnDefinition(LIST_COLUMN_ICON).setHelpText( Messages.get().container(Messages.GUI_ROLEEDIT_LIST_COLS_EDIT_HELP_0)); }