Tabnine Logo
XDOM.replaceChild
Code IndexAdd Tabnine to your IDE (free)

How to use
replaceChild
method
in
org.xwiki.rendering.block.XDOM

Best Java code snippets using org.xwiki.rendering.block.XDOM.replaceChild (Showing top 1 results out of 315)

origin: org.xwiki.platform/xwiki-platform-rendering-wikimacro-store

/**
 * Clone and filter wiki macro content depending of the context.
 * 
 * @param context the macro execution context
 * @return the cleaned wiki macro content
 */
private XDOM prepareWikiMacroContent()
{
  XDOM xdom = this.wikimacro.getContent().clone();
  // Macro code segment is always parsed into a separate xdom document. Now if this code segment starts with
  // another macro block, it will always be interpreted as a block macro regardless of the current wiki macro's
  // context (because as far as the nested macro is concerned, it starts on a new line). This will introduce
  // unnecessary paragraph elements when the wiki macro is used inline, so we need to force such opening macro
  // blocks to behave as inline macros if the wiki macro is used inline.
  if (this.inline) {
    List<Block> children = xdom.getChildren();
    if (!children.isEmpty() && children.get(0) instanceof MacroBlock) {
      MacroBlock old = (MacroBlock) children.get(0);
      MacroBlock replacement = new MacroBlock(old.getId(), old.getParameters(), old.getContent(), true);
      xdom.replaceChild(replacement, old);
    }
  }
  return xdom;
}
org.xwiki.rendering.blockXDOMreplaceChild

Popular methods of XDOM

  • getChildren
  • <init>
  • getMetaData
  • getBlocks
  • clone
  • getChildrenByType
  • setIdGenerator
  • traverse
  • addChild
  • getFirstBlock
  • getParameters
  • indexOf
  • getParameters,
  • indexOf,
  • setChildren

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now