blob: 7c84ed850821f5d115e4146d3b1dd03a510c4adc [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2007, 2019 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.ltk.model.core.impl;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.AbstractDocument;
import org.eclipse.statet.ltk.core.SourceContent;
import org.eclipse.statet.ltk.model.core.elements.ISourceUnit;
/**
* Interface to access documents.
* Usually only used inside implementations of {@link ISourceUnit}.
* <p>
* For the progress monitors of the methods the SubMonitor pattern is applied.</p>
*/
public interface IWorkingBuffer {
long getContentStamp(IProgressMonitor monitor);
/**
* @return the document or <code>null</code>
*/
AbstractDocument getDocument();
/**
* @return the document
*/
AbstractDocument getDocument(IProgressMonitor monitor);
SourceContent getContent(IProgressMonitor monitor);
boolean checkState(boolean validate, IProgressMonitor monitor);
boolean isSynchronized();
void saveDocument(IProgressMonitor monitor);
void releaseDocument(IProgressMonitor monitor);
}