blob: 8b5e4d93c4089b3be1f4f5d36aaf4e807352ea5a [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2020 1C-Soft LLC.
*
* 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/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Vladimir Piskarev (1C) - initial API and implementation
*******************************************************************************/
package org.eclipse.handly.buffer;
/**
* Interface for listeners to buffer state changes.
*
* @since 1.4
* @see IBuffer
*/
public interface IBufferListener
{
/**
* Bit-mask for the {@link #bufferSaved(IBuffer) bufferSaved} method.
*
* @see IBuffer#getSupportedListenerMethods()
*/
int M_BUFFER_SAVED = 1 << 0;
/**
* Informs this listener that the contents of the given buffer
* has been saved.
* <p>
* Note that this method is not invoked if the buffer's dirty flag
* is cleared for reasons other than saving the buffer's contents.
* </p>
* <p>
* In general, the buffer may be modified concurrently with calling
* this method.
* </p>
*
* @param buffer the affected buffer (never <code>null</code>)
*/
default void bufferSaved(IBuffer buffer)
{
}
}