Examples of ElementMetaData


Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

    }
    try
    {
      if (ElementMetaDataTransferable.ELEMENT_FLAVOR.equals(getFlavor()))
      {
        final ElementMetaData metaData = (ElementMetaData) getTransferData();
        dragHandler.drop(dtde, editorContext, metaData, null);
        return;
      }

      if (FieldDescriptionTransferable.ELEMENT_FLAVOR.equals(getFlavor()))
      {
        final String fieldName = (String) getTransferData();
        final ElementMetaData metaData = createMetaData(fieldName);
        dragHandler.drop(dtde, editorContext, metaData, fieldName);
        return;
      }
      dtde.rejectDrop();
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

  {
  }

  private String formatElement(final Element element)
  {
    final ElementMetaData data = element.getMetaData();
    final String displayName = data.getDisplayName(Locale.getDefault());
    if (WorkspaceSettings.getInstance().isElementsDisplayNames())
    {
      final String name = element.getName();

      if (StringUtils.isEmpty(name))
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

    setToolTipText(null);

    if (value instanceof Element)
    {
      final Element vr = (Element) value;
      final ElementMetaData data = vr.getMetaData();
      setText(formatElement(vr));
      final Image icon = data.getIcon(Locale.getDefault(), BeanInfo.ICON_COLOR_32x32);
      if (icon != null)
      {
        setIcon(new ImageIcon(icon));
      }
      setToolTipText(data.getDescription(Locale.getDefault()));
    }
    else if (value instanceof CompoundDataFactory)
    {
      setText(Messages.getString("StructureTreeCellRenderer.DataSets"));
      setIcon(IconLoader.getInstance().getDataSetsIcon());
    }
    else if (value instanceof ReportEnvironmentDataRow)
    {
      setText(Messages.getString("StructureTreeCellRenderer.Environment"));
      setIcon(IconLoader.getInstance().getPropertiesDataSetIcon());
    }
    else if (value instanceof ReportFunctionNode)
    {
      setText(Messages.getString("StructureTreeCellRenderer.Functions"));
      setIcon(IconLoader.getInstance().getFunctionsIcon());
    }
    else if (value instanceof ReportParametersNode || value instanceof SubReportParametersNode)
    {
      setText(Messages.getString("StructureTreeCellRenderer.Parameters"));
      setIcon(IconLoader.getInstance().getParameterIcon());
    }
    else if (value instanceof SubReportParametersNode.ExportParametersNode)
    {
      setText(Messages.getString("StructureTreeCellRenderer.ExportParameters"));
      setIcon(IconLoader.getInstance().getParameterIcon());
    }
    else if (value instanceof SubReportParametersNode.ImportParametersNode)
    {
      setText(Messages.getString("StructureTreeCellRenderer.ImportParameters"));
      setIcon(IconLoader.getInstance().getParameterIcon());
    }
    else if (value instanceof ParameterMapping)
    {
      final ParameterMapping mapping = (ParameterMapping) value;
      setText(Messages.getString("StructureTreeCellRenderer.ParameterMappingMessage", mapping.getAlias(), mapping.getName()));
      setIcon(IconLoader.getInstance().getParameterIcon());
    }
    else if (value instanceof ReportFieldNode)
    {
      final ReportFieldNode fieldNode = (ReportFieldNode) value;
      final ContextAwareDataSchemaModel model = fieldNode.getDataSchemaModel();
      final DataAttributes attributes = model.getDataSchema().getAttributes(fieldNode.getFieldName());
      setToolTipText(fieldNode.getFieldClass().getSimpleName());
      if (attributes == null)
      {
        setText(fieldNode.toString());
      }
      else
      {
        final String displayName = (String) attributes.getMetaAttribute
            (MetaAttributeNames.Formatting.NAMESPACE, MetaAttributeNames.Formatting.LABEL,
                String.class, model.getDataAttributeContext());
        setText(formatFieldType(displayName, fieldNode.getFieldName(), fieldNode.getFieldClass()));
      }
    }
    else if (value instanceof ReportQueryNode)
    {
      final ReportQueryNode queryNode = (ReportQueryNode) value;
      setText(queryNode.getQueryName());
      setToolTipText(queryNode.getDataFactory().getClass().getSimpleName());
    }
    else if (value instanceof Expression)
    {
      final Expression expression = (Expression) value;
      if (ExpressionRegistry.getInstance().isExpressionRegistered(expression.getClass().getName()) == false)
      {

        setText(expression.getClass().getName());
      }
      else
      {
        final ExpressionMetaData expressionMetaData =
            ExpressionRegistry.getInstance().getExpressionMetaData(expression.getClass().getName());

        if (expression.getName() == null)
        {
          setText(expressionMetaData.getDisplayName(Locale.getDefault()));
        }
        else
        {
          setText(Messages.getString("StructureTreeCellRenderer.NamedExpressionMessage",
              expressionMetaData.getDisplayName(Locale.getDefault()), expression.getName()));
        }
      }
    }
    else if (value instanceof ParameterDefinitionEntry)
    {
      final ParameterDefinitionEntry params = (ParameterDefinitionEntry) value;
      setText(params.getName());
    }
    else if (value instanceof DataFactory)
    {
      final DataFactory dfac = (DataFactory) value;
      final DataFactoryMetaData data = dfac.getMetaData();

      final Image image = data.getIcon(Locale.getDefault(), BeanInfo.ICON_COLOR_32x32);
      if (image != null)
      {
        setIcon(new ImageIcon(image));
      }

      final String connectionName = data.getDisplayConnectionName(dfac);
      if (connectionName != null)
      {
        setText(Messages.getString("StructureTreeCellRenderer.NamedDataFactoryMessage",
            data.getDisplayName(Locale.getDefault()), connectionName));
      }
      else
      {
        setText(data.getDisplayName(Locale.getDefault()));
      }
    }
    else if (value instanceof ParentDataFactoryNode)
    {
      setText(Messages.getString("StructureTreeCellRenderer.InheritedDataFactories"));
    }
    else if (value instanceof InheritedDataFactoryWrapper)
    {
      final InheritedDataFactoryWrapper wrapper = (InheritedDataFactoryWrapper) value;
      final DataFactory dfac = wrapper.getDataFactory();
      if (DataFactoryRegistry.getInstance().isRegistered(dfac.getClass().getName()) == false)
      {
        setText(dfac.getClass().getSimpleName());
      }
      else
      {
        final DataFactoryMetaData data = dfac.getMetaData();

        final Image image = data.getIcon(Locale.getDefault(), BeanInfo.ICON_COLOR_32x32);
        if (image != null)
        {
          setIcon(new ImageIcon(image));
        }

        final String connectionName = data.getDisplayConnectionName(dfac);
        if (connectionName != null)
        {
          setText(Messages.getString("StructureTreeCellRenderer.NamedDataFactoryMessage",
              data.getDisplayName(Locale.getDefault()), connectionName));
        }
        else
        {
          setText(data.getDisplayName(Locale.getDefault()));
        }
      }
    }
    return this;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

    final ArrayList<StyleMetaData> result = new ArrayList<StyleMetaData>();

    final ElementMetaData[] allElementTypes = ElementTypeRegistry.getInstance().getAllElementTypes();
    for (int i = 0; i < allElementTypes.length; i++)
    {
      final ElementMetaData elementType = allElementTypes[i];
      final StyleMetaData[] datas = elementType.getStyleDescriptions();
      for (int j = 0; j < datas.length; j++)
      {
        final StyleMetaData data = datas[j];

        if (seenKeys.add(data.getStyleKey()))
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

    return editor;
  }

  private AttributeMetaData selectMetaData(final ReportElement element)
  {
    final ElementMetaData elementMetaData = element.getMetaData();
    final AttributeMetaData fieldData =
            elementMetaData.getAttributeDescription(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD);
    if (fieldData != null)
    {
      return fieldData;
    }
    return elementMetaData.getAttributeDescription(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE);
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

  private boolean deprecated;

  public MorphAction(final ElementType elementType)
  {
    targetElementType = elementType;
    final ElementMetaData metaData = elementType.getMetaData();
    putValue(Action.NAME, metaData.getDisplayName(Locale.getDefault()));

    experimental = metaData.isExperimental();
    expert = metaData.isExpert();
    deprecated = metaData.isDeprecated();

    settingsChanged();
    WorkspaceSettings.getInstance().addSettingsListener(this);
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

    return editor;
  }

  private AttributeMetaData selectMetaData(final ReportElement element)
  {
    final ElementMetaData elementMetaData = element.getMetaData();
    if (Boolean.TRUE.equals(element.getAttribute
        (AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES)))
    {
      return elementMetaData.getAttributeDescription(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR);
    }

    return elementMetaData.getAttributeDescription(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE);
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

    {
      return;
    }

    final ArrayList<UndoEntry> undos = new ArrayList<UndoEntry>();
    final ElementMetaData targetMetaData = targetElementType.getMetaData();
    for (Element visualElement : visualElements)
    {
      if (visualElement instanceof Section)
      {
        continue;
      }
      if (ObjectUtilities.equal(visualElement.getElementTypeName(), targetElementType.getMetaData().getName()))
      {
        continue;
      }

      final ReportAttributeMap oldAttributes = visualElement.getAttributes();

      final ElementMetaData data = visualElement.getMetaData();
      final AttributeMetaData[] datas = data.getAttributeDescriptions();
      for (int j = 0; j < datas.length; j++)
      {
        final AttributeMetaData metaData = datas[j];
        final AttributeMetaData attributeMetaData =
            targetMetaData.getAttributeDescription(metaData.getNameSpace(), metaData.getName());
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

                                       final ReportElementEditorContext dragContext,
                                       final ElementMetaData elementMetaData,
                                       final Point2D point)
  {
    final Element rootBand = findRootBand(dragContext, point);
    final ElementMetaData metaData = rootBand.getElementType().getMetaData();
    final ElementMetaData.TypeClassification reportElementType = metaData.getReportElementType();
    if (reportElementType == ElementMetaData.TypeClassification.HEADER ||
        reportElementType == ElementMetaData.TypeClassification.FOOTER)
    {
      return true;
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.metadata.ElementMetaData

    final Locale locale = Locale.getDefault();
    String group = null;
    for (int i = 0; i < datas.length; i++)
    {
      final ElementMetaData data = datas[i];
      if (data.isHidden())
      {
        continue;
      }
      if (ObjectUtilities.equal(data.getGrouping(locale), group) == false)
      {
        group = data.getGrouping(locale);
        System.out.println();
        System.out.println("h2. " + group);
      }
      printElementInfo(locale, data);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.