Package org.gjt.sp.jedit.gui

Examples of org.gjt.sp.jedit.gui.HistoryModel


      {
        view.getStatus().setMessage(null);
      }
    }; //}}}

    HistoryModel model = HistoryModel.getModel("vfs.browser.path");
    if(model.getSize() == 0)
    {
      JMenuItem menuItem = new JMenuItem(
        jEdit.getProperty("no-recent-dirs.label"));
      menuItem.setEnabled(false);
      menu.add(menuItem);
      return;
    }

    boolean sort = jEdit.getBooleanProperty("sortRecent");

    int maxItems = jEdit.getIntegerProperty("menu.spillover",20);

    Vector menuItems = new Vector();

    for(int i = 0; i < model.getSize(); i++)
    {
      String path = model.getItem(i);
      JMenuItem menuItem = new JMenuItem(MiscUtilities.getFileName(path));
      menuItem.setActionCommand(path);
      menuItem.addActionListener(actionListener);
      menuItem.addMouseListener(mouseListener);
      menuItem.setIcon(FileCellRenderer.dirIcon);

      if(sort)
        menuItems.addElement(menuItem);
      else
      {
        if(menu.getMenuComponentCount() >= maxItems
          && i != model.getSize() - 1)
        {
          JMenu newMenu = new JMenu(
            jEdit.getProperty("common.more"));
          menu.add(newMenu);
          menu = newMenu;
View Full Code Here

TOP

Related Classes of org.gjt.sp.jedit.gui.HistoryModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.