mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
JavaDoc
This commit is contained in:
@@ -267,7 +267,14 @@ public abstract class CodeStyleManager {
|
||||
public abstract <T extends Throwable> void performActionWithFormatterDisabled(ThrowableRunnable<T> r) throws T;
|
||||
|
||||
public abstract <T> T performActionWithFormatterDisabled(Computable<T> r);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the current formatting mode.
|
||||
*
|
||||
* @param project The current project used to obtain {@code CodeStyleManager} instance.
|
||||
* @return The current formatting mode.
|
||||
* @see FormattingMode
|
||||
*/
|
||||
public static FormattingMode getCurrentFormattingMode(@NotNull Project project) {
|
||||
if (!project.isDisposed()) {
|
||||
CodeStyleManager instance = getInstance(project);
|
||||
|
||||
+14
@@ -19,8 +19,22 @@ import com.intellij.formatting.FormattingMode;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Used to differentiate between line indent adjustment on a new line after Enter and explicit indent adjustment action.
|
||||
*
|
||||
* @see FormattingMode
|
||||
* @see CodeStyleManager
|
||||
*/
|
||||
public interface FormattingModeAwareIndentAdjuster {
|
||||
|
||||
/**
|
||||
* Adjust line indent at document offset using {@code mode}.
|
||||
*
|
||||
* @param document The document to adjust line indent in.
|
||||
* @param offset The offset in the document.
|
||||
* @param mode The mode: {@link FormattingMode#ADJUST_INDENT} or {@link FormattingMode#ADJUST_INDENT_ON_ENTER}
|
||||
* @return Adjusted offset.
|
||||
*/
|
||||
int adjustLineIndent(@NotNull final Document document, final int offset, FormattingMode mode);
|
||||
|
||||
FormattingMode getCurrentFormattingMode();
|
||||
|
||||
Reference in New Issue
Block a user