AMADEUS html plain
import java.util.*;
class UndoStack
Editor editor;
peremees
private Vector stack;
undo magasin
UndoStack(Editor e)
konstruktor
editor = e;
stack = new Vector();
editor.sketchyText.frame.menuBar.setEnabled(
AmLocale.Edit(), AmLocale.Undo(), false);
magasini meetodid:
public Undo pop()
vo~tta
Undo u = (Undo)(stack.elementAt(0));
stack.removeElementAt(0);
? (stack.isEmpty())
editor.sketchyText.frame.menuBar.setEnabled(
AmLocale.Edit(), AmLocale.Undo(), false);
<======u
public void push(Undo u)
panna
? (stack.isEmpty())
editor.sketchyText.frame.menuBar.setEnabled(
AmLocale.Edit(), AmLocale.Undo(), true);
stack.insertElementAt(u, 0);
SS
public boolean stack_is_empty()
kasutab Am.setLocaleMenus
Tagastab true kui undo teha ei saa
<======stack.isEmpty()
public void setEmpty()
stack.removeAllElements();