KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > part > NewPartToWorkbenchPartAdapter


1 /*******************************************************************************
2  * Copyright (c) 2004, 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.part;
12
13 import org.eclipse.swt.graphics.Image;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.ui.IEditorInput;
16 import org.eclipse.ui.IPropertyListener;
17 import org.eclipse.ui.IWorkbenchPart2;
18
19 /**
20  * @since 3.1
21  */

22 public abstract class NewPartToWorkbenchPartAdapter implements IWorkbenchPart2 {
23     
24     private IPartPropertyProvider propertyProvider;
25     
26     public NewPartToWorkbenchPartAdapter(IPartPropertyProvider provider) {
27         this.propertyProvider = provider;
28     }
29     
30     /**
31      * @since 3.1
32      *
33      * @return
34      */

35     protected IPartPropertyProvider getPropertyProvider() {
36         return propertyProvider;
37     }
38     
39     /* (non-Javadoc)
40      * @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
41      */

42     public void addPropertyListener(IPropertyListener listener) {
43         propertyProvider.addPropertyListener(this, listener);
44     }
45     
46     /* (non-Javadoc)
47      * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
48      */

49     public void createPartControl(Composite parent) {
50         
51     }
52
53     /* (non-Javadoc)
54      * @see org.eclipse.ui.IWorkbenchPart#dispose()
55      */

56     public void dispose() {
57
58     }
59     
60     /* (non-Javadoc)
61      * @see org.eclipse.ui.IWorkbenchPart#setFocus()
62      */

63     public void setFocus() {
64
65     }
66     
67     /* (non-Javadoc)
68      * @see org.eclipse.ui.IWorkbenchPart2#getContentDescription()
69      */

70     public String JavaDoc getContentDescription() {
71         return propertyProvider.getContentDescription();
72     }
73     
74     /* (non-Javadoc)
75      * @see org.eclipse.ui.IWorkbenchPart2#getPartName()
76      */

77     public String JavaDoc getPartName() {
78         return propertyProvider.getPartName();
79     }
80
81     /* (non-Javadoc)
82      * @see org.eclipse.ui.IWorkbenchPart#getTitle()
83      */

84     public String JavaDoc getTitle() {
85         return propertyProvider.getTitle();
86     }
87     
88     /* (non-Javadoc)
89      * @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
90      */

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

98     public String JavaDoc getTitleToolTip() {
99         return propertyProvider.getTitleToolTip();
100     }
101     
102     /* (non-Javadoc)
103      * @see org.eclipse.ui.IWorkbenchPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
104      */

105     public void removePropertyListener(IPropertyListener listener) {
106         propertyProvider.removePropertyListener(this, listener);
107     }
108     
109     /* (non-Javadoc)
110      * @see org.eclipse.ui.IEditorPart#getEditorInput()
111      */

112     public IEditorInput getEditorInput() {
113         return propertyProvider.getEditorInput();
114     }
115     
116     public boolean isDirty() {
117         return propertyProvider.isDirty();
118     }
119     
120 }
121
Popular Tags