
org.eclipse.jface.text.IFindReplaceTargetExtension Maven / Gradle / Ivy
Show all versions of org.eclipse.jface.text Show documentation
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jface.text;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
/**
* Extension interface for {@link org.eclipse.jface.text.IFindReplaceTarget}.
*
* Introduces the concepts of find/replace sessions, searching in a limiting
* scope and a replace-all mode.
*
* If a scope is set, findAndSelect
is limited to the scope.
* Occurrences outside of the scope are not considered.
*
* @since 2.0
*/
public interface IFindReplaceTargetExtension {
/**
* Indicates that a session with the target begins.
* All calls except beginSession()
and endSession()
to
* IFindReplaceTarget
and
* IFindReplaceTargetExtension
must be embedded within calls to
* beginSession()
and endSession()
.
*
* @see #endSession()
*/
void beginSession();
/**
* Indicates that a session with the target ends.
*
* @see #beginSession()
*/
void endSession();
/**
* Returns the find scope of the target, null
for global scope.
*
* @return returns the find scope of the target, may be null
*/
IRegion getScope();
/**
* Sets the find scope of the target to operate on. null
* indicates that the global scope should be used.
*
* @param scope the find scope of the target, may be null
*/
void setScope(IRegion scope);
/**
* Returns the currently selected range of lines as a offset and length.
*
* @return the currently selected line range
*/
Point getLineSelection();
/**
* Sets a selection.
*
* @param offset the offset of the selection
* @param length the length of the selection
*/
void setSelection(int offset, int length);
/**
* Sets the scope highlight color
*
* @param color the color of the scope highlight
*/
void setScopeHighlightColor(Color color);
/**
* Sets the target's replace-all mode.
*
* @param replaceAll true
if this target should switch into replace-all mode,
* false
if it should leave the replace-all state
*/
void setReplaceAllMode(boolean replaceAll);
}