Package org.pentaho.reporting.designer.core.editor.format

Examples of org.pentaho.reporting.designer.core.editor.format.RowBandingDialog


    }

    final ReportDesignerContext context = getReportDesignerContext();
    final Component parent = context.getView().getParent();
    final Window window = LibSwingUtil.getWindowAncestor(parent);
    final RowBandingDialog dialog;
    if (window instanceof JDialog)
    {
      dialog = new RowBandingDialog((JDialog) window);
    }
    else if (window instanceof JFrame)
    {
      dialog = new RowBandingDialog((JFrame) window);
    }
    else
    {
      dialog = new RowBandingDialog();
    }

    final RowBandingFunction function = findRowbandingFunction(activeContext);
    final AbstractReportDefinition report = activeContext.getReportDefinition();
    if (function == null)
    {
      final RowBandingFunction newFunction = new RowBandingFunction();
      if (dialog.performEdit(newFunction))
      {
        report.getExpressions().add(newFunction);
        activeContext.getUndo().addChange(ActionMessages.getString("EditRowBandingAction.Text"),
            new ExpressionAddedUndoEntry(report.getExpressions().size() - 1, newFunction));
        report.notifyNodeChildAdded(function);
      }
    }
    else
    {
      final RowBandingFunction instance = (RowBandingFunction) function.getInstance();
      if (dialog.performEdit(instance))
      {
        final ExpressionCollection expressionCollection = report.getExpressions();
        final int idx = expressionCollection.indexOf(function);
        expressionCollection.set(idx, instance);
        activeContext.getUndo().addChange(ActionMessages.getString("EditRowBandingAction.Text"),
View Full Code Here


    }

    final ReportDesignerContext context = getReportDesignerContext();
    final Component parent = context.getParent();
    final Window window = SwingUtil.getWindowAncestor(parent);
    final RowBandingDialog dialog;
    if (window instanceof JDialog)
    {
      dialog = new RowBandingDialog((JDialog) window);
    }
    else if (window instanceof JFrame)
    {
      dialog = new RowBandingDialog((JFrame) window);
    }
    else
    {
      dialog = new RowBandingDialog();
    }

    SwingUtil.centerDialogInParent(dialog);

    final RowBandingFunction function = findRowbandingFunction(activeContext);
    final AbstractReportDefinition report = activeContext.getReportDefinition();
    if (function == null)
    {
      final RowBandingFunction newFunction = new RowBandingFunction();
      if (dialog.performEdit(newFunction))
      {
        report.getExpressions().add(newFunction);
        activeContext.getUndo().addChange(ActionMessages.getString("EditRowBandingAction.Text"),
            new ExpressionAddedUndoEntry(report.getExpressions().size() - 1, newFunction));
        report.notifyNodeChildAdded(function);
      }
    }
    else
    {
      final RowBandingFunction instance = (RowBandingFunction) function.getInstance();
      if (dialog.performEdit(instance))
      {
        final ExpressionCollection expressionCollection = report.getExpressions();
        final int idx = expressionCollection.indexOf(function);
        expressionCollection.set(idx, instance);
        activeContext.getUndo().addChange(ActionMessages.getString("EditRowBandingAction.Text"),
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.editor.format.RowBandingDialog

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.