Java Code Examples for org.eclipse.jface.text.TextUtilities#getDefaultLineDelimiter()

The following examples show how to use org.eclipse.jface.text.TextUtilities#getDefaultLineDelimiter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaMethodCompletionProposal.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Appends everything up to the method name including
 * the opening parenthesis.
 * <p>
 * In case of {@link CompletionProposal#METHOD_REF_WITH_CASTED_RECEIVER}
 * it add cast.
 * </p>
 *
 * @param buffer the string buffer
 * @since 3.4
 */
protected void appendMethodNameReplacement(StringBuffer buffer) {
	if (fProposal.getKind() == CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER) {
		String coreCompletion= String.valueOf(fProposal.getCompletion());
		String lineDelimiter= TextUtilities.getDefaultLineDelimiter(getTextViewer().getDocument());
		String replacement= CodeFormatterUtil.format(CodeFormatter.K_EXPRESSION, coreCompletion, 0, lineDelimiter, fInvocationContext.getProject());
		buffer.append(replacement.substring(0, replacement.lastIndexOf('.') + 1));
	}

	if (fProposal.getKind() != CompletionProposal.CONSTRUCTOR_INVOCATION)
		buffer.append(fProposal.getName());

	FormatterPrefs prefs= getFormatterPrefs();
	if (prefs.beforeOpeningParen)
		buffer.append(SPACE);
	buffer.append(LPAREN);
}
 
Example 2
Source File: JavaDocContext.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
	TemplateTranslator translator= new TemplateTranslator();
	TemplateBuffer buffer= translator.translate(template);

	getContextType().resolve(buffer, this);

	IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
	boolean useCodeFormatter= prefs.getBoolean(PreferenceConstants.TEMPLATES_USE_CODEFORMATTER);

	IJavaProject project= getJavaProject();
	JavaFormatter formatter= new JavaFormatter(TextUtilities.getDefaultLineDelimiter(getDocument()), getIndentation(), useCodeFormatter, project);
	formatter.format(buffer, this);

	return buffer;
}
 
Example 3
Source File: GetterSetterCompletionProposal.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * @param document
 * @param offset
 * @param importRewrite
 * @param completionSnippetsSupported
 * @param addComments
 * @return
 * @throws CoreException
 * @throws BadLocationException
 */
public String updateReplacementString(IDocument document, int offset, ImportRewrite importRewrite, boolean completionSnippetsSupported, boolean addComments) throws CoreException, BadLocationException {
	int flags= Flags.AccPublic | (fField.getFlags() & Flags.AccStatic);
	String stub;
	if (fIsGetter) {
		String getterName= GetterSetterUtil.getGetterName(fField, null);
		stub = GetterSetterUtil.getGetterStub(fField, getterName, addComments, flags);
	} else {
		String setterName= GetterSetterUtil.getSetterName(fField, null);
		stub = GetterSetterUtil.getSetterStub(fField, setterName, addComments, flags);
	}

	// use the code formatter
	String lineDelim= TextUtilities.getDefaultLineDelimiter(document);
	String replacement = CodeFormatterUtil.format(CodeFormatter.K_CLASS_BODY_DECLARATIONS, stub, 0, lineDelim, fField.getJavaProject());

	if (replacement.endsWith(lineDelim)) {
		replacement = replacement.substring(0, replacement.length() - lineDelim.length());
	}

	return replacement;
}
 
Example 4
Source File: QuickFixer.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public IRegion processFix(IDocument document, IMarker marker) throws CoreException {
    int line = (int) marker.getAttribute(IMarker.LINE_NUMBER);
    try {
        String indent = getIndent(document, line);
        // getLineOffset() is zero-based, and imarkerLine is one-based.
        int endOfCurrLine = document.getLineInformation(line - 1).getOffset()
                + document.getLineInformation(line - 1).getLength();
        // should be fine for first and last lines in the doc as well
        String replacementText = indent + "type: object";
        String delim = TextUtilities.getDefaultLineDelimiter(document);
        document.replace(endOfCurrLine, 0, delim + replacementText);
        return new Region(endOfCurrLine + delim.length(), replacementText.length());
    } catch (BadLocationException e) {
        throw new CoreException(createStatus(e, "Cannot process the IMarker"));
    }
}
 
