You can use Javascript to change the UI of the Simple Editor Applet. The following methods allow the general editing preferences of an editor applet to be persisted (i.e., saved and restored by your applet). Note that the Simple Editor Applet and the Style Editor Applet use different methods for setting preferences.
Javascript method
|
Description
|
void setEditingPreferences(int spacebar, boolean autoStretchy, boolean autoItalics, boolean autoFunctions, boolean greekNormal, boolean ddDoubleStruck)
|
spacebar
Sets the pattern of insertion when we press the keyboard spacebar.
autoStretchy
Sets whether or not keyboard entries of ( ), { }, [ ] and | | should be made stretchy by default.
autoItalics
Sets whether or not single-character variables should be made italic by default.
autoFunctions
Sets whether or not common functions should be automatically recognized.
greekNormal
Sets whether or not uppercase Greek letters should be made normal by default.
ddDoubleStruck
Sets whether or not differential d should be rendered in double struck.
|
boolean getAutoFunctions()
|
Returns whether common functions are automatically recognized.
|
boolean getAutoItalics()
|
Returns whether single-character variables are made italic by default.
|
boolean getAutoStretchy()
|
Returns whether keyboard entries of ( ), { }, [ ] and | | are made stretchy by default.
|
boolean getDifferentialDDoubleStruck()
|
Returns whether differential d is rendered in double struck.
|
boolean getDisplayStyle()
|
Returns whether the current equation is in display style.
|
void setDisplayStyle(boolean b)
|
Sets whether or not the current equation is in display style.
|
int getSpacebarBehavior()
|
Returns the pattern of insertion when we press the keyboard spacebar. The valid values are:
0
|
Invisible times after an operand, space otherwise
|
1
|
Invisible times always
|
2
|
Space always
|
3
|
Nothing
|
|
boolean getUpperGreekNormal()
|
Returns whether uppercase Greek letters are made normal by default.
|
void setToolbarMarkup(String toolbarMarkup)
|
Sets the toolbar configuration markup for the current editor applet. If there is any error in the markup, it will default back to the previous toolbar. See the MathFlow SDK Programmer's Guide for the description of the toolbar configuration language.
|
void hideToolbar()
|
Hides the MathFlow toolbar if it is visible.
|
void showToolbar()
|
Shows the MathFlow toolbar if it is hidden.
|