KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > core > refactoring > CategorizedTextEditGroup


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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 /**
19  * A special text edit group that manages an additional set of
20  * group categories.
21  * <p>
22  * Note: this class is not intended to be subclassed
23  * </p>
24  *
25  * @since 3.2
26  */

27 public class CategorizedTextEditGroup extends TextEditGroup {
28
29     private GroupCategorySet fGroupCategories;
30     
31     /**
32      * Creates a new text edit group with the given name and group
33      * categories.
34      *
35      * @param name the name of the text edit group. Must be
36      * a human readable string
37      * @param groupCategories a set of group categories
38      */

39     public CategorizedTextEditGroup(String JavaDoc name, GroupCategorySet groupCategories) {
40         super(name);
41         Assert.isNotNull(groupCategories);
42         fGroupCategories= groupCategories;
43     }
44
45     /**
46      * Creates a new text edit group with a name, a single {@link TextEdit}
47      * and a set of group categories.
48      *
49      * @param name the name of the text edit group. Must be
50      * a human readable string
51      * @param edit the edit to manage
52      * @param groupCategories a set of group categories
53      */

54     public CategorizedTextEditGroup(String JavaDoc name, TextEdit edit, GroupCategorySet groupCategories) {
55         super(name, edit);
56         Assert.isNotNull(groupCategories);
57         fGroupCategories= groupCategories;
58     }
59
60     /**
61      * Creates a new text edit group with the given name, array of edits
62      * and a set of group categories.
63      *
64      * @param name the name of the text edit group. Must be
65      * a human readable string
66      * @param edits the array of edits
67      * @param groupCategories a set of group categories
68      */

69     public CategorizedTextEditGroup(String JavaDoc name, TextEdit[] edits, GroupCategorySet groupCategories) {
70         super(name, edits);
71         Assert.isNotNull(groupCategories);
72         fGroupCategories= groupCategories;
73     }
74
75     /**
76      * Returns the set of group categories.
77      *
78      * @return the group categories of this text edit group
79      */

80     public GroupCategorySet getGroupCategorySet() {
81         return fGroupCategories;
82     }
83 }
84
Popular Tags