Examples of UndoManager


Examples of org.pentaho.reporting.designer.core.util.undo.UndoManager

    final ReportDocumentContext reportRenderContext = getReportRenderContext();
    if (reportRenderContext == null)
    {
      throw new IllegalStateException("No report render context? Thats bad.");
    }
    final UndoManager undo = reportRenderContext.getUndo();

    boolean changed = false;
    final ReportElement[] elements = getAttributeDataBackend().getData();
    final ArrayList<UndoEntry> undos = new ArrayList<UndoEntry>();
    for (int i = 0; i < elements.length; i++)
    {
      final ReportElement element = elements[i];
      final Object attribute = element.getAttribute(metaData.getNameSpace(), metaData.getName());
      if ((ObjectUtilities.equal(attribute, value)) == false)
      {
        undos.add(new AttributeEditUndoEntry
            (element.getObjectID(), metaData.getNameSpace(), metaData.getName(), attribute, value));
        element.setAttribute(metaData.getNameSpace(), metaData.getName(), value);
        changed = true;
      }
    }
    undo.addChange(Messages.getString("AttributeTableModel.UndoName"),
        new CompoundUndoEntry((UndoEntry[]) undos.toArray(new UndoEntry[undos.size()])));

    return changed;
  }
View Full Code Here

Examples of org.pentaho.reporting.designer.core.util.undo.UndoManager

    if (reportRenderContext == null)
    {
      throw new IllegalStateException("No report render context? Thats bad.");
    }

    final UndoManager undo = reportRenderContext.getUndo();
    boolean changed = false;
    final ReportElement[] elements = getAttributeDataBackend().getData();
    final ArrayList<UndoEntry> undos = new ArrayList<UndoEntry>();
    for (int i = 0; i < elements.length; i++)
    {
      final ReportElement element = elements[i];
      final Object attribute = element.getAttribute(metaData.getNameSpace(), metaData.getName());
      if ((ObjectUtilities.equal(attribute, value)) == false)
      {
        undos.add(new AttributeEditUndoEntry
            (element.getObjectID(), metaData.getNameSpace(), metaData.getName(), attribute, value));
        element.setAttribute(metaData.getNameSpace(), metaData.getName(), value);
        changed = true;
      }
    }
    undo.addChange(Messages.getString("VisualAttributeTableModel.UndoName"),
        new CompoundUndoEntry((UndoEntry[]) undos.toArray(new UndoEntry[undos.size()])));

    return changed;
  }
View Full Code Here

Examples of org.pentaho.reporting.designer.core.util.undo.UndoManager

      final ReportDocumentContext reportRenderContext = getReportRenderContext();
      if (reportRenderContext == null)
      {
        throw new IllegalStateException("No report render context? Thats bad.");
      }
      final UndoManager undo = reportRenderContext.getUndo();

      final ArrayList<UndoEntry> undos = new ArrayList<UndoEntry>();
      for (int i = 0; i < elements.length; i++)
      {
        final Element element = elements[i];
        final Expression attribute = element.getAttributeExpression
            (metaData.getNameSpace(), metaData.getName());
        if (value != null)
        {
          final Expression expression = value.getInstance();
          undos.add(new AttributeExpressionEditUndoEntry
              (element.getObjectID(), metaData.getNameSpace(), metaData.getName(), attribute, expression));
          element.setAttributeExpression(metaData.getNameSpace(), metaData.getName(), expression);
        }
        else
        {
          undos.add(new AttributeExpressionEditUndoEntry
              (element.getObjectID(), metaData.getNameSpace(), metaData.getName(), attribute, null));
          element.setAttributeExpression(metaData.getNameSpace(), metaData.getName(), null);
        }
      }
      undo.addChange(Messages.getString("VisualAttributeTableModel.UndoNameExpression"),
          new CompoundUndoEntry((UndoEntry[]) undos.toArray(new UndoEntry[undos.size()])));

    }
    return changed;
  }
View Full Code Here

Examples of palmed.edit.selection.UndoManager

        if( text == null )
            throw new IllegalArgumentException( "parameter 'text' is null" );
        text_ = text;
        selection_ = new Selection( text );
        selection_.register( this );
        manager_ = new UndoManager( UNDO_STACK_SIZE );
    }
View Full Code Here

Examples of slash.navigation.gui.undo.UndoManager

                        formatAndRoutesModel.getFormat() != null &&
                        formatAndRoutesModel.getFormat().isSupportsWriting());
            }
        });

        UndoManager undoManager = Application.getInstance().getContext().getUndoManager();
        undoManager.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                handleUndoUpdate();
            }
        });
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.