KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > AbstractDebugEventHandlerView


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.debug.internal.ui.views;
12
13  
14 import org.eclipse.debug.ui.AbstractDebugView;
15 import org.eclipse.jface.action.IStatusLineManager;
16
17 /**
18  * A debug view that uses an event handler to update its
19  * view/viewer.
20  */

21 public abstract class AbstractDebugEventHandlerView extends AbstractDebugView {
22
23     /**
24      * Event handler for this view
25      */

26     private AbstractDebugEventHandler fEventHandler;
27
28     /**
29      * Sets the event handler for this view
30      *
31      * @param eventHandler event handler
32      */

33     protected void setEventHandler(AbstractDebugEventHandler eventHandler) {
34         fEventHandler = eventHandler;
35     }
36     
37     /**
38      * Returns the event handler for this view
39      *
40      * @return The event handler for this view
41      */

42     protected AbstractDebugEventHandler getEventHandler() {
43         return fEventHandler;
44     }
45     
46     /**
47      * @see IWorkbenchPart#dispose()
48      */

49     public void dispose() {
50         super.dispose();
51         if (getEventHandler() != null) {
52             getEventHandler().dispose();
53         }
54     }
55     
56     /**
57      * @see org.eclipse.debug.ui.AbstractDebugView#becomesHidden()
58      */

59     protected void becomesHidden() {
60         super.becomesHidden();
61         getEventHandler().viewBecomesHidden();
62     }
63
64     /**
65      * @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
66      */

67     protected void becomesVisible() {
68         super.becomesVisible();
69         getEventHandler().viewBecomesVisible();
70     }
71     
72     protected void clearStatusLine() {
73         IStatusLineManager manager = getViewSite().getActionBars().getStatusLineManager();
74         manager.setErrorMessage(null);
75         manager.setMessage(null);
76     }
77
78 }
79
Popular Tags