Source code: javax/ide/view/View.java
1 package javax.ide.view;
2
3 import javax.ide.Identifiable;
4 import javax.ide.command.Context;
5 import javax.ide.command.Controller;
6
7 /**
8 * <code>View</code> components display information to the user. A view
9 * obtains the data from the model. There can be multiple views of the model.
10 *
11 * Each <code>View</code> has an associated {@link Controller}.
12 * Controllers receive requests to handle the commands associated with user
13 * interaction with the view.
14 */
15 public abstract class View extends DefaultViewable implements Identifiable
16 {
17 /**
18 * Get the root graphical user interface component.
19 */
20 public abstract GUIPanel getGUI();
21
22 /**
23 * Show/hide view.
24 * @param visible The visible state of the view.
25 */
26 public abstract void setVisible( boolean visible );
27
28 /**
29 * Determine whether the View is visible.
30 * @return The visible state of the view.
31 */
32 public abstract boolean isVisible();
33
34 /**
35 * Gets the current view context.
36 * @return The current view {@link Context}.
37 */
38 public abstract Context getContext();
39
40 /**
41 * Called when the View gains the input focus. View implementations
42 * generally respond to the fact that this View is now the active view by
43 * updating the view display, for example.
44 */
45 public abstract void activate();
46
47 /**
48 * Called when the View looses the input focus. View implementations
49 * generally, respond to the fact that this View is no longer the active
50 * view by reversing actions taken during view activation.
51 */
52 public abstract void deactivate();
53
54 /**
55 * Get the <code>Controller</code> associated with this view.
56 * @return The {@link Controller} responsible for handling the actions that
57 * can be executed from this view.
58 */
59 public abstract Controller getController();
60
61 /**
62 * Get the parent view.
63 * @return The parent view hosting this view.
64 */
65 public abstract View parent();
66
67 }