Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.edit.language.model
Class LanguageModel

java.lang.Object
  extended by com.ibm.etools.iseries.edit.language.model.LanguageModelElement
      extended by com.ibm.etools.iseries.edit.language.model.LanguageModel
Direct Known Subclasses:
ISeriesEditorCLModel, ISeriesEditorRPGILEModel, ISeriesEditorRPGOPMModel

public class LanguageModel
extends LanguageModelElement

This model contains child elements. An element contains attributes that are properties of the element. The model object is an element itself and is considered to be the root. However, this root is not a part of the tree that is displayed. This root element should only have one child. The entire tree can be printed to the console using the printElementTree method.


Field Summary
protected  boolean _bNotifyListeners
           
protected  Vector<ILanguageModelListener> _vectorListeners
           
static String Copyright
           
 
Fields inherited from class com.ibm.etools.iseries.edit.language.model.LanguageModelElement
_elementParent, _iLineNumberFirst, _iLineNumberLast, _model, _name, _objData, _strImage, _strName, _vectorAttributes, _vectorChildElements
 
Constructor Summary
LanguageModel()
          Constructor.
 
Method Summary
static void addAttributeToElement(LanguageModelElement element, String strAttributeName, String strValue, boolean bEditable)
          Convenience method that adds an attribute (property) to the element.
 void addLanguageModelListener(ILanguageModelListener listener)
          Adds a listener to this model.
static LanguageModelElement createChildElement(LanguageModelElement elementParent, String strName, String strImageName, int iLineNumberFirst, int iLineNumberLast, int iLocation)
          Convenience method that creates a child element of the given parent element.
static void deleteElement(LanguageModel model, LanguageModelElement element)
          Convenience method to delete an element from a model.
protected  void elementAdded(LanguageModelElement elementAdded)
          Used by elements to notify the model that an element has been added.
 void elementChanged(LanguageModelElement elementChanged)
          Used by elements to notify the model that an element has changed.
protected  void elementRemoved(LanguageModelElement elementRemoved)
          Used by elements to notify the model that an element has been removed
 LanguageModelElement getRootElement()
          Returns the root element which is this one.
 void printElementTree()
          This overrides the default behaviour since this is the root element that really is not a part of the element tree.
 void removeLanguageModelListener(ILanguageModelListener listener)
          Adds a listener to this model.
 void setNotifyListeners(boolean bNotifyListeners)
          When set to false, listeners are not notified when elements have been added, removed, or changed.
 
Methods inherited from class com.ibm.etools.iseries.edit.language.model.LanguageModelElement
addAttribute, addChildElement, addChildElement, findElementFromHashValue, getAdapter, getAttribute, getAttributeValue, getChildElement, getChildElementAt, getChildElementIndex, getChildren, getData, getEditableValue, getElementFromLineNumber, getImageName, getLineRangeExtent, getLineRangeOrigin, getModel, getName, getNumberOfAttributes, getNumberOfChildElements, getParent, getPropertyDescriptors, getPropertyValue, hasChildren, hasDescendent, isPropertySet, printElementTree, removeAllChildElements, removeChildElement, resetPropertyValue, setData, setPropertyValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

_vectorListeners

protected Vector<ILanguageModelListener> _vectorListeners

_bNotifyListeners

protected boolean _bNotifyListeners
Constructor Detail

LanguageModel

public LanguageModel()
Constructor.

Method Detail

addAttributeToElement

public static void addAttributeToElement(LanguageModelElement element,
                                         String strAttributeName,
                                         String strValue,
                                         boolean bEditable)
Convenience method that adds an attribute (property) to the element.


addLanguageModelListener

public void addLanguageModelListener(ILanguageModelListener listener)
Adds a listener to this model. Listeners are notified whenever an element has changed, created or destroyed.


createChildElement

public static LanguageModelElement createChildElement(LanguageModelElement elementParent,
                                                      String strName,
                                                      String strImageName,
                                                      int iLineNumberFirst,
                                                      int iLineNumberLast,
                                                      int iLocation)
Convenience method that creates a child element of the given parent element.


deleteElement

public static void deleteElement(LanguageModel model,
                                 LanguageModelElement element)
Convenience method to delete an element from a model.


elementAdded

protected void elementAdded(LanguageModelElement elementAdded)
Used by elements to notify the model that an element has been added.


elementChanged

public void elementChanged(LanguageModelElement elementChanged)
Used by elements to notify the model that an element has changed. Also used when notifyListeners is set to true.


elementRemoved

protected void elementRemoved(LanguageModelElement elementRemoved)
Used by elements to notify the model that an element has been removed


getRootElement

public LanguageModelElement getRootElement()
Returns the root element which is this one. Note that this element is not a part of the tree.


printElementTree

public void printElementTree()
This overrides the default behaviour since this is the root element that really is not a part of the element tree.

Overrides:
printElementTree in class LanguageModelElement

removeLanguageModelListener

public void removeLanguageModelListener(ILanguageModelListener listener)
Adds a listener to this model. Listeners are notified whenever an element has changed, created or destroyed.


setNotifyListeners

public void setNotifyListeners(boolean bNotifyListeners)
When set to false, listeners are not notified when elements have been added, removed, or changed. When set to true, all listeners are notified that the model has changed. This is typically used to temporarily halt updating of the outline view when multiple elements are added, removed, or changed.


Rational Developer for Power Systems Software
V7.6

Copyright 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.