alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

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-2000 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.modules.java.codegen;

import java.util.Collection;

import org.openide.src.Element;
import org.openide.text.PositionBounds;

import org.netbeans.modules.java.bridge.Binding;

/**
 * Interface for binding Elements to org.openide.text.* package.
 *
 * @author  sdedic
 * @version 
 */
public interface TextBinding extends Binding {
    /** Bounds for the whole element.
     */
    public static final int BOUNDS_ALL = 0;
    
    /** Bounds that will contain javadoc comment.
     */
    public static final int BOUNDS_JAVADOC = 1;
    
    /** Bounds that will contain the header of a method, declarator of a field,
     * or header of a class.
     */
    public static final int BOUNDS_HEADER = 2;
    
    /** Bounds for body of a constructor/method/initializer/class, or init value
     * for a field. Undefined otherwise.
     */
    public static final int BOUNDS_BODY = 3;

    public static final int BOUNDS_FIELD_TYPE = 4;
    
    /** Bounds suitable for the package statement. 
     */
    public static final int BOUNDS_PACKAGE = 10;
    
    public static final int BOUNDS_SOURCE = 10;
    
    /**
     * Returns the associated java Element.
     */
    public org.openide.src.Element getElement();
    
    /**
     * Returns the range occupied by the element.
     * @param if true, the returned range will not include javadoc.
     */
    public PositionBounds   getElementRange(boolean defRange);
    
    /**
     * Returns a container of the specified type, or null if there is not any.
     */
    public Container getContainer(String containerType);
    
    /**
     * Updates the specified bounds. Exact types can have element-specific meaning.
     */
    public void updateBounds(int boundsType, PositionBounds bounds);
    
    /**
     * A special method for linking fields, that are declared in one declarator
     * together.
     */
    public void linkAfter(TextBinding previousBinding);
    
    /** Extension for container bindings.
     */
    public interface Container extends Binding.Container {
        public void updateChildren(Collection members);
        public boolean isEmpty();
    }
    
    public interface ExElement extends javax.swing.text.Element {
        public org.openide.text.PositionRef getDeclarationStart();
    }
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.