Interface WidgetHandler

  • All Known Implementing Classes:
    DefaultWidgetHandler, VoidWidgetHandler

    public interface WidgetHandler
    WidgetHandler control when widgets should display on client, when should remove. WidgetHandler and Widget are implementation-sensitive.
    Author:
    Dennis.Chen
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean addWidget​(Widget widget)
      Add widget to a handler, notice : WidgetHandler and Widget are implementation-sensitive.
      Spreadsheet getSpreadsheet()
      get spreadsheet of this handler
      void init​(Spreadsheet spreadsheet)
      initial a widget handler.
      void invaliate()
      invalidate this handle, which means all widget in client side will be remove, and need to re-drew.
      void onLoadOnDemand​(SSheet sheet, int left, int top, int right, int bottom)
      call when spreadsheet try to load a block of cell to client side.
      boolean removeWidget​(Widget widget)
      Remove widget from a handler notice : WidgetHandler and Widget are implementation-sensitive.
      void updateWidget​(SSheet sheet, String widgetId)
      Redraw widget
    • Method Detail

      • init

        void init​(Spreadsheet spreadsheet)
        initial a widget handler. this method will be invoked by spreadsheet, you should not call this method directly.
        Parameters:
        spreadsheet -
      • getSpreadsheet

        Spreadsheet getSpreadsheet()
        get spreadsheet of this handler
        Returns:
        spreadsheet
      • addWidget

        boolean addWidget​(Widget widget)
        Add widget to a handler, notice : WidgetHandler and Widget are implementation-sensitive.
        Parameters:
        widget - a widget
        Returns:
        true if success to add a widget
      • removeWidget

        boolean removeWidget​(Widget widget)
        Remove widget from a handler notice : WidgetHandler and Widget are implementation-sensitive.
        Parameters:
        widget -
        Returns:
        true if success to remove a widget
      • onLoadOnDemand

        void onLoadOnDemand​(SSheet sheet,
                            int left,
                            int top,
                            int right,
                            int bottom)
        call when spreadsheet try to load a block of cell to client side. handler should take care this method and load corresponding widgets, which in the block , to client side. this method will be invoked by spreadsheet, you should not call this method directly.
      • invaliate

        void invaliate()
        invalidate this handle, which means all widget in client side will be remove, and need to re-drew. this method will be invoked when spreadsheet invalidate only.
      • updateWidget

        void updateWidget​(SSheet sheet,
                          String widgetId)
        Redraw widget
        Parameters:
        sheet -
        widgetId -