Package com.iizigo.editor
Class SyntSelectionProvider
java.lang.Object
com.iizigo.editor.SyntSelectionProvider
- All Implemented Interfaces:
IClipboardSelection,org.eclipse.jface.viewers.ISelectionProvider
- Direct Known Subclasses:
SyntSelectionProvider.CCombo,SyntSelectionProvider.Combo,SyntSelectionProvider.Spinner,SyntSelectionProvider.StyledText,SyntSelectionProvider.Text
public abstract class SyntSelectionProvider extends Object implements org.eclipse.jface.viewers.ISelectionProvider, IClipboardSelection
Class for synthesized selection provider and clipboard selection routines of the Text control.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass for Combo widget.static classClass for Combo widget.static classClass for Spinner widget: this widget doesn't really support selection in the same world as other text widgets.static classClass for StyledText widget.static classClass for Text widget.Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.eclipse.swt.graphics.PointGets the selection.protected abstract void_setSelection(int begin, int end) Sets the selection.voidaddSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener) Adds a listener for selection changes in this selection provider.booleancanCopy()Check if Copy is enabled.booleancanCut()Check if Cut is enabled.booleanChecks if Delete is enabled.booleancanPaste()Check for paste enabled.abstract voidcopy()Copy.abstract voidcut()Cut.voiddelete()Delete.org.eclipse.jface.viewers.ISelectionReturns the current selection for this provider.protected abstract StringgetText()Gets the text.protected abstract booleanChecks if enabled.protected booleanChecks if enabled.abstract voidpaste()Pastes text.voidremoveSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener) Removes the given selection change listener from this selection provider.voidSelect all.voidsetSelection(org.eclipse.jface.viewers.ISelection selection) Sets the current selection for this selection provider.protected abstract voidSets the text.
Method Details
addSelectionChangedListener
public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener) Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.- Specified by:
addSelectionChangedListenerin interfaceorg.eclipse.jface.viewers.ISelectionProvider- Parameters:
listener- a selection changed listener
removeSelectionChangedListener
public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener) Removes the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
removeSelectionChangedListenerin interfaceorg.eclipse.jface.viewers.ISelectionProvider- Parameters:
listener- a selection changed listener
getSelection
public org.eclipse.jface.viewers.ISelection getSelection()Returns the current selection for this provider.- Specified by:
getSelectionin interfaceorg.eclipse.jface.viewers.ISelectionProvider- Returns:
- the current selection
setSelection
public void setSelection(org.eclipse.jface.viewers.ISelection selection) Sets the current selection for this selection provider.- Specified by:
setSelectionin interfaceorg.eclipse.jface.viewers.ISelectionProvider- Parameters:
selection- the new selection
canPaste
public boolean canPaste()Check for paste enabled.- Specified by:
canPastein interfaceIClipboardSelection
canCut
public boolean canCut()Check if Cut is enabled.- Specified by:
canCutin interfaceIClipboardSelection
canCopy
public boolean canCopy()Check if Copy is enabled.- Specified by:
canCopyin interfaceIClipboardSelection
canDelete
public boolean canDelete()Checks if Delete is enabled.- Specified by:
canDeletein interfaceIClipboardSelection
delete
public void delete()Delete.- Specified by:
deletein interfaceIClipboardSelection
selectAll
public void selectAll()Select all.- Specified by:
selectAllin 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:
copyin interfaceIClipboardSelection
cut
public abstract void cut()Cut.- Specified by:
cutin interfaceIClipboardSelection
paste
public abstract void paste()Pastes text.- Specified by:
pastein interfaceIClipboardSelection
_setSelection
protected abstract void _setSelection(int begin, int end) Sets the selection._getSelection
protected abstract org.eclipse.swt.graphics.Point _getSelection()Gets the selection.