GroupCategorySet getGroupCategorySet() { return fChangeGroup.getGroupCategorySet(); }
boolean hasOneGroupCategory(List categories) { return fChangeGroup.getGroupCategorySet().containsOneCategory(categories); }
/** * Adds a {@link TextEditBasedChangeGroup text edit change group}. * The edits managed by the given text edit change group must be part of * the change's root edit. * * @param group the text edit change group to add */ public void addChangeGroup(TextEditBasedChangeGroup group) { Assert.isTrue(group != null); fChangeGroups.add(group); if (fCombiedGroupCategories != null) { fCombiedGroupCategories= GroupCategorySet.union(fCombiedGroupCategories, group.getGroupCategorySet()); } }
/** * Adds a {@link TextEditBasedChangeGroup text edit change group}. * The edits managed by the given text edit change group must be part of * the change's root edit. * * @param group the text edit change group to add */ public void addChangeGroup(TextEditBasedChangeGroup group) { Assert.isTrue(group != null); fChangeGroups.add(group); if (fCombiedGroupCategories != null) { fCombiedGroupCategories= GroupCategorySet.union(fCombiedGroupCategories, group.getGroupCategorySet()); } }
/** * Adds a {@link TextEditBasedChangeGroup text edit change group}. * The edits managed by the given text edit change group must be part of * the change's root edit. * * @param group the text edit change group to add */ public void addChangeGroup(TextEditBasedChangeGroup group) { Assert.isTrue(group != null); fChangeGroups.add(group); if (fCombiedGroupCategories != null) { fCombiedGroupCategories= GroupCategorySet.union(fCombiedGroupCategories, group.getGroupCategorySet()); } }
/** * Returns <code>true</code> if the change has one of the given group * categories. Otherwise <code>false</code> is returned. * * @param groupCategories the group categories to check * * @return whether the change has one of the given group * categories * * @since 3.2 */ public boolean hasOneGroupCategory(List<GroupCategory> groupCategories) { if (fCombiedGroupCategories == null) { fCombiedGroupCategories= GroupCategorySet.NONE; for (Iterator<TextEditBasedChangeGroup> iter= fChangeGroups.iterator(); iter.hasNext();) { TextEditBasedChangeGroup group= iter.next(); fCombiedGroupCategories= GroupCategorySet.union(fCombiedGroupCategories, group.getGroupCategorySet()); } } return fCombiedGroupCategories.containsOneCategory(groupCategories); }
/** * Returns <code>true</code> if the change has one of the given group * categories. Otherwise <code>false</code> is returned. * * @param groupCategories the group categories to check * * @return whether the change has one of the given group * categories * * @since 3.2 */ public boolean hasOneGroupCategory(List groupCategories) { if (fCombiedGroupCategories == null) { fCombiedGroupCategories= GroupCategorySet.NONE; for (Iterator iter= fChangeGroups.iterator(); iter.hasNext();) { TextEditBasedChangeGroup group= (TextEditBasedChangeGroup)iter.next(); fCombiedGroupCategories= GroupCategorySet.union(fCombiedGroupCategories, group.getGroupCategorySet()); } } return fCombiedGroupCategories.containsOneCategory(groupCategories); }
/** * Returns <code>true</code> if the change has one of the given group * categories. Otherwise <code>false</code> is returned. * * @param groupCategories the group categories to check * * @return whether the change has one of the given group * categories * * @since 3.2 */ public boolean hasOneGroupCategory(List<GroupCategory> groupCategories) { if (fCombiedGroupCategories == null) { fCombiedGroupCategories= GroupCategorySet.NONE; for (Iterator<TextEditBasedChangeGroup> iter= fChangeGroups.iterator(); iter.hasNext();) { TextEditBasedChangeGroup group= iter.next(); fCombiedGroupCategories= GroupCategorySet.union(fCombiedGroupCategories, group.getGroupCategorySet()); } } return fCombiedGroupCategories.containsOneCategory(groupCategories); }
private List collectTextEditBasedChangeGroups(List categories) { List result= new ArrayList(10); PreviewNode[] children= getChildren(); for (int i= 0; i < children.length; i++) { PreviewNode child= children[i]; if (child instanceof TextEditGroupNode) { TextEditBasedChangeGroup changeGroup= ((TextEditGroupNode)child).getChangeGroup(); if (categories == null || changeGroup.getGroupCategorySet().containsOneCategory(categories)) result.add(changeGroup); } else if (child instanceof InternalLanguageElementNode) { result.addAll(((InternalLanguageElementNode)child).collectTextEditBasedChangeGroups(categories)); } } return result; }
private void collectGroupCategories(Set/*<GroupCategory>*/ result, Change change) { if (change instanceof TextEditBasedChange) { TextEditBasedChangeGroup[] groups= ((TextEditBasedChange)change).getChangeGroups(); for (int i= 0; i < groups.length; i++) { result.addAll(groups[i].getGroupCategorySet().asList()); } } else if (change instanceof CompositeChange) { Change[] children= ((CompositeChange)change).getChildren(); for (int i= 0; i < children.length; i++) { collectGroupCategories(result, children[i]); } } }