1 19 20 package org.netbeans.modules.xml.xam.ui.highlight; 21 22 import org.netbeans.modules.xml.xam.Component; 23 24 29 public abstract class Highlight { 30 31 public static final String SEARCH_RESULT = "searchResult"; 32 33 public static final String SEARCH_RESULT_PARENT = "searchResultParent"; 34 35 public static final String FIND_USAGES_RESULT_PARENT = "find-usages-result-parent"; 36 37 public static final String FIND_USAGES_RESULT = "find-usages-result"; 38 39 private Component component; 40 41 private String type; 42 43 49 public Highlight(Component component, String type) { 50 assert component != null; 51 assert type != null; 52 this.component = component; 53 this.type = type; 54 } 55 56 public boolean equals(Object obj) { 57 if (obj instanceof Highlight) { 58 Highlight oh = (Highlight) obj; 59 return type.equals(oh.type) && component.equals(oh.component); 61 } 62 return false; 63 } 64 65 70 public Component getComponent() { 71 return component; 72 } 73 74 79 public String getType() { 80 return type; 81 } 82 83 public int hashCode() { 84 return type.hashCode() + component.hashCode(); 85 } 86 } 87 | Popular Tags |