Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 94987
Collapse All | Expand All

(-)src/org/eclipse/jface/text/AbstractDocument.java (-1 / +23 lines)
Lines 48-54 Link Here
48
 * @see org.eclipse.jface.text.ITextStore
48
 * @see org.eclipse.jface.text.ITextStore
49
 * @see org.eclipse.jface.text.ILineTracker
49
 * @see org.eclipse.jface.text.ILineTracker
50
 */
50
 */
51
public abstract class AbstractDocument implements IDocument, IDocumentExtension, IDocumentExtension2, IDocumentExtension3, IDocumentExtension4, IRepairableDocument {
51
public abstract class AbstractDocument implements IDocument, IDocumentExtension, IDocumentExtension2, IDocumentExtension3, IDocumentExtension4, IRepairableDocument, ILineDelimiterProvider {
52
52
53
	/**
53
	/**
54
	 * Tells whether this class is in debug mode.
54
	 * Tells whether this class is in debug mode.
Lines 155-160 Link Here
155
	 * @since 3.1
155
	 * @since 3.1
156
	 */
156
	 */
157
	private long fModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
157
	private long fModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
158
	/**
159
	 * This document's default line delimiter.
160
	 * @since 3.1
161
	 */
162
	private String fDefaultLineDelimiter;
158
163
159
164
160
	/**
165
	/**
Lines 803-808 Link Here
803
	public String[] getLegalLineDelimiters() {
808
	public String[] getLegalLineDelimiters() {
804
		return getTracker().getLegalLineDelimiters();
809
		return getTracker().getLegalLineDelimiters();
805
	}
810
	}
811
	
812
	/*
813
	 * @see org.eclipse.jface.text.ILineDelimiterProvider#getDefaultLineDelimiter()
814
	 * @since 3.1
815
	 */
816
	public String getDefaultLineDelimiter() {
817
		return fDefaultLineDelimiter;
818
	}
819
	
820
	/*
821
	 * @see org.eclipse.jface.text.ILineDelimiterProvider#setDefaultLineDelimiter(java.lang.String)
822
	 * @since 3.1
823
	 */
824
	public void setDefaultLineDelimiter(String lineDelimiter) {
825
		Assert.isNotNull(lineDelimiter);
826
		fDefaultLineDelimiter= lineDelimiter;
827
	}
806
828
807
	/*
829
	/*
808
	 * @see org.eclipse.jface.text.IDocument#getLineLength(int)
830
	 * @see org.eclipse.jface.text.IDocument#getLineLength(int)
(-)src/org/eclipse/jface/text/IDocument.java (+1 lines)
Lines 97-102 Link Here
97
 * @see org.eclipse.jface.text.ILineTracker
97
 * @see org.eclipse.jface.text.ILineTracker
98
 * @see org.eclipse.jface.text.IDocumentListener
98
 * @see org.eclipse.jface.text.IDocumentListener
99
 * @see org.eclipse.jface.text.IDocumentPartitioningListener
99
 * @see org.eclipse.jface.text.IDocumentPartitioningListener
100
 * @see org.eclipse.jface.text.ILineDelimiterProvider
100
 */
101
 */
101
public interface IDocument {
102
public interface IDocument {
102
103
(-)component.xml (+28 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<component xmlns="http://eclipse.org/component"
4
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
   xsi:schemaLocation="http://eclipse.org/component ../component.xsd "
6
   name="Eclipse Text">
7
 <plugin id="org.eclipse.text"/>
8
9
 <package name="org.eclipse.jface.text">
10
 </package>
11
12
 <package name="org.eclipse.jface.text.link">
13
 </package>
14
15
 <package name="org.eclipse.jface.text.projection">
16
 </package>
17
18
 <package name="org.eclipse.jface.text.source">
19
 </package>
20
21
 <package name="org.eclipse.jface.text.templates">
22
 </package>
23
24
 <package name="org.eclipse.text.edits">
25
 </package>
26
27
 <component-depends unrestricted="true"/>
28
</component>
(-)src/org/eclipse/jface/text/ILineDelimiterProvider.java (+39 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jface.text;
12
13
14
/**
15
 * A line delimiter provider is able to provide information about
16
 * line delimiters.
17
 * <p>
18
 * At this time there's only support for the default line delimiter
19
 * but more might come in the future through extension interfaces.
20
 * </p> 
21
 * @since 3.1
22
 */
23
public interface ILineDelimiterProvider {
24
25
	/**
26
	 * Returns this line delimiter provider's default line delimiter.
27
	 *
28
	 * @return the default line delimiter or <code>null</code> if none
29
	 */
30
	String getDefaultLineDelimiter();
31
	
32
	/**
33
	 * Sets this line delimiter provider's default line delimiter.
34
	 *
35
	 * @param lineDelimiter the default line delimiter
36
	 */
37
	void setDefaultLineDelimiter(String lineDelimiter);
38
	
39
}

Return to bug 94987