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

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


      {
        return;
      }

      // This is an attribute change event on the master report ... see if it is one we are concerned about
      final AttributeChange attributeChange = (AttributeChange) event.getParameter();
      if (AttributeNames.Core.NAMESPACE.equals(attributeChange.getNamespace()) &&
          AttributeNames.Core.BUNDLE.equals(attributeChange.getName()))
      {
        final Object value = attributeChange.getNewValue();
        if ((value instanceof DocumentBundle) == false)
        {
          return;
        }
View Full Code Here


        cachedAttributes = null;
      }
    }
    if (notifyChange)
    {
      notifyNodePropertiesChanged(new AttributeChange(namespace, name, oldValue, value));
    }
  }
View Full Code Here

        else if (event.getType() == ReportModelEvent.NODE_PROPERTIES_CHANGED)
        {
          final Object eventParameter = event.getParameter();
          if (eventParameter instanceof AttributeChange)
          {
            final AttributeChange attributeChange = (AttributeChange) eventParameter;
            if (AttributeNames.Core.NAMESPACE.equals(attributeChange.getNamespace()))
            {
              if (AttributeNames.Core.NAME.equals(attributeChange.getName()) ||
                  AttributeNames.Core.FIELD.equals(attributeChange.getName()) ||
                  AttributeNames.Core.VALUE.equals(attributeChange.getName()) ||
                  AttributeNames.Core.RESOURCE_IDENTIFIER.equals(attributeChange.getName()))
              {
                invalidateLayoutCache();
              }
            }
            return;
View Full Code Here

              return;
            }

            if (eventParameter instanceof AttributeChange)
            {
              final AttributeChange attributeChange = (AttributeChange) eventParameter;
              if (AttributeNames.Internal.NAMESPACE.equals(attributeChange.getNamespace()) ||
                  AttributeNames.Internal.QUERY.equals(attributeChange.getName()))
              {

                realModel.fireQueryChanged(attributeChange.getOldValue());
                realModel.fireQueryChanged(attributeChange.getNewValue());
              }
              return;
            }

            if (eventParameter instanceof Expression ||
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

      final MasterReport masterReport = (MasterReport) event.getElement();
      final Object parameter = event.getParameter();
      if (parameter instanceof AttributeChange)
      {
        final AttributeChange change = (AttributeChange) parameter;
        if (AttributeNames.Internal.NAMESPACE.equals(change.getNamespace()) &&
                AttributeNames.Internal.COMAPTIBILITY_LEVEL.equals(change.getName()))
        {
          updateCompatibilityLevel(masterReport);
        }
      }
    }
View Full Code Here

    {
      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

      }
      final MasterReport report = (MasterReport) event.getElement();

      if (event.getParameter() instanceof AttributeChange)
      {
        final AttributeChange attributeChange = (AttributeChange) event.getParameter();

        // This is an attribute change event on the master report ... see if it is one we are concerned about
        if (AttributeNames.Core.NAMESPACE.equals(attributeChange.getNamespace()) &&
            AttributeNames.Core.BUNDLE.equals(attributeChange.getName()))
        {
          final Object value = attributeChange.getNewValue();
          if ((value instanceof DocumentBundle) == false)
          {
            return;
          }
View Full Code Here

      }
    }

    if (notifyChange)
    {
      notifyNodePropertiesChanged(new AttributeChange(namespace, name, oldValue, value));
    }
  }
View Full Code Here

          if (event.getElement() == model.getRoot())
          {
            final Object eventParameter = event.getParameter();
            if (eventParameter instanceof AttributeChange)
            {
              final AttributeChange attributeChange = (AttributeChange) eventParameter;
              if (AttributeNames.Internal.NAMESPACE.equals(attributeChange.getNamespace()) ||
                  AttributeNames.Internal.QUERY.equals(attributeChange.getNamespace()))
              {
                realModel.fireTreeNodeChanged(realModel.getDataFactoryElement());
              }

              // else do nothing, as style-changes and other attribute-changes have no effect on the datamodel.
            }
            else if (eventParameter instanceof AttributeExpressionChange ||
                     eventParameter instanceof StyleChange ||
                     eventParameter instanceof StyleExpressionChange)
            {
              // these things have no effect on the data ..
            }
            else if (eventParameter instanceof Expression ||
                     eventParameter instanceof ReportParameterDefinition)
            {
              realModel.fireTreeNodeChanged(eventParameter);
            }
            else
            {
              realModel.fireTreeDataChanged();
            }
          }
          else
          {
            realModel.fireTreeNodeChanged(event.getElement());
          }
        }
        else if (model instanceof ReportStructureTreeModel)
        {
          final ReportStructureTreeModel realModel = (ReportStructureTreeModel) model;
          final Object eventParameter = event.getParameter();
          if (eventParameter instanceof AttributeChange)
          {
            final AttributeChange attributeChange = (AttributeChange) eventParameter;
            if (AttributeNames.Core.NAMESPACE.equals(attributeChange.getNamespace()))
            {
              if (AttributeNames.Core.NAME.equals(attributeChange.getName()) ||
                  AttributeNames.Core.FIELD.equals(attributeChange.getName()) ||
                  AttributeNames.Core.VALUE.equals(attributeChange.getName())||
                  AttributeNames.Core.RESOURCE_IDENTIFIER.equals(attributeChange.getName()))
              {
                invalidateLayoutCache();
              }
            }
          }
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.