1 11 package org.eclipse.team.internal.ccvs.ui.model; 12 13 14 import org.eclipse.team.internal.ccvs.core.CVSTag; 15 import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder; 16 import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; 17 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; 18 import org.eclipse.ui.views.properties.IPropertyDescriptor; 19 import org.eclipse.ui.views.properties.IPropertySource; 20 import org.eclipse.ui.views.properties.PropertyDescriptor; 21 22 public class CVSRemoteFolderPropertySource implements IPropertySource { 23 ICVSRemoteFolder folder; 24 25 static protected IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[2]; 27 { 28 PropertyDescriptor descriptor; 29 String category = CVSUIMessages.cvs; 30 31 descriptor = new PropertyDescriptor(ICVSUIConstants.PROP_NAME, CVSUIMessages.CVSRemoteFolderPropertySource_name); 33 descriptor.setAlwaysIncompatible(true); 34 descriptor.setCategory(category); 35 propertyDescriptors[0] = descriptor; 36 descriptor = new PropertyDescriptor(ICVSUIConstants.PROP_TAG, CVSUIMessages.CVSRemoteFolderPropertySource_tag); 38 descriptor.setAlwaysIncompatible(true); 39 descriptor.setCategory(category); 40 propertyDescriptors[1] = descriptor; 41 } 42 43 46 public CVSRemoteFolderPropertySource(ICVSRemoteFolder folder) { 47 this.folder = folder; 48 } 49 50 53 public Object getEditableValue() { 54 return this; 55 } 56 57 60 public IPropertyDescriptor[] getPropertyDescriptors() { 61 return propertyDescriptors; 62 } 63 64 67 public Object getPropertyValue(Object id) { 68 if (id.equals(ICVSUIConstants.PROP_NAME)) { 69 return folder.getName(); 70 } 71 if (id.equals(ICVSUIConstants.PROP_TAG)) { 72 CVSTag tag = folder.getTag(); 73 if (tag == null) { 74 return CVSUIMessages.CVSRemoteFolderPropertySource_none; 75 } 76 return tag.getName(); 77 } 78 return ""; } 80 81 85 public boolean isPropertySet(Object property) { 86 return false; 87 } 88 94 public void resetPropertyValue(Object property) { 95 } 96 99 public void setPropertyValue(Object name, Object value) { 100 } 101 } 102 | Popular Tags |