code: public boolean isPreviewEnabled() {
  
          try {
              // read the original file because temporary file is not created when opening button frame
              CmsFile file = getCms().readFile(getParamResource(), CmsResourceFilter.ALL);
              CmsXmlContent content = CmsXmlContentFactory.unmarshal(getCloneCms(), file);
              return content.getHandler().getPreview(getCms(), m_content, getParamResource()) != null;
          } catch (Exception e) {
              // error reading or unmarshalling, no preview available
              return false;
          }
      }
docs: Returns true if the preview is available for the edited xml content.<p>
  
  This method has to use the resource request parameter and read the file from vfs because the temporary file is
  not available in the upper button frame.<p>
  
  @return true if the preview is enabled, otherwise false