1 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 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 35 protected IPartPropertyProvider getPropertyProvider() { 36 return propertyProvider; 37 } 38 39 42 public void addPropertyListener(IPropertyListener listener) { 43 propertyProvider.addPropertyListener(this, listener); 44 } 45 46 49 public void createPartControl(Composite parent) { 50 51 } 52 53 56 public void dispose() { 57 58 } 59 60 63 public void setFocus() { 64 65 } 66 67 70 public String getContentDescription() { 71 return propertyProvider.getContentDescription(); 72 } 73 74 77 public String getPartName() { 78 return propertyProvider.getPartName(); 79 } 80 81 84 public String getTitle() { 85 return propertyProvider.getTitle(); 86 } 87 88 91 public Image getTitleImage() { 92 return propertyProvider.getTitleImage(); 93 } 94 95 98 public String getTitleToolTip() { 99 return propertyProvider.getTitleToolTip(); 100 } 101 102 105 public void removePropertyListener(IPropertyListener listener) { 106 propertyProvider.removePropertyListener(this, listener); 107 } 108 109 112 public IEditorInput getEditorInput() { 113 return propertyProvider.getEditorInput(); 114 } 115 116 public boolean isDirty() { 117 return propertyProvider.isDirty(); 118 } 119 120 } 121 | Popular Tags |