Changeset 13052


Ignore:
Timestamp:
2006-10-09T10:45:27+13:00 (18 years ago)
Author:
shaoqun
Message:

make the redo button enabled properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r12842 r13052  
    989989
    990990        public void actionPerformed(ActionEvent event)
    991         {
     991        {   
    992992                try {
    993993                    if (undo.canUndo()) {
    994                         int pos = editor_textarea.getCaretPosition();
     994               int pos = editor_textarea.getCaretPosition();
     995                redo_button.setEnabled(true);
    995996                        undo.undo();
    996             editor_textarea.setCaretPosition(pos);
    997                         redo_button.setEnabled(true);
    998 
    999                     }
     997            if (pos > 0)
     998                editor_textarea.setCaretPosition(pos-1);
     999            else
     1000                editor_textarea.setCaretPosition(pos);
     1001            }
    10001002                    if (!undo.canUndo()){
    10011003            undo_button.setEnabled(false);
     
    10061008
    10071009                } catch (Exception e) {
    1008                 }           
     1010           
     1011        }           
    10091012        }
    10101013    }
Note: See TracChangeset for help on using the changeset viewer.