KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > ui > refactoring > InternalTextEditChangeNode


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.internal.ui.refactoring;
12
13 import java.util.List JavaDoc;
14
15 import org.eclipse.ltk.core.refactoring.Change;
16 import org.eclipse.ltk.core.refactoring.TextEditBasedChange;
17
18 import org.eclipse.ltk.ui.refactoring.TextEditChangeNode;
19 import org.eclipse.ltk.ui.refactoring.TextEditChangeNode.ChildNode;
20
21 public abstract class InternalTextEditChangeNode extends AbstractChangeNode {
22
23     protected InternalTextEditChangeNode(PreviewNode parent, Change change) {
24         super(parent, change);
25     }
26
27     int getActive() {
28         return getCompositeChangeActive();
29     }
30     
31     boolean hasOneGroupCategory(List JavaDoc categories) {
32         return ((TextEditBasedChange)getChange()).hasOneGroupCategory(categories);
33     }
34     
35     protected TextEditBasedChange getTextEditBasedChange() {
36         return (TextEditBasedChange)getChange();
37     }
38     
39     final PreviewNode[] doCreateChildren() {
40         return createChildNodes();
41     }
42     
43     protected static TextEditChangeNode internalGetTextEditChangeNode(PreviewNode node) {
44         PreviewNode element= node.getParent();
45         while(!(element instanceof TextEditChangeNode) && element != null) {
46             element= element.getParent();
47         }
48         return (TextEditChangeNode)element;
49     }
50     
51     protected abstract ChildNode[] createChildNodes();
52 }
53
Popular Tags