1 /*******************************************************************************
2  * Copyright (c) 2015 Holger Voormann and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     Holger Voormann - initial API and implementation
13  *     Florian Weßling <flo@cdhq.de> - Word Wrap - https://bugs.eclipse.org/bugs/show_bug.cgi?id=35779
14  *******************************************************************************/
15 package org.eclipse.ui.texteditor;
16 
17 /**
18  * Extension interface for {@link org.eclipse.ui.texteditor.ITextEditor}. Adds the following
19  * functions:
20  * <ul>
21  * <li>word wrap</li>
22  * </ul>
23  * <p>
24  * This interface may be implemented by clients.
25  * </p>
26  *
27  * @since 3.10
28  */
29 public interface ITextEditorExtension6 {
30 
31 	/**
32 	 * Returns <code>true</code> if word wrap is currently enabled, <code>false</code> otherwise.
33 	 *
34 	 * @return the receiver's word wrap state
35 	 */
isWordWrapEnabled()36 	boolean isWordWrapEnabled();
37 
38 	/**
39 	 * Sets whether the text editor wraps lines. Nothing happens if the receiver already is in the
40 	 * requested state.
41 	 * <p>
42 	 * Note: enabling word wrap disables block selection mode (see {@link ITextEditorExtension5}),
43 	 * enabling block selection mode will disable word wrap.
44 	 *
45 	 * @param enable <code>true</code> to enable word wrap, <code>false</code> to turn it off.
46 	 *
47 	 * @see ITextEditorExtension5#setBlockSelectionMode(boolean)
48 	 */
setWordWrap(boolean enable)49 	public void setWordWrap(boolean enable);
50 }
51