Interface ConditionalStyles

All Known Subinterfaces:
Proxy.ConditionalStyles

public interface ConditionalStyles
Node's or map's conditional-styles table: node.conditionalStyles or node.mindMap.conditionalStyles - read-only.

In the Manage Conditional Styles dialog it's the entire table. Each row in the table is a separate ConditionalStyle.

Actions known from the Manage Conditional Styles dialog can be called on ConditionalStyles
     // add a conditional style to the end of the table
     node.conditionalStyles.add(
       true, // isActive
       "node.text == 'Sunday'", // script
       'styles.important', // styleName
       false) // isLast (aka stop)

     // insert a conditional style at the beginning of the table, with the condition "always"
     node.conditionalStyles.insert(0, true, null, 'defaultstyle.floating', false)

     // move the third conditional style to the top of the table
     node.conditionalStyles.move(2, 0)

     // remove the first conditional style from the table
     node.conditionalStyles.remove(0)

     // remove all, i.e. each ConditionalStyle item
     node.conditionalStyles.collect().each { it.remove() }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(boolean isActive, String script, String styleName, boolean isLast)
    Adds a conditional style to the end of the table
    void
    add(ConditionalStyleRO conditionalStyle)
    Adds a copy of conditionalStyle to the end of the table.
    void
    insert(int position, boolean isActive, String script, String styleName, boolean isLast)
    Inserts a conditional style at the specified position.
    void
    insert(int position, ConditionalStyleRO conditionalStyle)
    Inserts a copy of conditionalStyle at the specified position.
    void
    move(int position, int toPosition)
    Moves the conditional style found at position to toPosition
    remove(int position)
    It can be used to move a conditional style between nodes or between maps.
  • Method Details

    • add

      void add(boolean isActive, String script, String styleName, boolean isLast)
      Adds a conditional style to the end of the table
      Throws:
      IllegalArgumentException - if styleName is not found
      Since:
      1.11.1
    • add

      void add(ConditionalStyleRO conditionalStyle)
      Adds a copy of conditionalStyle to the end of the table. It can be used to copy a conditional style between nodes or between maps.
      Since:
      1.11.1
    • insert

      void insert(int position, boolean isActive, String script, String styleName, boolean isLast)
      Inserts a conditional style at the specified position.
      Throws:
      IllegalArgumentException - if styleName is not found
      Since:
      1.11.1
    • insert

      void insert(int position, ConditionalStyleRO conditionalStyle)
      Inserts a copy of conditionalStyle at the specified position. It can be used to copy a conditional style between nodes or between maps.
      Since:
      1.11.1
    • move

      void move(int position, int toPosition)
      Moves the conditional style found at position to toPosition
      Since:
      1.11.1
    • remove

      ConditionalStyle remove(int position)
      It can be used to move a conditional style between nodes or between maps.
           def cStyle = node.conditionalStyles.remove(0)
           node.parent.conditionalStyles.add(cStyle)
       
      Returns:
      the removed ConditionalStyle
      Since:
      1.11.1