Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 01cc3c2baf590f33244e9e2314ccffeddf676fe4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.ui.console;

import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.swt.custom.StyleRange;

/**
 * A document partitioner for a text console.
 * <p>
 * In addition to regular partitioner duties, a console document partitioner
 * dicates which regions in its document are read-only and provides style ranges.
 * </p>
 * @see org.eclipse.ui.console.TextConsole
 * @since 3.1
 */
public interface IConsoleDocumentPartitioner extends IDocumentPartitioner {
       
    /**
     * Returns whether this partitioner's document is read-only at the specified
     * offset. The user is not allowed to type in read-only locations. 
     * 
     * @param offset document offset
     * @return whether this partitioner's document is read-only at the specified
     * offset
     */
    public boolean isReadOnly(int offset);
    
    /**
     * Returns style ranges for the specified region of this partitioner's document
     * to use when rendering, or <code>null</code> if none. 
     * 
     * @param offset beginning offset for which style ranges are requested
     * @param length the length of text for which style ranges are requested
     * @return style ranges for the specified region of this partitioner's document
     * to use when rendering, or <code>null</code> if none
     */
    public StyleRange[] getStyleRanges(int offset, int length);
}

Back to the top