Changeset 4379


Ignore:
Timestamp:
10/15/03 14:43:31 (19 years ago)
Author:
piso
Message:

Lisp menu, cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/AbstractMode.java

    r3582 r4379  
    33 *
    44 * Copyright (C) 1998-2003 Peter Graves
    5  * $Id: AbstractMode.java,v 1.18 2003-09-04 15:03:42 piso Exp $
     5 * $Id: AbstractMode.java,v 1.19 2003-10-15 14:43:31 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    202202        menuBar.add(new Menu("Go", 'G'));
    203203        menuBar.add(new Menu("Mode", 'M'));
     204        menuBar.add(new Menu("Lisp", 'L'));
    204205        menuBar.add(new Menu("Help", 'H'));
    205206        return menuBar;
     
    223224            if (menu.getMenuComponentCount() == 0)
    224225                menu.add(new JMenuItem("This menu isn't here yet!")).setEnabled(false);
    225         } else if (text == "Help")
     226        } else if (text == "Lisp")
     227            populateLispMenu(editor, menu);
     228        else if (text == "Help")
    226229            populateHelpMenu(editor, menu);
    227230    }
     
    304307    private static void populateSearchMenu(Editor editor, Menu menu)
    305308    {
     309        final File dir = editor.getCurrentDirectory();
     310        final boolean local = (dir != null && dir.isLocal());
     311        if (Editor.preferences().getBooleanProperty(Property.USE_INCREMENTAL_FIND))
     312            menu.add(editor, "Incremental Find...", 'I', "incrementalFind");
    306313        menu.add(editor, "Find...", 'F', "find");
    307314        menu.add(editor, "Find Next", 'T', "findNext");
    308315        menu.add(editor, "Find Previous", 'R', "findPrev");
    309         menu.addSeparator();
    310         final File dir = editor.getCurrentDirectory();
    311         final boolean local = (dir != null && dir.isLocal());
    312         if (local) {
    313             menu.add(editor, "Find in Files...", 'I', "findInFiles");
    314             menu.add(editor, "List Files...", 'L', "listFiles");
    315             menu.addSeparator();
    316         }
     316        menu.add(editor, "Find in Files...", 'S', "findInFiles", local);
     317        menu.addSeparator();
     318        menu.add(editor, "List Occurrences of Last Pattern", 'L', "listOccurrences",
     319                 editor.getLastSearch() != null);
     320        menu.add(editor, "List Occurrences of Pattern in Files", 'O', "listFiles",
     321                 FindInFiles.getFindInFiles() != null);
     322        menu.addSeparator();
    317323        final boolean isNotReadOnly = !editor.getBuffer().isReadOnly();
    318324        menu.add(editor, "Replace...", 'P', "replace", isNotReadOnly);
    319         if (local)
    320             menu.add(editor, "Replace in Files...", 'E', "replaceInFiles");
     325        menu.add(editor, "Replace in Files...", 'E', "replaceInFiles", local);
    321326        menu.addSeparator();
    322327        menu.add(editor, "Find Tag...", 'A', "findTag");
     
    346351    public void populateModeMenu(Editor editor, Menu menu)
    347352    {
     353    }
     354
     355    public void populateLispMenu(Editor editor, Menu menu)
     356    {
     357        menu.add(editor, "Run Lisp as Separate Process", 'L', "lisp");
     358        menu.add(editor, "Run Embedded Lisp", 'E', "jlisp");
    348359    }
    349360
Note: See TracChangeset for help on using the changeset viewer.