Example 5
Source File: JavadocTagsSubProcessor.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void addEdits(IDocument document, TextEdit rootEdit) throws CoreException {
	try {
		String lineDelimiter= TextUtilities.getDefaultLineDelimiter(document);
		final IJavaProject project= getCompilationUnit().getJavaProject();
		IRegion region= document.getLineInformationOfOffset(fInsertPosition);

		String lineContent= document.get(region.getOffset(), region.getLength());
		String indentString= Strings.getIndentString(lineContent, project);
		String str= Strings.changeIndent(fComment, 0, project, indentString, lineDelimiter);
		InsertEdit edit= new InsertEdit(fInsertPosition, str);
		rootEdit.addChild(edit);
		if (fComment.charAt(fComment.length() - 1) != '\n') {
			rootEdit.addChild(new InsertEdit(fInsertPosition, lineDelimiter));
			rootEdit.addChild(new InsertEdit(fInsertPosition, indentString));
		}
	} catch (BadLocationException e) {
		throw new CoreException(StatusFactory.newErrorStatus("Invalid edit", e));
	}
}
 
Example 6
Source File: WhitespaceHelper.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public void initialize(IDocument document, int offset, int length, boolean ensureEmptyLinesAround) {
	this.offset = offset;
	this.length = length;
	this.lineSeparator = TextUtilities.getDefaultLineDelimiter(document);
	if (ensureEmptyLinesAround) {
		prefix = calculateLeadingWhitespace(document);
		suffix = calculateTrailingWhitespace(document);
	}
}
 
Example 7
Source File: LangContext.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
public TemplateBuffer evaluate(Template template, boolean fixIndentation) 
			throws BadLocationException, TemplateException {
		if (!canEvaluate(template))
			return null;
		
		TemplateTranslator translator= new TemplateTranslator();
		
		String pattern = template.getPattern();
//		if(fixIndentation) {
//			pattern = fixIndentation(pattern);
//		}
		TemplateBuffer buffer = translator.translate(pattern);
		
		getContextType().resolve(buffer, this);
		
		if(fixIndentation) {
			String delimiter = TextUtilities.getDefaultLineDelimiter(getDocument());
			JavaFormatter formatter = new JavaFormatter(delimiter) {
				@Override
				protected void indent(IDocument document) throws BadLocationException, MalformedTreeException {
					simpleIndent(document);
				}
			};
			formatter.format(buffer, this);
		}
		
		return buffer;
	}
 
Example 8
Source File: LangAutoEditStrategy.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
protected void smartIndentAfterNewLine(IDocument doc, DocumentCommand2 cmd) throws BadLocationException {
	if(cmd.length > 0 || cmd.text == null)
		return;
	
	IRegion lineRegion = doc.getLineInformationOfOffset(cmd.offset);
	int lineEnd = getRegionEnd(lineRegion);
	
	int postWsEndPos = TextSourceUtils.findEndOfIndent(docContents, cmd.offset); 
	boolean hasPendingTextAfterEdit = postWsEndPos != lineEnd;
	
	
	BlockHeuristicsScannner bhscanner = createBlockHeuristicsScanner(doc);
	
	int offsetForBalanceCalculation = findOffsetForBalanceCalculation(doc, bhscanner, cmd.offset);
	int lineForBalanceCalculation = doc.getLineOfOffset(cmd.offset);
	
	// Find block balances of preceding text (line start to edit cursor)
	LineIndentResult nli = determineIndent(doc, bhscanner, lineForBalanceCalculation, offsetForBalanceCalculation);
	cmd.text += nli.nextLineIndent;
	
	BlockBalanceResult blockInfo = nli.blockInfo;
	if(blockInfo.unbalancedOpens > 0) {
		if(preferences.closeBraces() && !hasPendingTextAfterEdit){
			
			if(bhscanner.shouldCloseBlock(blockInfo.rightmostUnbalancedBlockOpenOffset)) {
				//close block
				cmd.caretOffset = cmd.offset + cmd.text.length();
				cmd.shiftsCaret = false;
				String delimiter = TextUtilities.getDefaultLineDelimiter(doc);
				char openChar = doc.getChar(blockInfo.rightmostUnbalancedBlockOpenOffset);
				char closeChar = bhscanner.getClosingPeer(openChar); 
				cmd.text += delimiter + addIndent(nli.editLineIndent, blockInfo.unbalancedOpens - 1) + closeChar;
			}
		}
		return;
	}
}
 
