Class SyntSelectionProvider

java.lang.Object
com.iizigo.editor.SyntSelectionProvider
All Implemented Interfaces:
IClipboardSelection, ISelectionProvider
Direct Known Subclasses:
SyntSelectionProvider.CCombo, SyntSelectionProvider.Combo, SyntSelectionProvider.IZ_CCombo, SyntSelectionProvider.Spinner, SyntSelectionProvider.StyledText, SyntSelectionProvider.Text

public abstract class SyntSelectionProvider extends Object implements ISelectionProvider, IClipboardSelection
Class for synthesized selection provider and clipboard selection routines of the Text control.
Author:
Christopher Mindus
  • Method Details

    • addSelectionChangedListener

      public void addSelectionChangedListener(ISelectionChangedListener listener)
      Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.
      Specified by:
      addSelectionChangedListener in interface ISelectionProvider
      Parameters:
      listener - a selection changed listener
    • removeSelectionChangedListener

      public void removeSelectionChangedListener(ISelectionChangedListener listener)
      Removes the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.
      Specified by:
      removeSelectionChangedListener in interface ISelectionProvider
      Parameters:
      listener - a selection changed listener
    • getSelection

      public ISelection getSelection()
      Returns the current selection for this provider.
      Specified by:
      getSelection in interface ISelectionProvider
      Returns:
      the current selection
    • setSelection

      public void setSelection(ISelection selection)
      Sets the current selection for this selection provider.
      Specified by:
      setSelection in interface ISelectionProvider
      Parameters:
      selection - the new selection
    • canPaste

      public boolean canPaste()
      Check for paste enabled.
      Specified by:
      canPaste in interface IClipboardSelection
    • canCut

      public boolean canCut()
      Check if Cut is enabled.
      Specified by:
      canCut in interface IClipboardSelection
    • canCopy

      public boolean canCopy()
      Check if Copy is enabled.
      Specified by:
      canCopy in interface IClipboardSelection
    • canDelete

      public boolean canDelete()
      Checks if Delete is enabled.
      Specified by:
      canDelete in interface IClipboardSelection
    • delete

      public void delete()
      Delete.
      Specified by:
      delete in interface IClipboardSelection
    • selectAll

      public void selectAll()
      Select all.
      Specified by:
      selectAll in interface IClipboardSelection
    • isEnabled

      protected abstract boolean isEnabled()
      Checks if enabled.
    • getText

      protected abstract String getText()
      Gets the text.
    • setText

      protected abstract void setText(String s)
      Sets the text.
    • isPassword

      protected boolean isPassword()
      Checks if enabled.
    • copy

      public abstract void copy()
      Copy.
      Specified by:
      copy in interface IClipboardSelection
    • cut

      public abstract void cut()
      Cut.
      Specified by:
      cut in interface IClipboardSelection
    • paste

      public abstract void paste()
      Pastes text.
      Specified by:
      paste in interface IClipboardSelection
    • _setSelection

      protected abstract void _setSelection(int begin, int end)
      Sets the selection.
    • _getSelection

      protected abstract Point _getSelection()
      Gets the selection.