UndoManager

How do i focus the undomanager on individual textpanes in a tabbedpane. Here is my code:
This action Performed is opening a predefined file template and attempting to add an undo manager then adds it to the tabbed Pane
public void actionPerformed(ActionEvent e)
          //Adds a new text pane to screen
          if(e.getSource() == buttons[0] || e.getSource() == menu_items[0])
               pre = new Predefined();
               String file = pre.getChoice();
               File files = new File(file);
               String file_name = files.getName();
               String contents = file_opener.readFile(files);
               JTextPane pane = getPane();
               pane.setText(contents);          
               pane.getDocument().addUndoableEditListener(new UndoableEditListener(){
               public void undoableEditHappened(UndoableEditEvent ue)
                    undo_manager.addEdit(ue.getEdit());
                    updateActions();
               JScrollPane scroll = new JScrollPane(pane);
               tabbed_pane.add(file_name,scroll);
               int index = tabbed_pane.getTabCount();
               tabbed_pane.setSelectedIndex(index-1);
          }this piece updates my undo buttons and menu items
public void updateActions()
         buttons[6].setToolTipText(undo_manager.getUndoPresentationName());
         buttons[7].setToolTipText(undo_manager.getRedoPresentationName());
         buttons[6].setEnabled(undo_manager.canUndo());
         buttons[7].setEnabled(undo_manager.canRedo());
         menu_items[4].setToolTipText(undo_manager.getUndoPresentationName());
         menu_items[5].setToolTipText(undo_manager.getRedoPresentationName());
         menu_items[4].setEnabled(undo_manager.canUndo());
         menu_items[5].setEnabled(undo_manager.canRedo());
       }I hope i was clear enough if not plz say.

One simple approach would be to let each pane have its own UndoManager. The UndoManager for the currently active pane would be the one that controls the state of your Undo-Redo actions. When the user selects a new tab you update the actions accordingly.

