Java 类net.sf.jasperreports.engine.export.GenericElementHandler 实例源码

项目:jasperreports    文件:JROdtExporterNature.java   
@Override
public boolean isToExport(JRPrintElement element)
{
    if (element instanceof JRGenericPrintElement)
    {
        JRGenericPrintElement genericElement = (JRGenericPrintElement) element;
        GenericElementHandler handler = handlerEnvironment.getElementHandler(
                genericElement.getGenericType(), JROdtExporter.ODT_EXPORTER_KEY);
        if (handler == null || !handler.toExport(genericElement))
        {
            return false;
        }
    }

    return (filter == null || filter.isToExport(element));
}
项目:dynamicreports-jasper    文件:GoogleChartsHandler.java   
@Override
public GenericElementHandler getHandler(String elementName, String exporterKey) {
    if (handlers.containsKey(elementName)) {
        if (HtmlExporter.HTML_EXPORTER_KEY.equals(exporterKey)) {
            return handlers.get(elementName);
        }
    }
    return null;
}
项目:jasperreports    文件:TextInputElementHandlerBundle.java   
@Override
    public GenericElementHandler getHandler(String elementName,
            String exporterKey)
    {
//      else if (NAME.equals(elementName)
        if (TextInputElement.TEXT_INPUT_ELEMENT_NAME.equals(elementName)
                && JRPdfExporter.PDF_EXPORTER_KEY.equals(exporterKey))
        {
            return new TextInputElementPdfHandler();
        }
//      else if (NAME.equals(elementName)
//              && JRXlsExporter.XLS_EXPORTER_KEY.equals(exporterKey))
//      {
//          return new HtmlElementXlsHandler();
//      }
//      else if (NAME.equals(elementName)
//              && JRGraphics2DExporter.GRAPHICS2D_EXPORTER_KEY.equals(exporterKey))
//      {
//          return new HtmlElementGraphics2DHandler();
//      }       
//      else if (NAME.equals(elementName)
//              && JRDocxExporter.DOCX_EXPORTER_KEY.equals(exporterKey))
//      {
//          return new HtmlElementDocxHandler();
//      }       
//      else if (NAME.equals(elementName)
//              && JRPptxExporter.PPTX_EXPORTER_KEY.equals(exporterKey))
//      {
//          return new HtmlElementPptxHandler();
//      }
//      else if (NAME.equals(elementName)
//              && JRXlsxExporter.XLSX_EXPORTER_KEY.equals(exporterKey))
//      {
//          return new HtmlElementXlsxHandler();
//      }
//      else if (NAME.equals(elementName)
//              && JRRtfExporter.RTF_EXPORTER_KEY.equals(exporterKey))
//      {
//          return new HtmlElementRtfHandler();
//      }
//      else if (NAME.equals(elementName)
//              && JROdtExporter.ODT_EXPORTER_KEY.equals(exporterKey))
//      {
//          return new HtmlElementOdtHandler();
//      }
//      else if (NAME.equals(elementName)
//              && JROdsExporter.ODS_EXPORTER_KEY.equals(exporterKey))
//      {
//          return new HtmlElementOdsHandler();
//      }       
        return null;
    }
