1 11 package org.eclipse.ltk.core.refactoring; 12 13 import org.eclipse.text.edits.TextEdit; 14 import org.eclipse.text.edits.TextEditGroup; 15 16 import org.eclipse.core.runtime.Assert; 17 18 import org.eclipse.jface.text.IRegion; 19 20 31 public class TextEditBasedChangeGroup { 32 33 34 private TextEditBasedChange fChange; 35 private boolean fIsEnabled; 36 private TextEditGroup fTextEditGroup; 37 38 45 public TextEditBasedChangeGroup(TextEditBasedChange change, TextEditGroup group) { 46 Assert.isNotNull(change); 47 Assert.isNotNull(group); 48 fChange= change; 49 fIsEnabled= true; 50 fTextEditGroup= group; 51 } 52 53 58 public TextEditBasedChange getTextEditChange() { 59 return fChange; 60 } 61 62 68 public String getName() { 69 return fTextEditGroup.getName(); 70 } 71 72 79 public IRegion getRegion() { 80 return fTextEditGroup.getRegion(); 81 } 82 83 88 public TextEditGroup getTextEditGroup() { 89 return fTextEditGroup; 90 } 91 92 99 public TextEdit[] getTextEdits() { 100 return fTextEditGroup.getTextEdits(); 101 } 102 103 109 public boolean isEnabled() { 110 return fIsEnabled; 111 } 112 113 122 public void setEnabled(boolean enabled) { 123 fIsEnabled= enabled; 124 } 125 126 131 public GroupCategorySet getGroupCategorySet() { 132 if (fTextEditGroup instanceof CategorizedTextEditGroup) { 133 return ((CategorizedTextEditGroup)fTextEditGroup).getGroupCategorySet(); 134 } 135 return GroupCategorySet.NONE; 136 } 137 } | Popular Tags |