Similar Messages

  • UndoManager doesn't work when TextArea focusOut

    Hello,
    UndoManager no longer works when the textArea focusOut and I return in the textarea, the history is erased.
    <!-- Simple example to demonstrate the Spark List component -->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" width="260" height="480">
              <fx:Script>
        <![CDATA[
              import flashx.textLayout.edit.EditManager;
              import flashx.undo.UndoManager;
              public function comp (e:Event):void{
                        var undoManager:UndoManager = new UndoManager();
                        var editManager:EditManager = new EditManager(undoManager);
                        txt1.textFlow.interactionManager = editManager;
              ]]>
              </fx:Script>
              <s:Panel title="undo" width="240" height="460" horizontalCenter="0" verticalCenter="0">
                        <s:VGroup>
                                  <s:TextArea id="txt1" width="200" height="50"
                horizontalCenter="0" verticalCenter="0" />
                                  <s:Button label="focusOut"/>
                        </s:VGroup>
              </s:Panel>
    </s:Application>
    Thanks

    By default, the undo history is cleared when the RichEditableText component in the TextArea skin loses focus.
    I see in RichEditableText there is a backdoor to change this behavior:
         mx_internal var clearUndoOnFocusOut:Boolean = true;
    so you should be able to add
    import mx.core.mx_internal;
    use namespace mx_internal;
    and this to function comp
    RichEditableText(txt1.textDisplay).clearUndoOnFocusOut = false;
    to get the behavior you want.
    Carol

  • UndoManager is Too Slow

    Hi Forum!
    I have an UndoManager listening to a JTextPane. When I press and hold a key in the JTextPane, say, to insert a bunch of "j" characters, the JTextPane seems to respond very slowly, and the characters appear to be painted several seconds after they are typed.
    However, this performance issue seems to disappear as soon as I invoke either the "cut()" or "copy()" functions on the JTextPane. No other clipboard-oriented function has this effect.
    What on earth can be going on?
    Also, no matter what I try, I cannot seem to hold down control-Z and invoke repeating, rapidly successive Undos. They do occur, but the changes do not update themselves to the JTextPane immediately, and in fact, seem to eventually freeze up the JVM after too many Undos have been invoked, until the changes are eventually updated, after several seconds of processing.
    How can I force these Undos to execute and update the JTextPane immediately, so that I can press and hold control-Z and experience instantaneous Undos, just like in say, EditPlus 2?

    I have an UndoManager listening to a JTextPane. When I press and
    hold a key in the JTextPane, say, to insert a bunch of "j" characters,
    the JTextPane seems to respond very slowly, and the characters
    appear to be painted several seconds after they are typed.I don't notice a problem.
    Also, no matter what I try, I cannot seem to hold down control-Z and
    invoke repeating, rapidly successive Undos. I seem to experience similiar behaviour. About 5-10 get undo then it freezes for a split second then another 5-10. You should also note that by default only the last 100 edits will be saved. The UndoManager has a setLimits(...) method to control this.
    How can I force these Undos to execute and update the JTextPane
    immediately, so that I can press and hold control-Z and experience
    instantaneous Undos, just like in say, EditPlus 2? Just guessing that the events are being received so fast that the RepaintManager can't keep up and some repaints are being grouped together. If this is the problem, then the onlly way to solve it would be to slow down the events. One way would be to have the undo requests added to a private queue. Then you would start a Timer to remove each request from the queue in a more orderly fashion.
    Another option might be to use my CompoundUndoManager. This manager groups consecutive entry of characters into a single undo. Then the whole group can be undone at one time. This approach is closer to the way Word works for example.
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=637225

  • Flex 4.1 TLF UndoManager question

    Hey All,
    I am working on a project using TLF 1.1 and Flex 4.1 and have run into a bit of a problem with the UndoManager's calls to undo(). The situation goes that we have a TextFlow that contains text that fills up the dimensions of the flow. We run some checks on the text to ensure it stays within the bounds of the box and we use the EditManagers UndoManager to undo the operations performed by a user. Currently I am calling it like this:
    while( (textFlow.interactionManager as IEditManager).undoManager.canUndo() ) {
    (textFlow.interactionManager as IEditManager).undoManager.undo();
    I can see the operations in the list and can even get to them by calling popUndo(). However when I cycle over the list and call the operations to perform an undo it seems to not perform the undo. I can enter a newline into the text flow, paste some length of text, or even change the font size and those operations do not seem to be undone. I was wondering if there was anyone that has run into this before? If so is there an available fix?
    We are holding off on upgrading to 4.5.1 till after we get this fixed for this particular project. It may be something to look into more with the newer versions of TLF.

    To reproduce the problem just populate a Spark List with items from an ArrayCollection,make the list dragEnabled,
    dragMoveEnabled,and dropEnabled.Write an event handler for a dragDrop or dragComplete type of DragEvent,like so
    private function onDragComplete(e:DragEvent):void{
    var draggedItems:Vector.<Object>=e.dragSource.dataForFormat("itemsByIndex") as Vector.<Object>;
    trace ('draggedItems Vector  :'+draggedItems);
    trace ('Property prop of   item[0] : '+draggedItems[0].prop);
    If you debug with Flex 4.0 and drag an item in the List,the traces will print the object dragged as the first element of the draggedItems Vector,
    (or any property of that item if we like).
    In Flex 4.1 you will get just an empty Vector.

  • UndoManager mass events

    My SSCCE copes with single events correctly. For example if you add a square, you can undo this event. Similiarly if you delete a square, you can undo this event. However if you add 3 squares at once, you need to click undo 3 times. It should work that if you add/delete multiple square you only need to click undo once to revert.
    To do this I think I need to create some sort of thread within the MyUndoManager class which is started when massEvent variable equals true and ends with massEvent = false. However im not to sure how to go about creating a waiting thread? Any hints?
    import Swing.Model.ModelEvent;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.undo.*;
    public class UndoManagerThreadedDemo extends JFrame {
        public static void main(String argv[]) {
            Model m = new Model();
            new GUI(m);
    class GUI extends JFrame {
        protected JButton undoButton = new JButton("Undo");
        protected JButton redoButton = new JButton("Redo");
        protected JButton add3SquaresButton = new JButton("add 3 Squares");
        protected JButton addSquareButton = new JButton("Add Sqaure");
        protected JButton deleteSquareButton = new JButton("Delete Square");
        protected PaintCanvas canvas;
        private Model model;
        private MyUndoManager undoManager;
        private boolean undoEvent = false;
        private boolean massEvent = false;
        public GUI(Model mo) {
            super("Undo/Redo Demo");
            this.model = mo;
            undoManager = new MyUndoManager();
            canvas = new PaintCanvas();
            undoButton.setEnabled(false);
            redoButton.setEnabled(false);
            deleteSquareButton.setEnabled(false);
            JPanel buttonPanel = new JPanel(new GridLayout());
            buttonPanel.add(undoButton);
            buttonPanel.add(redoButton);
            buttonPanel.add(addSquareButton);
            buttonPanel.add(add3SquaresButton);
            buttonPanel.add(deleteSquareButton);
            getContentPane().add(buttonPanel, BorderLayout.NORTH);
            getContentPane().add(canvas, BorderLayout.CENTER);
            addSquareButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    model.addSquare();
                    deleteSquareButton.setEnabled(true);
            add3SquaresButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    massEvent = true;
                    model.addSquare();
                    model.addSquare();
                    model.addSquare();
                    massEvent = false;
            deleteSquareButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    model.removeSquare();
                    if (model.getSquaresVector().isEmpty()) {
                        deleteSquareButton.setEnabled(false);
            undoButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        undoManager.getUndoManager().undo();
                    } catch (CannotRedoException cre) {
                        cre.printStackTrace();
                    undoButton.setEnabled(undoManager.getUndoManager().canUndo());
                    redoButton.setEnabled(undoManager.getUndoManager().canRedo());
            redoButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        undoManager.getUndoManager().redo();
                    } catch (CannotRedoException cre) {
                        cre.printStackTrace();
                    undoButton.setEnabled(undoManager.getUndoManager().canUndo());
                    redoButton.setEnabled(undoManager.getUndoManager().canRedo());
            setSize(400, 300);
            setVisible(true);
        class PaintCanvas extends JPanel implements Observer {
            protected int width = 50;
            protected int height = 50;
            public PaintCanvas() {
                super();
                setOpaque(true);
                setBackground(Color.white);
                model.addObserver(this);
            public void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.setColor(Color.black);
                for (int i = 0; i < model.getSquaresVector().size(); i++) {
                    Point point = (Point) model.getSquaresVector().get(i);
                    g.drawRect(point.x, point.y, width, height);
            public void update(Observable o, Object arg) {
                canvas.repaint();
        class MyUndoManager implements Observer {
            protected UndoManager undoManager = new UndoManager();
            public MyUndoManager() {
                model.addObserver(this);
            public UndoManager getUndoManager() {
                return undoManager;
            public void update(Observable o, Object arg) {
                ModelEvent me = (ModelEvent) arg;
                if (massEvent) {
                    System.out.println("Here I want to start some thread to collect all mass add events, so there is only one undo action");
                if (undoEvent) {
                    return;
                switch (me.getEventType()) {
                    case ModelEvent.ADD:
                        System.out.println("Adding undoable add square object");
                        undoManager.undoableEditHappened(new UndoableEditEvent(
                                canvas, new UndoableAddSquare(me.getSource())));
                        undoButton.setEnabled(undoManager.canUndo());
                        redoButton.setEnabled(undoManager.canRedo());
                        break;
                    case ModelEvent.REMOVE:
                        System.out.println("Adding undoable delete square object");
                        undoManager.undoableEditHappened(new UndoableEditEvent(
                                canvas, new UndoableDeleteSquare((Point) model.getSquaresVector().lastElement())));
                        undoButton.setEnabled(undoManager.canUndo());
                        redoButton.setEnabled(undoManager.canRedo());
                        break;
        class UndoableAddSquare extends AbstractUndoableEdit {
            private ArrayList<Point> points;
            public UndoableAddSquare(Point p) {
                points = new ArrayList<Point>();
                points.add(p);
            public UndoableAddSquare(ArrayList<Point> points) {
                this.points = points;
            @Override
            public void undo() {
                undoEvent = true;
                super.undo();
                for (int i = 0; i < points.size(); i++) {
                    model.removeSquare(points.get(i));
                System.out.println("\nUndoing add(s)");
                if (model.getSquaresVector().isEmpty()) {
                    deleteSquareButton.setEnabled(false);
                undoEvent = false;
            @Override
            public void redo() {
                undoEvent = true;
                super.redo();
                for (int i = 0; i < points.size(); i++) {
                    model.addSqaure(points.get(i));
                System.out.println("\nRediong add");
                deleteSquareButton.setEnabled(true);
                undoEvent = false;
        class UndoableDeleteSquare extends AbstractUndoableEdit {
            private ArrayList<Point> points;
            public UndoableDeleteSquare(Point p) {
                points = new ArrayList<Point>();
                points.add(p);
            public UndoableDeleteSquare(ArrayList<Point> points) {
                this.points = points;
            @Override
            public void undo() {
                undoEvent = true;
                super.undo();
                System.out.println("\nUndoing delete");
                for (int i = 0; i < points.size(); i++) {
                    model.addSqaure(points.get(i));
                deleteSquareButton.setEnabled(true);
                undoEvent = false;
            @Override
            public void redo() {
                undoEvent = true;
                super.redo();
                for (int i = 0; i < points.size(); i++) {
                    model.removeSquare(points.get(i));
                System.out.println("\nredoing delete");
                if (model.getSquaresVector().isEmpty()) {
                    deleteSquareButton.setEnabled(false);
                undoEvent = false;
    class Model extends java.util.Observable {
        private Vector squaresVector;
        private int x = 10;
        private int y = 10;
        private Point p;
        public Model() {
            squaresVector = new Vector();
        public void addSquare() {
            p = new Point(x += 10, x += 10);
            squaresVector.addElement(p);
            this.setChanged();
            this.notifyObservers(new ModelEvent(ModelEvent.ADD, p));
        public void addSqaure(Point p) {
            squaresVector.addElement(p);
            this.setChanged();
            this.notifyObservers(new ModelEvent(ModelEvent.ADD, p));
        public void removeSquare() {
            squaresVector.remove(squaresVector.lastElement());
            this.setChanged();
            this.notifyObservers(new ModelEvent(ModelEvent.REMOVE, p));
        public void removeSquare(Point p) {
            squaresVector.remove(p);
            this.setChanged();
            this.notifyObservers(new ModelEvent(ModelEvent.REMOVE, p));
        public Vector getSquaresVector() {
            return squaresVector;
        class ModelEvent {
            public static final int ADD = 1;
            public static final int REMOVE = 2;
            private int eventType;
            private Point source;
            public ModelEvent(int eventType, Point source) {
                this.eventType = eventType;
                this.source = source;
            public int getEventType() {
                return eventType;
            public Point getSource() {
                return source;
    }

    I managed to solve it using a simple boolean condition. Now MyUndoManager will collect undo events while boolean condition compoundUnadoableEdit is set to false.
    import Swing.Model.ModelEvent;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.undo.*;
    public class UndoManagerThreadedDemo extends JFrame {
        public static void main(String argv[]) {
            Model m = new Model();
            new GUI(m);
    class GUI extends JFrame {
        protected JButton undoButton = new JButton("Undo");
        protected JButton redoButton = new JButton("Redo");
        protected JButton add3SquaresButton = new JButton("add 3 Squares");
        protected JButton delete3SquaresButton = new JButton("Delete 3 Squares");
        protected JButton addSquareButton = new JButton("Add Sqaure");
        protected JButton deleteSquareButton = new JButton("Delete Square");
        protected PaintCanvas canvas;
        private Model model;
        private MyUndoManager undoManager;
        private boolean undoEvent = false;
        public GUI(Model mo) {
            super("Undo/Redo Demo");
            this.model = mo;
            undoManager = new MyUndoManager();
            canvas = new PaintCanvas();
            undoButton.setEnabled(false);
            redoButton.setEnabled(false);
            deleteSquareButton.setEnabled(false);
            JPanel buttonPanel = new JPanel(new GridLayout());
            buttonPanel.add(undoButton);
            buttonPanel.add(redoButton);
            buttonPanel.add(addSquareButton);
            buttonPanel.add(add3SquaresButton);
            buttonPanel.add(deleteSquareButton);
            buttonPanel.add(delete3SquaresButton);
            getContentPane().add(buttonPanel, BorderLayout.NORTH);
            getContentPane().add(canvas, BorderLayout.CENTER);
            addSquareButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    model.addSquare();
                    deleteSquareButton.setEnabled(true);
            add3SquaresButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    undoManager.setCompoundUnadoableEdit(true);
                    model.addSquare();
                    model.addSquare();
                    model.addSquare();
                    undoManager.setCompoundUnadoableEdit(false);
            deleteSquareButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    model.removeSquare();
                    if (model.getSquaresVector().isEmpty()) {
                        deleteSquareButton.setEnabled(false);
            delete3SquaresButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    undoManager.setCompoundUnadoableEdit(true);
                    model.removeSquare();
                    model.removeSquare();
                    model.removeSquare();
                    undoManager.setCompoundUnadoableEdit(false);
            undoButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        undoManager.getUndoManager().undo();
                    } catch (CannotRedoException cre) {
                        cre.printStackTrace();
                    undoButton.setEnabled(undoManager.getUndoManager().canUndo());
                    redoButton.setEnabled(undoManager.getUndoManager().canRedo());
            redoButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        undoManager.getUndoManager().redo();
                    } catch (CannotRedoException cre) {
                        cre.printStackTrace();
                    undoButton.setEnabled(undoManager.getUndoManager().canUndo());
                    redoButton.setEnabled(undoManager.getUndoManager().canRedo());
            setSize(400, 300);
            setVisible(true);
        class PaintCanvas extends JPanel implements Observer {
            protected int width = 50;
            protected int height = 50;
            public PaintCanvas() {
                super();
                setOpaque(true);
                setBackground(Color.white);
                model.addObserver(this);
            public void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.setColor(Color.black);
                for (int i = 0; i < model.getSquaresVector().size(); i++) {
                    Point point = (Point) model.getSquaresVector().get(i);
                    g.drawRect(point.x, point.y, width, height);
            public void update(Observable o, Object arg) {
                canvas.repaint();
        class MyUndoManager implements Observer {
            private UndoManager undoManager = new UndoManager();
            private ArrayList<ModelEvent> compoundUnadoableEdits;
            private boolean compoundUnadoableEdit = false;
            public static final String ADD_COMPOUND_UNDO_EVENTS = "ADD_COMPOUND_UNDO_EVENTS";
            public MyUndoManager() {
                model.addObserver(this);
                compoundUnadoableEdits = new ArrayList<ModelEvent>();
            public UndoManager getUndoManager() {
                return undoManager;
            public ArrayList<Point> getPoints(){
                ArrayList<Point> points = new ArrayList<Point>();
                for(int i = 0;i<compoundUnadoableEdits.size();i++){
                    points.add(compoundUnadoableEdits.get(i).getSource());
                return points;
            public void setCompoundUnadoableEdit(boolean compoundUnadoableEdit) {
                this.compoundUnadoableEdit = compoundUnadoableEdit;
                if(!compoundUnadoableEdit){
                    update(null,ADD_COMPOUND_UNDO_EVENTS);
            public void update(Observable o, Object arg) {
                    if ( undoEvent) {
                        return;
                    if(compoundUnadoableEdit){
                        ModelEvent me = (ModelEvent) arg;
                        compoundUnadoableEdits.add(me);
                        return;
                    int eventType = -1;
                    ArrayList<Point> points = null;
                    if(arg.toString().equals(ADD_COMPOUND_UNDO_EVENTS)){
                        eventType = compoundUnadoableEdits.get(0).getEventType();
                        points = getPoints();
                    }else{
                        ModelEvent me = (ModelEvent) arg;
                        eventType = me.getEventType();
                        points = new ArrayList<Point>();
                        points.add(me.getSource());
                    switch (eventType) {
                        case ModelEvent.ADD:
                            System.out.println("Adding undoable add square object");
                            undoManager.undoableEditHappened(new UndoableEditEvent(canvas, new UndoableAddSquare(points)));
                            undoButton.setEnabled(undoManager.canUndo());
                            redoButton.setEnabled(undoManager.canRedo());
                            break;
                        case ModelEvent.REMOVE:
                            System.out.println("Adding undoable delete square object");
                            undoManager.undoableEditHappened(new UndoableEditEvent(canvas, new UndoableDeleteSquare(points)));
                            undoButton.setEnabled(undoManager.canUndo());
                            redoButton.setEnabled(undoManager.canRedo());
                            break;
                    compoundUnadoableEdits.clear();
        class UndoableAddSquare extends AbstractUndoableEdit {
            private ArrayList<Point> points;
            public UndoableAddSquare(Point p) {
                points = new ArrayList<Point>();
                points.add(p);
            public UndoableAddSquare(ArrayList<Point> points) {
                this.points = new ArrayList<Point>();
                this.points.addAll(points);
            @Override
            public void undo() {
                undoEvent = true;
                super.undo();
                for (int i = 0; i < points.size(); i++) {
                    model.removeSquare(points.get(i));
                System.out.println("Undoing add");
                if (model.getSquaresVector().isEmpty()) {
                    deleteSquareButton.setEnabled(false);
                undoEvent = false;
            @Override
            public void redo() {
                undoEvent = true;
                super.redo();
                for (int i = 0; i < points.size(); i++) {
                    model.addSqaure(points.get(i));
                System.out.println("Rediong add");
                deleteSquareButton.setEnabled(true);
                undoEvent = false;
        class UndoableDeleteSquare extends AbstractUndoableEdit {
            private ArrayList<Point> points;
            public UndoableDeleteSquare(Point p) {
                points = new ArrayList<Point>();
                points.add(p);
            public UndoableDeleteSquare(ArrayList<Point> points) {
                this.points = points;
            @Override
            public void undo() {
                undoEvent = true;
                super.undo();
                System.out.println("Undoing delete");
                for (int i = 0; i < points.size(); i++) {
                    model.addSqaure(points.get(i));
                deleteSquareButton.setEnabled(true);
                undoEvent = false;
            @Override
            public void redo() {
                undoEvent = true;
                super.redo();
                for (int i = 0; i < points.size(); i++) {
                    model.removeSquare(points.get(i));
                System.out.println("Redoing delete");
                if (model.getSquaresVector().isEmpty()) {
                    deleteSquareButton.setEnabled(false);
                undoEvent = false;
    class Model extends java.util.Observable {
        private Vector squaresVector;
        private int x = 10;
        private int y = 10;
        private Point p;
        public Model() {
            squaresVector = new Vector();
        public void addSquare() {
            p = new Point(x += 10, x += 10);
            squaresVector.addElement(p);
            this.setChanged();
            this.notifyObservers(new ModelEvent(ModelEvent.ADD, p));
        public void addSqaure(Point p) {
            squaresVector.addElement(p);
            this.setChanged();
            this.notifyObservers(new ModelEvent(ModelEvent.ADD, p));
        public void removeSquare() {
            p = (Point)squaresVector.lastElement();
            squaresVector.remove(p);
            this.setChanged();
            this.notifyObservers(new ModelEvent(ModelEvent.REMOVE, p));
        public void removeSquare(Point p) {
            squaresVector.remove(p);
            this.setChanged();
            this.notifyObservers(new ModelEvent(ModelEvent.REMOVE, p));
        public Vector getSquaresVector() {
            return squaresVector;
        class ModelEvent {
            public static final int ADD = 1;
            public static final int REMOVE = 2;
            private int eventType;
            private Point source;
            public ModelEvent(int eventType, Point source) {
                this.eventType = eventType;
                this.source = source;
            public int getEventType() {
                return eventType;
            public Point getSource() {
                return source;
    }

  • Compoundedit problems! Undomanager behaves strangely in JTextArea

    Hi,
    I have a JTextArea and I need to put edits into sets so that I can undo all at the same time. For this I use Compoundedit. Most of the time the undoing and redoing works, even with large amounts of edits.
    Problem is that sometimes, I don't know exactly why, after undoing for a while I get this strange behaviour when the JtextArea get two copies of the text on it, one with new lines and the other where the text is all in the same row. The most strange is that when I clicked on the text on the line, the cursor appears in the other copy of the text where it looks "mormal".
    Anyone had that problem?? Could it be because there is some edit somewhere that doesn't get stored properly?? Does the undomanager ask for some kind of properly ordered edit in the hashtable??
    Please help me!!!

    Hi,
    I have a JTextArea and I need to put edits into sets so that I can undo all at the same time. For this I use Compoundedit. Most of the time the undoing and redoing works, even with large amounts of edits.
    Problem is that sometimes, I don't know exactly why, after undoing for a while I get this strange behaviour when the JtextArea get two copies of the text on it, one with new lines and the other where the text is all in the same row. The most strange is that when I clicked on the text on the line, the cursor appears in the other copy of the text where it looks "mormal".
    Anyone had that problem?? Could it be because there is some edit somewhere that doesn't get stored properly?? Does the undomanager ask for some kind of properly ordered edit in the hashtable??
    Please help me!!!

  • A light UndoManager Problem

    hi there,
    thanks for taking time to read about my problem. i hope you also have enough time to write a solution for me.
    the project i'm working at with the JDK 1.4.0 is an GUI-Editor. you can place buttons and textpanes, labels, trees ... all on one big JPanel. the program also supports editing of some properties of the components, so now, after some month work, it look's quite like a real editor.
    one of the last features i wantet to implement is a UndoManager that supports adding and removing of components on the panel and if possible supports the change of properties of components. but i failed on implementing the first point, so it shouldn't be to complex to fix my problem:
    when i add an component i also add, by using the UndoableEditSupport, one of my own UndoableEdit to a standard UndoManager. i do that every time i add a component. now i want to undo an add. what happened is, that the first component added is deleted (not the last one) ... why?
    the next time, after it has deleted the first component, it throws an CannotUndoAction (i think, because the UndoManager wants to undo the UndoableEdit number -1 and that is NULL ). i allready set the isSegnificant attribute on TRUE for every UndoableEdit.
    another thing that i want to ask is, if there is another more simple way of doing that?
    thanks a lot
    wayne

    shure ... i have written a class that extends the interface UndoableEdit. my class discribes a constructor that takes some parameters, in example the component that is added, an ID that discribes what what action happened with the component and some more. it also contains an undo()- and a redo()-methode, called, depending on that ID, different submethods that discribe what to do with the component and its parent.
    as i understand the UndoManager of Swing, every object from UndoableEdit describes one undo-able user action. if this user action is performed, my application has to generate a new UndoableEdit object and has to transmit it, by using the UndoableSupport, to an UndoManager. if the user performes the undo action in the menu the UndoManager will call the undo()-methode of an these UndoableEdit objects.
    what i have done is, that i don't implemented my own version of an UndoManager ... why should i? it just calls this undo()- and redo()-methodes. the order of the UndoableEdit objects in the UndoManager should be like everyone suspects. you add: obj1, obj2, obj3 ... and this is the order the UndoManager has in its Vector-object too. the you call 3 times undo() and he should call: obj3.undo(), obj2.undo(), obj1.undo() ... thats what i had read in the source code of swings UndoManager.
    but thats not what happened in my application. i added obj1, obj2, obj3 ... then i called the undo action and the UndoManager calls:
    obj1.undo(), error!!!
    the UndoManager calls the undo()-methode of the object in his vector that is found on count: 0. the next time he try's to call the methode at -1 and throws an CannotUndoException. i've tried some serinarios with different return values of the methods that deliver boolean values of my UndoableEdit implementing class: isSignificant(), canUndo(), canRedo(), addEdit(...) and replaceEdit(...). but that didn't work.
    so were am i wrong??? can somebody help me? if i didn't understand the concept of the swing UndoManager right, tell me were i'm wrong.
    thanks a lot :-)
    wayne

  • Disabling Listener/Removing edit From UndoManager

    Problem I was wondering if someone could assist me with.
    Currently im using a standard UndoManager and i need someway of removing an edit from the manager.
    A function in the application loads clears and adds new text to a textArea, i need someway of not listening to these events or (or removing them from the edit after they happen) I cannot just add the listener after they occur as I need to listen to all Undoableedit events before and after the function runs.
    Any help would be very much appreciated.
    Tim

    My suggestion is to create your own MyUndoManager which extends UndoManger. You can override adddUndo() method where you can check whether current undo is acceptable if not just skip it in other cases call super.addUndo();
    regards
    Stas

  • Unit testing with TLF

    While unit testing complex formating, I hit several problems. Below are simple tests that fail with an error. Does anybody know what is wrong with these tests?
    Thanks for any hints,
    Marc
        public function test_apply_Link():void
            var init:XML = <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"><p><span>aaa</span></p></TextFlow>
            var textFlow:TextFlow = TextConverter.importToFlow(init, TextConverter.TEXT_LAYOUT_FORMAT)
            var editManager:IEditManager = new EditManager()
            textFlow.interactionManager = editManager
            editManager.selectRange(1,2)
            editManager.applyLink("http://livedocs.adobe.com/", "_self", true) // throws error:
            RangeError: Error #2006: The supplied index is out of bounds.
                at flash.text.engine::GroupElement/replaceElements()
                at flashx.textLayout.elements::ParagraphElement/http://ns.adobe.com/textLayout/internal/2008::insertBlockElement()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\ParagraphElement.as:277]
                at flashx.textLayout.elements::FlowLeafElement/http://ns.adobe.com/textLayout/internal/2008::createContentElement()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\FlowLeafElement.as:95]
                at flashx.textLayout.elements::SpanElement/http://ns.adobe.com/textLayout/internal/2008::createContentElement()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\SpanElement.as:77]
                at flashx.textLayout.elements::ParagraphElement/http://ns.adobe.com/textLayout/internal/2008::createTextBlock()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\ParagraphElement.as:100]
                at flashx.textLayout.elements::ParagraphElement/http://ns.adobe.com/textLayout/internal/2008::createContentElement()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\ParagraphElement.as:241]
                at flashx.textLayout.elements::SubParagraphGroupElement/http://ns.adobe.com/textLayout/internal/2008::setParentAndRelativeStart()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\SubParagraphGroupElement.as:178]
                at flashx.textLayout.elements::LinkElement/http://ns.adobe.com/textLayout/internal/2008::setParentAndRelativeStart()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\LinkElement.as:495]
                at flashx.textLayout.elements::FlowGroupElement/replaceChildren()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\FlowGroupElement.as:764]
                at Function/http://adobe.com/AS3/2006/builtin::apply()
                at flashx.textLayout.elements::ParagraphElement/replaceChildren()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_core\src\flashx\textLayout\elements\ParagraphElement.as:302]
                at flashx.textLayout.edit::TextFlowEdit$/insertNewSPBlock()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\textLayout\edit\TextFlowEdit.as:655]
                at flashx.textLayout.edit::TextFlowEdit$/makeLink()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\textLayout\edit\TextFlowEdit.as:503]
                at flashx.textLayout.operations::ApplyLinkOperation/doOperation()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\textLayout\operations\ApplyLinkOperation.as:146]
                at flashx.textLayout.edit::EditManager/doInternal()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\textLayout\edit\EditManager.as:418]
                at flashx.textLayout.edit::EditManager/doOperation()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\textLayout\edit\EditManager.as:321]
                at flashx.textLayout.edit::EditManager/applyLink()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\textLayout\edit\EditManager.as:1137]
        public function test_undo():void
            var init:XML = <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"><p><span>aaa</span></p></TextFlow>
            var textFlow:TextFlow = TextConverter.importToFlow(init, TextConverter.TEXT_LAYOUT_FORMAT)
            var undoManager:IUndoManager = new UndoManager()
            var editManager:IEditManager = new EditManager(undoManager)
            textFlow.interactionManager = editManager
            editManager.selectRange(1,2)
             var format:TextLayoutFormat = new TextLayoutFormat()
            format.fontWeight = FontWeight.BOLD
            editManager.applyLeafFormat(format)
            undoManager.undo() // throws error:
            TypeError: Error #1009: Cannot access a property or method of a null object reference
                at flashx.textLayout.edit::EditManager/performUndo()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\textLayout\edit\EditManager.as:540]
                at flashx.textLayout.operations::FlowOperation/performUndo()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\textLayout\operations\FlowOperation.as:181]
                at flashx.undo::UndoManager/undo()[E:\dev\trunk\frameworks\projects\textLayout\textLayout_edit\src\flashx\undo\UndoManager.as:197]            

    For your second issue, you didn't display TextFlow before you selected the Text.  I also changed the FontWeight.BOLD to "bold" in order to pass compilation.  The code below should work:
    var  
    var controllerOne:ContainerController = new ContainerController(container, 500, 500); 
    var undoManager:IUndoManager = new UndoManager() 
    var init:XML = <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"><p><span>aaa</span></p></TextFlow>  
    var textFlow:TextFlow = TextConverter.importToFlow(init, TextConverter.TEXT_LAYOUT_FORMAT) 
    addChild(container);
    textFlow.flowComposer.addController(controllerOne);
    textFlow.flowComposer.updateAllControllers();
    var editManager:IEditManager = new EditManager();textFlow.interactionManager = editManager;
    editManager.selectRange(1,2)
    var format:TextLayoutFormat = new TextLayoutFormat();format.fontWeight ="bold";container:Sprite = new Sprite(); 
    editManager.applyLeafFormat(format);
    undoManager.undo();
    textFlow.flowComposer.updateAllControllers();

  • Openinig internal frames by clicking menuitems

    Hi,
    I have been trying to open internal frames by clicking menu items but
    have not been able to do so because menuitems support only action listeners and not all mouse event listeners.
    Actually I wanted the event to return the frame n which the event has occured
    e.g., event,getframe(), so that I could create an internal frame in the same frame.
    But such kind of function is unavailable.
    Kindly suggest something...the code is given below (it works perfectly)..it need a text file from which the menuitems are read. This is also given below:
    import javax.swing.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.io.*;
    import javax.swing.plaf.metal.*;
    import javax.swing.*;
    import javax.swing.undo.*;
    class Action extends JFrame
         ActionListener FListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of File Menu was pressed.");}
        ActionListener EListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of Edit Menu was pressed.");}
        ActionListener VListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of View Menu was pressed.");}
        ActionListener TListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of Tools Menu was pressed.");}
        ActionListener HListener = new ActionListener()
               public void actionPerformed(ActionEvent event)
                  {System.out.println("Menu item " + event.getActionCommand(  ) +"  of Help Menu was pressed.");}
         /*     protected class MyUndoableEditListener  implements UndoableEditListener
                  protected UndoManager undo = new UndoManager();
                  public void undoableEditHappened(UndoableEditEvent e)
                 //Remember the edit and update the menus
                 undo.addEdit(e.getEdit());
                 undoAction.updateUndoState();
                 redoAction.updateRedoState();
          class framecreator extends JFrame
               public JFrame CreateFrame(JMenuBar m)
             JDesktopPane jdp= new JDesktopPane();
              JFrame.setDefaultLookAndFeelDecorated(true);       
            JFrame frame = new JFrame("PEA");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         
            frame.setContentPane(jdp);
            jdp.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);          
            frame.setJMenuBar(m);       
            frame.pack();
            frame.setVisible(true);
            frame.setSize(600,600);
            frame.setLocation(100,100);
            return frame;
          class internalframecreator extends JFrame
             public JInternalFrame CreateInternalFrame(JFrame f)
              Container cp= f.getContentPane();
              JInternalFrame jif = new JInternalFrame("internal frame",true,true,true,true);
             cp.add(jif);
             jif.pack();
             jif.setVisible(true);
             jif.setSize(300,300);
             jif.setLocation(80,80);
             return jif;    
      class menucreator
         public String[] filereader()
              String[] menuitems=new String[21];
              int i=0,j=0;
              String record = null;            
                   for(int h=0;h<21;h++){ menuitems[h]=null;}
               try { 
                    FileReader fr = new FileReader("projectconfig2.txt");  
                     BufferedReader br = new BufferedReader(fr);
                         while ( (record=br.readLine()) != null )
                           StringTokenizer st = new StringTokenizer(record,"\n");
                             while (st.hasMoreTokens())
                          menuitems= st.nextToken();
         System.out.println(menuitems[i]);
    i++;
                   /* StringTokenizer st1 = new StringTokenizer(record,"\n");
         while (st1.hasMoreTokens())
         while ( (record=br.readLine()) != null )
         StringTokenizer st2 = new StringTokenizer(record,":");
         while (st2.hasMoreTokens())
         menuitems[i][j]= st2.nextToken();
         System.out.println(menuitems[i][j]);
              j++;      
         i++;
              } catch(IOException e)
         System.out.println("Error reading file");
         return (menuitems);
         public JMenuBar CreateMenu(Action a, String menuitems[])
    JMenuBar mb = new JMenuBar();
    JMenu fileB = new JMenu(menuitems[0]);
    JMenu editB = new JMenu(menuitems[8]);
    JMenu viewB = new JMenu(menuitems[11]);
    JMenu toolsB = new JMenu(menuitems[14]);
    JMenu helpB = new JMenu(menuitems[18]);
    mb.add(fileB);
    mb.add(editB);
    mb.add(viewB);
    mb.add(toolsB);
    mb.add(helpB);
    JMenuItem newpolicyB = new JMenuItem(menuitems[1]);
    newpolicyB.addActionListener(a.FListener);
    //newpolicyB.addUndoableEditListener(new MyUndoableEditListener());
    JMenuItem openB = new JMenuItem(menuitems[2]);
    openB.addActionListener(a.FListener);
    JMenuItem saveB = new JMenuItem(menuitems[3]);
    saveB.addActionListener(a.FListener);
    JMenuItem saveasB = new JMenuItem(menuitems[4]);
    saveasB.addActionListener(a.FListener);
    JMenuItem printxmlB = new JMenuItem(menuitems[5]);
    printxmlB.addActionListener(a.FListener);
    JMenuItem printreadablepolicyB = new JMenuItem(menuitems[6]);
    printreadablepolicyB.addActionListener(a.FListener);
    JMenuItem exitB = new JMenuItem(menuitems[7]);
    exitB.addActionListener(a.FListener);
    JMenuItem undoB = new JMenuItem(menuitems[9]);
    undoB.addActionListener(a.EListener);
    JMenuItem redoB = new JMenuItem(menuitems[10]);
    redoB.addActionListener(a.EListener);
    JMenuItem xmlB = new JMenuItem(menuitems[12]);
    xmlB.addActionListener(a.VListener);
    JMenuItem readablepolicyB = new JMenuItem(menuitems[13]);
    readablepolicyB.addActionListener(a.VListener);
    JMenuItem validateB = new JMenuItem(menuitems[15]);
    validateB.addActionListener(a.TListener);
    JMenuItem signandpublishB = new JMenuItem(menuitems[16]);
    signandpublishB.addActionListener(a.TListener);
    JMenuItem optionsB = new JMenuItem(menuitems[17]);
    optionsB.addActionListener(a.TListener);
    JMenuItem pemanualB = new JMenuItem(menuitems[19]);
    pemanualB.addActionListener(a.HListener);
    JMenuItem aboutB = new JMenuItem(menuitems[20]);
    aboutB.addActionListener(a.HListener);
    fileB.add(newpolicyB);
    fileB.add(openB);
    fileB.add(saveB);
    fileB.add(saveasB);
    fileB.add(printxmlB);
    fileB.add(printreadablepolicyB);
    fileB.add(exitB);
    editB.add(undoB);
    editB.add(redoB);
    viewB.add(xmlB);
    viewB.add(readablepolicyB);
    toolsB.add(validateB);
    toolsB.add(signandpublishB);
    toolsB.add(optionsB);
    helpB.add(pemanualB);
    helpB.add(aboutB);
    mb.setSize(300,200);
    mb.setVisible(true);
    return mb;
    public class project
    public static void main(String args[])
              Action a =new Action();           
              framecreator fc=new framecreator();           
         menucreator mc=new menucreator();     
         internalframecreator ifc= new internalframecreator();          
         ifc.CreateInternalFrame(fc.CreateFrame(mc.CreateMenu(a,mc.filereader())));
    The text file called projectconfig2.txt
    File
    New Policy
    Open...
    Save
    Save As...
    Print XML
    Print Readable Policy
    Exit
    Edit
    Undo
    Redo
    View
    XML
    Readable Policy
    Tools
    Validate
    Sign & Publish
    Options
    Help
    PE Manual
    About

    The problem is that you are adding the JInternalFrame to the JFrame's contentPane when it should be added to the JDesktopPane. See your code ...
    public JInternalFrame CreateInternalFrame( JFrame  f )
         Container  cp = f.getContentPane();
         JInternalFrame jif = new JInternalFrame("internal frame",true,true,true,true);
         cp.add( jif );

  • Weekly build notes listings

    Since there are major changes going on in the TLF weekly builds, and the ASDocs aren't up to date, and the changes made are not searchable, I thought people might want the list dumped on here so changes to particular classes would show up in a forum search.  To see the changes made in Build 360, check out the TLF Blog post on it ( http://blogs.adobe.com/tlf/2009/02/tlf_api_changes_in_build_370_1.html ).
    Here's the list.  Maybe this could become a common practice.
    Build 432, Fri May 15 2009
    Changes in build 437 (2009/05/22)
        * remove flashx.textLayout.edit.UndoManager and flashx.textLayout.IUndoManager
        * Fix 2330964 BackgroundColor Placed incorrectly from TextLineFactory. Actually was in 436.
        * Fix 2326588 TextContainerManager Does Not Support Background Color
        * Fix 2330946 Remove TextContainerManager.trunctationOptions property
        * Fix 2337918 Please expose the scrollToPosition() API in TextContainerManager
        * Fix 2336672 Preserve selection when switching editingMode in TextContainerManager
        * Setting editingMode to the current editingMode should do nothing in TextContainerManager
    Changes in build 436 (2009/05/22)
        * Fix 2331711 TextContainerManager now sends a DamageEvent from setText().
        * Fix 2326543 bug where selection wasn't being extended on mouse drag.
        * add [RichTextContent] metadata to SpanElement and FlowGroupElement mxmlChildren properties
        * Fix 2337740 Flex bug SDK-20964 TCM rcycling bug
        * Partial fix 2330964 background color placed incorrectly from TextLineFactory
        * Remove vestigal experiment with Tables code
        * Fix 2321538. On the Mac, the keyboard shortcuts for cmd-A,C,V,X were not working.
        * Fix 2326543, "drag select of scrolling flows doesn't expand selection".
        * Fix 2329527. Content bounds being reported was slightly different between the factory and TextFlow composer.
        * Fix 2328695 TextContainerManager Stops Receiving FocusIn Events. This is a complete fix - previously this bug was worked around
        * Added TextLineFactoryBase.isTruncated
        * Fix 2315119 - Graphic will be redrawn when link applied.
    Changes in build 434 (2009/05/22)
        * Fix 2323921: RichText truncation doesn't work in all cases
    Build 432, Fri May 15 2009
    Changes in build 432 (2009/05/14)
        * Fixed regression that broke truncation feature
        * Added TextLineFactoryBase.isTruncated
        * Changed text line factory behavior such that scrolling is turned off when truncation options are set
    Build 427, Fri May 8 2009
    Changes in build 427 (2009/05/07)
        * Fix bug - RTE in computeSelectinIndexInContainer
        * Namespace change -- mxml namespace for TLF was "library:adobe/flashx/textLayout". Now it is: library://ns.adobe.com/flashx/textLayout".
        * Fix bug - Scrolled TextContainerManager Can be Difficult To Create Point Selection
    Changes in build 426 (2009/05/06)
        * Fix bug - TextFlow double-deletes text when pressing the backspace or delete key
    Build 422, Fri May 1 2009
    Changes in build 422 (2009/04/30)
        * API Changes: TextContainerManager now has a getContentBounds function, in place of individual getters for contentLeft, contentTop, etc. ContainerController also now has a getContentBounds function, in place of individual getters. Added functions to TextContainerManager to support custom classes for ISelectionManager and IEditManager (see createSelectionManager and createEditManager).
        * API changes for TextContainerManager:
              o getInteractionManager renamed to beginInteraction(), and added a new function endInteraction() which clients should use after beginInteraction() to signal that they are done with selecting/editing. This tells the TextContainerManager that it can go back to factory mode, which is more efficient.
              o invalidateInteractionManager() removed and replaced with two new functions, invalidateSelectionFormats() which clients should called when SelectionFormats have changed, and invalidateUndoManager which clients should call to change the undo manager.
        * API Changes for InputManager
              o InputManager renamed as TextContainerManager
              o IInputManagerClient removed, now you can subclass InputManager and override its methods
        * API Changes:
              o InputManager
                    + damaged property renamed to isDamaged() function
                    + focusSelectionFormat renamed to focusedSelectionFormat
                    + container retyped to Sprite
                    + compositionWidth and compositionHeight removed as constructor parameters, now you need to set the properties on the InputManager you create
              o ContainerController
                    + container retyped to Sprite
              o ISelectionManager
                    + focusSelectionFormat renamed to focusedSelectionFormat
              o IConfiguration & Configuration
                    + focusSelectionFormat renamed to focusedSelectionFormat
        * API Changes:
              o ISelectionManager
                    + setSelection deselects if negative numbers are passed in.
                    + selectAll removed, you can call ISelection.setSelection() to get the same behavior, if you need to redraw the selection, call ISelectionManager.textFlow.flowComposer.updateAllControllers().
                    + flushPendingEvents moved to IInteractionHandler
                    + notifyInsertOrDelete moved to IInteractionHandler
              o IUndoManager
                    + clear renamed to clearAll().
                    + undoLastOperation renamed to undo()
                    + redoLastOperation renamed to redo()
        * API Change: SelectionEvent now contains a SelectionState, not an ElementRange; this is much cheaper for us to provide. ElementRange is now tlf_internal. ElementRange.firstLeafPosition renamed to absoluteStart, ElementRange.lastLeafPosition renamed to absoluteEnd.
        * API Change: TextScrap.copyTextScrap renamed to clone.
        * API Changes to InputManager. defaultInputManagerConfiguration renamed to defaultConfiguration. composeToController renamed to compose(), and updateToController renamed to updateContainer().
        * API Changes:
              o ISelectionManager:
                    + Event handling functions moved out of ISelectionManager into new interface, IInteractionHandler
                    + selectionFormat renamed to currentSelectionFormat
                    + selectionState renamed to function getSelectionState()
                    + setSelection now takes default parameters to select the entire flow
                    + noFocusSelectionFormat renamed to unfocusedSelectionFormat
              o SelectionFormat:
                    + blockAlpha reanmed to rangeAlpha
                    + blockBlendMode renamed to rangeBlendMode
                    + blockColor renamed to rangeColor
              o IEditManager:
                    + added get undoManager()
                    + added changeElementID()
                    + added changeElementStyleName()
              o SelectionManager:
                    + activeMark and anchorMark are now private
                    + selectionChanged is private
                    + setSelectionState is tlf_internal
              o EditManager:
                    + stage is private
                    + ChangeElementIdOperation renamed to ChangeElementIDOperation
    Changes in build 420 (2009/04/28)
        * API change: Removed the misleadingly named and superfluous TextFlowLine.textIndent. Documented and ensured consistent use of TextFlowLine.lineOffset as lhe line's offset in pixels from the appropriate container inset (as dictated by paragraph direction and container block progression), prior to alignment of lines in the paragraph.
        * API change: more changes to the factory classes. ITextLineCreator is now a property of the base class, so instead of passing it in the constructor you construct and then set the property in the factory. bounds property renamed to compositionBounds, and measuredBounds renamed to contentBounds. containerController property is now private.
        * API Change: moved ITextLineCreator interface from the elements package to the compose package.
        * PlainTextExporter is now public and has methods for controlling the paragraphSeparator and whether discretionary hyphens are included in the export. To use it, you can either construct it directly, or via the TextFilter class. Removed the newlineIndicator string from IConfiguration.
        * Fixed a bug where tabs in RTL text were being being offset by textIndent and marginRight values.
    Changes in build 419 (2009/04/24)
        * Once a mouseWheel event has been handled, mark with preventDefault so client applications don't also try to handle it.
        * Don't start compose if text is already composed. Optimization for callers of composeToPosition.
        * Always call resetContentTopLeft, to give more accurate top left positions, particularly for cases where the text is outdented and left aligned.
        * API CHANGE: TextLineFactory revised. It is now split into 3 classes, TextLineFactoryBase, StringTextLineFactory, and TextFlowTextLineFactory. Use StringTextLineFactory for creating TextLines from a String. Use TextFlowTextLineFactory for creating TextLines from a TextFlow. Static methods have been removed, so create a new factory in order to create lines. One factory may be reused many times, just resetting the values (text, bounds, truncation options, etc.) in between. See StaticHelloWorld.as for a simple example of how this works for Strings, see StaticTextFlow.as for a simple example of it with TextFlows.
    Build 418, Fri Apr 24 2009
    Changes in build 418 (2009/04/23)
        * API CHANGE: TextLineFactory revised. It is now split into 3 classes, TextLineFactoryBase, StringTextLineFactory, and TextFlowTextLineFactory. Use StringTextLineFactory for creating TextLines from a String. Use TextFlowTextLineFactory for creating TextLines from a TextFlow. Static methods have been removed, so create a new factory in order to create lines. One factory may be reused many times, just resetting the values (text, bounds, truncation options, etc.) in between. See StaticHelloWorld.as for a simple example of how this works for Strings, see StaticTextFlow.as for a simple example of it with TextFlows.
    Changes in build 417 (2009/04/22)
        * Fixed Vertical Justification behavior; it now increases the spacing between consecutive lines proportionally rather than spacing lines uniformly.
        * API Changes: Renamed DisplayObjectContainerController to ContainerController, and removed IContainerController and IInternalContainerController. Wherever you used to use "IContainerController" or "DisplayObjectContainerController" now just use "ContainerController".
              o Moved some functions that were public into the tlf_internal namespace: effectivePaddingLeft, effectivePaddingTop, effectivePaddingRight, and effectivePaddingBottom.
              o ColumnState.createColumnState removed. A ColumnState constructor now takes all the relevant values, so whereever you used to do this:
                    + var columnState:ColumnState = ColumnState.createColumnState(...your values here...);
              o you can now do this:
                    + var columnState:ColumnState = new ColumnState();
              o ColumnState.getColumnAtIndex(index) has been renamed to getColumnAt(index). So, once you have the columnState, you do, for instance:
                    + var columnRect:Rectangle = getColumnAt(0);
        * Fixed bug where spaces at end of a line would "overflow" into neighboring columns. New code keeps drawing of cursor at the column boundary and limits block selection drawing to the same bounds.
        * Enhancement to cursor navigation for Right to Left text systems. Previous code moved cursor according to logical order vs. visual order. Result was that a right arrow key press in Arabic, Hebrew or other RTL languages meant that the cursor actually moved left. New code moves cursor according to the visual order of the text based on the direction of the entire text flow. Note that changing the direction on a paragraph will not alter the behavior of the cursor, nor will the presence of LTR text within a RTL text flow. This means that if a TextFlow is set to Right to Left and a given paragraph is entirely in English and the paragraph is set to be Left to Right, the cursor will seem to move in the wrong direction. TLF does not support customization of cursor movement based on the locale or direction of anything except the parent TextFlow.
        * Fixed a bug that caused undoing an ApplyFormatToElementOperation to have no effect.
        * API Changes:
              o DisplayObjectContainer event handling functions renamed:
                    + processMouseOverEvent -> mouseOverHandler
                    + processMouseOutEvent -> mouseOutHandler
                    + processMouseWheelEvent -> mouseWheelHandler
                    + processMouseDownEvent -> mouseDownHandler
                    + processMouseUpEvent -> mouseUpHandler
                    + processMouseMoveEvent -> mouseMoveHandler
                    + processMouseDoubleClickEvent -> mouseDoubleClickHandler
                    + processFocusInEvent -> focusInHandler
                    + processFocusOutEvent -> focusOutHandler
                    + processActivateEvent -> activateHandler
                    + processDeactivateEvent -> deactivateHandler
                    + processKeyDownEvent -> keyDownHandler
                    + processKeyUpEvent -> keyUpHandler
                    + processTextInputEvent -> textInputHandler
                    + processContextMenuSelectHandler -> menuSelectHandler
                    + eventHandler -> editHandler
              o ISelectManager & SelectionManager & EditManager renamings:
                    + eventHandler -> editHandler
        * API Changes: renamed IContainerController.scrollLines to getScrollDelta, renamed InputManager.scrollLines to getScrollDelta, and removed constants for default container width and height.
    Changes in build 412 (2009/04/10)
        * API CHANGE: DisplayObjectContainerController methods processCopyEvent, processCutEvent, processPasteEvent, processSelectAllEvent collapsed into a single processEvent that handles all these basic events. Added to ISelectionManager a new function, processEvent for handling these same events in the SelectionManager, and removed processSelectAll, which is no longer used. cutTextScrap and pasteTextScrap moved from ISelectionManager to IEditManager, since these are editing operations.
    Build 411, Fri Apr 10 2009
    Changes in build 411 (2009/04/09)
        * Fixed a bug where noFocus selection format was not being set on re-activation
        * API CHANGES. These functions in IFlowComposer were renamed:
              o updateContainer -> updateToController
              o updateAllContainers -> updateControllers
              o composeContainer -> composeToController
              o composePosition -> composeToPosition
        * API CHANGE: Changing name of TextFlow.hostTextLayoutFormat to hostFormat
    Changes in build 410 (2009/04/08)
        * Fix bug where leading info used for composing the next line was being saved prematurely, causing incorrect layout if the current line needed to be composed in multiple passes.
    Build 409, Tue Apr 7 2009
    Changes in build 409 (2009/04/07)
        * Fix bug where clicking on container when height or width NaN doesn't work. When measuring, transparent hit detect region wasn't being redrawn to correct size after composition.
        * API CHANGE: Plain-text import/export changes. Newline indicators exported based on setting in IConfiguration.newLineIndicator. On import, LF/CR/CR+LF are all recognized as new line indicators.
        * Compose to container size with scrolling on -- previously was composing to double composer size. This may flush out some invalid line bugs.
        * Fixed a bug with blockProgression="rl" and compositionWidth=NaN, lines were getting improperly clipped out so that no text appeared.
        * API CHANGE: Renaming functions in IFormatResolver. invalidateAllTargets is now invalidateAll, and invalidateTarget is now invalidate. resolveTextLayoutFormat is now resolveFormat.
        * API CHANGE: eventMirror on FlowLeafElement and SubParagraphGroupElement is now tlf_internal.
        * API CHANGE: Moving TextRange from the edit package to the elements package.
    Changes in build 406 (2009/04/02)
        * API CHANGE: Renaming DamageEvent.damageStart to damageAbsoluteStart.
        * API Change: IConfiguration.includePartialLine renamed to overflowPolicy. Defined new class OverflowPolicy that describes the different policies that can be used to control whether lines that fall at the end of the container are included in the container, or not.
    Changes in build 405 (2009/04/01)
        * API CHANGE: IFlowComposer.firstDamagePosition renamed to damageStartPosition.
        * API CHANGE: Rename GeometryUtil.getRangeBounds to GeometryUtil.getHighlightBounds.
        * API CHANGE: ParagraphElement.getText now takes an additional optional parameter that specifies the terminator for the paragraph. By default, this is the Unicode paragraph terminator character (\u2029), but you can make it whatever you want, including a simple newline by passing a String for the paragraphTerminator. This change is backwards compatible for current callers of getText().
        * Fix clipping problem when text is placed above the container (6 lines aligned verticalAlign = bottom in a space that fits 4 lines).
    Changes in build 404 (2009/03/31)
        * Updating typgraphic case --Markup and API Change-- Now uses a new class TLFTypographicCase, and has different options. Support for "title" and "caps" dropped. Use TLFTypographicCase with TLF in preference to flash.text.engine.TypographicCase. "smallCaps" renamed to "capsToSmallCaps". "capsAndSmallCaps" renamed to "lowercaseToSmallCaps". Also made AUTO the default setting for kerning, which matches FXG spec.
    Changes in build 403 (2009/03/30)
        * format Markup Changes:
              o <TextLayoutFormat> now <format>
              o When referring to a format id, don't use brackets. So this:
                <TextLayoutFormat id="english" locale="en" fontFamily="Minion Pro"/>
                <p marginBottom="15" ><span format="{english}">This text is supposed to be in Minion Pro via a named character attribute</span></p>
                Is now this:
                <format id="english" locale="en" fontFamily="Minion Pro"/>
                <p marginBottom="15" ><span format="english">This text is supposed to be in Minion Pro via a named character attribute</span></p>
        * API Changes:
              o Rename FlowElement.textLayoutFormat -> format
              o Rename FlowElement.computedTextLayoutFormat -> computedFormat
              o Rename IContainerController.textLayoutFormat -> format
              o Rename IContainerController.textLayoutFormat -> computedFormat
              o Rename DisplayObjectContainerController.textLayoutFormat -> format
              o Rename DisplayObjectContainerController.textLayoutFormat -> computedFormat
    Changes in build 402 (2009/03/27)
        * verticalAlign of "middle" or "bottom" will now align to the compositionHeight (or compositionWidth in vertical text) even if the height of the text exceeds the compositionHeight. This means that lines that don't fit may be get pushed above the box, or (for middle) pushed both above and below. It also means that all lines will forced to compose to the end, so it will be quite slow to use verticalAlign in large text flows. Made some corresponding fixes to scrolling to make it work with text off the start of the container. Added some new test cases to exercise this functionality in all the different alignment settings.
        * Scrolling fixes for next/previous line with arrow keys. Fix a bug where the arrow key would move to the end of the line if the line required composition (e.g., the line was not previously in view). Also fixed a bug when scrolling up by a line where it would scroll down instead.
        * doOperation used to return an SelectionState, but with the exception of two places that were using it internally, all external callers only checked to see if it was null or not. null was being used to indicate failure, or nothing changed, which means that the operation is not placed on the undo stack. Now it returns a Boolean, true for success, false for failure. There may be further changes in this area to make FlowOperations simpler.
    Changes in build 397 (2009/03/20)
        * Made DisplayObjectContainerController's and FlowElement's TextLayoutFormat properties read/write (used to be write-only).
        * Merge ContainerControllerBase class into DisplayObjectContainerController.
        * Mark TextFlow class as final
    Changes in build 396 (2009/03/19)
        * Fix RTE in StandardFlowComposer.releaseLines
        * Fix possible source of the RTE on null reference from findFirstAndLastVisibleLines in ContainerControllerBase.
    Changes in build 394 (2009/03/17)
        * Fix issue with changes made in StatusChangeEvent to embedded graphics by blocking recursive composition. Bug 2298043
        * Add IFlowComposer.composeInProcess property.
        * Fixed problem where first part of a link could not be replaced by a new link. New code allows partial replacement of a link element with a selection which starts at the first character.
        * Fixed a problem where the cursor was getting set to the I-beam, and wouldn't set back.
    Changes in build 393 (2009/03/16)
        * Fix a bug where keyboard navigation with linked containers was causing a scroll because it was trying to scroll to a position not in the container.
    Changes in build 392 (2009/03/13)
        * Removed optimization that was preventing scrolling in the logical width direction if scrolling in the logical vertical direction was turned off.
        * Removed the container-level mouseMove and rollOver handlers which were changing the link state. These are now part of the LinkElement, and added only when they are needed.
    Changes in build 390 (2009/03/11)
        * Fix for application of attributes to a point selection where only the last attribute would be applied. New code applies all attributes applied to the point.
        * IContainerController.contentWidth (or contentHeight in vertical text) is now based on the actual text width, not the unjustified text width. This fixes some problems where scrolling wasn't working correctly because the reported width of the text was greater than the compositionWidth, but lines were wrapped. It does mean that to get the unjustified width you will have to set the textAlign to something other than "justify", recompose, and then get the resulting width.
        * Fix for unintended scroll when at the end of a TextFlow.
        * Fix for RTE when dragging over text generated from a factory, or non-TLF TextLines.
        * Changes for alignment and measurement. You can now set NaN for compositionWidth or compositionHeight, and TLF will compose and use the generated contentWidth or contentHeight for alignment, scrolling, etc. The composer now generates a topLeft for the bounds, so you can make a full "content bounds" using contentLeft, contentTop, contentWidth, and contentHeight.Note that this is logical bounds and not inked bounds, so there are some circumstances where ink will not fit in the content bounds.Fixed bugs in how the factory was doing vertical alignment that caused it to be a few pixels off.Fixed some incosistencies between how the standard flow composer worked and how the factory's simple composer works -- composition results should now be more uniform. Added a new test program, MeasurementGrid, for testing all this. It's still a work in progress.
    Changes in build 388 (2009/03/09)
        * Fixed issue where applying link or TCY to the last span of a paragraph caused a dangling span to remain with the para terminator.
        * Fixed issue where text would go into a link when it was the last element in a paragraph. Newly typed text now goes into a new span when the selection marker is at the last index.
    Changes in build 386 (2009/03/06)
        * Fixed issue with placement of underline and strikethrough on inline images.
        * Fixed placement of underline and strikethrough on text which has a baseline shift applied to it.
    Changes in build 385 (2009/03/04)
        * Combined SWC 'textLayout.swc' now included in the libs directory of the build. This includes everything from textLayout_core, textLayout_edit, and textLayout_conversion.
        * Combined RSLs now included in the rsl directory of the build. Both an unsigned SWF and signed SWZ are created. These include everything from textLayout_core, textLayout_edit, and textLayout_conversion.
    Changes in build 382 (2009/03/02)
        * Fix issue with composing a TextFlow containing just an empty ParagraphElement.
        * TextLineFactory will generate lines that included InlineGraphics whose source is a "class" - normally an embedded graphic.
        * Expose eventMirrors - use FlowElement.getEventMirror function to access the eventMirror.
    Changes in build 381 (2009/02/27)
        * Fixed issue with graphic assigned to ILG getting the wrong sizing.
        * Factory instance functions renamed to textLinesFromString and textLinesFromTextFlow. Static functions renamin unchanged.
    Changes in build 380 (2009/02/26)
        * Made backgroundColor work with TextLineFactory. This required an API change - the callback to the factory now must take a DisplayObject as its parameter, since it won't always be passed TextLines. Also, the background shapes themselves no longer include leading, so they do not exactly coincide with the selection bounds. This was another change to support calculating the shapes during composition as opposed to afterward. Also added a snapshot test as part of FactoryImportTest that uses backgroundColor, in addition to updating the existing unit tests.
    Changes in build 379 (2009/02/25)
        * Fixed for multiple containers ( we were getting incorrect textLength in the containers), as well as a fix that forces scrollToPosition to compose if the text isn't composed yet.
        * Fix so that we scroll to the active position of the selection after we extend the selection with a keyboard event. Also fixed some of the TextRangeUtil functions used for nextLine, etc. to make sure text is composed through selection before processing that depends on composition results.
        * Plain text import now consistently converts \r to space; previously it was converting only the first one. Still not clear what correct behavior should be.
    Changes in build 377 (2009/02/23)
        * Fix bug with importing trailing empty div elements.
    Changes in build 374 (2009/02/18)
        * Added support for TextField-style leading. A new leading model value allows lineHeight to be interpreted as the distance of line's ascent from the previous line's descent. Further, lineHeight can be negative. which specifies the criteria for truncation, the string used to indicate truncation and the format for this string.
    Changes in build 372 (2009/02/16)
        * Added "enableAccessibility" property to IConfiguration, defaults to false. Allows clients to avoid paying price for TextAccImpl objects unless needed.
        * Added support for truncation for text composed using TextLineFactory. The TextLineFactory methods now take a truncation options parameter, which specifies the criteria for truncation, the string used to indicate truncation and the format for this string.
    Changes in build 371 (2009/02/13)
        * Fixed a number of bugs relating to scrolling by line.
        * Measurement changes. Changed the way contentHeight and contentWidth are calculated, now they reflect the size of the text, regardless of alignment. Eliminated unjustifiedContentHeight and unjustifiedContentWidth; use contentHeight and contentWidth instead.
        * Fix RTE in damage when we try to damage back one line, for textFlow that doesn't have any leaf nodes.
        * Changed InlineGraphicElement so that GraphicElements (and the TextBlocks they are part of) don't get released. Fixes RTE on null pointer in places where we access the GraphicElement.
        * Fix bug deleting all of the last Span of a paragraph, plus some of the following paragraph.
    Changes in build 370 (2009/02/12)
        * Removed textFlow property from CompositionCompletionEvent. Use event.target to get to the TextFlow.
    Changes in build 369 (2009/02/11)
        * Fix issues in usage of hostTextLayoutFormat
        * Fix FXG export to not export styles with value "inherit"
        * lineBreak property no longer inherits by default
    Changes in build 368 (2009/02/10)
        * Fix for RTE that happens after cancelling an operation (calling preventDefault on a FlowOperationEvent).
    Changes in build 367 (2009/02/09)
        * ported to Flex 4.0.0.4836. All SWCs now build with this SDK.
    Changes in build 366 (2009/02/06)
        * FlowGroupElement addChild, addChildAt and replaceChildren methods now automatically delete new elements from any existing parents. Previously the code would test for parent on new elements and throw.
        * mxmlChildren FlowElement property which is normally used for mxml compilation of TextFlow objects now always deletes existing children
        * Fix a memory leak issue with the TextLayoutFormat cache
        * Fix cascade bug with non-inheriting attributes getting inherited
    Changes in build 365 (2009/02/05)
        * Changed TextLayoutFormat.backgroundColor to allow setting value of "transparent" (now the default). Because of this new value for backgroundColor, backgroundAlpha now defaults to 1.
    Changes in build 364 (2009/02/04)
        * Performance improvement for handling of TextFlow.hostTextLayoutFormat. The code now assumes that once set by the client the supplied object won't be changed. This avoids a copy.
    Changes in build 363 (2009/02/03)
        * Performance work. Remove getCanonical from TextLayoutFormat.
        * Fix for RTE cancelling SplitParagraphOperation.
        * Fixing some float bugs.

    Try searching discussions--see: http://discussions.apple.com/thread.jspa?threadID=684662
    only caveat is link is dated-I googled for newer...
    MacBook Pro 17" Mac mini (Intel)   Mac OS X (10.4.8)  

  • How to find out the differences in minor builds for components?

    Hello,
    We use crystal 10 included in a vb6 application for reports design and viewing. When we changed our installshield version, for a reason I haven't understood yet, our versions of all the crystal components changed with it. This got identified as a problem with some minor difference in a small bit of functionality, what I'm now looking for is to know what changes were made between the builds for these components. If it's very minor changes that will not affect us we will leave these components as they are, if there are any major changes that will affect us we can either test their impact or make the decision to revert to all the old versions and re-release the software.
    I've spent just under an hour looking for the information but to no success, this forum really helped me out before with a weird crystal problem we were getting so thought I'd try here!
    These are all from the Ciphr Install\Common\Crystal Decisions\2.5\bin directory.
    File Name     Previous Version      Version in 5.1     Product
    commonobjmodel.dll     10.0.5.587     10.0.5.1017     Report Application Server
    craxddrt.dll     10.0.5.860     10.0.5.1506     Crystal Reports
    craxddrt_res_en.dll     10.0.5.860     10.0.5.1450     Crystal Reports
    craxdrt.dll     10.0.5.839     10.0.5.1519     Crystal Reports
    craxdrt_res_en.dll     10.0.5.839     10.0.5.1450     Crystal Reports
    crdb_ado.dll     10.0.5.655     10.0.5.668     Crystal Reports
    crdb_adoplus.dll     10.0.5.418     10.0.5.1210     Crystal Reports
    crdb_adoplus_res_en.dll     10.0.5.418     10.0.5.1210     Crystal Reports
    crdb_ado_res_en.dll     10.0.5.655     10.0.5.663     Crystal Reports
    crdb_cdo.dll     10.0.5.573     10.0.5.578     Crystal Reports
    crdb_cdo_res_en.dll     10.0.5.573     10.0.5.578     Crystal Reports
    crdb_com.dll     10.0.5.137     10.0.5.143     Crystal Reports
    crdb_com_res_en.dll     10.0.5.137     10.0.5.143     Crystal Reports
    crdb_dao.dll     10.0.5.606     10.0.5.611     Crystal Reports
    crdb_dao_res_en.dll     10.0.5.606     10.0.5.611     Crystal Reports
    crdb_dataset.dll     10.0.5.148     10.0.5.152     Crystal Reports
    crdb_dataset_res_en.dll     10.0.5.148     10.0.5.152     Crystal Reports
    crdb_fielddef.dll     10.0.5.568     10.0.5.574     Crystal Reports
    crdb_fielddef_res_en.dll     10.0.5.568     10.0.5.574     Crystal Reports
    crdb_filesystem.dll     10.0.5.563     10.0.5.567     Crystal Reports
    crdb_filesystem_res_en.dll     10.0.5.563     10.0.5.567     Crystal Reports
    crdb_JavaBeans.dll     10.0.5.145     10.0.5.152     Crystal Reports
    crdb_JavaBeans_res_en.dll     10.0.5.145     10.0.5.152     Crystal Reports
    crdb_odbc.dll     10.0.5.751     10.0.5.768     Crystal Reports
    crdb_odbc_res_en.dll     10.0.5.751     10.0.5.768     Crystal Reports
    crdb_oracle.dll     10.0.5.249     10.0.5.257     Crystal Reports
    crdb_oracle_res_en.dll     10.0.5.249     10.0.5.257     Crystal Reports
    crdb_p2bact3.dll     10.0.5.199     10.0.5.196     Crystal Reports
    crdb_p2bbde.dll     10.0.5.115     10.0.5.116     Crystal Reports
    crdb_p2bbtrv.dll     10.0.5.200     10.0.5.210     Crystal Reports
    crdb_p2bxbse.dll     10.0.5.113     10.0.5.114     Crystal Reports
    crdb_p2sacl.dll     10.0.5.128     10.0.5.129     Crystal Reports
    crdb_p2sdb2.dll     10.0.5.196     10.0.5.197     Crystal Reports
    crdb_p2sevta.dll     10.0.5.129     10.0.5.130     Crystal Reports
    crdb_p2sevtc.dll     10.0.5.129     10.0.5.130     Crystal Reports
    crdb_p2sexsrm.dll     10.0.5.130     10.0.5.131     Crystal Reports
    crdb_p2sexsrp.dll     10.0.5.130     10.0.5.131     Crystal Reports
    crdb_p2smapi.dll     10.0.5.133     10.0.5.134     Crystal Reports
    crdb_p2smsiis.dll     10.0.5.137     10.0.5.139     Crystal Reports
    crdb_p2soutlk.dll     10.0.5.222     10.0.5.225     Crystal Reports
    crdb_p2srepl.dll     10.0.5.130     10.0.5.131     Crystal Reports
    crdb_p2ssyb10.dll     10.0.5.176     10.0.5.179     Crystal Reports
    crdb_p2strack.dll     10.0.5.130     10.0.5.131     Crystal Reports
    crdb_p2swblg.dll     10.0.5.134     10.0.5.135     Crystal Reports
    crdb_query.dll     10.0.5.689     10.0.5.693     Crystal Reports
    crdb_query_res_en.dll     10.0.5.689     10.0.5.693     Crystal Reports
    CRDesignerCtrl.DLL     10.0.5.819     10.0.5.1016     Crystal Reports
    crdesignerctrl_res_en.dll     10.0.5.819     10.0.5.1016     Crystal Reports
    crqe.dll     10.0.5.877     10.0.5.882     Crystal Reports
    crqe_res_en.dll     10.0.5.877     10.0.5.882     Crystal Reports
    crtslv.dll     10.0.5.587     10.0.5.1017     TSLV Reader
    crviewer.dll     10.0.5.822     10.0.5.1155     Crystal Reports
    crxf_html.dll     10.0.5.72     10.0.5.75     Crystal Reports
    crxf_html_res_en.dll     10.0.5.72     10.0.5.75     Crystal Reports
    crxf_pdf.dll     10.0.5.598     10.0.5.604     Portable Document Format DLL for Crystal Reports
    crxf_pdf_res_en.dll     10.0.5.598     10.0.5.604     Portable Document Format DLL for Crystal Reports
    crxf_rtf.dll     10.0.5.603     10.0.5.604     Rich Text and MSWord Format DLL for Crystal Reports
    crxf_rtf_res_en.dll     10.0.5.603     10.0.5.604     Rich Text and MSWord Format DLL for Crystal Reports
    crxf_wordw.dll     10.0.5.603     10.0.5.604     Rich Text and MSWord Format DLL for Crystal Reports
    crxf_wordw_res_en.dll     10.0.5.603     10.0.5.604     Rich Text and MSWord Format DLL for Crystal Reports
    crxf_xls.dll     10.0.5.737     10.0.5.755     Crystal Reports
    crxf_xls_res_en.dll     10.0.5.737     10.0.5.754     Crystal Reports
    Emfgen.dll     10.0.5.587     10.0.5.1017     Crystal Reports
    exlate32.dll     10.0.5.587     10.0.5.1017     Crystal Reports For Windows
    ExportModeller.dll     10.0.5.580     10.0.5.581     ExportModeller Module
    filedialog.dll     10.0.5.587     10.0.5.1017     Report Application Server
    filedialog_res_chs.dll     10.0.5.587     10.0.5.1016     Report Application Server
    filedialog_res_de.dll     10.0.5.587     10.0.5.1016     Report Application Server
    filedialog_res_en.dll     10.0.5.587     10.0.5.1017     Report Application Server
    filedialog_res_es.dll     10.0.5.587     10.0.5.1016     Report Application Server
    filedialog_res_fr.dll     10.0.5.587     10.0.5.1016     Report Application Server
    filedialog_res_it.dll     10.0.5.587     10.0.5.1016     Report Application Server
    filedialog_res_jp.dll     10.0.5.587     10.0.5.1016     Report Application Server
    filedialog_res_ko.dll     10.0.5.587     10.0.5.1016     Report Application Server
    keycode.dll     10.0.5.417     10.0.5.847     Crystal Decisions keycode Module
    p2bbtrv.dll     10.0.5.16     10.0.5.24     Crystal Reports
    p3dbeen.dll     10.0.5.115     10.0.5.116     Crystal Reports
    p3dbten.dll     10.0.5.16     10.0.5.23     Crystal Reports
    p3dxben.dll     10.0.5.113     10.0.5.114     Crystal Reports
    p3sacen.dll     10.0.5.128     10.0.5.129     Crystal Reports
    p3sd2en.dll     10.0.5.196     10.0.5.197     Crystal Reports
    p3seven.dll     10.0.5.129     10.0.5.130     Crystal Reports
    p3sisen.dll     10.0.5.137     10.0.5.139     Crystal Reports
    p3smpen.dll     10.0.5.133     10.0.5.134     Crystal Reports
    p3srpen.dll     10.0.5.130     10.0.5.131     Crystal Reports
    p3ssten.dll     10.0.5.176     10.0.5.179     Crystal Reports
    p3stken.dll     10.0.5.130     10.0.5.131     Crystal Reports
    p3swlen.dll     10.0.5.134     10.0.5.135     Crystal Reports
    p3sxsen.dll     10.0.5.130     10.0.5.131     Crystal Reports
    pageObjectModel.dll     10.0.5.855     10.0.5.1509     PageObjectModel Module
    querybuilder.dll     10.0.5.625     10.0.5.630     Crystal Reports
    querybuilder_res_en.dll     10.0.5.625     10.0.5.630     Crystal Reports
    r3exlen.dll     10.0.5.587     10.0.5.1017     Crystal Reports For Windows
    ReportRenderer.dll     10.0.5.855     10.0.5.1509     ReportRenderer Module
    RptControllers.dll     10.0.5.798     10.0.5.1031     Report Application Server
    rptcontrollers_res_en.dll     10.0.5.798     10.0.5.1031     Report Application Server
    rptdefmodel.dll     10.0.5.587     10.0.5.1016     Report Application Server
    rptdefmodel_res_en.dll     10.0.5.587     10.0.5.1016     Report Application Server
    sacommoncontrols.dll     10.0.5.696     10.0.5.1251     Report Application Server
    sacommoncontrols_res_chs.dll     10.0.5.587     10.0.5.1016     Report Application Server
    sacommoncontrols_res_de.dll     10.0.5.587     10.0.5.1016     Report Application Server
    sacommoncontrols_res_es.dll     10.0.5.587     10.0.5.1016     Report Application Server
    sacommoncontrols_res_fr.dll     10.0.5.587     10.0.5.1016     Report Application Server
    sacommoncontrols_res_it.dll     10.0.5.587     10.0.5.1016     Report Application Server
    sacommoncontrols_res_jp.dll     10.0.5.587     10.0.5.1016     Report Application Server
    sacommoncontrols_res_ko.dll     10.0.5.587     10.0.5.1016     Report Application Server
    saxmlserialize.dll     10.0.5.587     10.0.5.1017     Report Application Server
    saxmlserialize_res_en.dll     10.0.5.587     10.0.5.1017     Report Application Server
    sscdlg.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscdlg_res_chs.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscdlg_res_de.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscdlg_res_en.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscdlg_res_es.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscdlg_res_fr.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscdlg_res_it.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscdlg_res_jp.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscdlg_res_ko.dll     10, 0, 0, 6     10, 0, 0, 7     Amigo Dialogs DLL
    sscsdk80.dll     10, 0, 0, 8     10, 0, 0, 16     Charting Engine DLL
    sscsdk80_res_chs.dll     10, 0, 0, 7     10, 0, 0, 12     Charting Engine DLL
    sscsdk80_res_de.dll     10, 0, 0, 7     10, 0, 0, 12     Charting Engine DLL
    sscsdk80_res_en.dll     10, 0, 0, 8     10, 0, 0, 16     Charting Engine DLL
    sscsdk80_res_es.dll     10, 0, 0, 7     10, 0, 0, 12     Charting Engine DLL
    sscsdk80_res_fr.dll     10, 0, 0, 7     10, 0, 0, 12     Charting Engine DLL
    sscsdk80_res_it.dll     10, 0, 0, 7     10, 0, 0, 12     Charting Engine DLL
    sscsdk80_res_jp.dll     10, 0, 0, 7     10, 0, 0, 12     Charting Engine DLL
    sscsdk80_res_ko.dll     10, 0, 0, 7     10, 0, 0, 12     Charting Engine DLL
    sviewhlp.dll     10.0.5.822     10.0.5.1155     Crystal Reports
    swebrs.dll     10.0.5.822     10.0.5.1155     Crystal Reports
    u2dapp.dll     10.0.5.548     10.0.5.550     Crystal Reports
    u2ddisk.dll     10.0.5.554     10.0.5.556     Crystal Reports
    u2dmapi.dll     10.0.5.549     10.0.5.550     Crystal Reports
    u2dpost.dll     10.0.5.560     10.0.5.562     Crystal Reports
    u2dvim.dll     10.0.5.20     10.0.5.21     Crystal Reports
    u2fcompress.dll     10.0.5.537     10.0.5.539     Crystal Reports
    u2fcr.dll     10.0.5.552     10.0.5.554     Crystal Reports
    u2fodbc.dll     10.0.5.556     10.0.5.558     Crystal Reports
    u2frdef.dll     10.0.5.23     10.0.5.25     Crystal Reports
    u2frec.dll     10.0.5.545     10.0.5.547     Crystal Reports
    u2fsepv.dll     10.0.5.59     10.0.5.62     Crystal Reports
    u2ftext.dll     10.0.5.591     10.0.5.604     Crystal Reports
    u2fxml.dll     10.0.5.582     10.0.5.584     Crystal Reports
    ufmanager.dll     10.0.5.30     10.0.5.32     Crystal Reports Professional For Windows
    UndoManager.dll     10.0.5.587     10.0.5.1017     Report Application Server
    vle.dll     10.0.5.587     10.0.5.904     VLE Module
    vle_res_en.dll     10.0.5.587     10.0.5.904     VLE Module
    webReporting.dll     10.0.5.855     10.0.5.1509     WebReporting Module
    x3dapen.dll     10.0.5.548     10.0.5.550     Crystal Reports
    x3ddken.dll     10.0.5.554     10.0.5.556     Crystal Reports
    x3dmpen.dll     10.0.5.549     10.0.5.550     Crystal Reports
    x3dpten.dll     10.0.5.560     10.0.5.562     Crystal Reports
    x3dvmen.dll     10.0.5.20     10.0.5.21     Crystal Reports
    x3fcpen.dll     10.0.5.537     10.0.5.539     Crystal Reports
    x3fcren.dll     10.0.5.552     10.0.5.554     Crystal Reports
    x3foden.dll     10.0.5.556     10.0.5.558     Crystal Reports
    x3frcen.dll     10.0.5.545     10.0.5.547     Crystal Reports
    x3frden.dll     10.0.5.23     10.0.5.25     Crystal Reports
    x3fsven.dll     10.0.5.59     10.0.5.61     Crystal Reports
    x3ftxen.dll     10.0.5.591     10.0.5.603     Crystal Reports
    x3fxmen.dll     10.0.5.582     10.0.5.584     Crystal Reports
    Thanks in advance for any pointers on where to get this info!
    Tim
    Edited by: Tim Hopkins on Sep 27, 2010 5:34 PM

    This is in the order of Filename, then the previous version number, then the build number that's now been included, then the product name.<br><br>commonobjmodel.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Report Application Server     <br><br>
    craxddrt.dll     <br>     10.0.5.860     <br>     10.0.5.1506     <br>     Crystal Reports     <br><br>
    craxddrt_res_en.dll     <br>     10.0.5.860     <br>     10.0.5.1450     <br>     Crystal Reports     <br><br>
    craxdrt.dll     <br>     10.0.5.839     <br>     10.0.5.1519     <br>     Crystal Reports     <br><br>
    craxdrt_res_en.dll     <br>     10.0.5.839     <br>     10.0.5.1450     <br>     Crystal Reports     <br><br>
    crdb_ado.dll     <br>     10.0.5.655     <br>     10.0.5.668     <br>     Crystal Reports     <br><br>
    crdb_adoplus.dll     <br>     10.0.5.418     <br>     10.0.5.1210     <br>     Crystal Reports     <br><br>
    crdb_adoplus_res_en.dll     <br>     10.0.5.418     <br>     10.0.5.1210     <br>     Crystal Reports     <br><br>
    crdb_ado_res_en.dll     <br>     10.0.5.655     <br>     10.0.5.663     <br>     Crystal Reports     <br><br>
    crdb_cdo.dll     <br>     10.0.5.573     <br>     10.0.5.578     <br>     Crystal Reports     <br><br>
    crdb_cdo_res_en.dll     <br>     10.0.5.573     <br>     10.0.5.578     <br>     Crystal Reports     <br><br>
    crdb_com.dll     <br>     10.0.5.137     <br>     10.0.5.143     <br>     Crystal Reports     <br><br>
    crdb_com_res_en.dll     <br>     10.0.5.137     <br>     10.0.5.143     <br>     Crystal Reports     <br><br>
    crdb_dao.dll     <br>     10.0.5.606     <br>     10.0.5.611     <br>     Crystal Reports     <br><br>
    crdb_dao_res_en.dll     <br>     10.0.5.606     <br>     10.0.5.611     <br>     Crystal Reports     <br><br>
    crdb_dataset.dll     <br>     10.0.5.148     <br>     10.0.5.152     <br>     Crystal Reports     <br><br>
    crdb_dataset_res_en.dll     <br>     10.0.5.148     <br>     10.0.5.152     <br>     Crystal Reports     <br><br>
    crdb_fielddef.dll     <br>     10.0.5.568     <br>     10.0.5.574     <br>     Crystal Reports     <br><br>
    crdb_fielddef_res_en.dll     <br>     10.0.5.568     <br>     10.0.5.574     <br>     Crystal Reports     <br><br>
    crdb_filesystem.dll     <br>     10.0.5.563     <br>     10.0.5.567     <br>     Crystal Reports     <br><br>
    crdb_filesystem_res_en.dll     <br>     10.0.5.563     <br>     10.0.5.567     <br>     Crystal Reports     <br><br>
    crdb_JavaBeans.dll     <br>     10.0.5.145     <br>     10.0.5.152     <br>     Crystal Reports     <br><br>
    crdb_JavaBeans_res_en.dll     <br>     10.0.5.145     <br>     10.0.5.152     <br>     Crystal Reports     <br><br>
    crdb_odbc.dll     <br>     10.0.5.751     <br>     10.0.5.768     <br>     Crystal Reports     <br><br>
    crdb_odbc_res_en.dll     <br>     10.0.5.751     <br>     10.0.5.768     <br>     Crystal Reports     <br><br>
    crdb_oracle.dll     <br>     10.0.5.249     <br>     10.0.5.257     <br>     Crystal Reports     <br><br>
    crdb_oracle_res_en.dll     <br>     10.0.5.249     <br>     10.0.5.257     <br>     Crystal Reports     <br><br>
    crdb_p2bact3.dll     <br>     10.0.5.199     <br>     10.0.5.196     <br>     Crystal Reports     <br><br>
    crdb_p2bbde.dll     <br>     10.0.5.115     <br>     10.0.5.116     <br>     Crystal Reports     <br><br>
    crdb_p2bbtrv.dll     <br>     10.0.5.200     <br>     10.0.5.210     <br>     Crystal Reports     <br><br>
    crdb_p2bxbse.dll     <br>     10.0.5.113     <br>     10.0.5.114     <br>     Crystal Reports     <br><br>
    crdb_p2sacl.dll     <br>     10.0.5.128     <br>     10.0.5.129     <br>     Crystal Reports     <br><br>
    crdb_p2sdb2.dll     <br>     10.0.5.196     <br>     10.0.5.197     <br>     Crystal Reports     <br><br>
    crdb_p2sevta.dll     <br>     10.0.5.129     <br>     10.0.5.130     <br>     Crystal Reports     <br><br>
    crdb_p2sevtc.dll     <br>     10.0.5.129     <br>     10.0.5.130     <br>     Crystal Reports     <br><br>
    crdb_p2sexsrm.dll     <br>     10.0.5.130     <br>     10.0.5.131     <br>     Crystal Reports     <br><br>
    crdb_p2sexsrp.dll     <br>     10.0.5.130     <br>     10.0.5.131     <br>     Crystal Reports     <br><br>
    crdb_p2smapi.dll     <br>     10.0.5.133     <br>     10.0.5.134     <br>     Crystal Reports     <br><br>
    crdb_p2smsiis.dll     <br>     10.0.5.137     <br>     10.0.5.139     <br>     Crystal Reports     <br><br>
    crdb_p2soutlk.dll     <br>     10.0.5.222     <br>     10.0.5.225     <br>     Crystal Reports     <br><br>
    crdb_p2srepl.dll     <br>     10.0.5.130     <br>     10.0.5.131     <br>     Crystal Reports     <br><br>
    crdb_p2ssyb10.dll     <br>     10.0.5.176     <br>     10.0.5.179     <br>     Crystal Reports     <br><br>
    crdb_p2strack.dll     <br>     10.0.5.130     <br>     10.0.5.131     <br>     Crystal Reports     <br><br>
    crdb_p2swblg.dll     <br>     10.0.5.134     <br>     10.0.5.135     <br>     Crystal Reports     <br><br>
    crdb_query.dll     <br>     10.0.5.689     <br>     10.0.5.693     <br>     Crystal Reports     <br><br>
    crdb_query_res_en.dll     <br>     10.0.5.689     <br>     10.0.5.693     <br>     Crystal Reports     <br><br>
    CRDesignerCtrl.DLL     <br>     10.0.5.819     <br>     10.0.5.1016     <br>     Crystal Reports     <br><br>
    crdesignerctrl_res_en.dll     <br>     10.0.5.819     <br>     10.0.5.1016     <br>     Crystal Reports     <br><br>
    crqe.dll     <br>     10.0.5.877     <br>     10.0.5.882     <br>     Crystal Reports     <br><br>
    crqe_res_en.dll     <br>     10.0.5.877     <br>     10.0.5.882     <br>     Crystal Reports     <br><br>
    crtslv.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     TSLV Reader     <br><br>
    crviewer.dll     <br>     10.0.5.822     <br>     10.0.5.1155     <br>     Crystal Reports     <br><br>
    crxf_html.dll     <br>     10.0.5.72     <br>     10.0.5.75     <br>     Crystal Reports     <br><br>
    crxf_html_res_en.dll     <br>     10.0.5.72     <br>     10.0.5.75     <br>     Crystal Reports     <br><br>
    crxf_pdf.dll     <br>     10.0.5.598     <br>     10.0.5.604     <br>     Portable Document Format DLL for Crystal Reports     <br><br>
    crxf_pdf_res_en.dll     <br>     10.0.5.598     <br>     10.0.5.604     <br>     Portable Document Format DLL for Crystal Reports     <br><br>
    crxf_rtf.dll     <br>     10.0.5.603     <br>     10.0.5.604     <br>     Rich Text and MSWord Format DLL for Crystal Reports     <br><br>
    crxf_rtf_res_en.dll     <br>     10.0.5.603     <br>     10.0.5.604     <br>     Rich Text and MSWord Format DLL for Crystal Reports     <br><br>
    crxf_wordw.dll     <br>     10.0.5.603     <br>     10.0.5.604     <br>     Rich Text and MSWord Format DLL for Crystal Reports     <br><br>
    crxf_wordw_res_en.dll     <br>     10.0.5.603     <br>     10.0.5.604     <br>     Rich Text and MSWord Format DLL for Crystal Reports     <br><br>
    crxf_xls.dll     <br>     10.0.5.737     <br>     10.0.5.755     <br>     Crystal Reports     <br><br>
    crxf_xls_res_en.dll     <br>     10.0.5.737     <br>     10.0.5.754     <br>     Crystal Reports     <br><br>
    Emfgen.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Crystal Reports     <br><br>
    exlate32.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Crystal Reports For Windows     <br><br>
    ExportModeller.dll     <br>     10.0.5.580     <br>     10.0.5.581     <br>     ExportModeller Module     <br><br>
    filedialog.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Report Application Server     <br><br>
    filedialog_res_chs.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    filedialog_res_de.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    filedialog_res_en.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Report Application Server     <br><br>
    filedialog_res_es.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    filedialog_res_fr.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    filedialog_res_it.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    filedialog_res_jp.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    filedialog_res_ko.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    keycode.dll     <br>     10.0.5.417     <br>     10.0.5.847     <br>     Crystal Decisions keycode Module     <br><br>
    p2bbtrv.dll     <br>     10.0.5.16     <br>     10.0.5.24     <br>     Crystal Reports     <br><br>
    p3dbeen.dll     <br>     10.0.5.115     <br>     10.0.5.116     <br>     Crystal Reports     <br><br>
    p3dbten.dll     <br>     10.0.5.16     <br>     10.0.5.23     <br>     Crystal Reports     <br><br>
    p3dxben.dll     <br>     10.0.5.113     <br>     10.0.5.114     <br>     Crystal Reports     <br><br>
    p3sacen.dll     <br>     10.0.5.128     <br>     10.0.5.129     <br>     Crystal Reports     <br><br>
    p3sd2en.dll     <br>     10.0.5.196     <br>     10.0.5.197     <br>     Crystal Reports     <br><br>
    p3seven.dll     <br>     10.0.5.129     <br>     10.0.5.130     <br>     Crystal Reports     <br><br>
    p3sisen.dll     <br>     10.0.5.137     <br>     10.0.5.139     <br>     Crystal Reports     <br><br>
    p3smpen.dll     <br>     10.0.5.133     <br>     10.0.5.134     <br>     Crystal Reports     <br><br>
    p3srpen.dll     <br>     10.0.5.130     <br>     10.0.5.131     <br>     Crystal Reports     <br><br>
    p3ssten.dll     <br>     10.0.5.176     <br>     10.0.5.179     <br>     Crystal Reports     <br><br>
    p3stken.dll     <br>     10.0.5.130     <br>     10.0.5.131     <br>     Crystal Reports     <br><br>
    p3swlen.dll     <br>     10.0.5.134     <br>     10.0.5.135     <br>     Crystal Reports     <br><br>
    p3sxsen.dll     <br>     10.0.5.130     <br>     10.0.5.131     <br>     Crystal Reports     <br><br>
    pageObjectModel.dll     <br>     10.0.5.855     <br>     10.0.5.1509     <br>     PageObjectModel Module     <br><br>
    querybuilder.dll     <br>     10.0.5.625     <br>     10.0.5.630     <br>     Crystal Reports     <br><br>
    querybuilder_res_en.dll     <br>     10.0.5.625     <br>     10.0.5.630     <br>     Crystal Reports     <br><br>
    r3exlen.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Crystal Reports For Windows     <br><br>
    ReportRenderer.dll     <br>     10.0.5.855     <br>     10.0.5.1509     <br>     ReportRenderer Module     <br><br>
    RptControllers.dll     <br>     10.0.5.798     <br>     10.0.5.1031     <br>     Report Application Server     <br><br>
    rptcontrollers_res_en.dll     <br>     10.0.5.798     <br>     10.0.5.1031     <br>     Report Application Server     <br><br>
    rptdefmodel.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    rptdefmodel_res_en.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    sacommoncontrols.dll     <br>     10.0.5.696     <br>     10.0.5.1251     <br>     Report Application Server     <br><br>
    sacommoncontrols_res_chs.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    sacommoncontrols_res_de.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    sacommoncontrols_res_es.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    sacommoncontrols_res_fr.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    sacommoncontrols_res_it.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    sacommoncontrols_res_jp.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    sacommoncontrols_res_ko.dll     <br>     10.0.5.587     <br>     10.0.5.1016     <br>     Report Application Server     <br><br>
    saxmlserialize.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Report Application Server     <br><br>
    saxmlserialize_res_en.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Report Application Server     <br><br>
    sscdlg.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscdlg_res_chs.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscdlg_res_de.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscdlg_res_en.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscdlg_res_es.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscdlg_res_fr.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscdlg_res_it.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscdlg_res_jp.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscdlg_res_ko.dll     <br>     10, 0, 0, 6     <br>     10, 0, 0, 7     <br>     Amigo Dialogs DLL     <br><br>
    sscsdk80.dll     <br>     10, 0, 0, 8     <br>     10, 0, 0, 16     <br>     Charting Engine DLL     <br><br>
    sscsdk80_res_chs.dll     <br>     10, 0, 0, 7     <br>     10, 0, 0, 12     <br>     Charting Engine DLL     <br><br>
    sscsdk80_res_de.dll     <br>     10, 0, 0, 7     <br>     10, 0, 0, 12     <br>     Charting Engine DLL     <br><br>
    sscsdk80_res_en.dll     <br>     10, 0, 0, 8     <br>     10, 0, 0, 16     <br>     Charting Engine DLL     <br><br>
    sscsdk80_res_es.dll     <br>     10, 0, 0, 7     <br>     10, 0, 0, 12     <br>     Charting Engine DLL     <br><br>
    sscsdk80_res_fr.dll     <br>     10, 0, 0, 7     <br>     10, 0, 0, 12     <br>     Charting Engine DLL     <br><br>
    sscsdk80_res_it.dll     <br>     10, 0, 0, 7     <br>     10, 0, 0, 12     <br>     Charting Engine DLL     <br><br>
    sscsdk80_res_jp.dll     <br>     10, 0, 0, 7     <br>     10, 0, 0, 12     <br>     Charting Engine DLL     <br><br>
    sscsdk80_res_ko.dll     <br>     10, 0, 0, 7     <br>     10, 0, 0, 12     <br>     Charting Engine DLL     <br><br>
    sviewhlp.dll     <br>     10.0.5.822     <br>     10.0.5.1155     <br>     Crystal Reports     <br><br>
    swebrs.dll     <br>     10.0.5.822     <br>     10.0.5.1155     <br>     Crystal Reports     <br><br>
    u2dapp.dll     <br>     10.0.5.548     <br>     10.0.5.550     <br>     Crystal Reports     <br><br>
    u2ddisk.dll     <br>     10.0.5.554     <br>     10.0.5.556     <br>     Crystal Reports     <br><br>
    u2dmapi.dll     <br>     10.0.5.549     <br>     10.0.5.550     <br>     Crystal Reports     <br><br>
    u2dpost.dll     <br>     10.0.5.560     <br>     10.0.5.562     <br>     Crystal Reports     <br><br>
    u2dvim.dll     <br>     10.0.5.20     <br>     10.0.5.21     <br>     Crystal Reports     <br><br>
    u2fcompress.dll     <br>     10.0.5.537     <br>     10.0.5.539     <br>     Crystal Reports     <br><br>
    u2fcr.dll     <br>     10.0.5.552     <br>     10.0.5.554     <br>     Crystal Reports     <br><br>
    u2fodbc.dll     <br>     10.0.5.556     <br>     10.0.5.558     <br>     Crystal Reports     <br><br>
    u2frdef.dll     <br>     10.0.5.23     <br>     10.0.5.25     <br>     Crystal Reports     <br><br>
    u2frec.dll     <br>     10.0.5.545     <br>     10.0.5.547     <br>     Crystal Reports     <br><br>
    u2fsepv.dll     <br>     10.0.5.59     <br>     10.0.5.62     <br>     Crystal Reports     <br><br>
    u2ftext.dll     <br>     10.0.5.591     <br>     10.0.5.604     <br>     Crystal Reports     <br><br>
    u2fxml.dll     <br>     10.0.5.582     <br>     10.0.5.584     <br>     Crystal Reports     <br><br>
    ufmanager.dll     <br>     10.0.5.30     <br>     10.0.5.32     <br>     Crystal Reports Professional For Windows     <br><br>
    UndoManager.dll     <br>     10.0.5.587     <br>     10.0.5.1017     <br>     Report Application Server     <br><br>
    vle.dll     <br>     10.0.5.587     <br>     10.0.5.904     <br>     VLE Module     <br><br>
    vle_res_en.dll     <br>     10.0.5.587     <br>     10.0.5.904     <br>     VLE Module     <br><br>
    webReporting.dll     <br>     10.0.5.855     <br>     10.0.5.1509     <br>     WebReporting Module     <br><br>
    x3dapen.dll     <br>     10.0.5.548     <br>     10.0.5.550     <br>     Crystal Reports     <br><br>
    x3ddken.dll     <br>     10.0.5.554     <br>     10.0.5.556     <br>     Crystal Reports     <br><br>
    x3dmpen.dll     <br>     10.0.5.549     <br>     10.0.5.550     <br>     Crystal Reports     <br><br>
    x3dpten.dll     <br>     10.0.5.560     <br>     10.0.5.562     <br>     Crystal Reports     <br><br>
    x3dvmen.dll     <br>     10.0.5.20     <br>     10.0.5.21     <br>     Crystal Reports     <br><br>
    x3fcpen.dll     <br>     10.0.5.537     <br>     10.0.5.539     <br>     Crystal Reports     <br><br>
    x3fcren.dll     <br>     10.0.5.552     <br>     10.0.5.554     <br>     Crystal Reports     <br><br>
    x3foden.dll     <br>     10.0.5.556     <br>     10.0.5.558     <br>     Crystal Reports     <br><br>
    x3frcen.dll     <br>     10.0.5.545     <br>     10.0.5.547     <br>     Crystal Reports     <br><br>
    x3frden.dll     <br>     10.0.5.23     <br>     10.0.5.25     <br>     Crystal Reports     <br><br>
    x3fsven.dll     <br>     10.0.5.59     <br>     10.0.5.61     <br>     Crystal Reports     <br><br>
    x3ftxen.dll     <br>     10.0.5.591     <br>     10.0.5.603     <br>     Crystal Reports     <br><br>
    x3fxmen.dll     <br>     10.0.5.582     <br>     10.0.5.584     <br>     Crystal Reports     <br><br>

  • How can i copy line with text and image to ms word

    When I insert an image in textflow using InlineGraphicElement it works, but when I copy the line with the image to MS Word it copies only the text (not the image).
    How can i copy the image to MS Word?

    If you want copy formatted text and image to MS Word, you need to give MS Word rtf markup, because Word can recognize rtf markup but not TLF markup.
    So you need to create a custom clipboard to paste a rtf markup. It's a large feature for you, because you need a tlf-rtf converter in your custom clipboard.
    TLF Custom Clipboard Example:
    package
        import flash.display.Sprite;
        import flash.desktop.ClipboardFormats;
        import flashx.textLayout.container.ContainerController;
        import flashx.textLayout.conversion.ITextImporter;
        import flashx.textLayout.conversion.TextConverter;
        import flashx.textLayout.edit.EditManager;
        import flashx.textLayout.elements.*;
        import flashx.undo.UndoManager;
        // Example code to install a custom clipboard format. This one installs at the front of the list (overriding all later formats)
        // and adds a handler for plain text that strips out all consonants (everything except aeiou).
        public class CustomClipboardFormat extends Sprite
            public function CustomClipboardFormat()
                var textFlow:TextFlow = setup();
                TextConverter.addFormatAt(0, "vowelsOnly_extraList", VowelsOnlyImporter, AdditionalListExporter, "air:text" /* it's a converter for cliboard */);
            private const markup:String = '<TextFlow whiteSpaceCollapse="preserve" version="2.0.0" xmlns="http://ns.adobe.com/textLayout/2008"><p><span color=\"0x00ff00\">Anything you paste will have all consonants removed.</span></p></TextFlow>';
            private function setup():TextFlow
                var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
                var textFlow:TextFlow = importer.importToFlow(markup);
                textFlow.flowComposer.addController(new ContainerController(this,500,200));
                textFlow.interactionManager = new EditManager(new UndoManager());
                textFlow.flowComposer.updateAllControllers();
                return textFlow;
    import flashx.textLayout.conversion.ITextExporter;
    import flashx.textLayout.conversion.ConverterBase;
    import flashx.textLayout.conversion.ITextImporter;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.elements.IConfiguration;
    import flashx.textLayout.elements.TextFlow;
    class VowelsOnlyImporter extends ConverterBase implements ITextImporter
        protected var _config:IConfiguration = null;
        /** Constructor */
        public function VowelsOnlyImporter()
            super();
        public function importToFlow(source:Object):TextFlow
            if (source is String)
                var firstChar:String = (source as String).charAt(0);
                firstChar = firstChar.toLowerCase();
                // This filter only applies if the first character is a vowel
                if (firstChar == 'a' || firstChar == 'i' || firstChar == 'e' || firstChar == 'o' || firstChar == 'u')
                    var pattern:RegExp = /([b-df-hj-np-tv-z])*/g;
                    source = source.replace(pattern, "");
                    var importer:ITextImporter = TextConverter.getImporter(TextConverter.PLAIN_TEXT_FORMAT);
                    importer.useClipboardAnnotations = this.useClipboardAnnotations;
                    importer.configuration = _config;
                    return importer.importToFlow(source);
            return null;
        public function get configuration():IConfiguration
            return _config;
        public function set configuration(value:IConfiguration):void
            _config = value;
    import flashx.textLayout.elements.ParagraphElement;
    import flashx.textLayout.elements.SpanElement;
    import flashx.textLayout.elements.ListElement;
    import flashx.textLayout.elements.ListItemElement;
    class AdditionalListExporter extends ConverterBase implements ITextExporter
        /** Constructor */
        public function AdditionalListExporter()   
            super();
        public function export(source:TextFlow, conversionType:String):Object
            if (source is TextFlow)
                source.getChildAt(source.numChildren - 1).setStyle(MERGE_TO_NEXT_ON_PASTE, false);
                var list:ListElement = new ListElement();
                var item1:ListItemElement = new ListItemElement();
                var item2:ListItemElement = new ListItemElement();
                var para1:ParagraphElement = new ParagraphElement();
                var para2:ParagraphElement = new ParagraphElement();
                var span1:SpanElement = new SpanElement();
                span1.text = "ab";
                var span2:SpanElement = new SpanElement();
                span2.text = "cd";
                list.addChild(item1);
                list.addChild(item2);
                item1.addChild(para1);
                para1.addChild(span1);
                item2.addChild(para2);
                para2.addChild(span2);
                source.addChild(list);
                var exporter:ITextExporter = TextConverter.getExporter(TextConverter.TEXT_LAYOUT_FORMAT);
                exporter.useClipboardAnnotations = this.useClipboardAnnotations;
                return exporter.export(source, conversionType);   
            return null;

  • Need help in xml

    i want to know how to parse an xml doc using javax.xml.parsers
    i have written a simple ide for java with lots of options and the software would look better if i include xml support.
    u can find the code below.
    /* Thank you for your interest in viewing the source of Jcom */
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.jar.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.undo.*;
    import javax.swing.text.*;
    // The main Class.
    public class Jcom extends JFrame
    JTextArea t=new JTextArea();
    JTextField output;
    Font f=new Font("SansSerif",Font.PLAIN,13);
    int count=0,char_count=0,class_count=0,char_changed=0,recent_compile=0,tabinsert=0;
    String curfile,Dir="./",text,file="Untitled",Key_word="",ext="java";
    String menucomm[]={"New","Open","Save","Save as","Exit","Cut","Copy","Paste","Select All","Comment","Compile","Run","About","Shortcut List","Undo","Redo","Bookmark"};
    File o_file;
    OutputStream f1;
    MessageWindow mw=new MessageWindow("Console Window.");
    protected UndoManager undo = new UndoManager();
    static Jcom jc;
    StatusBar status;
    JProgressBar progress;
    displayProgress dp=new displayProgress("Loading in Progress.");
    JComboBox jb;
    // Constructor
    public Jcom(String title) throws Exception
    super(title);
    setVisible(true);
    //setIconImage(new ImageIcon("./images/icon.gif"));
    t.setMargin(new Insets(20,30,20,20));
    setSize(700,500);
    String vers = System.getProperty("java.version");
    if(vers.compareTo("1.1.2")>0)
    t.setDragEnabled(true); // Works only in version 1.4
    t.setAutoscrolls(true);
    t.setFont(f);
    t.setLineWrap(true);
    t.setWrapStyleWord(true);
    t.setTabSize(6);
    Dimension dim=getToolkit().getScreenSize();
    setLocation(dim.width/2-getWidth()/2,dim.height/2-getHeight()/2);
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    addWindowListener(new Winlis());
    undo.discardAllEdits();
    //main() method
    public static void main(String arg[]) throws Exception
    jc=new Jcom("JCom - The Java IDE.");
    jc.addmenu();
    jc.addtools();
    // Ask for exit
    public void askexit()
    int ch=2;
    if(char_changed==1)
    ch=JOptionPane.showOptionDialog(null,"Save Changes you made to "+file+" ?","Confirm",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
    if(ch==0)
    save_doc();
    System.exit(0);
    public boolean save_doc()
    try
         if(file.equals("Untitled") || file==null)
              save_doc_as();
         else
         String text=t.getText();
         byte buf[]=text.getBytes();
         o_file=new File(Dir,file);
         OutputStream f1=new FileOutputStream(o_file);
         f1.write(buf);
         f1.close();
         char_changed=0;
         setTitle(file+" - JCompile");
    //setIcon(new ImageIcon("./images/icon.gif");
         catch(Exception i)
         return false;
    output.setText(file+" Total lines : "+t.getLineCount());
    return true;
    public boolean save_doc_as()
         try
         FileDialog fd=new FileDialog(this,"Save this document as",FileDialog.SAVE);
         fd.setVisible(true);
         file=fd.getFile();
         if(file==null)
         file="Untitled";
         return false;
         Dir=fd.getDirectory();
         text=t.getText();
         byte buf[]=text.getBytes();
         o_file=new File(Dir,file);
         f1=new FileOutputStream(o_file);
         f1.write(buf);
         f1.close();
         setTitle(file+" - JCompile");
         char_changed=0;
         setTitle(file+" - JCompile");
    //setIcon(new ImageIcon("./images/icon.gif");
         catch(Exception e)
         return false;
    output.setText(file+" Total lines : "+t.getLineCount());
    return true;
    public boolean compileit()
         try
         if(file.equals("Untitled"))
         if(save_doc()==false)
         return false;
         if(file==null)
         return false;
         if(char_changed==1)
         if(save_doc()==false)
         return false;
         output.setText("Compiling "+file+" ...");
         mw.jt.setText("Compiling "+file+" ..."+"\n");
         String comm="Javac.exe "+Dir+file;
         Process ps=Runtime.getRuntime().exec(comm);
         Runtime.getRuntime().gc();     
         InputStream textfile=ps.getErrorStream();
         DataInputStream dai=new DataInputStream(textfile);
         String S=dai.readLine();
         int errorcount=0;
         while(S != null)
         errorcount++;
         mw.jt.append(S+"\n");
         S=dai.readLine();
         if(errorcount==0)
              output.setText("Compilation Successful. Alt+v to Run the code.");
         else
         output.setText("Some Errors/Warnings occured during the compilation.");
         mw.setVisible(true);
         mw.setTitle("Compilation Results.");
         return false;
         }// end of try
         catch(IOException ie)
         JOptionPane.showMessageDialog(null, "Some I/O Error has occured. Please save your file and continue.", "I/O Error.",JOptionPane. ERROR_MESSAGE);
         return false;
         catch(Exception e)
         JOptionPane.showMessageDialog(null, "Exception has occured. Please save your file and continue.", "Exception.",JOptionPane. ERROR_MESSAGE);           
         return false;
         return true;
    public void run_program()
         try
         if(file==null)
         return;
         if(!mw.isVisible())
         mw.setVisible(true);
         if(char_changed==1)
         if(save_doc()==false)
         return;
         if(compileit()==false)
         return;
         mw.jt.setText("\nExecuting "+file+" ..."+"\n");
         int pos_dot=file.indexOf('.');
         char class_name[]=file.toCharArray();
         String class_name_string=new String(class_name,0,pos_dot);
         String comm="java "+class_name_string;
         Runtime ru=Runtime.getRuntime();
         Process ps=ru.exec(comm);
         InputStream textfile=ps.getErrorStream();
         Runtime.getRuntime().gc();     
         DataInputStream dai=new DataInputStream(textfile);
         String S=dai.readLine();
         if(S!=null)
         mw.jt.append("\nFollowing Runtime Error has occured.\n");
         int errorcount=0;
         while(S != null)
         errorcount++;
         mw.jt.append(S+"\n");
         S=dai.readLine();
         DataInputStream din=new DataInputStream(ps.getInputStream());
         S=din.readLine();
         errorcount=0;
         while(S != null)
         errorcount++;
         mw.jt.append(S+"\n");
         S=din.readLine();
         mw.jt.append("Execution of "+file+" has terminated."+"\n");
         output.setText("Execution completed.");
         mw.setTitle("Execution Results.");
         catch(IOException ie)
         JOptionPane.showMessageDialog(null, "Exception has occured. Please save your work and continue. ", "I/O Error",JOptionPane. ERROR_MESSAGE);           
         return;
         catch(Exception e)
         JOptionPane.showMessageDialog(null, "Exception has occured. Please save your work and continue. ", "I/O Error",JOptionPane. ERROR_MESSAGE);           
         return;
    public void addtools()
    //Adding toolbar
    JToolBar toolbar=new JToolBar();
    String[] iconfiles={"./images/new.gif","./images/open.gif","./images/save.gif","./images/cut.gif","./images/copy.gif","./images/paste.gif","./images/compile.gif","./images/run.gif"};
    jb = new JComboBox();
    jb.addActionListener(new bookListen());
    String[] butcomm={"New","Open","Save","Cut","Copy","Paste","Compile","Run"};
    ImageIcon[] icons=new ImageIcon[iconfiles.length];
    JButton[] buttons = new JButton[iconfiles.length];
    for(int i=0;i<iconfiles.length;i++)
         icons=new ImageIcon(iconfiles[i]);
         buttons[i]=new JButton(icons[i]);
         buttons[i].addActionListener(new actListen());
         buttons[i].setActionCommand(butcomm[i]);
         buttons[i].setToolTipText(butcomm[i]);
         toolbar.add(buttons[i]);
         if(i+1%3==0)
         toolbar.addSeparator();
         getContentPane().add("North",toolbar);
    status=new StatusBar();
    getContentPane().add("South",status);
    // this adds fonts support to the toolbar
    /*JComboBox jc = new JComboBox();
         String[] fonts = getToolkit().getFontList();
         for (int i = 0; i < fonts.length; i++)
         jc.addItem(fonts[i]);
         toolbar.add(jc);*/
    output=new JTextField(30);
    output.setEditable(false);
    status.add(output);
    status.add(new JLabel("Bookmarks "));
    jb.setMaximumRowCount(8);
    status.add(jb); //Add bookmark list
    validate();
    }/* End of addtools*/
    public void addmenu()
    //Adding menu Bar
    JMenuBar mb= new JMenuBar();
    setJMenuBar(mb);
    JMenuItem new1,open,save,save_as,cut,copy,paste,sel_all,und,red,find,replace,exit,about,compile,check,runit,shortcut_list,bookmark;
    // Adding contents for menu bar
    JMenu file=new JMenu("File");
    JMenu edit=new JMenu("Edit");
    JMenu search=new JMenu("Search");
    JMenu tools=new JMenu("Tools");
    JMenu make=new JMenu("Make");
    JMenu help=new JMenu("Help");
    new1=new JMenuItem("New");
    new1.setToolTipText("Create a new file.");
    new1.setIcon(new ImageIcon("./images/new.gif"));
    new1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK ));
    file.add(new1);
    new1.addActionListener(new actListen());
    open=new JMenuItem("Open");
    open.setToolTipText("Open an existing file.");
    open.setIcon(new ImageIcon("./images/open.gif"));
    open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK ));
    file.add(open);
    open.addActionListener(new actListen());
    save=new JMenuItem("Save");
    save.setToolTipText("Save changes.");
    save.setIcon(new ImageIcon("./images/save.gif"));
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK ));
    file.add(save);
    save.addActionListener(new actListen());
    save_as=new JMenuItem("Save as");
    save_as.setToolTipText("Save changes as.");
    file.add(save_as);
    save_as.addActionListener(new actListen());
    exit=new JMenuItem("Exit");
    exit.setToolTipText("Exit.");
    exit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.ALT_MASK ));
    file.add(exit);
    exit.addActionListener(new actListen());
    exit.setIcon(new ImageIcon("./images/exit.gif"));
    mb.add(file);
    cut=new JMenuItem("Cut");
    cut.setToolTipText("Cut selection.");
    cut.setIcon(new ImageIcon("./images/cut.gif"));
    cut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK ));
    edit.add(cut);
    cut.addActionListener(new actListen());
    copy=new JMenuItem("Copy");
    copy.setToolTipText("Copy selection.");
    copy.setIcon(new ImageIcon("./images/copy.gif"));
    copy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK ));
    edit.add(copy);
    copy.addActionListener(new actListen());
    paste=new JMenuItem("Paste");
    paste.setToolTipText("Paste from clipboard.");
    paste.setIcon(new ImageIcon("./images/paste.gif"));
    paste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK ));
    edit.add(paste);
    paste.addActionListener(new actListen());
    sel_all=new JMenuItem("Select All");
    sel_all.setToolTipText("Select all.");
    sel_all.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK ));
    edit.add(sel_all);
    sel_all.addActionListener(new actListen());
    und=new JMenuItem("Undo");
    und.setToolTipText("Undo.");
    und.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK ));
    edit.add(und);
    und.addActionListener(new actListen());
    red=new JMenuItem("Redo");
    red.setToolTipText("Redo.");
    red.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_MASK ));
    edit.add(red);
    red.addActionListener(new actListen());
    mb.add(edit);
    find=new JMenuItem("Find");
    search.add(find);
    find.setIcon(new ImageIcon("./images/find.gif"));
    find.addActionListener(new actListen());
    replace=new JMenuItem("Replace");
    search.add(replace);
    replace.setIcon(new ImageIcon("./images/replace.gif"));
    replace.addActionListener(new actListen());
    mb.add(search);
    JMenuItem tar_file=new JMenuItem("Create Archive");
    tools.add(tar_file);
    tar_file.addActionListener(new actListen());
    JMenuItem docu=new JMenuItem("Create Documentation");
    tools.add(docu);
    docu.addActionListener(new actListen());
    JMenuItem comment=new JMenuItem("Comment");
    comment.setToolTipText("Comment Selection.");
    tools.add(comment);
    comment.addActionListener(new actListen());
    bookmark=new JMenuItem("Bookmark");
    tools.add(bookmark);
    bookmark.addActionListener(new actListen());
    mb.add(tools);
    compile=new JMenuItem("Compile");
    compile.setToolTipText("Compile.");
    compile.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.ALT_MASK ));
    make.add(compile);
    compile.setIcon(new ImageIcon("./images/compile.gif"));
    compile.addActionListener(new actListen());
    runit=new JMenuItem("Run");
    runit.setToolTipText("Run.");
    runit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.ALT_MASK ));
    make.add(runit);
    runit.setIcon(new ImageIcon("./images/run.gif"));
    runit.addActionListener(new actListen());
    mb.add(make);
    shortcut_list=new JMenuItem("Shortcut List");
    help.add(shortcut_list);
    shortcut_list.addActionListener(new actListen());
    about=new JMenuItem("About");
    help.add(about);
    about.addActionListener(new actListen());
    mb.add(help);
    //Register with document listener.
    t.getDocument().addDocumentListener(new docListen());
    // Register with Undo Listener
    t.getDocument().addUndoableEditListener(new UndoHandler());
    //Register with Keyboard listener
    t.addKeyListener(new keyListen());
    JScrollPane scrollpane=new JScrollPane(t);
    Container cont=getContentPane();
    cont.add(scrollpane);
    validate();
    }/* End of addmenu */
    /* Frame for displaying console outputs */
    public class MessageWindow extends JFrame
    JTextArea jt;
    public MessageWindow(String title)
    super(title);
    setSize(400,400);
    //setIcon(new ImageIcon("./images/icon.gif"));
    jt =new JTextArea();
    jt.setEditable(false);
    JScrollPane scroll=new JScrollPane(jt);
    getContentPane().add(scroll);
    jt.addKeyListener(new keyListen());
    jt.addMouseListener(new mouseListen());
    validate();
    }//End of console display class
    /* Frame for displaying progress bar during an operation */
    public class displayProgress extends JFrame
    JLabel jl;
    public displayProgress(String title)
    super(title);
    setSize(300,100);
    setResizable(false);
    removeNotify();
    Dimension dim=getToolkit().getScreenSize();
    setLocation(dim.width/2-getWidth()/2,dim.height/2-getHeight()/2);
    getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER,8,30));
    jl=new JLabel("Lines Loaded : ");
    progress = new JProgressBar();
    progress.setMinimum(0);
    progress.setMaximum(45);
    getContentPane().add(jl);
    getContentPane().add(progress);
    validate();
    }//End of progress display.
    public void addNew() // To add a new Book Mark
    String selectedText=t.getSelectedText();
    if(selectedText!=null)
    jb.addItem(selectedText);
    jb.showPopup();
    output.setText("Bookmark added.");
    public void remove() // To remove a Bookmark
    jb.removeAllItems();
    /* Book Mark Handler*/
    class bookListen implements ActionListener
    public void actionPerformed(ActionEvent ae)
    String search=(String)jb.getSelectedItem();
    if(search!=null)
    findString(search);
    }//End of class
    // Undo Handler
    class UndoHandler implements UndoableEditListener
         public void undoableEditHappened(UndoableEditEvent e)
              undo.addEdit(e.getEdit());
    }// undo handler
    public class keyListen extends KeyAdapter
    KeyStroke ks;
    public void keyPressed(KeyEvent ke)
    try
    ks=KeyStroke.getKeyStrokeForEvent(ke);
    String s1=KeyEvent.getKeyModifiersText(ks.getModifiers()); //s1 has modifiers like Ctrl+Alt
    String s2=KeyEvent.getKeyText(ks.getKeyCode()); //s2 has key like 'a'
    if(s2.equals("Up") || s2.equals("Down") || s2.equals("Left") || s2.equals("Right"))
    int chcount=t.getCaretPosition();
    int linecount=t.getLineOfOffset(chcount)+1;
    output.setText("Character count : "+chcount+" Line Number : "+linecount);
    boolean flag=true;
    String search;
         if(s1.equals("Ctrl+Shift")) // Required
              output.setText("Looking for Macro ...");          
              if(s2.equals("S"))
              t.insert("\tSystem.out.println(\"\");",t.getCaretPosition());
              output.setText("Macro : Insert System.out.println() method.");          
              else if(s2.equals("C")) // Create a default constructor
              if(file.equals("Untitled"))
              flag=save_doc_as();
              if(flag)
              int pos_dot=file.indexOf('.');
              char class_name[]=file.toCharArray();
              String class_name_string=new String(class_name,0,pos_dot);
              t.insert("public "+class_name_string+"()\n\t{\n\n\t}",t.getCaretPosition());
              output.setText("Macro : Insert Default Constructor.");          
              else if(s2.equals("M"))
              t.insert("\tpublic static void main(String arg[])\n\t{\n\n\t}",t.getCaretPosition());
              output.setText("Macro : Insert Main method.");          
              else if(s2.equals("T"))
              t.insert("try\n{\n\n}\n\ncatch(Exception e)\n{\n\te.printStackTrace();\n}",t.getCaretPosition());
              output.setText("Macro : Insert try-catch block.");                              }
         }// Macro check end ctrl+alt
         // Additional check using only alt.
         else if(s1.equals("Alt"))
              if(s2.equals("F"))
              search=mw.jt.getSelectedText();
              if(search!=null)
              findString(search);
         } // Alt check
    }//try
    catch(Exception e)
         output.setText("Cannot find the Error Region.");
    }// Function end
    }/* End of Keylisten */
    public void findString(String search)
    try
    boolean found=false;
              String lineToFind=search;
              if(lineToFind==null)
              return;
              for(int i=0;i<t.getLineCount();i++)
              int offset=t.getLineStartOffset(i);
              String lineInArea=t.getText(offset,lineToFind.length());
              output.setText("Currently Looking ... "+lineInArea);
              if(lineInArea.equals(lineToFind))
              t.requestFocus();
              t.select(offset,offset+lineToFind.length());
              output.setText("Required Line Detected.");
              found=true;
              break;
              }//for loop
              if(found==false)
              output.setText("Cannot find Required Line.");
              found=false;
    catch(BadLocationException be)
         output.setText("Cannot find the Error Region.");
    }// end of find error.
    //Window Listener
    public class Winlis extends WindowAdapter
    public void windowClosing(WindowEvent we)
    askexit();
    //Document Listener
    public class docListen implements DocumentListener
    public void changedUpdate(DocumentEvent de)
    try
    char_changed=1;
    setTitle(file+" <changed> - JCompile");
    //setIcon(new ImageIcon("./images/save.gif");
    int chcount=t.getCaretPosition();
    int linecount=t.getLineOfOffset(chcount)+1;
    output.setText("Character count : "+chcount+" Line Number : "+linecount);
    catch(BadLocationException be)
    output.setText("Character count : "+t.getCaretPosition());
    public void insertUpdate(DocumentEvent de)
    try
    char_changed=1;
    setTitle(file+" <changed> - JCompile");
    //setIcon(new ImageIcon("./images/save.gif");
    int chcount=t.getCaretPosition();
    int linecount=t.getLineOfOffset(chcount)+1;
    output.setText("Character count : "+chcount+" Line Number : "+linecount);
    catch(BadLocationException be)
    output.setText("Character count : "+t.getCaretPosition());
    public void removeUpdate(DocumentEvent de)
    try
    char_changed=1;
    setTitle(file+" <changed> - JCompile");
    //setIcon(new ImageIcon("./images/save.gif");
    int chcount=t.getCaretPosition();
    int linecount=t.getLineOfOffset(chcount)+1;
    output.setText("Character count : "+chcount+" Line Number : "+linecount);
    catch(BadLocationException be)
    output.setText("Character count : "+t.getCaretPosition());
    }//Document Listener
    // Action Listener
    public class actListen implements ActionListener
    //Action listener
    public void actionPerformed(ActionEvent ae)
    String str=(String)ae.getActionCommand();
    int command_number=0;
    for(int i=0;i<20;i++)
    if(str.equals(menucomm[i]))
    command_number=i;
    break;
    switch(command_number)
         case 0:
         if(char_changed==1)
         int ch=JOptionPane.showOptionDialog(null,"Save Changes you made to "+file+" ?","Confirm",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
         if(ch==0)
         save_doc();     
         t.setText("");
         char_changed=0;
         setTitle("Untitled");
         file="Untitled";
         remove();
         undo.discardAllEdits();
         break;
         case 1:
         //open_doc();
         int ch=2;
         if(char_changed==1)
         ch=JOptionPane.showOptionDialog(null,"Save Changes you made to "+file+" ?","Confirm",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
              if(ch==0)
              save_doc_as();
         t.setText("");
         FileDialog fd=new FileDialog(jc,"Open a file",FileDialog.LOAD);
         fd.setVisible(true);
         file=fd.getFile();
         // Support for class files also
         int pos_dot=file.indexOf('.');
         ext=file.substring(pos_dot+1,file.length());
         if(ext.equalsIgnoreCase("class")) // it is a class file
         try
         Runtime r=Runtime.getRuntime();
         String comm="jad.exe -s .java "+file;
         r.exec(comm);
         file=file.substring(0,pos_dot)+".java";
         catch(Exception e)
         output.setText("Some error has occured in Decompiling the class file.");
         Dir=fd.getDirectory();
         if(file!=null)
         Thread ofile=new openFile();
         ofile.start();
         dp.setVisible(false);
         remove();
         break;
         case 2:
         // Save
         save_doc();
         break;
         case 3:
         save_doc_as();
         break;     
         case 4:
         // Exit
         askexit();
         break;
         case 5:
         t.cut();
         break;
         case 6:
         t.copy();
         break;
         case 7:
         t.paste();
         break;
         case 8:
         t.selectAll();
         break;
         case 9: //comment
         String otext=t.getSelectedText();
         if(otext!=null)
         String ntext="/*\n"+otext+"\n*/";
         t.replaceSelection(ntext);
         break;
         case 10:
         if(char_changed==1)
         save_doc();
         output.setText("Compiling "+file+" ...");
         compileit();
         break;
         case 11:
         if(char_changed==1)
         compileit();
         if(file.equals("Untitled"))
         save_doc_as();
         compileit();
         else
         output.setText("Executing "+file+" ...");
         run_program();
         break;
         case 12: //about
         JOptionPane.showMessageDialog(null, "Jcom - IDE for Java beta 1.0.\nVisit www.geocities.com/prabhus14 for updates.", "About",JOptionPane. INFORMATION_MESSAGE);           
         break;
         case 13: //Short Cut List
         mw.setVisible(true);
    mw.setTitle("Shortcut keys List.");
         mw.jt.setText("Shortcut Keys for Jcom.\nRight now only some of them are implemented.\nIn later versions users can customise these keys(called \"macros\" in Jcom) and can also add new ones!");
         mw.jt.append("\nMacros begin with Ctrl+Shift or Alt alone.\n\n");
         mw.jt.append("Ctrl+Shift+S\tTo insert System.out.println() method.\n");
         mw.jt.append("Ctrl+Shift+C\tTo create the default constructor for your class.\n");
         mw.jt.append("Ctrl+Shift+M\tTo insert main() method.\n");
         mw.jt.append("Ctrl+Shift+T\tTo insert try-catch block.\n");
         mw.jt.append("\nThe following macro is quite different and will differentiate Jcom from any other IDE.\n");
         mw.jt.append("\nAfter compiling if you get any errors then the console window will automatically appear with the messages.\n");     
         mw.jt.append("1. Select the line in the Error Message.(using mouse of course)\n");
         mw.jt.append("2. Press Alt+F or Right Click.\n");
         mw.jt.append("3. You will see the Error Region selected in your code.\n");
         mw.jt.append("Remember you must select right from the beginning of the line.\nRead Readme.html for more guidance.\n");     
         break;
         case 14:
         if(undo.canUndo())
              undo.undo();
              output.setText(undo.getUndoPresentationName());
         break;
         case 15:
         if(undo.canRedo())
              undo.redo();
              output.setText(undo.getRedoPresentationName());
         break;
         case 16: //Bookmark
         addNew();
         break;
    }/*End of action listener*/
    }//Action Listener
    // Mouse Listener
    class mouseListen extends MouseAdapter
    String search;
    public void mouseClicked(MouseEvent me)
    String vers = System.getProperty("java.version");
    if(vers.compareTo("1.1.2")>0)
    if(me.getButton()==3)
         search=mw.jt.getSelectedText();
         if(search!=null)
         findString(search);
    }//mouse listener
    // A thread for opening file.
    protected class openFile extends Thread
    openFile()
    setPriority(7);
    public void run()
    try
         int count=0;
         File fil1=new File(Dir,file);
         dp.setVisible(true);
         int factor=(int)fil1.length()/45;
         int i=1;
         FileInputStream textfile=new FileInputStream(fil1);
         DataInputStream dai=new DataInputStream(textfile);
         String S=dai.readLine();
         count+=S.length();
         dp.jl.setText("Lines Loaded : "+i++);
         if(ext.equals("class"))
         t.setText("/* Jcom - IDE for Java.\nVisit www.geocities.com/prabhus14 for updates.\n*/\n");
         while(S != null)
         if(ext.equals("class"))
         if(i>5)
         t.append(S+"\n");
         else
         t.append(S+"\n");
         S=dai.readLine();
         count+=S.length();
         progress.setValue((int)count/factor);
         dp.jl.setText("Lines Loaded : "+i++);
         }//while
         progress.setValue(45);
         dp.setVisible(false);
         setTitle(file+" - JCompile");
         catch(Exception ie)
         dp.setVisible(false);
    output.setText(file+" Total lines : "+t.getLineCount());
    return;
    }//End of run
    }//End of thread     
    // A class simulating Status Bar
    class StatusBar extends JComponent
    public StatusBar()
         super();
         setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    public void paint(Graphics g)
    super.paint(g);
    }//End of class StatusBar
    }/*End of class Jcom*/

    Hmm well my first reply didn't seem to make it.
    I would recommend Castor if you are talking about supporting XML to save your Java Objects. Castor is a great XML-Java data binding tool that I personally love. You can just write a map between the XML and java elements and it can marshal and unmarshal for you. JAXB (Java API fo XML Binding) can do the same thing but you have to build the classes from a schema you can't just supply a map for it (so you might have to rework your classes). If you mean that you want to edit XML directly in the IDE then you might want to look at the DOM (Document Object Model), its memory intensive though.

  • To many undo redo button

    Hi to everyone!!!
    I need your advice for my problem!!
    when I cliked new in the file to create a new JTextPane the undo redo button will multiply and if I have so many JTextPane then I have many undo redo in my toolbar
    here is my code.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import java.util.*;
    import javax.swing.undo.*;
    public class URTest extends JFrame {
         JToolBar toolBar = new JToolBar();
         JButton undo;
         JButton redo = new JButton("Redo");
         JMenuBar menuBar = new JMenuBar();
         JMenu menu = new JMenu("File");
         JMenuItem item = new JMenuItem("New");
         JMenuItem item2 = new JMenuItem("Close");
         JTabbedPane tabbedPane = new JTabbedPane();
         JTextPane pane;
         public URTest() {
              item.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        create();
              item2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        removeCreate();
              menu.add(item);
              menu.add(item2);
              menuBar.add(menu);
              this.add(toolBar,BorderLayout.NORTH);
              this.add(tabbedPane);
              this.setJMenuBar(menuBar);
         void create() {
              undo = new JButton("Undo");
              redo = new JButton("Redo");
              pane = new JTextPane();
              EditorKit editorKit = new StyledEditorKit() {
                   public Document createDefaultDocument() {
                        return new SyntaxDocument();
              pane.setEditorKit(editorKit);
              final CompoundUndoManager undoManager = new CompoundUndoManager( pane );
              undo.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             undoManager.undo();
                             pane.requestFocus();
                        catch (CannotUndoException ex)
                             System.out.println("Unable to undo: " + ex);
              redo.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             undoManager.redo();
                             pane.requestFocus();
                        catch (CannotRedoException ex)
                             System.out.println("Unable to redo: " + ex);
              toolBar.add(undo);
              toolBar.add(redo);
              tabbedPane.addTab("Tab",pane);
         void removeCreate() {
              tabbedPane.remove(tabbedPane.getSelectedIndex());
         public static void main(String[] args) {
              URTest frame = new URTest();
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              frame.setSize(400,400);
              frame.setVisible(true);
    class CompoundUndoManager extends UndoManager
         implements UndoableEditListener, DocumentListener
         public CompoundEdit compoundEdit;
         private JTextComponent editor;
         //  These fields are used to help determine whether the edit is an
         //  incremental edit. For each character added the offset and length
         //  should increase by 1 or decrease by 1 for each character removed.
         private int lastOffset;
         private int lastLength;
         public CompoundUndoManager(JTextComponent editor)
              this.editor = editor;
              editor.getDocument().addUndoableEditListener( this );
         **  Add a DocumentLister before the undo is done so we can position
         **  the Caret correctly as each edit is undone.
         public void undo()
              editor.getDocument().addDocumentListener( this );
              super.undo();
              editor.getDocument().removeDocumentListener( this );
         **  Add a DocumentLister before the redo is done so we can position
         **  the Caret correctly as each edit is redone.
         public void redo()
              editor.getDocument().addDocumentListener( this );
              super.redo();
              editor.getDocument().removeDocumentListener( this );
         **  Whenever an UndoableEdit happens the edit will either be absorbed
         **  by the current compound edit or a new compound edit will be started
         public void undoableEditHappened(UndoableEditEvent e)
              //  Start a new compound edit
              if (compoundEdit == null)
                   compoundEdit = startCompoundEdit( e.getEdit() );
                   lastLength = editor.getDocument().getLength();
                   return;
              //  Check for an attribute change
              AbstractDocument.DefaultDocumentEvent event =
                   (AbstractDocument.DefaultDocumentEvent)e.getEdit();
              if  (event.getType().equals(DocumentEvent.EventType.CHANGE))
                   compoundEdit.addEdit( e.getEdit() );
                   return;
              //  Check for an incremental edit or backspace.
              //  The change in Caret position and Document length should be either
              //  1 or -1 .
              int offsetChange = editor.getCaretPosition() - lastOffset;
              int lengthChange = editor.getDocument().getLength() - lastLength;
              if (Math.abs(offsetChange) == 1
              &&  Math.abs(lengthChange) == 1)
                   compoundEdit.addEdit( e.getEdit() );
                   lastOffset = editor.getCaretPosition();
                   lastLength = editor.getDocument().getLength();
                   return;
              //  Not incremental edit, end previous edit and start a new one
              compoundEdit.end();
              compoundEdit = startCompoundEdit( e.getEdit() );
         **  Each CompoundEdit will store a group of related incremental edits
         **  (ie. each character typed or backspaced is an incremental edit)
         private CompoundEdit startCompoundEdit(UndoableEdit anEdit)
              //  Track Caret and Document information of this compound edit
              lastOffset = editor.getCaretPosition();
              lastLength = editor.getDocument().getLength();
              //  The compound edit is used to store incremental edits
              compoundEdit = new MyCompoundEdit();
              compoundEdit.addEdit( anEdit );
              //  The compound edit is added to the UndoManager. All incremental
              //  edits stored in the compound edit will be undone/redone at once
              addEdit( compoundEdit );
              return compoundEdit;
         //  Implement DocumentListener
         //      Updates to the Document as a result of Undo/Redo will cause the
         //  Caret to be repositioned
         public void insertUpdate(final DocumentEvent e)
              SwingUtilities.invokeLater(new Runnable()
                   public void run()
                        int offset = e.getOffset() + e.getLength();
                        offset = Math.min(offset, editor.getDocument().getLength());
                        editor.setCaretPosition( offset );
         public void removeUpdate(DocumentEvent e)
              editor.setCaretPosition(e.getOffset());
         public void changedUpdate(DocumentEvent e)      {}
         class MyCompoundEdit extends CompoundEdit
              public boolean isInProgress()
                   //  in order for the canUndo() and canRedo() methods to work
                   //  assume that the compound edit is never in progress
                   return false;
              public void undo() throws CannotUndoException
                   //  End the edit so future edits don't get absorbed by this edit
                   if (compoundEdit != null)
                        compoundEdit.end();
                   super.undo();
                   //  Always start a new compound edit after an undo
                   compoundEdit = null;

    I was not actually sure what you wanted so I made the wild guess that you actually wanted only one pair of Undo/Redo buttons. Here you go :import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.undo.*;
    public class URTest extends JPanel {
         private JMenuBar theMenuBar;
         private JTabbedPane theTabbedPane;
         private List<Pane> thePanes;
         private static class Pane {
              private JTextPane theTextPane;
              private CompoundUndoManager theUndoManager;
              private class CompoundUndoManager extends UndoManager implements UndoableEditListener, DocumentListener {
                   public CompoundEdit compoundEdit;
                   private int lastOffset;
                   private int lastLength;
                   public CompoundUndoManager() {
                        compoundEdit = null;
                   public void undo() {
                        theTextPane.getDocument().addDocumentListener(this);
                        super.undo();
                        theTextPane.getDocument().removeDocumentListener(this);
                   public void redo() {
                        theTextPane.getDocument().addDocumentListener(this);
                        super.redo();
                        theTextPane.getDocument().removeDocumentListener(this);
                   public void undoableEditHappened(UndoableEditEvent e) {
                        if (compoundEdit == null) {
                             compoundEdit = startCompoundEdit(e.getEdit());
                             lastLength = theTextPane.getDocument().getLength();
                             return;
                        AbstractDocument.DefaultDocumentEvent event = (AbstractDocument.DefaultDocumentEvent)e.getEdit();
                        if (event.getType().equals(DocumentEvent.EventType.CHANGE)) {
                             compoundEdit.addEdit(e.getEdit());
                             return;
                        int offsetChange = theTextPane.getCaretPosition() - lastOffset;
                        int lengthChange = theTextPane.getDocument().getLength() - lastLength;
                        if (Math.abs(offsetChange) == 1
                             && Math.abs(lengthChange) == 1) {
                             compoundEdit.addEdit(e.getEdit());
                             lastOffset = theTextPane.getCaretPosition();
                             lastLength = theTextPane.getDocument().getLength();
                             return;
                        compoundEdit.end();
                        compoundEdit = startCompoundEdit(e.getEdit());
                   private CompoundEdit startCompoundEdit(UndoableEdit anEdit) {
                        lastOffset = theTextPane.getCaretPosition();
                        lastLength = theTextPane.getDocument().getLength();
                        compoundEdit = new MyCompoundEdit();
                        compoundEdit.addEdit(anEdit);
                        addEdit(compoundEdit);
                        return compoundEdit;
                   public void insertUpdate(final DocumentEvent e) {
                        SwingUtilities.invokeLater(new Runnable() {
                             public void run() {
                                  int offset = e.getOffset() + e.getLength();
                                  offset = Math.min(offset, theTextPane.getDocument().getLength());
                                  theTextPane.setCaretPosition(offset);
                   public void removeUpdate(DocumentEvent e) {
                        theTextPane.setCaretPosition(e.getOffset());
                   public void changedUpdate(DocumentEvent e) {}
                   class MyCompoundEdit extends CompoundEdit {
                        public boolean isInProgress() {
                             return false;
                        public void undo() throws CannotUndoException {
                             if (compoundEdit != null) compoundEdit.end();
                             super.undo();
                             compoundEdit = null;
              public Pane() {
                   theTextPane = new JTextPane();
                   theTextPane.setEditorKit(new StyledEditorKit() {
                        public Document createDefaultDocument() {
                             return new SyntaxDocument();
                   theUndoManager = new CompoundUndoManager();
                   theTextPane.getDocument().addUndoableEditListener(theUndoManager);
              public JTextPane getTextPane() {
                   return theTextPane;
              public UndoManager getUndoManager() {
                   return theUndoManager;
         public URTest() {
              super(new BorderLayout(5, 5));
              setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
              JToolBar toolBar = new JToolBar();
              toolBar.setFloatable(false);
              toolBar.add(new AbstractAction("Undo") {
                   public void actionPerformed(ActionEvent e) {
                        undo();
              toolBar.add(new AbstractAction("Redo") {
                   public void actionPerformed(ActionEvent e) {
                        redo();
              add(toolBar, BorderLayout.NORTH);
              thePanes = new LinkedList<Pane>();
              theTabbedPane = new JTabbedPane();
              add(theTabbedPane, BorderLayout.CENTER);
              theMenuBar = new JMenuBar();
              JMenu menu = new JMenu("File");
              menu.add(new AbstractAction("New") {
                   public void actionPerformed(ActionEvent e) {
                        create();
              menu.add(new AbstractAction("Close") {
                   public void actionPerformed(ActionEvent e) {
                        remove();
              theMenuBar.add(menu);
         public JMenuBar getMenuBar() {
              return theMenuBar;
         private void create() {
              Pane pane = new Pane();
              thePanes.add(pane);
              theTabbedPane.addTab("Tab", pane.getTextPane());
         private void remove() {
              Pane selectedPane = getSelectedPane();
              if (selectedPane == null) return;
              thePanes.remove(selectedPane);
              theTabbedPane.remove(selectedPane.getTextPane());
         private void undo() {
              Pane selectedPane = getSelectedPane();
              if (selectedPane == null) return;
              try {
                   selectedPane.getUndoManager().undo();
                   selectedPane.getTextPane().requestFocus();
              } catch (CannotUndoException ex) {
                   System.out.println("Unable to undo: " + ex);
         private void redo() {
              Pane selectedPane = getSelectedPane();
              if (selectedPane == null) return;
              try {
                   selectedPane.getUndoManager().redo();
                   selectedPane.getTextPane().requestFocus();
              } catch (CannotRedoException ex) {
                   System.out.println("Unable to redo: " + ex);
         private Pane getSelectedPane() {
              Component selectedComponent = theTabbedPane.getSelectedComponent();
              if (selectedComponent == null) return null;
              for (Pane pane : thePanes) {
                   if (pane.getTextPane() == selectedComponent) return pane;
              return null;
         private static void test() {
              JFrame f = new JFrame("URTest");
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              URTest urTest = new URTest();
              f.setContentPane(urTest);
              f.setJMenuBar(urTest.getMenuBar());
              f.setSize(400, 400);
              f.setLocationRelativeTo(null);
              f.setVisible(true);
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        test();
    }Hope it helps.

Maybe you are looking for