Java Code Examples for org.eclipse.swt.custom.StyledText#removeKeyListener()

The following examples show how to use org.eclipse.swt.custom.StyledText#removeKeyListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContentAssistSubjectControlAdapter.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @see org.eclipse.jface.contentassist.IContentAssistSubjectControl#removeKeyListener(org.eclipse.swt.events.KeyListener)
 */
public void removeKeyListener(KeyListener keyListener)
{
	if (fContentAssistSubjectControl != null)
	{
		fContentAssistSubjectControl.removeKeyListener(keyListener);
	}
	else
	{
		StyledText textWidget = fViewer.getTextWidget();
		
		if (Helper.okToUse(textWidget))
		{
			textWidget.removeKeyListener(keyListener);
		}
	}
}
 
Example 2
Source File: EditorListener.java    From saros with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Disconnects all selection listeners from the underlying {@linkplain IEditorPart editor part}.
 *
 * @see #bind(IEditorPart)
 */
public void unbind() {

  if (part == null) return;

  StyledText textWidget = viewer.getTextWidget();
  textWidget.removeControlListener(controlListener);
  textWidget.removeMouseListener(mouseListener);
  textWidget.removeKeyListener(keyListener);

  viewer.getSelectionProvider().removeSelectionChangedListener(selectionChangedListener);
  viewer.removeViewportListener(viewportListener);
  viewer.removeTextListener(textListener);

  viewer = null;
  part = null;
}
 
Example 3
Source File: StyledTextActionHandler.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Removes a <code>StyledText</code> widget from the handler so that the Copy,
 * Cut, Paste and Select All actions are no longer redirected to it when
 * focused.
 *
 * @param textWidget
 *            the <code>StyledText</code> widget
 */
public void removeStyledText(StyledText textWidget) {
	if (textWidget == null)
		return;

	textWidget.removeListener(SWT.Activate, textControlListener);
	textWidget.removeListener(SWT.Deactivate, textControlListener);

	textWidget.removeMouseListener(mouseAdapter);
	textWidget.removeKeyListener(keyAdapter);

	styledText = null;
	updateActionsEnableState();
}
 
Example 4
Source File: TypingRunDetector.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * If there is a selection listener, it is removed from the text widget
 * underlying the viewer.
 */
private void ensureSelectionListenerRemoved() {
	if (fSelectionListener != null) {
		StyledText textWidget= fViewer.getTextWidget();
		textWidget.removeFocusListener(fSelectionListener);
		textWidget.removeKeyListener(fSelectionListener);
		textWidget.removeMouseListener(fSelectionListener);
		fSelectionListener= null;
	}
}