|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.java.ui.nodes.elements; import org.openide.nodes.Children; import org.openide.nodes.Sheet; import org.openide.util.HelpCtx; import org.openide.util.datatransfer.NewType; import org.openide.src.ElementProperties; import org.netbeans.jmi.javamodel.AnnotationType; import java.util.Map; import java.util.HashMap; /** * Node representing an annotation type * @see org.netbeans.jmi.javamodel.AnnotationType */ public final class AnnotationTypeNode extends ElementNode { private static final Map mapAttributeName; static { mapAttributeName = new HashMap(); mapAttributeName.put(PROP_MODIFIERS, PROP_MODIFIERS); mapAttributeName.put(ElementProperties.PROP_NAME, ElementProperties.PROP_NAME); } public AnnotationTypeNode(AnnotationType element, Children children, boolean writeable) { super(element, children, writeable, SourceOptions.PROP_ANNOTATION_TYPE_FORMAT); setElementFormat0(getElementFormatProperty()); } protected String resolveIconBase() { return IconStrings.ANNOTATION_TYPE; } protected ElementFormat getElementFormatProperty() { return getSourceOptions().getAnnTypeElementFormat(); } protected ElementFormat getHintElementFormat() { return getSourceOptions().getAnnTypeElementLongFormat(); } protected Map getAttributeNameMap() { return mapAttributeName; } public NewType[] getNewTypes() { if (writeable) { return SourceEditSupport.createInterfaceNewTypes(getAnnotationType()); } else { return super.getNewTypes(); } } protected Sheet createSheet() { Sheet s = Sheet.createDefault(); Sheet.Set ps = s.get(Sheet.PROPERTIES); ps.put(createModifiersProperty(writeable)); ps.put(createNameProperty(getAnnotationType())); return s; } private AnnotationType getAnnotationType() { return (AnnotationType) this.element; } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.