node structure from htmlparser
@param page
@param startPosition
@param endPosition
@class KISSY.HtmlParse.Node
 
node structure from htmlparser
@param page
@param startPosition
@param endPosition
@class KISSY.HtmlParse.Node
177353
function Node(page, startPosition, endPosition) {
        this.parentNode = null;
        this.page = page;
        this.startPosition = startPosition;
        this.endPosition = endPosition;
        this.nodeName = null;
        this.previousSibling = null;
        this.nextSibling = null;
    }
123369
public static void destroyAppContext(Page page) {
        XmlWebApplicationContext appContext = getAppContext(page);
        
        if (appContext != null) {
            appContext.close();
        }
    }
650425
@Override
    public synchronized void free(Page page) {
        if (page.isFreeable()) {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Freeing a {}B buffer from chunk {} &{}", DebuggingUtils.toBase2SuffixedString(page.size()), page.index(), page.address());
            }
            markAllAvailable();
            sliceAllocators.get(page.index()).free(page.address(), page.size());
            victims.get(page.index()).remove(page);
            victimAllocators.get(page.index()).tryFree(page.address(), page.size());
            if (!fallingThresholds.isEmpty()) {
              long allocated = getAllocatedSize();
              fireThresholds(allocated + page.size(), allocated);
            }
        }
    }
323019
function processCompositions( topPage, pageRef ) {

      return processNestedCompositions( topPage, pageRef, null, [] );

      function processNestedCompositions( page, pageRef, instanceId, compositionChain ) {

         page.debugInfo = {
            id: instanceId,
            name: page.name,
            path: page.path,
            //validate: validators.features.pages[ page.name ],
            compositions: [],
            [ FLAT ]: page.definition,
            [ COMPACT ]: deepClone( page.definition )
         };

         let promise = Promise.resolve();

         forEachArea( page, (items, areaName) => {
            items.slice().reverse().forEach( (item, index) => {
               if( item.enabled === false ) {
                  return;
               }
               ensureItemHasId( item );
               if( !has( item, 'composition' ) ) {
                  return;
               }

               const compositionRef = item.composition;
               if( compositionChain.indexOf( compositionRef ) !== -1 ) {
                  const chainString = compositionChain.concat( [ compositionRef ] ).join( ' -> ' );
                  const message = `Cycle in compositions detected: ${chainString}`;
                  throw formatError( topPage, message );
               }

               const itemPointer = `/areas/${areaName}/${items.length - index - 1}`;

               // Compositions must be loaded sequentially, because replacing the widgets in the page needs to
               // take place in order. Otherwise the order of widgets could be messed up.
               promise = promise
                  .then( () => prefixCompositionIds( lookup( compositionRef ), item ) )
                  .then( composition =>
                     processCompositionExpressions( composition, item, itemPointer, pageRef )
                  )
                  .then( composition => {
                     const chain = compositionChain.concat( composition.name );
                     return processNestedCompositions( composition, compositionRef, item.id, chain );
                  } )
                  .then( composition => {
                     page.debugInfo.compositions.push( composition.debugInfo );
                     mergeCompositionAreasWithPageAreas( composition, page.definition, items, item );
                     validateWidgetItems( composition, compositionRef );
                  } );
            } );
         } );

         return promise
            .then( () => page );
      }
   }
1275341
public void startWizard(AbstractWizardPage startPage) {
		if (startPage == null) {
			throw new IllegalArgumentException("startPage can't be null");
		}
		if (currentPage != null) {
			wizard.getWizardPageContainer().remove(currentPage);
			pageHistory.clear();
			currentPage = null;
		}
		showNextPage(startPage);
	}
266234
final public void addPosition(int position) {
    if (tokenPosition == null) {
      tokenPosition = new MtasPosition(position);
    } else {
      tokenPosition.add(position);
    }
  }
1173451
private boolean parseInstructions(final Page page, final DOMNode node, final String src, final boolean apply) throws FrameworkException {

		this.source          = src.toCharArray();
		this.sourceLength    = src.length();
		this.currentPosition = 0;
		boolean hit          = false;

		while (currentPosition < sourceLength) {

			if (findSequence("@structr:")) {

				// comment contains instruction, can be removed upon import
				hit = true;

				// currentPosition is now at the first letter of the actual instruction
				final String token    = getNextToken();
				final Handler handler = handlers.get(token);
				String parameters     = null;

				if (handler != null) {

					// additional characters..
					if (hasMore()) {

						final char c = source[currentPosition++];
						switch (c) {

							case '(':
								parameters = getUntilClosingParenthesis();
								break;

							case ',':
								// next instruction, ignore
								break;
						}
					}

					// only apply if instructed to (can be used to check
					// if the comment source actually contains instructions)
					if (apply) {

						handler.apply(page, node, parameters);
					}

				} else {

					logger.warn("Unknown token {}, expected one of {}.", new Object[] { token, handlers.keySet() });
					break;
				}
			}
		}

		return hit;
	}
1253000
public void select(int start, int end) {
        int docEnd = textArea.getDocument().getLength();
        textArea.select(docEnd, docEnd);
        textArea.select(start, end);
    }
