KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > synchronize > SynchronizeViewWorkbenchPart


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

24 public class SynchronizeViewWorkbenchPart implements IWorkbenchPart {
25
26     private ISynchronizeParticipant participant;
27     private IWorkbenchPartSite site;
28     private ISynchronizePageConfiguration configuration;
29     
30     /* (non-Javadoc)
31      * @see java.lang.Object#equals(java.lang.Object)
32      */

33     public boolean equals(Object JavaDoc obj) {
34         return (obj instanceof SynchronizeViewWorkbenchPart) &&
35             participant.equals(((SynchronizeViewWorkbenchPart)obj).getParticipant());
36     }
37
38     /* (non-Javadoc)
39      * @see java.lang.Object#hashCode()
40      */

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

49     public SynchronizeViewWorkbenchPart(ISynchronizeParticipant participant, IWorkbenchPartSite site) {
50         this.participant = participant;
51         this.site = site;
52     }
53
54     /* (non-Javadoc)
55      * @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
56      */

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

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

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

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

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

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

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

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

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

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

124     public ISynchronizeParticipant getParticipant() {
125         return participant;
126     }
127
128     public void setConfiguration(ISynchronizePageConfiguration configuration) {
129         this.configuration = configuration;
130     }
131
132     public ISynchronizePageConfiguration getConfiguration() {
133         return configuration;
134     }
135 }
136
Popular Tags