Example 9
Source File: SpellCheckIterator.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates a new spell check iterator.
 *
 * @param document the document containing the specified partition
 * @param region the region to spell check
 * @param locale the locale to use for spell checking
 * @param breakIterator the break-iterator
 */
public SpellCheckIterator(IDocument document, IRegion region, Locale locale, BreakIterator breakIterator) {
	fOffset= region.getOffset();
	fWordIterator= breakIterator;
	fDelimiter= TextUtilities.getDefaultLineDelimiter(document);

	String content;
	try {

		content= document.get(region.getOffset(), region.getLength());
		if (content.startsWith(NLSElement.TAG_PREFIX))
			content= ""; //$NON-NLS-1$

	} catch (Exception exception) {
		content= ""; //$NON-NLS-1$
	}
	fContent= content;

	fWordIterator.setText(content);
	fPredecessor= fWordIterator.first();
	fSuccessor= fWordIterator.next();

	final BreakIterator iterator= BreakIterator.getSentenceInstance(locale);
	iterator.setText(content);

	int offset= iterator.current();
	while (offset != BreakIterator.DONE) {

		fSentenceBreaks.add(new Integer(offset));
		offset= iterator.next();
	}
}
 
Example 10
Source File: InternalASTRewrite.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Performs the rewrite: The rewrite events are translated to the corresponding in text changes.
 * The given options can be null in which case the global options {@link JavaCore#getOptions() JavaCore.getOptions()}
 * will be used.
 *
 * @param document Document which describes the code of the AST that is passed in in the
 * constructor. This document is accessed read-only.
 * @param options the given options
 * @throws IllegalArgumentException if the rewrite fails
 * @return Returns the edit describing the text changes.
 */
public TextEdit rewriteAST(IDocument document, Map options) {
	TextEdit result = new MultiTextEdit();

	final CompilationUnit rootNode = getRootNode();
	if (rootNode != null) {
		TargetSourceRangeComputer xsrComputer = new TargetSourceRangeComputer() {
			/**
			 * This implementation of
			 * {@link TargetSourceRangeComputer#computeSourceRange(ASTNode)}
			 * is specialized to work in the case of internal AST rewriting, where the
			 * original AST has been modified from its original form. This means that
			 * one cannot trust that the root of the given node is the compilation unit.
			 */
			public SourceRange computeSourceRange(ASTNode node) {
				int extendedStartPosition = rootNode.getExtendedStartPosition(node);
				int extendedLength = rootNode.getExtendedLength(node);
				return new SourceRange(extendedStartPosition, extendedLength);
			}
		};
		char[] content= document.get().toCharArray();
		LineInformation lineInfo= LineInformation.create(document);
		String lineDelim= TextUtilities.getDefaultLineDelimiter(document);
		List comments= rootNode.getCommentList();

		Map currentOptions = options == null ? JavaCore.getOptions() : options;
		ASTRewriteAnalyzer visitor = new ASTRewriteAnalyzer(content, lineInfo, lineDelim, result, this.eventStore, this.nodeStore, comments, currentOptions, xsrComputer, (RecoveryScannerData)rootNode.getStatementsRecoveryData());
		rootNode.accept(visitor);
	}
	return result;
}
 
Example 11
Source File: RefactoringInfo.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
private String normalizeBlockIndentation(ICoreTextSelection selection, String selectedText) throws Throwable {
    String[] lines = selectedText.split("\\n");
    if (lines.length < 2) {
        return selectedText;
    }

    String firstLine = doc.get(doc.getLineOffset(selection.getStartLine()),
            doc.getLineLength(selection.getStartLine()));
    String lineDelimiter = TextUtilities.getDefaultLineDelimiter(doc);

    String indentation = "";
    int bodyIndent = 0;
    while (firstLine.startsWith(" ")) {
        indentation += " ";
        firstLine = firstLine.substring(1);
        bodyIndent += 1;
    }

    if (bodyIndent > 0) {
        StringBuffer selectedCode = new StringBuffer();
        for (String line : lines) {
            if (line.startsWith(indentation)) {
                selectedCode.append(line.substring(bodyIndent) + lineDelimiter);
            } else {
                selectedCode.append(line + lineDelimiter);
            }

        }
        selectedText = selectedCode.toString();
    }
    return selectedText;
}
 
Example 12
Source File: RefactoringInfo.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
public String getNewLineDelim() {
    return TextUtilities.getDefaultLineDelimiter(this.doc);
}
 
Example 13
Source File: CommonFormatterUtils.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Format a given input string that is in the given file path (or should be injected to).<br>
 * This method will try to determine the content type and the project's formatter settings by the file path and run
 * the right formatter in order to generate a formatted output.
 * 
 * @param filePath
 * @param input
 * @return The formatted output, or the given input in case the input could not be formatted.
 */
public static String format(IPath filePath, String input)
{
	if (filePath == null || input == null || input.trim().length() == 0)
	{
		return input;
	}
	IContentType contentType = Platform.getContentTypeManager().findContentTypeFor(filePath.lastSegment());
	if (contentType != null)
	{
		// Format the string before returning it
		IScriptFormatterFactory factory = ScriptFormatterManager.getSelected(contentType.getId());
		if (factory != null)
		{
			IDocument document = new Document(input);
			IPartitioningConfiguration partitioningConfiguration = (IPartitioningConfiguration) factory
					.getPartitioningConfiguration();
			CompositePartitionScanner partitionScanner = new CompositePartitionScanner(
					partitioningConfiguration.createSubPartitionScanner(), new NullSubPartitionScanner(),
					new NullPartitionerSwitchStrategy());
			IDocumentPartitioner partitioner = new ExtendedFastPartitioner(partitionScanner,
					partitioningConfiguration.getContentTypes());
			partitionScanner.setPartitioner((IExtendedPartitioner) partitioner);
			partitioner.connect(document);
			document.setDocumentPartitioner(partitioner);

			final String lineDelimiter = TextUtilities.getDefaultLineDelimiter(document);
			IResource parentResource = ResourcesPlugin.getWorkspace().getRoot()
					.findMember(filePath.removeLastSegments(1));
			if (parentResource != null)
			{
				IProject project = parentResource.getProject();
				Map<String, String> preferences = factory
						.retrievePreferences(new PreferencesLookupDelegate(project));
				TextEdit formattedTextEdit = factory.createFormatter(lineDelimiter, preferences).format(input, 0,
						input.length(), 0, false, null, StringUtil.EMPTY);
				try
				{
					formattedTextEdit.apply(document);
					input = document.get();
				}
				catch (Exception e)
				{
					IdeLog.logError(CommonEditorPlugin.getDefault(),
							"Error while formatting the file template code", e); //$NON-NLS-1$
				}
			}
		}
	}
	return input;
}
 
Example 14
Source File: PropertyFileDocumentModel.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public PropertyFileDocumentModel(IDocument document) {
    parsePropertyDocument(document);
    fLineDelimiter= TextUtilities.getDefaultLineDelimiter(document);
}
 
Example 15
Source File: TextSelectionUtils.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @return the delimiter that should be used for the passed document
 */
public static String getDelimiter(IDocument doc) {
    return TextUtilities.getDefaultLineDelimiter(doc);
}
 
Example 16
Source File: ASTRewrite.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Converts all modifications recorded by this rewriter
 * into an object representing the corresponding text
 * edits to the given document containing the original source
 * code. The document itself is not modified.
 * <p>
 * For nodes in the original that are being replaced or deleted,
 * this rewriter computes the adjusted source ranges
 * by calling {@link TargetSourceRangeComputer#computeSourceRange(ASTNode) getExtendedSourceRangeComputer().computeSourceRange(node)}.
 * </p>
 * <p>
 * Calling this methods does not discard the modifications
 * on record. Subsequence modifications are added to the ones
 * already on record. If this method is called again later,
 * the resulting text edit object will accurately reflect
 * the net cumulative effect of all those changes.
 * </p>
 *
 * @param document original document containing source code
 * @param options the table of formatter options
 * (key type: <code>String</code>; value type: <code>String</code>);
 * or <code>null</code> to use the standard global options
 * {@link JavaCore#getOptions() JavaCore.getOptions()}
 * @return text edit object describing the changes to the
 * document corresponding to the changes recorded by this rewriter
 * @throws IllegalArgumentException An <code>IllegalArgumentException</code>
 * is thrown if the document passed does not correspond to the AST that is rewritten.
 */
public TextEdit rewriteAST(IDocument document, Map options) throws IllegalArgumentException {
	if (document == null) {
		throw new IllegalArgumentException();
	}

	ASTNode rootNode= getRootNode();
	if (rootNode == null) {
		return new MultiTextEdit(); // no changes
	}

	char[] content= document.get().toCharArray();
	LineInformation lineInfo= LineInformation.create(document);
	String lineDelim= TextUtilities.getDefaultLineDelimiter(document);

	ASTNode astRoot= rootNode.getRoot();
	List commentNodes= astRoot instanceof CompilationUnit ? ((CompilationUnit) astRoot).getCommentList() : null;
	Map currentOptions = options == null ? JavaCore.getOptions() : options;
	return internalRewriteAST(content, lineInfo, lineDelim, commentNodes, currentOptions, rootNode, (RecoveryScannerData)((CompilationUnit) astRoot).getStatementsRecoveryData());
}
 
Example 17
Source File: AddJavaDocStubOperation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private void addJavadocComments(IProgressMonitor monitor) throws CoreException {
	ICompilationUnit cu= fMembers[0].getCompilationUnit();

	ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
	IPath path= cu.getPath();

	manager.connect(path, LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
	try {
		IDocument document= manager.getTextFileBuffer(path, LocationKind.IFILE).getDocument();

		String lineDelim= TextUtilities.getDefaultLineDelimiter(document);
		MultiTextEdit edit= new MultiTextEdit();

		for (int i= 0; i < fMembers.length; i++) {
			IMember curr= fMembers[i];
			int memberStartOffset= getMemberStartOffset(curr, document);

			String comment= null;
			switch (curr.getElementType()) {
				case IJavaElement.TYPE:
					comment= createTypeComment((IType) curr, lineDelim);
					break;
				case IJavaElement.FIELD:
					comment= createFieldComment((IField) curr, lineDelim);
					break;
				case IJavaElement.METHOD:
					comment= createMethodComment((IMethod) curr, lineDelim);
					break;
			}
			if (comment == null) {
				StringBuffer buf= new StringBuffer();
				buf.append("/**").append(lineDelim); //$NON-NLS-1$
				buf.append(" *").append(lineDelim); //$NON-NLS-1$
				buf.append(" */").append(lineDelim); //$NON-NLS-1$
				comment= buf.toString();
			} else {
				if (!comment.endsWith(lineDelim)) {
					comment= comment + lineDelim;
				}
			}

			final IJavaProject project= cu.getJavaProject();
			IRegion region= document.getLineInformationOfOffset(memberStartOffset);

			String line= document.get(region.getOffset(), region.getLength());
			String indentString= Strings.getIndentString(line, project);

			String indentedComment= Strings.changeIndent(comment, 0, project, indentString, lineDelim);

			edit.addChild(new InsertEdit(memberStartOffset, indentedComment));

			monitor.worked(1);
		}
		edit.apply(document); // apply all edits
	} catch (BadLocationException e) {
		throw new CoreException(JavaUIStatus.createError(IStatus.ERROR, e));
	} finally {
		manager.disconnect(path, LocationKind.IFILE,new SubProgressMonitor(monitor, 1));
	}
}
 
Example 18
Source File: ScriptConsoleDocumentListener.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @return the delimiter to be used to add new lines to the console.
 */
public String getDelimeter() {
    return TextUtilities.getDefaultLineDelimiter(doc);
}
 
Example 19
Source File: MethodDeclarationCompletionProposal.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected boolean updateReplacementString(IDocument document, char trigger, int offset, ImportRewrite impRewrite) throws CoreException, BadLocationException {

	CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(fType.getJavaProject());
	boolean addComments= settings.createComments;

	String[] empty= new String[0];
	String lineDelim= TextUtilities.getDefaultLineDelimiter(document);
	String declTypeName= fType.getTypeQualifiedName('.');
	boolean isInterface= fType.isInterface();

	StringBuffer buf= new StringBuffer();
	if (addComments) {
		String comment= CodeGeneration.getMethodComment(fType.getCompilationUnit(), declTypeName, fMethodName, empty, empty, fReturnTypeSig, empty, null, lineDelim);
		if (comment != null) {
			buf.append(comment);
			buf.append(lineDelim);
		}
	}
	if (fReturnTypeSig != null) {
		if (!isInterface) {
			buf.append("private "); //$NON-NLS-1$
		}
	} else {
		if (fType.isEnum())
			buf.append("private "); //$NON-NLS-1$
		else
			buf.append("public "); //$NON-NLS-1$
	}

	if (fReturnTypeSig != null) {
		buf.append(Signature.toString(fReturnTypeSig));
	}
	buf.append(' ');
	buf.append(fMethodName);
	if (isInterface) {
		buf.append("();"); //$NON-NLS-1$
		buf.append(lineDelim);
	} else {
		buf.append("() {"); //$NON-NLS-1$
		buf.append(lineDelim);

		String body= CodeGeneration.getMethodBodyContent(fType.getCompilationUnit(), declTypeName, fMethodName, fReturnTypeSig == null, "", lineDelim); //$NON-NLS-1$
		if (body != null) {
			buf.append(body);
			buf.append(lineDelim);
		}
		buf.append("}"); //$NON-NLS-1$
		buf.append(lineDelim);
	}
	String stub=  buf.toString();

	// use the code formatter
	IRegion region= document.getLineInformationOfOffset(getReplacementOffset());
	int lineStart= region.getOffset();
	int indent= Strings.computeIndentUnits(document.get(lineStart, getReplacementOffset() - lineStart), settings.tabWidth, settings.indentWidth);

	String replacement= CodeFormatterUtil.format(CodeFormatter.K_CLASS_BODY_DECLARATIONS, stub, indent, lineDelim, fType.getJavaProject());

	if (replacement.endsWith(lineDelim)) {
		replacement= replacement.substring(0, replacement.length() - lineDelim.length());
	}

	setReplacementString(Strings.trimLeadingTabsAndSpaces(replacement));
	return true;
}
 
Example 20
Source File: ModuleAdapter.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
public String getEndLineDelimiter() {
    return TextUtilities.getDefaultLineDelimiter(doc);
}