KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > INavigationLocation


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui;
12
13 /**
14  * Represents the context marked for the user in the navigation history.
15  *
16  * Not intended to be implemented by clients. Clients should subclass NavigationLocation
17  * instead.
18  *
19  * @since 2.1
20  */

21 public interface INavigationLocation {
22
23     /**
24      * Disposes of this location and frees any allocated resource.
25      */

26     public void dispose();
27
28     /**
29      * Release any state kept by this location. Any relevant state should be
30      * saved by the previous call of saveState(IMemento). This object will
31      * not be used until restoreState is called again.
32      */

33     public void releaseState();
34
35     /**
36      * Persists the state of this location into the <code>memento</code>
37      *
38      * @param memento the storage were the state should be saved into.
39      */

40     public void saveState(IMemento memento);
41
42     /**
43      * Restore the state of this location from the <code>memento</code>
44      *
45      * @param memento the storage were the state was saved into.
46      */

47     public void restoreState(IMemento memento);
48
49     /**
50      * Restore the context saved by this location.
51      */

52     public void restoreLocation();
53
54     /**
55      * Merge the receiver into <code>currentLocation</code>. Return true if
56      * the two locations could be merged otherwise return false.
57      * <p>
58      * This message is sent to all locations before being added to the history;
59      * given the change to the new location to merge itself into the current
60      * location minimizing the number of entries in the navigation history.
61      * </p>
62      *
63      * @param currentLocation where the receiver should be merged into
64      * @return boolean true if the merge was possible
65      */

66     public boolean mergeInto(INavigationLocation currentLocation);
67
68     /**
69      * Returns the input used for this location. Returns <code>null</code> if the
70      * receiver's state has been released.
71      *
72      * @return the input for this location
73      */

74     public Object JavaDoc getInput();
75
76     /**
77      * Returns the display name for this location. This name is used in the
78      * navigation history list.
79      *
80      * @return the display name
81      */

82     public String JavaDoc getText();
83
84     /**
85      * Sets the location's input.
86      * <p>
87      * Should not be called by clients.
88      * </p>
89      *
90      * @param input the editor input.
91      */

92     public void setInput(Object JavaDoc input);
93
94     /**
95      * The message <code>update</code> is sent to the active location before
96      * another location becomes active.
97      */

98     public void update();
99 }
100
Popular Tags