/** * 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 GroupCategorySet getGroupCategorySet() { if (fGroupCategories == null) { fGroupCategories= GroupCategorySet.NONE; for (Iterator iter= fChildren.iterator(); iter.hasNext();) { PreviewNode node= (PreviewNode)iter.next(); GroupCategorySet other= null; if (node instanceof TextEditGroupNode) { other= ((TextEditGroupNode)node).getGroupCategorySet(); } else if (node instanceof InternalLanguageElementNode) { other= ((InternalLanguageElementNode)node).getGroupCategorySet(); } else { Assert.isTrue(false, "Shouldn't happen"); //$NON-NLS-1$ } fGroupCategories= GroupCategorySet.union(fGroupCategories, other); } } return fGroupCategories; }