# com.bea.ide.lang.control.element
ControlVariable Class

public class ControlVariable
extends `JavaVariable`
implements `ILinkedElement`

This is an instance variable in a ControlContainer that is a control.

Hierarchy
  `Object`
  `DefaultElement`
  `DefaultTreeElement`
  `DefaultDocumentElement`
  `DefaultSourceElement`
  `JavaElement`
  `JavaModifierSupport`
  `JavaMember`
  `JavaVariable`
  `ControlVariable`

All Implemented Interfaces
  `IDocumentElement`, `IElement`, `ILinkedElement`, `ISourceElement`, `IStructureFeature.IStructureNode`, `ITreeElement`

## Nested Class Summary

`protected static class` | `ControlVariable.LinkRemovedListener` Listener on the document to notice when a link is removed.

Nested classes from com.bea.ide.sourceeditor.element`.`DefaultSourceElement``
``DefaultSourceElement.CompilerPropertyDescriptor`, `DefaultSourceElement.DefaultAuthorElement`, `DefaultSourceElement.StaticCompilerPropertyDescriptor`, `DefaultSourceElement.StickyRange``

## Field Summary

`public static final `String`` | `PROP_linkSet` String

Fields from com.bea.ide.lang.java.element`.`JavaMember``
``PROP_THROWS``

Fields from com.bea.ide.lang.java.element`.`JavaModifierSupport``
``PROP_ABSTRACT`, `PROP_ACCESS`, `PROP_FINAL`, `PROP_NATIVE`, `PROP_STATIC`, `PROP_STRICTFP`, `PROP_SYNCHRONIZED`, `PROP_TRANSIENT`, `PROP_TYPE`, `PROP_VOLATILE``

Fields from com.bea.ide.sourceeditor.element`.`DefaultSourceElement``
``_range`, `PROP_NAME`, `PROP_VALUE``

Fields from com.bea.ide.element`.`DefaultTreeElement``
``_parent`, `_vChildren``

Fields from interface com.bea.ide.sourceeditor.element`.`ISourceElement``
``STATUS_IN_TREE`, `STATUS_NOT_IN_TREE`, `STATUS_REMOVED_FROM_TREE``

## Constructor Summary

ControlVariable(`Object` compilerCookie) Constructor.

## Method Summary

