1 20 21 package org.apache.directory.ldapstudio.schemas.view.editors.schema; 22 23 24 import org.apache.directory.ldapstudio.schemas.Messages; 25 import org.apache.directory.ldapstudio.schemas.model.Schema; 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 SchemaEditorInput implements IEditorInput 35 { 36 private Schema schema; 37 38 39 43 public SchemaEditorInput( Schema schema ) 44 { 45 super(); 46 this.schema = schema; 47 } 48 49 50 53 public boolean exists() 54 { 55 return ( this.schema == null ); 56 } 57 58 59 62 public ImageDescriptor getImageDescriptor() 63 { 64 return null; 65 } 66 67 68 71 public String getName() 72 { 73 return this.schema.getName(); 74 } 75 76 77 80 public IPersistableElement getPersistable() 81 { 82 return null; 83 } 84 85 86 89 public String getToolTipText() 90 { 91 return Messages.getString( "SchemaEditorInput.Source_code_of" ) + this.schema.getName(); } 93 94 95 98 public Object getAdapter( Class adapter ) 99 { 100 return null; 101 } 102 103 104 107 public boolean equals( Object obj ) 108 { 109 if ( this == obj ) 110 return true; 111 if ( !( obj instanceof SchemaEditorInput ) ) 112 return false; 113 SchemaEditorInput other = ( SchemaEditorInput ) obj; 114 return other.getSchema().getName().equals( this.schema.getName() ); 115 } 116 117 118 122 public Schema getSchema() 123 { 124 return this.schema; 125 } 126 } 127 | Popular Tags |