1 20 21 package org.apache.directory.ldapstudio.schemas.view.editors.objectClass; 22 23 24 import org.apache.directory.ldapstudio.schemas.Messages; 25 import org.apache.directory.ldapstudio.schemas.model.ObjectClass; 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 ObjectClassEditorInput implements IEditorInput 35 { 36 private ObjectClass objectClass = null; 37 38 39 45 public ObjectClassEditorInput( ObjectClass obj ) 46 { 47 super(); 48 this.objectClass = obj; 49 } 50 51 52 55 public boolean exists() 56 { 57 return ( this.objectClass == null ); 58 } 59 60 61 64 public ImageDescriptor getImageDescriptor() 65 { 66 return null; 68 } 69 70 71 74 public String getName() 75 { 76 return this.objectClass.getNames()[0]; 77 } 78 79 80 83 public IPersistableElement getPersistable() 84 { 85 return null; 86 } 87 88 89 92 public String getToolTipText() 93 { 94 return this.objectClass.getNames()[0] 95 + Messages.getString( "ObjectClassEditorInput.In_the" ) + this.objectClass.getOriginatingSchema().getName() + Messages.getString( "ObjectClassEditorInput.Schema" ); } 97 98 99 102 public Object getAdapter( Class adapter ) 103 { 104 return null; 105 } 106 107 108 111 public boolean equals( Object obj ) 112 { 113 if ( this == obj ) 114 return true; 115 if ( !( obj instanceof ObjectClassEditorInput ) ) 116 return false; 117 ObjectClassEditorInput other = ( ObjectClassEditorInput ) obj; 118 return other.getObjectClass().getOid().equals( this.objectClass.getOid() ); 119 } 120 121 122 128 public ObjectClass getObjectClass() 129 { 130 return this.objectClass; 131 } 132 } 133 | Popular Tags |