Package org.pentaho.reporting.designer.core.model.selection

Examples of org.pentaho.reporting.designer.core.model.selection.DocumentContextSelectionModel


    if (activeContext == null)
    {
      return;
    }

    final DocumentContextSelectionModel selectionModel1 = getSelectionModel();
    if (selectionModel1 == null)
    {
      return;
    }
    final List<Element> visualElements = selectionModel1.getSelectedElementsOfType(Element.class);
    if (visualElements.isEmpty())
    {
      return;
    }
View Full Code Here


    if (activeContext == null)
    {
      return;
    }

    final DocumentContextSelectionModel selectionModel = activeContext.getSelectionModel();
    final Object[] selectedElements = selectionModel.getSelectedElements();
    if (isParameter())
    {
      final String theTitle = ActionMessages.getString("DeleteAction.Warning");
      final String theDeleteMessage = ActionMessages.getString("DeleteAction.Confirmation");
      final Component theParent = getReportDesignerContext().getView().getParent();
View Full Code Here

    }
  }

  private boolean isParameter()
  {
    final DocumentContextSelectionModel selectionModel = getActiveContext().getSelectionModel();
    final Object[] selectedElements = selectionModel.getSelectedElements();
    for (int i = 0; i < selectedElements.length; i++)
    {
      if (selectedElements[i] instanceof ParameterDefinitionEntry)
      {
        return true;
View Full Code Here

  {
  }

  protected void updateSelection()
  {
    final DocumentContextSelectionModel selectionModel1 = getSelectionModel();
    if (selectionModel1 == null || selectionModel1.getSelectionCount() == 0)
    {
      setEnabled(false);
      return;
    }
    final Object[] selectedElements = selectionModel1.getSelectedElements();
    for (int i = 0; i < selectedElements.length; i++)
    {
      final Object selectedElement = selectedElements[i];
      if (selectedElement instanceof AbstractReportDefinition)
      {
View Full Code Here

          selectionModel.clearSelection();
          renderContext.getSelectionModel().clearSelection();
          return;
        }

        final DocumentContextSelectionModel selectionModel = renderContext.getSelectionModel();
        final Object[] data = new Object[treePaths.length];
        for (int i = 0; i < treePaths.length; i++)
        {
          final TreePath path = treePaths[i];
          data[i] = path.getLastPathComponent();
        }
        selectionModel.setSelectedElements(data);
      }
      finally
      {
        updateFromInternalSource = false;
      }
View Full Code Here

  /**
   * Invoked when an action occurs.
   */
  public void actionPerformed(final ActionEvent e)
  {
    final DocumentContextSelectionModel selectionModel1 = getSelectionModel();
    if (selectionModel1 == null)
    {
      return;
    }

    final ReportDocumentContext activeContext = getActiveContext();
    final Object[] selectedElements = selectionModel1.getSelectedElements();
    if (selectedElements.length == 0)
    {
      return;
    }

View Full Code Here

    }
  }

  protected void updateSelection()
  {
    final DocumentContextSelectionModel selectionModel = getSelectionModel();
    if (selectionModel == null)
    {
      setEnabled(false);
      return;
    }
    if (selectionModel.getSelectionCount() == 0)
    {
      // there's nothing selected, we can safely add a new group
      // at the report level (AbstractReportDefinition)
      setEnabled(true);
      return;
    }
    if (isSingleElementSelection() == false)
    {
      // there's more than 1 element selected, disable because
      // we can't know where to insert in this case
      setEnabled(false);
      return;
    }

    final Object selectedElement = selectionModel.getSelectedElement(0);
    if (selectedElement == getActiveContext().getReportDefinition() || selectedElement instanceof RelationalGroup)
    {
      // if the selectedElement is the report-definition or a relational group
      // then we can safely insert to those
      setEnabled(true);
View Full Code Here

  {
  }

  protected void updateSelection()
  {
    final DocumentContextSelectionModel reportSelectionModel = getSelectionModel();
    if (reportSelectionModel == null)
    {
      setEnabled(false);
      return;
    }

    final Object[] selectedElements = reportSelectionModel.getSelectedElements();
    for (int i = 0; i < selectedElements.length; i++)
    {
      final Object selectedElement = selectedElements[i];
      if (selectedElement instanceof ReportQueryNode)
      {
View Full Code Here

    setEnabled(false);
  }

  public void actionPerformed(final ActionEvent e)
  {
    final DocumentContextSelectionModel reportSelectionModel = getSelectionModel();
    if (reportSelectionModel == null)
    {
      return;
    }

    final Object[] selectedElements = reportSelectionModel.getSelectedElements();
    for (int i = 0; i < selectedElements.length; i++)
    {
      final Object selectedElement = selectedElements[i];
      if (selectedElement instanceof ReportQueryNode)
      {
View Full Code Here

    }

    final RootBandRenderComponent rootBandRenderComponent = (RootBandRenderComponent) owner;
    final Band rootBand = rootBandRenderComponent.getRootBand();

    final DocumentContextSelectionModel selectionModel = renderContext.getSelectionModel();
    for (final Element element : selectionModel.getSelectedElementsOfType(Element.class))
    {
      if (element instanceof Band && ModelUtility.isDescendant(rootBand, element))
      {
        return element;
      }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.model.selection.DocumentContextSelectionModel

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.