项目:jasperreports    文件:HtmlElementHandlerBundle.java   
@Override
public GenericElementHandler getHandler(String elementName,
        String exporterKey)
{
    if (NAME.equals(elementName)
            && JRPdfExporter.PDF_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementPdfHandler();
    }
    else if (NAME.equals(elementName)
            && HtmlExporter.HTML_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementHtmlHandler();
    }
    else if (NAME.equals(elementName)
            && JRXlsExporter.XLS_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementXlsHandler();
    }
    else if (NAME.equals(elementName)
            && JRGraphics2DExporter.GRAPHICS2D_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementGraphics2DHandler();
    }       
    else if (NAME.equals(elementName)
            && JRDocxExporter.DOCX_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementDocxHandler();
    }       
    else if (NAME.equals(elementName)
            && JRPptxExporter.PPTX_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementPptxHandler();
    }
    else if (NAME.equals(elementName)
            && JRXlsxExporter.XLSX_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementXlsxHandler();
    }
    else if (NAME.equals(elementName)
            && JRRtfExporter.RTF_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementRtfHandler();
    }
    else if (NAME.equals(elementName)
            && JROdtExporter.ODT_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementOdtHandler();
    }
    else if (NAME.equals(elementName)
            && JROdsExporter.ODS_EXPORTER_KEY.equals(exporterKey))
    {
        return new HtmlElementOdsHandler();
    }       
    return null;
}
项目:dynamicreports-jasper    文件:GoogleChartsHandler.java   
public GoogleChartsHandler() {
    components = new HashMap<String, Class<? extends Component>>();
    handlers = new HashMap<String, GenericElementHandler>();
}
项目:dynamicreports-jasper    文件:GoogleChartsHandler.java   
public void add(String name, Class<? extends Component> componentClass, GenericElementHandler handler) {
    components.put(name, componentClass);
    handlers.put(name, handler);
}
项目:jasperreports-wms-component    文件:ExtensionsRegistryFactory.java   
@Override
public GenericElementHandler getHandler(String elementName,
    String exporterKey) {
  if (WmsMapPrintElement.WMS_MAP_ELEMENT_NAME.equals(elementName)) {
    if (JRGraphics2DExporter.GRAPHICS2D_EXPORTER_KEY
        .equals(exporterKey)) {
      return WmsMapElementGraphics2DHandler.getInstance();
    }
    if (JRHtmlExporter.HTML_EXPORTER_KEY.equals(exporterKey)
        || JRXhtmlExporter.XHTML_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementHtmlHandler.getInstance();
    }
    else if (JRPdfExporter.PDF_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementPdfHandler.getInstance();
    }
    else if (JRXlsExporter.XLS_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementXlsHandler.getInstance();
    }
    else if (JExcelApiExporter.JXL_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementJExcelApiHandler.getInstance();
    }
    // else
    // if(JExcelApiMetadataExporter.JXL_METADATA_EXPORTER_KEY.equals(exporterKey))
    // {
    // return MapElementJExcelApiMetadataHandler.getInstance();
    // }
    else if (JRXlsxExporter.XLSX_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementXlsxHandler.getInstance();
    }
    else if (JRDocxExporter.DOCX_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementDocxHandler.getInstance();
    }
    else if (JRPptxExporter.PPTX_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementPptxHandler.getInstance();
    }
    else if (JRRtfExporter.RTF_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementRtfHandler.getInstance();
    }
    else if (JROdtExporter.ODT_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementOdtHandler.getInstance();
    }
    else if (JROdsExporter.ODS_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementOdsHandler.getInstance();
    }
  }
  return null;
}
项目:jasperreports-wms-component    文件:ComponentsExtensionsRegistryFactory.java   
@Override
public GenericElementHandler getHandler(String elementName,
    String exporterKey) {
  if (WmsMapPrintElement.WMS_MAP_ELEMENT_NAME.equals(elementName)) {
    if (JRGraphics2DExporter.GRAPHICS2D_EXPORTER_KEY
        .equals(exporterKey)) {
      return WmsMapElementGraphics2DHandler.getInstance();
    }
    if (JRHtmlExporter.HTML_EXPORTER_KEY.equals(exporterKey)
        || JRXhtmlExporter.XHTML_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementHtmlHandler.getInstance();
    }
    else if (JRPdfExporter.PDF_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementPdfHandler.getInstance();
    }
    else if (JRXlsExporter.XLS_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementXlsHandler.getInstance();
    }
    else if (JExcelApiExporter.JXL_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementJExcelApiHandler.getInstance();
    }
    // else
    // if(JExcelApiMetadataExporter.JXL_METADATA_EXPORTER_KEY.equals(exporterKey))
    // {
    // return MapElementJExcelApiMetadataHandler.getInstance();
    // }
    else if (JRXlsxExporter.XLSX_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementXlsxHandler.getInstance();
    }
    else if (JRDocxExporter.DOCX_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementDocxHandler.getInstance();
    }
    else if (JRPptxExporter.PPTX_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementPptxHandler.getInstance();
    }
    else if (JRRtfExporter.RTF_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementRtfHandler.getInstance();
    }
    else if (JROdtExporter.ODT_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementOdtHandler.getInstance();
    }
    else if (JROdsExporter.ODS_EXPORTER_KEY.equals(exporterKey)) {
      return WmsMapElementOdsHandler.getInstance();
    }
  }
  return null;
}