Class FormulaRootElement
java.lang.Object
org.pentaho.openformula.ui.model2.FormulaElement
org.pentaho.openformula.ui.model2.FormulaRootElement
- All Implemented Interfaces:
Element
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
getElement
(int index) Fetches the child element at the given index.int
Gets the number of child elements contained by this element.int
getElementIndex
(int offset) Gets the child element index closest to the given offset.getName()
Fetches the name of the element.getText()
void
insert
(FormulaElement oldElement, FormulaTextElement formulaTextElement) void
insertElement
(int index, FormulaElement element) boolean
isLeaf()
Is this element a leaf element? An element that may have children, even if it currently has no children, would returnfalse
.void
print()
void
removeElement
(int index) void
replace
(FormulaElement oldElement, FormulaTextElement formulaTextElement, boolean hasDummyParams) void
void
void
setElement
(int index, FormulaElement element) void
setElements
(FormulaElement[] elements) Methods inherited from class org.pentaho.openformula.ui.model2.FormulaElement
getAttributes, getDocument, getEndOffset, getParentElement, getStartOffset, setEndOffset, setStartOffset
-
Constructor Details
-
FormulaRootElement
-
-
Method Details
-
getText
- Specified by:
getText
in classFormulaElement
-
getElementIndex
public int getElementIndex(int offset) Gets the child element index closest to the given offset. The offset is specified relative to the beginning of the document. Returns-1
if theElement
is a leaf, otherwise returns the index of theElement
that best represents the given location. Returns0
if the location is less than the start offset. ReturnsgetElementCount() - 1
if the location is greater than or equal to the end offset.- Specified by:
getElementIndex
in interfaceElement
- Overrides:
getElementIndex
in classFormulaElement
- Parameters:
offset
- the specified offset >= 0- Returns:
- the element index >= 0
-
getElementCount
public int getElementCount()Gets the number of child elements contained by this element. If this element is a leaf, a count of zero is returned.- Specified by:
getElementCount
in interfaceElement
- Overrides:
getElementCount
in classFormulaElement
- Returns:
- the number of child elements >= 0
-
getElement
Fetches the child element at the given index.- Specified by:
getElement
in interfaceElement
- Overrides:
getElement
in classFormulaElement
- Parameters:
index
- the specified index >= 0- Returns:
- the child element. If index is invalid, return null
-
isLeaf
public boolean isLeaf()Is this element a leaf element? An element that may have children, even if it currently has no children, would returnfalse
.- Specified by:
isLeaf
in interfaceElement
- Overrides:
isLeaf
in classFormulaElement
- Returns:
- true if a leaf element else false
-
getName
Fetches the name of the element. If the element is used to represent some type of structure, this would be the type name.- Returns:
- the element name
-
setElements
-
setElement
-
insertElement
-
removeElement
public void removeElement(int index) -
revalidateStructure
public void revalidateStructure() -
revalidateNodePositions
public void revalidateNodePositions() -
print
public void print() -
clear
public void clear() -
replace
public void replace(FormulaElement oldElement, FormulaTextElement formulaTextElement, boolean hasDummyParams) -
insert
-