Class ExpressionPane

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible
    Direct Known Subclasses:
    ProductExpressionPane

    public class ExpressionPane
    extends JPanel
    The expression pane is a UI component which is used to edit mathematical expressions. There are four methods which can be used to customize the UI of the expression pane: {@link #setLeftAccessory}, {@link #setRightAccessory}, {@link #setTopAccessory} and {@link #setBottomAccessory}.
    See Also:
    Serialized Form
    • Field Detail

      • CODE_HISTORY_PREFERENCES_PREFIX

        public static final String CODE_HISTORY_PREFERENCES_PREFIX
        The prefix used to store the code history in the preferences.
        See Also:
        Constant Field Values
      • PLACEHOLDER

        public static final String PLACEHOLDER
        The string used to represent an expression placeholder for text insertion.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExpressionPane

        public ExpressionPane​(boolean requiresBoolExpr,
                              Parser parser,
                              PropertyMap preferences)
        Constructs a new expression pane.
        Parameters:
        requiresBoolExpr - if true the expressions are checked to return a boolean value.
        parser - the parser used to check expression syntax
        preferences - a property map which stores expression pane related properties such as the code history
    • Method Detail

      • showModalDialog

        public int showModalDialog​(Window parent,
                                   String title)
      • setPreferences

        public void setPreferences​(PropertyMap preferences)
      • setEmptyExpressionAllowed

        public void setEmptyExpressionAllowed​(boolean allow)
      • isEmptyExpressionAllowed

        public boolean isEmptyExpressionAllowed()
      • updateCodeHistory

        public void updateCodeHistory()
      • loadCodeHistory

        public void loadCodeHistory()
      • storeCodeHistory

        public void storeCodeHistory()
      • dispose

        protected void dispose()
      • setLeftAccessory

        public void setLeftAccessory​(Component component)
      • setRightAccessory

        public void setRightAccessory​(Component component)
      • setTopAccessory

        public void setTopAccessory​(Component component)
      • setBottomAccessory

        public void setBottomAccessory​(Component component)
      • getCodeArea

        public JTextArea getCodeArea()
      • isBooleanExpressionPreferred

        public boolean isBooleanExpressionPreferred()
      • setBooleanExpressionPreferred

        public void setBooleanExpressionPreferred​(boolean booleanExpressionPreferred)
      • getParser

        public Parser getParser()
      • setParser

        public void setParser​(Parser parser)
      • getCode

        public String getCode()
      • setCode

        public void setCode​(String newCode)
      • setCode

        public void setCode​(String newCode,
                            boolean recordUndo,
                            int caretPos)
      • clearCode

        public void clearCode()
      • selectAllCode

        public void selectAllCode()
      • undoLastEdit

        public void undoLastEdit()
      • insertCodePattern

        public void insertCodePattern​(String pattern)
      • createActionPane

        public org.esa.snap.ui.ExpressionPane.ActionPane createActionPane()
      • createInsertButton

        public JButton createInsertButton​(String pattern)
      • createPatternList

        public JList<String> createPatternList()
      • createPatternListPane

        protected JPanel createPatternListPane​(String labelText,
                                               String[] patterns)
      • createUI

        protected void createUI()
      • createPatternInsertionPane

        protected JPanel createPatternInsertionPane()
      • createDefaultAccessoryPane

        protected JPanel createDefaultAccessoryPane​(Component subAssessory)
      • checkCode

        protected void checkCode()
      • checkCode

        protected void checkCode​(String code)
      • getLastErrorMessage

        public String getLastErrorMessage()
      • updateUIState

        protected void updateUIState()
      • getParamTypeString

        public static String getParamTypeString​(String name,
                                                Term[] args)