Class CompositeFreezeLayer

All Implemented Interfaces:
ILayer, ILayerListener, IUniqueIndexLayer, IPersistable

public class CompositeFreezeLayer extends CompositeLayer implements IUniqueIndexLayer
  • Constructor Details

  • Method Details

    • handleLayerEvent

      public void handleLayerEvent(ILayerEvent event)
      Description copied from class: AbstractLayer
      Handle layer event notification. Convert it to your context and propagate UP. If you override this method you MUST NOT FORGET to raise the event up the layer stack by calling super.fireLayerEvent(event) - unless you plan to eat the event yourself.
      Specified by:
      handleLayerEvent in interface ILayerListener
      Overrides:
      handleLayerEvent in class AbstractLayer
      Parameters:
      event - the event
    • isFrozen

      public boolean isFrozen()
    • registerCommandHandlers

      protected void registerCommandHandlers()
      Description copied from class: AbstractLayer
      Layers should use this method to register their command handlers and call it from their constructor. This allows easy overriding if required of command handlers
      Overrides:
      registerCommandHandlers in class AbstractLayer
    • doCommand

      public boolean doCommand(ILayerCommand command)
      Description copied from class: CompositeLayer
      Opportunity to respond to a command as it flows down the stack. If the layer is not interested in the command it should allow the command to keep traveling down the stack.

      Note: Before the layer can process a command it must convert the command to its local coordinates using ILayerCommand.convertToTargetLayer(ILayer) Handle commands

      Specified by:
      doCommand in interface ILayer
      Overrides:
      doCommand in class CompositeLayer
      Parameters:
      command - The command to execute.
      Returns:
      true if the command has been handled and was therefore consumed, false otherwise.
    • getColumnPositionByIndex

      public int getColumnPositionByIndex(int columnIndex)
      Specified by:
      getColumnPositionByIndex in interface IUniqueIndexLayer
    • getRowPositionByIndex

      public int getRowPositionByIndex(int rowIndex)
      Specified by:
      getRowPositionByIndex in interface IUniqueIndexLayer
    • getLayoutXByColumnPosition

      protected int getLayoutXByColumnPosition(int compositeColumnPosition)
      Overrides:
      getLayoutXByColumnPosition in class CompositeLayer
    • getLayoutYByRowPosition

      protected int getLayoutYByRowPosition(int compositeRowPosition)
      Overrides:
      getLayoutYByRowPosition in class CompositeLayer
    • getLayoutXYByPosition

      protected org.eclipse.swt.graphics.Point getLayoutXYByPosition(int compositeColumnPosition, int compositeRowPosition)
      Overrides:
      getLayoutXYByPosition in class CompositeLayer
    • modifyColumnSpanLayerCell

      public ILayerCell modifyColumnSpanLayerCell(ILayerCell cell)
      Modifies a column spanned cell in case the spanned cell is in the frozen area but the origin column is not visible as the frozen state was created in scrolled state.
      Parameters:
      cell - The cell to check and modify.
      Returns:
      The given ILayerCell or a modified one in case it needs to be updated.
      Since:
      2.1
    • getColumnBounds

      public int[] getColumnBounds(int columnPosition, int startColumn, int endColumn)
      This method is used to determine the bounds of a cell with column span in case of an active freeze. This is needed because column positions can be ambiguous if the start column of a spanned cell is moved below the frozen area.
      Parameters:
      columnPosition - The column position that was used to retrieve the cell. Needed to identify the origin layout in order to know if the start needs to be searched in the frozen or the scrollable area.
      startColumn - The start column position of the spanned cell.
      endColumn - The end column position of the spanned cell.
      Returns:
      int array that contains the start x position of a cell in the first element, and the width of the cell in the second element.
      Since:
      1.6
    • modifyRowSpanLayerCell

      public ILayerCell modifyRowSpanLayerCell(ILayerCell cell)
      Modifies a row spanned cell in case the spanned cell is in the frozen area but the origin row is not visible as the frozen state was created in scrolled state.
      Parameters:
      cell - The cell to check and modify.
      Returns:
      The given ILayerCell or a modified one in case it needs to be updated.
      Since:
      2.1
    • getRowBounds

      public int[] getRowBounds(int rowPosition, int startRow, int endRow)
      This method is used to determine the bounds of a cell with row span in case of an active freeze. This is needed because row positions can be ambiguous if the start row of a spanned cell is moved below the frozen area.
      Parameters:
      rowPosition - The row position that was used to retrieve the cell. Needed to identify the origin layout in order to know if the start needs to be searched in the frozen or the scrollable area.
      startRow - The start row position of the spanned cell.
      endRow - The end row position of the spanned cell.
      Returns:
      int array that contains the start y position of a cell in the first element, and the height of the cell in the second element.
      Since:
      1.6
    • saveState

      public void saveState(String prefix, Properties properties)
      Description copied from interface: IPersistable
      Saves the state to the given Properties using the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.
      Specified by:
      saveState in interface IPersistable
      Overrides:
      saveState in class CompositeLayer
      Parameters:
      prefix - The prefix to use for the state keys. Is also used as the state configuration name.
      properties - The Properties instance to save the state to.
    • loadState

      public void loadState(String prefix, Properties properties)
      Description copied from interface: IPersistable
      Restore the state out of the given Properties identified by the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.
      Specified by:
      loadState in interface IPersistable
      Overrides:
      loadState in class CompositeLayer
      Parameters:
      prefix - The prefix to use for the state keys. Is also used as the state configuration name.
      properties - The Properties instance to load the state from.