Class AbstractTableAction

    • Constructor Detail

      • AbstractTableAction

        public AbstractTableAction()
        Defines an AbstractTableAction object with a default description string and default icon.
      • AbstractTableAction

        public AbstractTableAction​(String name)
        Defines an AbstractTableAction object with the specified description string and a default icon.
        Parameters:
        name - the description
      • AbstractTableAction

        public AbstractTableAction​(String name,
                                   Icon icon)
        Defines an AbstractTableAction object with the specified description string and a the specified icon.
        Parameters:
        name - the description
        icon - the icon
      • AbstractTableAction

        public AbstractTableAction​(String name,
                                   String icon)
        Defines an AbstractTableAction object with the specified description string and a the specified icon.
        Parameters:
        name - the description
        icon - the icon file (without path)
    • Method Detail

      • setTable

        protected void setTable​(ReportFactory.Table value)
        Sets the table to use.
        Parameters:
        value - the table
      • getTable

        protected ReportFactory.Table getTable()
        Returns the currently table.
        Returns:
        the table, null if not applicable
      • setRows

        protected void setRows​(int[] value)
        Sets the rows to use.
        Parameters:
        value - the rows
      • getRow

        protected int[] getRow()
        Returns the currently selected rows in the table.
        Returns:
        the rows, null if not applicable
      • setFields

        protected void setFields​(AbstractField[] value)
        Sets the fields to use.
        Parameters:
        value - the fields
      • getFields

        protected AbstractField[] getFields()
        Returns the currently selected fields in the table.
        Returns:
        the fields, null if not applicable
      • setValues

        protected void setValues​(String[] value)
        Sets the values to use.
        Parameters:
        value - the values
      • getValues

        protected String[] getValues()
        Returns the currently selected values in the table.
        Returns:
        the values, null if not applicable
      • getReportProvider

        protected ReportProvider<?,​?> getReportProvider()
        Returns the underlying report provider.
        Returns:
        the report provider, null if not available
      • setReport

        protected void setReport​(Report value)
        Sets the underlying report.
        Parameters:
        value - the report to set
      • notifyReportChangeListeners

        protected void notifyReportChangeListeners()
        Notifies the listeners that the report has changed.
      • getReport

        protected Report getReport()
        Returns the underlying report.
        Returns:
        the report, null if not available
      • getFileChooser

        protected AbstractReportFileChooser getFileChooser()
        Returns the underlying report file chooser.
        Returns:
        the file chooser, null if not available
      • parseDouble

        protected Double parseDouble​(String s)
        Parses a string as double. If parsing fails, an error dialog is popped up.
        Parameters:
        s - the string to parse
        Returns:
        the double or null in case of an error
      • parseBoolean

        protected Boolean parseBoolean​(String s)
        Parses a string as boolean. If parsing fails, an error dialog is popped up.
        Parameters:
        s - the string to parse
        Returns:
        the boolean or null in case of an error
      • isApplicable

        public abstract boolean isApplicable​(ReportFactory.Table table,
                                             int row,
                                             AbstractField field,
                                             String value)
        Checks whether the action is applicable and should be added to the popup menu.
        Parameters:
        table - the table the popup menu is for
        row - the currently selected row
        field - the field in the specified row
        value - the current value
        Returns:
        true if the action is applicable, i.e., should be included in the popup menu
      • createPopup

        public static BasePopupMenu createPopup​(String[] actions,
                                                ReportFactory.Table table,
                                                int[] rows)
        Assembles the popup menu for the table.
        Parameters:
        actions - the classnames of the actions, "-" indicates a separator
        table - the table the popup menu is for
        rows - the row(s) in the table this popup menu is for
        Returns:
        the popup menu
        See Also:
        SEPARATOR
      • createName

        public static String createName​(String prefix,
                                        AbstractField[] fields,
                                        int limit)
        Creates a string for the menu based on the prefix and the fields.
        Parameters:
        prefix - the prefix to use (separated by a blank from fields)
        fields - the fields
        limit - the maximum number of characters for the fields
        Returns:
        the generated string