/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jface.text; import org.eclipse.swt.custom.VerifyKeyListener; import org.eclipse.swt.widgets.Control; /** * Extension interface for {@link org.eclipse.jface.text.ITextViewer}. *
* This extension interface replaces the event consumer mechanism ( * {@link org.eclipse.jface.text.ITextViewer#setEventConsumer(IEventConsumer)}) * with a set of methods that allow to manage a sequence of * {@link org.eclipse.swt.custom.VerifyKeyListener}objects. It also adds *
setRedraw(boolean)
* -1
. If a mark is set and the selection is
* empty, cut and copy actions performed on this text viewer work on the
* region described by the positions of the mark and the cursor.
*
* @param offset the offset of the mark
*/
void setMark(int offset);
/**
* Returns the position of the mark, -1
if the mark is not set.
*
* @return the position of the mark or -1
if no mark is set
*/
int getMark();
/**
* Enables/disables the redrawing of this text viewer. This temporarily
* disconnects the viewer from its underlying
* {@link org.eclipse.swt.custom.StyledText}widget. While being
* disconnected only the viewer's selection may be changed using
* setSelectedRange
. Any direct manipulation of the widget
* as well as calls to methods that change the viewer's presentation state
* (such as enabling the segmented view) are not allowed. When redrawing is
* disabled the viewer does not send out any selection or view port change
* notification. When redrawing is enabled again, a selection change
* notification is sent out for the selected range and this range is
* revealed causing a view port changed notification.
*
* @param redraw true
to enable redrawing, false
* otherwise
*/
void setRedraw(boolean redraw);
/**
* Returns the viewer's rewrite target.
*
* @return the viewer's rewrite target
*/
IRewriteTarget getRewriteTarget();
}