Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.eclipse.util
Class NavigateHistory  view NavigateHistory download NavigateHistory.java

java.lang.Object
  extended bycom.port80.eclipse.util.NavigateHistory

public class NavigateHistory
extends java.lang.Object


Field Summary
private  org.eclipse.jface.action.Action backAction
           
private static int DEF_HISTORY_SIZE
           
private static int DEF_VISITED_SIZE
           
private  boolean fCanGoBack
           
private  boolean fCanGoForward
           
private  java.lang.Object[] fHistory
          History, in acess time order, oldest first.
private  int fLast
           
private  java.util.List fListeners
           
private  org.eclipse.jface.action.Action forwardAction
           
private  int fPos
           
private  java.lang.Object[] fVisited
          Unique objects visited, unordered.
private  int fVisitedSize
           
static java.lang.String ID
           
static java.lang.String NAME
           
 
Constructor Summary
NavigateHistory()
           
NavigateHistory(int size)
           
NavigateHistory(int historysize, int visitedsize)
           
 
Method Summary
 void add(java.lang.Object a)
          Add an object to the history.
 void addHistoryListener(IHistoryListener l)
           
 void addNavigationActions(org.eclipse.jface.action.IMenuManager manager)
          Adds actions for "go back", "go home", and "go into" to a menu manager.
 void addNavigationActions(org.eclipse.jface.action.IToolBarManager toolBar)
          Adds actions for "go back", "go home", and "go into" to a tool bar manager.
 boolean canGoBack()
           
 boolean canGoForward()
           
private  void createActions()
          Create the actions for navigation.
private  void fireGotoEvent(java.lang.Object a)
           
private  void fireUpdateStatusEvent()
           
 java.lang.Object[] getHistory()
           
 java.lang.Object getHistory(int n)
           
 java.lang.Object[] getVisited()
           
 java.lang.Object getVisited(int n)
           
 boolean goBack()
          Go back.
 boolean goForward()
          Go forward.
 void gotoHistory(int n)
          Goto the specified position.
 void gotoVisited(int n)
           
 int historyPos()
           
 int historySize()
           
 void removeHistoryListener(IHistoryListener l)
           
 void reset()
          Resets the history.
protected  void updateButtonStatus()
          Updates the enabled state for each navigation button.
 void updateVisited(java.lang.Object a)
          Added object to visited set.
 int visitedSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

ID

public static final java.lang.String ID
See Also:
Constant Field Values

DEF_HISTORY_SIZE

private static final int DEF_HISTORY_SIZE
See Also:
Constant Field Values

DEF_VISITED_SIZE

private static final int DEF_VISITED_SIZE
See Also:
Constant Field Values

fHistory

private java.lang.Object[] fHistory
History, in acess time order, oldest first.


fVisited

private java.lang.Object[] fVisited
Unique objects visited, unordered.


fListeners

private java.util.List fListeners

fPos

private int fPos

fLast

private int fLast

fVisitedSize

private int fVisitedSize

backAction

private org.eclipse.jface.action.Action backAction

forwardAction

private org.eclipse.jface.action.Action forwardAction

fCanGoBack

private boolean fCanGoBack

fCanGoForward

private boolean fCanGoForward
Constructor Detail

NavigateHistory

public NavigateHistory()

NavigateHistory

public NavigateHistory(int size)

NavigateHistory

public NavigateHistory(int historysize,
                       int visitedsize)
Method Detail

addHistoryListener

public void addHistoryListener(IHistoryListener l)

removeHistoryListener

public void removeHistoryListener(IHistoryListener l)

add

public void add(java.lang.Object a)
Add an object to the history. Adding object now do not fire any GotoEvent. Typical event sequence is: Trigger (doubleclick,actions in views, eg. History forward/backward/goto action->GotoHistoryEvent) -> Editor open -> PartActivationEvent -> Add to history, select in views ... etc. When a new object is added when visiting an object in the middle of the history, the new object is inserted to the history after the current position in the history.


historySize

public int historySize()

historyPos

public int historyPos()

getHistory

public java.lang.Object getHistory(int n)

getHistory

public java.lang.Object[] getHistory()

gotoHistory

public void gotoHistory(int n)
Goto the specified position.


visitedSize

public int visitedSize()

getVisited

public java.lang.Object getVisited(int n)

getVisited

public java.lang.Object[] getVisited()

gotoVisited

public void gotoVisited(int n)

updateVisited

public void updateVisited(java.lang.Object a)
Added object to visited set. This is automatically invoked before firing a GotoEvent.


canGoBack

public boolean canGoBack()

canGoForward

public boolean canGoForward()

goBack

public boolean goBack()
Go back.


goForward

public boolean goForward()
Go forward.


reset

public void reset()
Resets the history.


updateButtonStatus

protected void updateButtonStatus()
Updates the enabled state for each navigation button.


fireUpdateStatusEvent

private void fireUpdateStatusEvent()

fireGotoEvent

private void fireGotoEvent(java.lang.Object a)

addNavigationActions

public void addNavigationActions(org.eclipse.jface.action.IMenuManager manager)
Adds actions for "go back", "go home", and "go into" to a menu manager.


addNavigationActions

public void addNavigationActions(org.eclipse.jface.action.IToolBarManager toolBar)
Adds actions for "go back", "go home", and "go into" to a tool bar manager.


createActions

private void createActions()
Create the actions for navigation.