Package org.pentaho.reporting.engine.classic.core.designtime

Examples of org.pentaho.reporting.engine.classic.core.designtime.AttributeChange


    {
      if (event.getElement() != element)
      {
        if (event.getParameter() instanceof AttributeChange)
        {
          final AttributeChange attributeChange = (AttributeChange) event.getParameter();
          if (ReportDesignerBoot.DESIGNER_NAMESPACE.equals(attributeChange.getNamespace()) &&
              ReportDesignerBoot.VISUAL_HEIGHT.equals(attributeChange.getName()))
          {
            fireChangeEvent();
          }
        }
      }
View Full Code Here


    {
      return;
    }

    // This is an attribute change event ... see if it is one we are concerned about
    final AttributeChange attributeChange = (AttributeChange) event.getParameter();
    final ReportElement reportElement = (ReportElement) event.getElement();
    final AttributeMetaData attributeDescription = reportElement.getMetaData().getAttributeDescription(attributeChange.getNamespace(), attributeChange.getName());
    if (attributeDescription == null ||
        AttributeMetaData.VALUEROLE_RESOURCE.equals(attributeDescription.getValueRole()) == false)
    {
      return;
    }

    // See if we need to load the resource's value into the resource key
    final Object newValue = attributeChange.getNewValue();
    if (newValue instanceof ResourceKey && shouldBeLoaded((ResourceKey) newValue))
    {
      try
      {
        // Embed the file and swap in the key which refers to the embedded resource
        final ResourceKey newKey = loadResourceIntoKey((ResourceKey) newValue);
        if (newKey != null)
        {
          // Swap out the old key with the new key (the new key has the resource loaded)
          reportElement.setAttribute(attributeChange.getNamespace(), attributeChange.getName(), newKey);
        }
      }
      catch (Exception e)
      {
        reportElement.setAttribute(attributeChange.getNamespace(), attributeChange.getName(), null);
        UncaughtExceptionsModel.getInstance().addException(e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.designtime.AttributeChange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.