1 20 21 package org.apache.directory.ldapstudio.schemas.view.editors.attributeType; 22 23 24 import org.apache.directory.ldapstudio.schemas.Messages; 25 import org.apache.directory.ldapstudio.schemas.model.AttributeType; 26 import org.eclipse.jface.resource.ImageDescriptor; 27 import org.eclipse.ui.IEditorInput; 28 import org.eclipse.ui.IPersistableElement; 29 30 31 34 public class AttributeTypeEditorInput implements IEditorInput 35 { 36 private AttributeType attributeType = null; 37 38 39 45 public AttributeTypeEditorInput( AttributeType at ) 46 { 47 super(); 48 this.attributeType = at; 49 } 50 51 52 57 public boolean exists() 58 { 59 return ( this.attributeType == null ); 60 } 61 62 63 68 public ImageDescriptor getImageDescriptor() 69 { 70 return null; 72 } 73 74 75 80 public String getName() 81 { 82 return this.attributeType.getNames()[0]; 83 } 84 85 86 91 public IPersistableElement getPersistable() 92 { 93 return null; 95 } 96 97 98 103 public String getToolTipText() 104 { 105 return this.attributeType.getNames()[0] 106 + Messages.getString( "AttributeTypeEditorInput.In_the" ) + this.attributeType.getOriginatingSchema().getName() 108 + Messages.getString( "AttributeTypeEditorInput.Schema" ); } 110 111 112 117 public Object getAdapter( Class adapter ) 118 { 119 return null; 120 } 121 122 123 128 public boolean equals( Object obj ) 129 { 130 if ( this == obj ) 131 return true; 132 if ( !( obj instanceof AttributeTypeEditorInput ) ) 133 return false; 134 AttributeTypeEditorInput other = ( AttributeTypeEditorInput ) obj; 135 return other.getAttributeType().getOid().equals( this.attributeType.getOid() ); 136 } 137 138 139 144 public AttributeType getAttributeType() 145 { 146 return this.attributeType; 147 } 148 } 149 | Popular Tags |