KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > console > ConsoleWorkbenchPart


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.ui.internal.console;
12
13 import org.eclipse.swt.graphics.Image;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.ui.IPropertyListener;
16 import org.eclipse.ui.IWorkbenchPart;
17 import org.eclipse.ui.IWorkbenchPartSite;
18 import org.eclipse.ui.console.IConsole;
19
20 /**
21  * Fake part to use as keys in page book for console pages
22  */

23 public class ConsoleWorkbenchPart implements IWorkbenchPart {
24
25     private IConsole fConsole = null;
26     private IWorkbenchPartSite fSite = null;
27     
28     /* (non-Javadoc)
29      * @see java.lang.Object#equals(java.lang.Object)
30      */

31     public boolean equals(Object JavaDoc obj) {
32         return (obj instanceof ConsoleWorkbenchPart) &&
33             fConsole.equals(((ConsoleWorkbenchPart)obj).fConsole);
34     }
35
36     /* (non-Javadoc)
37      * @see java.lang.Object#hashCode()
38      */

39     public int hashCode() {
40         return fConsole.hashCode();
41     }
42
43     /**
44      * Constructs a part for the given console that binds to the given
45      * site
46      */

47     public ConsoleWorkbenchPart(IConsole console, IWorkbenchPartSite site) {
48         fConsole = console;
49         fSite = site;
50     }
51
52     /* (non-Javadoc)
53      * @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
54      */

55     public void addPropertyListener(IPropertyListener listener) {
56     }
57
58     /* (non-Javadoc)
59      * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
60      */

61     public void createPartControl(Composite parent) {
62     }
63
64     /* (non-Javadoc)
65      * @see org.eclipse.ui.IWorkbenchPart#dispose()
66      */

67     public void dispose() {
68     }
69
70     /* (non-Javadoc)
71      * @see org.eclipse.ui.IWorkbenchPart#getSite()
72      */

73     public IWorkbenchPartSite getSite() {
74         return fSite;
75     }
76
77     /* (non-Javadoc)
78      * @see org.eclipse.ui.IWorkbenchPart#getTitle()
79      */

80     public String JavaDoc getTitle() {
81         return ""; //$NON-NLS-1$
82
}
83
84     /* (non-Javadoc)
85      * @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
86      */

87     public Image getTitleImage() {
88         return null;
89     }
90
91     /* (non-Javadoc)
92      * @see org.eclipse.ui.IWorkbenchPart#getTitleToolTip()
93      */

94     public String JavaDoc getTitleToolTip() {
95         return ""; //$NON-NLS-1$
96
}
97
98     /* (non-Javadoc)
99      * @see org.eclipse.ui.IWorkbenchPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
100      */

101     public void removePropertyListener(IPropertyListener listener) {
102     }
103
104     /* (non-Javadoc)
105      * @see org.eclipse.ui.IWorkbenchPart#setFocus()
106      */

107     public void setFocus() {
108     }
109
110     /* (non-Javadoc)
111      * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
112      */

113     public Object JavaDoc getAdapter(Class JavaDoc adapter) {
114         return null;
115     }
116
117     /**
118      * Returns the console associated with this part.
119      *
120      * @return console associated with this part
121      */

122     protected IConsole getConsole() {
123         return fConsole;
124     }
125 }
126
Popular Tags