849784
function position() {
    /**
     * Find our nearest block level parent and access its lines property.
     * @var Block_Frame_Decorator
     */ 
    $p = $this->_frame->find_block_parent();

    // Debugging code:

//     pre_r("\nPositioning:");
//     pre_r("Me: " . $this->_frame->get_node()->nodeName . " (" . spl_object_hash($this->_frame->get_node()) . ")");
//     pre_r("Parent: " . $p->get_node()->nodeName . " (" . spl_object_hash($p->get_node()) . ")");

    // End debugging

    if ( !$p )
      throw new DOMPDF_Exception("No block-level parent found.  Not good.");

    $f = $this->_frame;
    
    $cb = $f->get_containing_block();
    $line = $p->get_current_line_box();

    // Skip the page break if in a fixed position element
    $is_fixed = false;
    while($f = $f->get_parent()) {
      if($f->get_style()->position === "fixed") {
        $is_fixed = true;
        break;
      }
    }

    $f = $this->_frame;

    if ( !$is_fixed && $f->get_parent() &&
         $f->get_parent() instanceof Inline_Frame_Decorator &&
         $f->is_text_node() ) {
      
      $min_max = $f->get_reflower()->get_min_max_width();
      
      // If the frame doesn't fit in the current line, a line break occurs
      if ( $min_max["min"] > ($cb["w"] - $line->left - $line->w - $line->right) ) {
        $p->add_line();
      }
    }
    
    $f->set_position($cb["x"] + $line->w, $line->y);

  }
798516
public void parseModelPage(I_CmsXmlContentLocation node) throws CmsException {

        String page = getString(node.getSubValue(N_PAGE));
        I_CmsXmlContentValueLocation disabledLoc = node.getSubValue(N_DISABLED);
        boolean disabled = (disabledLoc != null) && Boolean.parseBoolean(disabledLoc.asString(m_cms));
        I_CmsXmlContentValueLocation defaultLoc = node.getSubValue(N_IS_DEFAULT);
        boolean isDefault = (defaultLoc != null) && Boolean.parseBoolean(defaultLoc.asString(m_cms));
        CmsModelPageConfig modelPage = new CmsModelPageConfig(m_cms.readResource(page), isDefault, disabled);
        m_modelPageConfigs.add(modelPage);

    }
819808
protected void parseBegin() {
        BeginNode beginNode = new BeginNode();
        peek().addChild(beginNode);
        push(beginNode);
        parseEnd();
    }
315039
public void onNodeStarted(final IExecutionNode node) {

        if (!node.equals(this.theLastNode)) {

            if (this.theLastNode != null) {
                printStarted("Starting: " + format(this.theLastNode));
            }

            this.theLastNode = node;
        } else {
            // not sure how this would happen
            printStarted("Starting: " + format(node));
        }

    }
1251485
public void closeElement() throws XMLException, IOException {
		if (!Type.START_ELEMENT.equals(event.type))
			throw new IOException("Invalid call of closeElement: it must be called on a start element");
		if (event.isClosed) return;
		ElementContext ctx = event.context.getFirst();
		do {
			try { next(); }
			catch (EOFException e) {
				throw new XMLException(getPosition(), "Unexpected end", "closeElement(" + ctx.text.asString() + ")");
			}
			if (Type.END_ELEMENT.equals(event.type)) {
				if (event.context.getFirst() == ctx)
					return;
			}
		} while (true);
	}
1244432
void setPage(Page page) {
		synchronized(lock) {
			checkNotFrozen();
			if(this.page != null) throw new IllegalStateException("element already has a page: " + this);
			this.page = page;
		}
		assert checkPageAndParentElement();
	}
933512
@Override
	public void apply(final App app, final Page sourcePage, final Page newPage) throws FrameworkException {

		final InsertPosition insertPosition = findInsertPosition(sourcePage, parentHash, siblingHashes, newNode);
		if (insertPosition != null) {

			final DOMNode parent  = insertPosition.getParent();
			final DOMNode sibling = insertPosition.getSibling();

			if (parent != null && !parent.isSynced()) {

				if (sourcePage != null) {
					sourcePage.adoptNode(newNode);
				}

				parent.insertBefore(newNode, sibling);

				// make existing node known to other operations
				hashMappedExistingNodes.put(newNode.getIdHashOrProperty(), newNode);

				// remove children of new node so that existing nodes can be moved later
				for (final RelationshipInterface childRel : newNode.getChildRelationships()) {
					app.delete(childRel);
				}
			}
		}
	}
414079
public void setPage(int page) {

        if (m_collectorParameter != null) {
            int pos = m_collectorParameter.indexOf(I_CmsListResourceCollector.PARAM_PAGE);
            if (pos >= 0) {
                String params = "";
                int endPos = m_collectorParameter.indexOf(I_CmsListResourceCollector.SEP_PARAM, pos);
                if (pos > 0) {
                    pos -= I_CmsListResourceCollector.SEP_PARAM.length(); // remove also the SEP_PARAM
                    params += m_collectorParameter.substring(0, pos);
                }
                if (endPos >= 0) {
                    if (pos == 0) {
                        endPos += I_CmsListResourceCollector.SEP_PARAM.length(); // remove also the SEP_PARAM
                    }
                    params += m_collectorParameter.substring(endPos, m_collectorParameter.length());
                }
                m_collectorParameter = params;
            }
        }
        if (m_collectorParameter == null) {
            m_collectorParameter = "";
        } else if (m_collectorParameter.length() > 0) {
            m_collectorParameter += I_CmsListResourceCollector.SEP_PARAM;
        }
        m_collectorParameter += I_CmsListResourceCollector.PARAM_PAGE + I_CmsListResourceCollector.SEP_KEYVAL + page;
        synchronized (this) {
            m_resources = null;
        }
    }
1097388
public void addChild(String text, Position position) {
        this.children.add(new Child(text, position));
    }