`public `IDocument`` | `getImplDocument`() Get the Document which implements the control for this variable.
`public `IDocumentElement`` | `getLink`() Get the control JavaClass if this variable is a control instance.
`public `IDocument`` | `getLinkedDocument`() Get the document that contains the linked element.
`public `String`` | `getNonFactoryType`() Get the non-factory type of this control.
`public boolean` | `isContextVariable`() Determine if this element is a context variable.
`public boolean` | `isControlInstance`() Determine if this element is a control variable.
`public boolean` | `isFactory`() Determine if this is a Factory control variable.
`public boolean` | `isLegacyVariable`() Determine if this element is a legacy control or context variable (i.e.
`public void` | `setImplDocument`(`IDocument` implDoc) Set the impl document.
`public void` | `setLink`(`IDocumentElement` link) Set the link.
`public void` | `setLinkedDocument`(`IDocument` doc) Sets the linked document.

Methods from `com.bea.ide.lang.java.element.`JavaVariable``
``getDefaultPropertyDescriptors`, `getType`, `getTypeCode`, `setInitializer`, `setInitializer`, `setType`, `toString`, `visit``

Methods from `com.bea.ide.lang.java.element.`JavaMember``
``getAccess`, `getDefaultPropertyDescriptors`, `getName`, `setAccess`, `setName`, `toString``

Methods from `com.bea.ide.lang.java.element.`JavaModifierSupport``
``getAbstract`, `getDefaultPropertyDescriptors`, `getFinal`, `getNative`, `getStatic`, `getStrictFloatingPoint`, `getSynchronized`, `getTransient`, `getVolatile`, `mergePropertyDescriptors`, `setAbstract`, `setFinal`, `setNative`, `setStatic`, `setStrictFloatingPoint`, `setSynchronized`, `setTransient`, `setVolatile``

Methods from `com.bea.ide.lang.java.element.`JavaElement``
``visit``

Methods from `com.bea.ide.sourceeditor.element.`DefaultSourceElement``
``addChild`, `createAuthorNode`, `debugDump`, `equals`, `getChildrenByClass`, `getClassLoader`, `getCookie`, `getDefaultPropertyDescriptors`, `getDiagnostics`, `getGroup`, `getInstanceName`, `getProperty`, `getPropertyCode`, `getPropertyDescriptors`, `getPropertySourceRange`, `getPropertySourceRanges`, `getPropertySourceText`, `getPropertySourceText`, `getRange`, `getRange`, `getRangePrefetchProperties`, `getStatus`, `getTypeCode`, `initializeRange`, `initializeRange`, `insertChild`, `isAuthorProperty`, `markRemovedFromTree`, `mergeElements`, `mergeFrom`, `propertyModified`, `removeChild`, `removeChild`, `replaceChild`, `requestAddChild`, `requestAddChild`, `requestRemoveChild`, `requestSetProperty`, `setProperty`, `setStatus``

Methods from `com.bea.ide.document.`DefaultDocumentElement``
``addChild`, `getDocument`, `setDocument``

Methods from `com.bea.ide.element.`DefaultTreeElement``
``addChild`, `children`, `getChild`, `getChildCount`, `getParent`, `removeChild``

Methods from `com.bea.ide.element.`DefaultElement``
``getProperty`, `getPropertyDescriptors`, `setProperty``

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from interface `com.bea.ide.document.`IDocumentElement``
``getDocument``

Methods from interface `com.bea.ide.element.`IElement``
``getProperty`, `getPropertyDescriptors`, `setProperty``

Methods from interface `com.bea.ide.document.`ILinkedElement``
``getLink`, `getLinkedDocument``

Methods from interface `com.bea.ide.sourceeditor.element.`ISourceElement``
``createAuthorNode`, `getCookie`, `getDiagnostics`, `getPropertyCode`, `getRange`, `getStatus`, `mergeFrom`, `requestAddChild`, `requestAddChild`, `requestRemoveChild`, `requestSetProperty``

Methods from interface `com.bea.compiler.feature.`IStructureFeature.IStructureNode``
`getCookie, getTypeCode`

Methods from interface `com.bea.ide.element.`ITreeElement``
``children`, `getChild`, `getChildCount`, `getParent``

## Field Detail

### PROP_linkSet

    public static final String PROP_linkSet

## Constructor Detail

### ControlVariable

    public ControlVariable(Object compilerCookie)

  Constructor.

## Method Detail

### getImplDocument() Method

    public IDocument getImplDocument()

Get the Document which implements the control for this variable. This will return null if the control doesn't have implementation source in the same project as it's use.

#### Returns

the implementation document, if available.

### getLink() Method

    public IDocumentElement getLink()

Get the control JavaClass if this variable is a control instance.

#### Returns

the JavaClass of the control that defines this instance. This may be null if there is an error in the file or it simply hasn't been parsed yet. It's not guaranteed to have a document or have all properties set.

### getLinkedDocument() Method

    public IDocument getLinkedDocument()

Get the document that contains the linked element.

#### Returns

the document that contains the definition of this instance.

### getNonFactoryType() Method

    public String getNonFactoryType()

Get the non-factory type of this control.

#### Returns

the non-factory type for the control, if this is a factory control instance.

### isContextVariable() Method

    public boolean isContextVariable()

Determine if this element is a context variable.

#### Returns

true if this is a control context, false if it's a normal variable.

### isControlInstance() Method

    public boolean isControlInstance()

Determine if this element is a control variable.

#### Returns

true if this is a control instance, false if it's a normal variable.

### isFactory() Method

    public boolean isFactory()

Determine if this is a Factory control variable. This result is only relevant if isControlInstance() is true.

#### Returns

true if this is a Factory instance.

### isLegacyVariable() Method

    public boolean isLegacyVariable()

Determine if this element is a legacy control or context variable (i.e. uses @jws instead of @common).

#### Returns

true if this is a WLW 7.x control declaration.

### setImplDocument(IDocument) Method

    public void setImplDocument(IDocument implDoc)

Set the impl document. This is public only for implementation reasons. It should only be called by the document or builder, not by any consumer of this class.

### setLink(IDocumentElement) Method

    public void setLink(IDocumentElement link)

Set the link. This is public only for implementation reasons. It should only be called by the document or builder, not by any consumer of this class.

### setLinkedDocument(IDocument) Method

    public void setLinkedDocument(IDocument doc)

Sets the linked document. This is public only for implementation reasons. It should only be called by the document or builder, not by any consumer of this class.