EclipseJDT ASTViewer Source Viewer

Home|eclipse_jdt_astviewer/src/org/eclipse/jdt/astview/views/ASTAttribute.java
1/*******************************************************************************
2 * Copyright (c) 2000, 2005 IBM Corporation and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 *     IBM Corporation - initial API and implementation
13 *******************************************************************************/
14package org.eclipse.jdt.astview.views;
15
16import org.eclipse.swt.graphics.Image;
17
18import org.eclipse.jdt.core.dom.ASTNode;
19
20/**
21 *
22 */
23public abstract class ASTAttribute {
24
25    protected static final Object[] EMPTY= new Object[0];
26
27    public abstract Object getParent();
28    public abstract Object[] getChildren();
29    public abstract String getLabel();
30    public abstract Image getImage();
31
32    public ASTNode getParentASTNode() {
33        Object parentgetParent();
34        while (parent instanceof ASTAttribute) {
35            parent= ((ASTAttributeparent).getParent();
36        }
37        if (parent instanceof ASTNode) {
38            return (ASTNodeparent;
39        }
40        return null;
41    }
42
43}
44
MembersX
ASTAttribute:getParentASTNode:Block:parent
ASTAttribute:getChildren
ASTAttribute:getLabel
ASTAttribute:getImage
ASTAttribute:getParent
ASTAttribute:EMPTY
ASTAttribute:getParentASTNode
Members
X