Package sc.lang.html

Class Element<RE>

  • All Implemented Interfaces:
    IDynObject, INamedChildren, IObjChildren, IStatefulPage, INamedNode, ISemanticNode, ISrcStatement, IUserDataNode, ILifecycle, IChildInit, IStoppable, ITypeUpdateHandler
    Direct Known Subclasses:
    HTMLElement

    public class Element<RE>
    extends Node
    implements IChildInit, IStatefulPage, IObjChildren, ITypeUpdateHandler, ISrcStatement, IStoppable, INamedChildren
    This class, along with HTMLElement, serve as the server-side implementations for tags in the system. The class itself inherits from Node which extends JavaSemanticNode. While this makes the javadoc hard to read because of all of the methods, it gives you a very simple API for manipulating HTML documents. After the HTML file is parsed, you can edit the attributeList and children properties using the SemanticNodeList interface. As you change those properties, the HTML definition can be updated on the fly or invalidated and refreshed as needed.

    Most of the time though, your Element instances will not result from being parsed. Instead, this class is also used as the base class for tag objects instances on the server when you compiled your schtml files. In this case, the Element instances don't have parse nodes. Rendering HTML occurs in the generated code in the outputStartTag and outputBody methods. If you ever did need the HTML though, you could regenerate it. Or if you needed to parse HTML, validate it, manipulate it, then save it, you can do so all with this one flexible Java api.

    If this were not enough functionality, Element's also implement the IDynObject interface. This lets us use Element instances directly from interpreted schtml code, avoiding the need for generating wrapper classes. This makes the dynamic mode on the server faster, more flexible and efficient.

    Currently, the api doc for this class is hard to wade through given all of these concerns implemented in one class. When we implement SC in SC, we can fix this with layered doc :)

    • Field Detail

      • trace

        public static boolean trace
      • verbose

        public static boolean verbose
      • tagName

        public java.lang.String tagName
      • selfClose

        public java.lang.Boolean selfClose
      • closeTagName

        public java.lang.String closeTagName
      • hiddenChildren

        public transient SemanticNodeList<java.lang.Object> hiddenChildren
      • startTagValid

        public transient boolean startTagValid
        Tags are rendered in two different phases - 1) the start tag, which includes the attributes and 2) the body. These flags indicate if the current rendered version is known to be stale for each of these two phases
      • bodyValid

        public transient boolean bodyValid
        Tags are rendered in two different phases - 1) the start tag, which includes the attributes and 2) the body. These flags indicate if the current rendered version is known to be stale for each of these two phases
      • bodyTxtValid

        public transient boolean bodyTxtValid
        Like bodyValid but applies only to changes made this tag's body, not including child tag bodies. When a child tag's bodyTxt changes, we set both this and bodyValid = false. For the parent nodes, we only make bodyValid = false. This way, we can walk down the tree looking for bodyValid=false nodes, to ultimately find child nodes which have actually changed where bodyTxtValid = false for an incremental update.
      • repeatTagsValid

        public transient boolean repeatTagsValid
        A separate flag to handle the state where we know repeat has changed but don't know if the bodyTxt of the list has changed or just an element
      • refreshTagsScheduled

        public transient boolean refreshTagsScheduled
      • refreshTagsNeeded

        public transient boolean refreshTagsNeeded
      • startTagCache

        public transient java.lang.String startTagCache
      • bodyCache

        public transient java.lang.String bodyCache
      • staticContentOnly

        public transient boolean staticContentOnly
        When processing a template once we hit a parent node whose type is not available in this mode, we insert a dummy node and only process static portion of the template until some tag sets exec="process" to turn back on processing
      • wrap

        public transient boolean wrap
        For repeat tags, with wrap=true, the body repeats without a wrapper tag. Instead a wrapper tag based using this element's tag name wraps all of the repeated content without a separate tag wrapping each element. (e.g. if this is a div tag:
        body for repeat[0]...body for repeat[n]
        ) With wrap=false, there is no outer wrapper tag. Just the body tags are rendered using this tag's name:
        body for repeat[0]
        ...
        body with repeat[n]
      • serverContent

        public transient boolean serverContent
        This property is set to true for the client version of the tag objects on tags whose content is defined on the server, not dynamically by running the Javascript code on the client. This property is not the same as setting exec="server" which indicates that the tag object itself should not be included in the client version at all. With serverContent=true, a stub tag object is included in the client (i.e. no children). Instead, the client side serverContent=true tag knows to just grab the innerHTML of it's tag and re-insert it if the parent node is trying to refresh. You need to use serverContent=true when you want that content to be included in the static HTML file for the client-only version. For example, you'd set serverContent on tags which generate the script tags to include javascript.
      • serverTag

        public transient boolean serverTag
        Set to true in the runtime version of the tag object for tags which are to be run on the server only
      • refreshBindings

        public transient boolean refreshBindings
        Set to true to call 'refreshBindings' before each page refresh - in case there are events missing for a binding
      • refreshOnLoad

        public transient boolean refreshOnLoad
        Set to false to prevent the page from being re-drawn in JS during the initial page load
      • repeatSync

        public transient boolean repeatSync
      • allowBehaviorTagsInContent

        public static boolean allowBehaviorTagsInContent
        For an schtml page with a behavior tag like input or submit that's used in the context where the code expects a String, an error is generated unless this global flag is set to true. We need this option set to true for documenting snippets of schtml, and it's possible in code you'd want to use schtml to generate these tags. There's not much harm to set this to true so it's a global flag. It does mean these behavior tags won't work when there are in this context - you'll just see the HTML string generated.
      • fromElement

        public transient Element fromElement
      • execFlags

        public transient int execFlags
      • HTMLClass

        public transient java.lang.String HTMLClass
        Returns the set of types which are either mainInit elements (for JS) or which have the URL annotation (for server based components)
      • style

        public transient java.lang.String style
      • serverTagInfo

        public ServerTag serverTagInfo
      • REFRESH_TAG_PRIORITY

        public static final int REFRESH_TAG_PRIORITY
        This is a step we do after refreshing all of the bindings before rendering to improve incremental refresh efficiency. If any 'repeat' properties have changed, we'll now go through and determine if the repeat tag's body has changed or perhaps we can handle any repeat tag changes incrementally through the children. This should be called before refreshTags which triggers the innerHTML property changes for incremental refresh. This is a simple approach for now until we handle selective update of the elements of the list. Right now if the class or structure of a child has changed,
        See Also:
        Constant Field Values
      • AFTER_REFRESH_TAG_PRIORITY

        public static final int AFTER_REFRESH_TAG_PRIORITY
        See Also:
        Constant Field Values
    • Constructor Detail

      • Element

        public Element()
      • Element

        public Element​(TypeDeclaration concreteType,
                       Element parent,
                       java.lang.String id,
                       java.lang.Object repeatVar,
                       int repeatIx)
      • Element

        public Element​(Element parent,
                       java.lang.String id,
                       java.lang.Object repeatVar,
                       int repeatIx)
    • Method Detail

      • setVisible

        public void setVisible​(boolean vis)
      • isVisible

        public boolean isVisible()
        Is this tag visible. Note: using isVisible here to match swing's isVisible
      • getBodyOnly

        public boolean getBodyOnly()
      • setBodyOnly

        public void setBodyOnly​(boolean nbo)
      • setReplaceWith

        public void setReplaceWith​(Element replTag)
      • getReplaceWith

        public Element getReplaceWith()
      • setRepeat

        public void setRepeat​(java.lang.Object rv)
        Typed either as a List<RE> or an RE[] This instance can be used in two modes - one as the controller of the array in which case repeat is set. The other when it represents the element of the array and repeatVar is set to the element of the array.
      • getRepeat

        public java.lang.Object getRepeat()
      • setRepeatVar

        public void setRepeatVar​(RE rv)
      • getRepeatVar

        public RE getRepeatVar()
      • setRepeatIndex

        public void setRepeatIndex​(int ix)
      • getRepeatIndex

        public int getRepeatIndex()
      • getRepeatVarName

        public java.lang.String getRepeatVarName()
      • setRepeatVarName

        public void setRepeatVarName​(java.lang.String rvn)
      • isRepeatElement

        public boolean isRepeatElement()
      • allocUniqueId

        public java.lang.String allocUniqueId​(java.lang.String name)
      • initUniqueId

        public void initUniqueId()
        Should be called after the parentNode is set on tags that are created in code (e.g. repeat tags) that become part of the page so that we can be sure to add a suffix for ids that are not unique in the page.
      • isClientServerSpecific

        public boolean isClientServerSpecific()
        If this only runs on one side or the other, it's a client/server specific node and gets named differently
      • getNeedsClientServerSpecificId

        public boolean getNeedsClientServerSpecificId()
      • isSingletonTag

        public boolean isSingletonTag()
      • enableRepeatSync

        public void enableRepeatSync()
      • allocUniqueId

        public java.lang.String allocUniqueId​(java.lang.String name,
                                              boolean clientServerSpecific)
      • getDefinedExecFlags

        public int getDefinedExecFlags()
      • getComputedExecFlags

        public int getComputedExecFlags()
        Returns the derived execFlags for this tag - i.e. the value of the exec=".." attribute or the inherited value if it's not set, defaulting to "ExecAll"
      • isAbstract

        public boolean isAbstract()
      • execOmitObject

        public boolean execOmitObject()
      • needsObjectDef

        public boolean needsObjectDef()
      • needsObject

        public boolean needsObject()
        Returns true if this tag needs an object definition
      • displayTypeError

        public boolean displayTypeError​(java.lang.String... args)
        Description copied from class: JavaSemanticNode
        Used for errors involving type resolution. These errors can be disabled during certain operations like transform
        Overrides:
        displayTypeError in class Node
      • selfClosed

        public boolean selfClosed()
      • getAllChildTagsWithName

        public Element[] getAllChildTagsWithName​(java.lang.String name)
      • getInheritedChildTagsWithName

        public Element[] getInheritedChildTagsWithName​(java.lang.String name)
      • getChildTagsWithName

        public Element[] getChildTagsWithName​(java.lang.String name)
      • getChildTags

        public Element[] getChildTags()
      • addChildTagsWithName

        public static java.util.ArrayList<Element> addChildTagsWithName​(java.util.ArrayList<Element> res,
                                                                        SemanticNodeList<java.lang.Object> childList,
                                                                        java.lang.String name)
      • getDefaultObjectName

        public java.lang.String getDefaultObjectName()
      • getRawObjectName

        public java.lang.String getRawObjectName()
      • getObjectName

        public java.lang.String getObjectName()
        If needsObject is true, the object name to use for this tag. The rules are: name attribute (if set). if id is set - either id or id0, id1, etc. if this id is not unique at this tag level. If neither name nor id, then tagName or tagName0, tagName1 If the tag is a child of a tag which does not need the object, that tag's object name is prepended onto this one.
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
      • getAttribute

        public Attr getAttribute​(java.lang.String name)
      • getBooleanAttribute

        public boolean getBooleanAttribute​(java.lang.String name)
      • getElementId

        public java.lang.String getElementId()
      • lowerTagName

        public java.lang.String lowerTagName()
      • needsId

        public boolean needsId()
      • needsAutoId

        public boolean needsAutoId​(java.lang.String id)
      • inheritsId

        public boolean inheritsId​(java.lang.String id)
      • addExtraAttributes

        public java.lang.StringBuilder addExtraAttributes​(java.lang.StringBuilder str,
                                                          SemanticNodeList<Expression> strExprs)
      • getOutputExpression

        public Expression getOutputExpression()
      • execTagStatements

        public void execTagStatements​(java.lang.StringBuilder str,
                                      ExecutionContext ctx)
      • addToOutputMethod

        public int addToOutputMethod​(TypeDeclaration parentType,
                                     BlockStatement block,
                                     Template template,
                                     int doFlags,
                                     SemanticNodeList<java.lang.Object> uniqueChildren,
                                     int initCt,
                                     boolean statefulContext)
        This method gets called from two different contexts and for tags which are both dynamic and static so it's a little confusing. For "OutputAll" when this tag needs an object, it is added to the parent's outputTag method objectName.outputTag(sb, ctx); For static tags (deprecated), we add the expressions needed to render this tag as content in the parent method. For needsObject tags, we also call this method to generate the outputStart and outputBody methods in separate passes. The content for the object then gets added to the outputStart and outputBody methods of the generated object for this tag.
      • getExtendsType

        public JavaType getExtendsType​(java.lang.String parentPrefix,
                                       java.lang.String rootTypeName)
      • convertExtendsTypeToJavaType

        public JavaType convertExtendsTypeToJavaType​(java.lang.Object tagType,
                                                     boolean addTypeVar,
                                                     java.lang.String parentPrefix,
                                                     java.lang.String rootTypeName)
      • getDeclaredExtendsTypeDeclaration

        public java.lang.Object getDeclaredExtendsTypeDeclaration()
      • getSystemTagClassForTagName

        public static java.lang.Class getSystemTagClassForTagName​(java.lang.String tagName)
      • getDefaultExtendsTypeDeclaration

        public java.lang.Object getDefaultExtendsTypeDeclaration​(boolean processable)
      • getExtendsTypeDeclaration

        public java.lang.Object getExtendsTypeDeclaration()
      • invalidateStartTag

        public void invalidateStartTag()
      • invalidateBody

        public void invalidateBody()
      • childInvalidated

        public void childInvalidated()
      • invalidateRepeatTags

        public void invalidateRepeatTags()
      • getDerivedElement

        public Element getDerivedElement()
      • getExtendsElement

        public Element getExtendsElement()
      • getImplementsElements

        public Element[] getImplementsElements()
      • isModifyingElement

        public boolean isModifyingElement()
      • sortChildrenByBeforeAfter

        public void sortChildrenByBeforeAfter​(SemanticNodeList<java.lang.Object> children)
      • getObjChildren

        public java.lang.Object[] getObjChildren​(boolean create)
        Specified by:
        getObjChildren in interface IObjChildren
      • getStateless

        public boolean getStateless()
      • getNodeContainsPart

        public boolean getNodeContainsPart​(ISrcStatement partNode)
        This handles breakpoints at the tag level. To find the matching source statement, need to check our attributes and sub-tags
        Specified by:
        getNodeContainsPart in interface ISrcStatement
      • getNumStatementLines

        public int getNumStatementLines()
        Description copied from interface: ISrcStatement
        For breakpoint and navigation purposes, how many lines does this statement take up - usually it's 1
        Specified by:
        getNumStatementLines in interface ISrcStatement
      • getSimpleChildValue

        public java.lang.String getSimpleChildValue​(java.lang.String childName)
      • getSingleChildTag

        public Element getSingleChildTag​(java.lang.String name)
      • getBodyAsString

        public java.lang.String getBodyAsString()
      • addMixinProperties

        public void addMixinProperties​(BodyTypeDeclaration tagType)
        Called during transform to set properties specific to the java version of the StrataCode. Used to modify the generated Java based on the merged version of the type, not know in convertToObject. Specifically because the exec attribute can affect the tag properties, but is not know until transform type because we create the tagObject during init. TODO: could be implemented as a mixinTemplate but since we have the element in the tagObject this is easier
      • getRepeatObjectName

        public java.lang.String getRepeatObjectName()
      • isPageElement

        protected boolean isPageElement()
        Are we the top-level page element
      • mapAttributeToProperty

        public static java.lang.String mapAttributeToProperty​(java.lang.String name)
      • mapPropertyToAttribute

        public static java.lang.String mapPropertyToAttribute​(java.lang.String name)
      • getPossibleAttributes

        public java.util.Set<java.lang.String> getPossibleAttributes()
      • getPossibleAttributesForTag

        public static java.util.Set<java.lang.String> getPossibleAttributesForTag​(java.lang.String tagName)
      • isHtmlAttribute

        public boolean isHtmlAttribute​(java.lang.String name)
      • isLinkAttribute

        public boolean isLinkAttribute​(java.lang.String name)
      • isRefreshAttribute

        public boolean isRefreshAttribute​(java.lang.String name)
      • isReadOnlyAttribute

        public boolean isReadOnlyAttribute​(java.lang.String name)
      • output

        public java.lang.StringBuilder output()
      • output

        public java.lang.StringBuilder output​(OutputCtx ctx)
      • output_c

        public java.lang.StringBuilder output_c()
        Just like output but when invoked on the server, evaluates the output on the client as a remote method call
      • repeatTagsChanged

        public void repeatTagsChanged()
        A hook for tag objects to override to be notified when the repeat tags have has been updated
      • anyChangedRepeatTags

        public boolean anyChangedRepeatTags()
        Returns true if any values have been removed, added or replaced in the repeat property for this tag.
      • syncRepeatTags

        public boolean syncRepeatTags​(java.lang.Object repeatVal)
      • appendElement

        public void appendElement​(Element elem)
      • insertElement

        public void insertElement​(Element elem,
                                  int ix)
      • removeElement

        public void removeElement​(Element elem,
                                  int ix)
      • removeRepeatElement

        public void removeRepeatElement​(Element oldTag)
      • moveElement

        public void moveElement​(Element elem,
                                int fromIx,
                                int toIx)
      • initChildren

        public void initChildren()
        Before we can run the sync code this method gets called so we can populate any components
        Specified by:
        initChildren in interface IChildInit
      • destroyRepeatTags

        public void destroyRepeatTags()
      • rebuildRepeat

        public void rebuildRepeat()
      • refreshRepeat

        public void refreshRepeat​(boolean noRefresh)
        For application code to manually synchronize the repeat state of the tags. TODO: do we need to support noRefresh on the server? I think we always refresh at the end of the request so maybe it's not needed here?
      • isRepeatTag

        public boolean isRepeatTag()
      • outputTag

        public void outputTag​(java.lang.StringBuilder sb,
                              OutputCtx ctx)
      • outputStartTag

        public void outputStartTag​(java.lang.StringBuilder sb,
                                   OutputCtx ctx)
      • outputBody

        public void outputBody​(java.lang.StringBuilder sb,
                               OutputCtx ctx)
      • markBodyValid

        public void markBodyValid​(boolean val)
      • markStartTagValid

        public void markStartTagValid​(boolean val)
      • outputEndTag

        public void outputEndTag​(java.lang.StringBuilder sb,
                                 OutputCtx ctx)
      • getInnerHTML

        public java.lang.String getInnerHTML()
        Returns the current body contents by regenerating it - so the Element api mirrors the DOM api and for synchronization. This is read-only by default on the server but used for serverTags to transfer a change of body to the client.
      • setInnerHTML

        public void setInnerHTML​(java.lang.String htmlTxt)
      • getStartTagTxt

        public java.lang.String getStartTagTxt()
        Returns the current contents of the startTagTxt, composed of the tag name and attributes - e.g. <input id="foo">
      • setStartTagTxt

        public void setStartTagTxt​(java.lang.String newStartTxt)
      • setTextContent

        public void setTextContent​(java.lang.String tc)
      • isEmptyBody

        public boolean isEmptyBody()
      • getTextContent

        public java.lang.String getTextContent()
      • getChildrenByIdAndType

        public Element[] getChildrenByIdAndType​(java.lang.String id,
                                                java.lang.Class type)
      • getAltChildren

        public Element[] getAltChildren()
      • getChildrenById

        public Element[] getChildrenById​(java.lang.String id)
      • addChildListToByIdMap

        public void addChildListToByIdMap​(java.lang.Object[] childList,
                                          java.lang.String id)
      • setId

        public void setId​(java.lang.String _id)
      • getId

        public java.lang.String getId()
      • getMergeAttribute

        public MergeMode getMergeAttribute​(java.lang.String attName)
      • getSubTagMerge

        public MergeMode getSubTagMerge()
      • getRawTagMerge

        public MergeMode getRawTagMerge()
      • getBodyMergeMode

        public MergeMode getBodyMergeMode()
      • getRawSubTagMerge

        public MergeMode getRawSubTagMerge()
      • getTagMergeMode

        public MergeMode getTagMergeMode()
      • findMethod

        public java.lang.Object findMethod​(java.lang.String name,
                                           java.util.List<? extends java.lang.Object> parametersOrExpressions,
                                           java.lang.Object fromChild,
                                           java.lang.Object refType,
                                           boolean staticOnly,
                                           java.lang.Object inferredType)
        Overrides:
        findMethod in class JavaSemanticNode
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getJSFiles

        public java.util.List<java.lang.String> getJSFiles()
      • getRelFileList

        public java.util.List<java.lang.String> getRelFileList​(java.util.List<java.lang.String> fileList)
      • getRelURL

        public static java.lang.String getRelURL​(java.lang.String srcRelPath,
                                                 java.lang.String urlPath)
        This converts relative URL paths in the context of this element. The goal is that a path relative to a template in one directory can be extended, or included into a template in a different directory. You call it with the relative path to the current source file (which is the context URLs in that file will be evaluated in, along with the relative URL to be translated. It looks at the Window.location.pathname to determine the current URL from the browser's perspective and returns a path to this supplied urlPath in the context of the browser's URL. TODO: should we have a mode where we specify a mapping from urls specified as path names to some other abstract name. If so, we can use that table here to figure out which external URL corresponds to a given internal path.
      • getRelPrefix

        public static java.lang.String getRelPrefix​(java.lang.String srcRelPath)
      • getRelPrefix

        public static java.lang.String getRelPrefix​(Window window,
                                                    java.lang.String srcRelPath)
        In the generated code, we'll call this method to find the relative directory prefix to prepend (if any) for a reference from this src path in the tree.
      • getAllJSFiles

        public java.util.List<java.lang.String> getAllJSFiles()
      • getHTMLClass

        public java.lang.String getHTMLClass()
      • setHTMLClass

        public void setHTMLClass​(java.lang.String cl)
      • getStyle

        public java.lang.String getStyle()
      • setStyle

        public void setStyle​(java.lang.String s)
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class SemanticNode
      • getFullTypeName

        public java.lang.String getFullTypeName()
      • getOffsetWidth

        public int getOffsetWidth()
      • setOffsetWidth

        public void setOffsetWidth​(int ow)
      • getOffsetHeight

        public int getOffsetHeight()
      • setOffsetHeight

        public void setOffsetHeight​(int oh)
      • getOffsetTop

        public int getOffsetTop()
      • setOffsetTop

        public void setOffsetTop​(int ot)
      • getOffsetLeft

        public int getOffsetLeft()
      • setOffsetLeft

        public void setOffsetLeft​(int ol)
      • getClientWidth

        public int getClientWidth()
      • setClientWidth

        public void setClientWidth​(int iw)
      • getClientHeight

        public int getClientHeight()
      • setClientHeight

        public void setClientHeight​(int ih)
      • getScrollWidth

        public int getScrollWidth()
      • setScrollWidth

        public void setScrollWidth​(int iw)
      • getScrollHeight

        public int getScrollHeight()
      • setScrollHeight

        public void setScrollHeight​(int ih)
      • getPreviousElementSibling

        public Element getPreviousElementSibling()
      • getHovered

        public boolean getHovered()
      • setHovered

        public void setHovered​(boolean h)
      • escAtt

        public static java.lang.String escAtt​(java.lang.CharSequence in,
                                              boolean singleQuote)
      • escBody

        public static java.lang.String escBody​(java.lang.Object in)
      • resetTagObject

        public void resetTagObject()
      • refreshNode

        public Element refreshNode()
        Description copied from class: JavaSemanticNode
        Needs to be implemented for IDE support on nodes which can be referenced outside of the same file. If the model in which this references lives has been removed (or really replaced by another version of the same model), we need to find the node in the other model that corresponds to this node and return it.
        Specified by:
        refreshNode in interface ISemanticNode
        Overrides:
        refreshNode in class JavaSemanticNode
      • suggestCompletions

        public int suggestCompletions​(java.lang.String prefix,
                                      java.lang.Object currentType,
                                      ExecutionContext ctx,
                                      java.lang.String command,
                                      int cursor,
                                      java.util.Set<java.lang.String> candidates,
                                      java.lang.Object continuation,
                                      int max)
        Description copied from class: JavaSemanticNode
        Used to create a list of suggestions to complete this node. Returns the character offset into the parse-tree (or command string if there's no parse tree) where the completion should start. Parameters: prefix is the starting sequence of chars in the identifier to complete. All candidates returned will start with the prefix if it's provided. currentType provides a context for the current type if the node is not embedded in a model - i.e. an identifier expression on its own but known to live in a specific type If ctx is not null, it's an execution context we can use to evaluate the "root value" - i.e. in a.b the value of the variable 'a' is evaluated and the returned instance can be used to suggest candidates. This is useful in live-programming situations. The command String parameter is used to determine the offset returned for where the completion starts for the case where the parseNode tree is not available.
        Overrides:
        suggestCompletions in class JavaSemanticNode
      • addNodeCompletions

        public java.lang.String addNodeCompletions​(JavaModel origModel,
                                                   JavaSemanticNode origNode,
                                                   java.lang.String extMatchPrefix,
                                                   int offset,
                                                   java.lang.String dummyIdentifier,
                                                   java.util.Set<java.lang.String> candidates,
                                                   boolean nextNameInPath,
                                                   int max)
        Description copied from class: JavaSemanticNode
        This works like suggestCompletions but designed to conform to the requirements of IntelliJ. We don't support the live programming use case in this version and have access (possibly) to the original model and original node which most closely approximates this node which is being parsed (so we can use more context to do a better job of matching because those values are all resolved).
        Overrides:
        addNodeCompletions in class JavaSemanticNode
      • setNodeName

        public void setNodeName​(java.lang.String newName)
        Specified by:
        setNodeName in interface INamedNode
      • getNodeName

        public java.lang.String getNodeName()
        Specified by:
        getNodeName in interface INamedNode
      • stop

        public void stop()
        This method has to be here so we properly remap JS references to here instead of SemanticNode.stop which does not exist in the JS runtime
        Specified by:
        stop in interface ILifecycle
        Specified by:
        stop in interface IStoppable
        Overrides:
        stop in class Node
      • getElementTypeDeclaration

        public TypeDeclaration getElementTypeDeclaration()
      • getCloseStartTagOffset

        public int getCloseStartTagOffset()
      • updateElementIndexes

        public void updateElementIndexes​(int fromIx)
      • deepCopy

        public Element deepCopy​(int options,
                                java.util.IdentityHashMap<java.lang.Object,​java.lang.Object> oldNewMap)
        Description copied from interface: ISemanticNode
        Performs a deep copy of the semantic node tree. Subclasses should do their own copy implementation to decide what else to copy. Uses the copy options flags above. The default, with 0, just copies the semantic node information so you get a new tree like's it parsed but without parse node info. Use that mode only if you want to throw away the original source and regenerate it all from scratch. Otherwise, you can copy the parse tree as well. If you want to copy the semantic node's initial resolved state - including it's init/start, etc. and whatever the subclass adds to that copy, use CopyState or CopyNormal - for both parse nodes and state.
        Specified by:
        deepCopy in interface ISemanticNode
        Overrides:
        deepCopy in class SemanticNode
      • isEventSource

        public boolean isEventSource()
      • addServerTagFlags

        public void addServerTagFlags​(ServerTag st)
      • getServerTagInfo

        public ServerTag getServerTagInfo​(java.lang.String id)
      • getCustomServerTagProps

        public java.util.Map<java.lang.String,​IBeanMapper> getCustomServerTagProps()
      • addServerTags

        public void addServerTags​(ScopeDefinition scopeDef,
                                  ServerTagContext stCtx,
                                  boolean defaultServerTag)
        Walks the tree represented by this element and adds or updates the server tag information necessary for this tag. The scopeDef provided is the scope to store the server tag instances - usually 'window' for stateful pages but for request pages, we need to store this in the request scope and re-create it from scratch on each request.
      • updateServerTag

        public static Element updateServerTag​(Element tagObj,
                                              java.lang.String id,
                                              ServerTag stag,
                                              boolean addSync)
        Called on the client only. It will create or update a tag object based on the DOM element id. When a ServerTag is provided, it provides additional info on what the server needs the client to do, in order to synchronize properties of the server tag object. For example, it includes properties with bindings on the server the client knows which DOM events to listen to, in order to send the appropriate changes to the server.
      • scheduleRefresh

        public static void scheduleRefresh()
        Call this method in order to indicate some page state might have changed that could affect the need to call refreshBindings if the page object is marked
      • scheduleRefreshTags

        public void scheduleRefreshTags()
      • refreshTags

        public void refreshTags​(boolean parentBodyChanged)
      • resetPageContext

        public void resetPageContext()
        This is called when a tagObject in a shared scope is accessed from a new child scope. We need to refresh the page in this context so that all referenced objects that need to be synchronized on the client are accessed via the "accessSyncInst" accessHook.
      • initSync

        public static void initSync()
        Can be called at startup by frameworks to allow synchronization of tag objects. This is helpful for 'serverTags' which are always rendered on the server, but the important properties can be synchronized to the client and parsed and managed with a smaller code footprint, or to mix and match Javascript client tag objects with html server-side rendered objects in a single page.
      • isCacheEnabled

        public boolean isCacheEnabled()
      • displayError

        public void displayError​(java.lang.String... args)
        Description copied from class: JavaSemanticNode
        Used for errors that should always be displayed
        Overrides:
        displayError in class Node
      • getNameForChild

        public java.lang.String getNameForChild​(java.lang.Object child)
        Specified by:
        getNameForChild in interface INamedChildren
      • getChildForName

        public java.lang.Object getChildForName​(java.lang.String name)
        Specified by:
        getChildForName in interface INamedChildren
      • getChangedCount

        public java.lang.Object getChangedCount()
      • setChangedCount

        public void setChangedCount​(int _changedCount)
      • setCache

        public void setCache​(CacheMode m)
      • getInitScript

        public java.lang.String getInitScript()
      • setInitScript

        public void setInitScript​(java.lang.String is)
      • getStopScript

        public java.lang.String getStopScript()
      • setStopScript

        public void setStopScript​(java.lang.String is)