1 20 21 package org.apache.directory.ldapstudio.schemas.view.views.wrappers; 22 23 24 import org.apache.directory.ldapstudio.schemas.Activator; 25 import org.apache.directory.ldapstudio.schemas.PluginConstants; 26 import org.apache.directory.ldapstudio.schemas.model.AttributeType; 27 import org.eclipse.swt.graphics.Image; 28 import org.eclipse.ui.plugin.AbstractUIPlugin; 29 30 31 37 public class AttributeTypeWrapper extends TreeNode 38 { 39 40 private AttributeType myAttributeType; 41 private State state; 42 43 public enum State 44 { 45 resolved, unResolved 46 } 47 48 49 57 public AttributeTypeWrapper( AttributeType myAttributeType, ITreeNode parent ) 58 { 59 super( parent ); 60 61 this.myAttributeType = myAttributeType; 62 this.state = State.resolved; 63 } 64 65 66 72 public AttributeType getMyAttributeType() 73 { 74 return myAttributeType; 75 } 76 77 78 81 public Image getImage() 82 { 83 return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, PluginConstants.IMG_ATTRIBUTE_TYPE ) 84 .createImage(); 85 } 86 87 88 91 public boolean equals( Object obj ) 92 { 93 if ( obj instanceof AttributeTypeWrapper ) 94 { 95 AttributeTypeWrapper compared = ( AttributeTypeWrapper ) obj; 96 return compared.getMyAttributeType().getOid().equals( getMyAttributeType().getOid() ); 97 } 98 99 return false; 100 } 101 102 103 106 public String toString() 107 { 108 return myAttributeType + " wrapper"; } 110 111 112 118 public State getState() 119 { 120 return state; 121 } 122 123 124 130 public void setState( State state ) 131 { 132 this.state = state; 133 } 134 } 135 | Popular Tags |