/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#getVisibility(org.opencms.file.CmsObject, CmsResourceUtil[]) */ @Override public CmsMenuItemVisibilityMode getVisibility(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (resourceUtil[0].getStateAbbreviation() == CmsResourceState.STATE_DELETED.getAbbreviation()) { return CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE; } return CmsMenuItemVisibilityMode.VISIBILITY_INVISIBLE; }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#getVisibility(org.opencms.file.CmsObject, CmsResourceUtil[]) */ @Override public CmsMenuItemVisibilityMode getVisibility(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (resourceUtil[0].getStateAbbreviation() == CmsResourceState.STATE_DELETED.getAbbreviation()) { return CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE; } return CmsMenuItemVisibilityMode.VISIBILITY_INVISIBLE; }
/** * Returns resource state abbreviation.<p> * * @return resource state abbreviation */ public char getStateAbbreviation() { return getResource().getState().getAbbreviation(); }
/** * Helper method to generate a string representation for a collection of resources for debug purposes.<p> * * @param resources the resources * @return a string representing the list of resources */ private String resourcesToString(Iterable<CmsResource> resources) { StringBuffer buffer = new StringBuffer(); boolean first = true; buffer.append("["); for (CmsResource res : resources) { if (!first) { buffer.append(", "); } first = false; buffer.append(res.getRootPath()); buffer.append("!"); buffer.append(res.getState().getAbbreviation()); } buffer.append("]"); return buffer.toString(); } }
/** * Returns resource state abbreviation.<p> * * @return resource state abbreviation */ public char getStateAbbreviation() { return getResource().getState().getAbbreviation(); }