1 19 20 package org.netbeans.modules.xml.refactoring; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 import org.netbeans.modules.xml.refactoring.impl.RefactoringUtil; 25 import org.netbeans.modules.xml.xam.Component; 26 import org.netbeans.modules.xml.xam.Reference; 27 28 29 public class Usage { 30 private Component component; 31 private Type type; 32 private UsageGroup container; 33 private boolean includedInRefactoring; 34 private String refactoringDescription; 35 36 public Usage(Component component, UsageGroup container) { 37 this(component, Type.REFERENCE, container); 38 } 39 40 public Usage(Component component, Type type, UsageGroup container) { 41 this.component = component; 42 this.type = type; 43 this.container = container; 44 includedInRefactoring = true; 45 } 46 47 public enum Type { 48 REFERENCE, GENERALIZATION; 49 public String toString() { 50 return RefactoringUtil.getDescription(this); 51 } 52 } 53 54 57 public Component getComponent() { 58 return component; 59 } 60 61 64 public Type getType() { 65 return type; 66 } 67 68 public void setType(Type type) { 69 this.type = type; 70 } 71 72 75 public UsageGroup getContainer() { 76 return container; 77 } 78 79 82 public List <Component> getPathFromRoot() { 83 return getContainer().getEngine().getUIHelper().getRelevantPathFromRoot(this.getComponent()); 84 } 85 86 89 public boolean isIncludedInRefactoring() { 90 return includedInRefactoring; 91 } 92 public void setIncludedInRefactoring(boolean included) { 93 includedInRefactoring = included; 94 } 95 96 102 public String getRefactoringDescription() { 103 return refactoringDescription; 104 } 105 public void setRefactoringDescription(String desc) { 106 this.refactoringDescription = desc; 107 } 108 } | Popular Tags |