Package org.freeplane.api
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.
// 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 TypeMethodDescriptionvoidAdds a conditional style to the end of the tablevoidadd(ConditionalStyleRO conditionalStyle) Adds a copy of conditionalStyle to the end of the table.voidInserts a conditional style at the specified position.voidinsert(int position, ConditionalStyleRO conditionalStyle) Inserts a copy of conditionalStyle at the specified position.voidmove(int position, int toPosition) Moves the conditional style found at position to toPositionremove(int position) It can be used to move a conditional style between nodes or between maps.
-
Method Details
-
add
Adds a conditional style to the end of the table- Throws:
IllegalArgumentException- if styleName is not found- Since:
- 1.11.1
-
add
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
Inserts a conditional style at the specified position.- Throws:
IllegalArgumentException- if styleName is not found- Since:
- 1.11.1
-
insert
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
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
-