Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.service.project
Class RecentFilesMenu

java.lang.Object
  extended by org.eclipse.jface.action.ContributionItem
      extended by eu.esdihumboldt.hale.ui.service.project.RecentFilesMenu
All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem

public class RecentFilesMenu
extends org.eclipse.jface.action.ContributionItem

A menu filled with the list of recently opened files (MRU).

Author:
Michel Kraemer, Simon Templer

Field Summary
static String FILLSTRING
          The string filled in for the gap in the filename
static int MAX_LENGTH
          Maximum length of the string displayed in the menu
 
Constructor Summary
RecentFilesMenu()
           
 
Method Summary
 void fill(org.eclipse.swt.widgets.Menu menu, int index)
           
 boolean isDynamic()
           
static String shorten(String file, int maxLength, int endKeep)
          Shortens the given file path.
 
Methods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, fill, fill, getId, getParent, isDirty, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILLSTRING

public static final String FILLSTRING
The string filled in for the gap in the filename

See Also:
Constant Field Values

MAX_LENGTH

public static final int MAX_LENGTH
Maximum length of the string displayed in the menu

See Also:
Constant Field Values
Constructor Detail

RecentFilesMenu

public RecentFilesMenu()
Method Detail

isDynamic

public boolean isDynamic()
Specified by:
isDynamic in interface org.eclipse.jface.action.IContributionItem
Overrides:
isDynamic in class org.eclipse.jface.action.ContributionItem
See Also:
ContributionItem.isDynamic()

fill

public void fill(org.eclipse.swt.widgets.Menu menu,
                 int index)
Specified by:
fill in interface org.eclipse.jface.action.IContributionItem
Overrides:
fill in class org.eclipse.jface.action.ContributionItem
See Also:
ContributionItem.fill(Menu, int)

shorten

public static String shorten(String file,
                             int maxLength,
                             int endKeep)
Shortens the given file path.

Parameters:
file - the complete file path to shorten
maxLength - the maximum length the shortened verison should have
endKeep - the length at the end of the string that should not be removed
Returns:
a shortened version of the file path

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d