Package com.iizigo.editor
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
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class for CCombo widget.static class
Class for Combo widget.static class
Class for IZ_CCombo widget.static class
Class for Spinner widget: this widget doesn't really support selection in the same world as other text widgets.static class
Class for StyledText widget.static class
Class for Text widget.Method Summary
Modifier and TypeMethodDescriptionprotected abstract Point
Gets the selection.protected abstract void
_setSelection
(int begin, int end) Sets the selection.void
Adds a listener for selection changes in this selection provider.boolean
canCopy()
Check if Copy is enabled.boolean
canCut()
Check if Cut is enabled.boolean
Checks if Delete is enabled.boolean
canPaste()
Check for paste enabled.abstract void
copy()
Copy.abstract void
cut()
Cut.void
delete()
Delete.Returns the current selection for this provider.protected abstract String
getText()
Gets the text.protected abstract boolean
Checks if enabled.protected boolean
Checks if enabled.abstract void
paste()
Pastes text.void
Removes the given selection change listener from this selection provider.void
Select all.void
setSelection
(ISelection selection) Sets the current selection for this selection provider.protected abstract void
Sets the text.
Method Details
addSelectionChangedListener
Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.- Specified by:
addSelectionChangedListener
in interfaceISelectionProvider
- Parameters:
listener
- a selection changed listener
removeSelectionChangedListener
Removes the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
removeSelectionChangedListener
in interfaceISelectionProvider
- Parameters:
listener
- a selection changed listener
getSelection
Returns the current selection for this provider.- Specified by:
getSelection
in interfaceISelectionProvider
- Returns:
- the current selection
setSelection
Sets the current selection for this selection provider.- Specified by:
setSelection
in interfaceISelectionProvider
- Parameters:
selection
- the new selection
canPaste
public boolean canPaste()Check for paste enabled.- Specified by:
canPaste
in interfaceIClipboardSelection
canCut
public boolean canCut()Check if Cut is enabled.- Specified by:
canCut
in interfaceIClipboardSelection
canCopy
public boolean canCopy()Check if Copy is enabled.- Specified by:
canCopy
in interfaceIClipboardSelection
canDelete
public boolean canDelete()Checks if Delete is enabled.- Specified by:
canDelete
in interfaceIClipboardSelection
delete
public void delete()Delete.- Specified by:
delete
in interfaceIClipboardSelection
selectAll
public void selectAll()Select all.- Specified by:
selectAll
in interfaceIClipboardSelection
isEnabled
protected abstract boolean isEnabled()Checks if enabled.getText
Gets the text.setText
Sets the text.isPassword
protected boolean isPassword()Checks if enabled.copy
public abstract void copy()Copy.- Specified by:
copy
in interfaceIClipboardSelection
cut
public abstract void cut()Cut.- Specified by:
cut
in interfaceIClipboardSelection
paste
public abstract void paste()Pastes text.- Specified by:
paste
in interfaceIClipboardSelection
_setSelection
protected abstract void _setSelection(int begin, int end) Sets the selection._getSelection
Gets the selection.