Java 类com.intellij.psi.codeStyle.FormattingModeAwareIndentAdjuster 实例源码

项目:intellij    文件:DelegatingCodeStyleManagerSdkCompatAdapter.java   
/** Uses same fallback as {@link CodeStyleManager#getCurrentFormattingMode}. */
@Override
public FormattingMode getCurrentFormattingMode() {
  if (delegate instanceof FormattingModeAwareIndentAdjuster) {
    return ((FormattingModeAwareIndentAdjuster) delegate).getCurrentFormattingMode();
  }
  return FormattingMode.REFORMAT;
}
项目:intellij    文件:DelegatingCodeStyleManagerSdkCompatAdapter.java   
@Override
public int adjustLineIndent(
    @NotNull final Document document, final int offset, FormattingMode mode)
    throws IncorrectOperationException {
  if (delegate instanceof FormattingModeAwareIndentAdjuster) {
    return ((FormattingModeAwareIndentAdjuster) delegate)
        .adjustLineIndent(document, offset, mode);
  }
  return offset;
}
项目:intellij    文件:DelegatingCodeStyleManagerSdkCompatAdapter.java   
/** Uses same fallback as {@link CodeStyleManager#getCurrentFormattingMode}. */
@Override
public FormattingMode getCurrentFormattingMode() {
  if (delegate instanceof FormattingModeAwareIndentAdjuster) {
    return ((FormattingModeAwareIndentAdjuster) delegate).getCurrentFormattingMode();
  }
  return FormattingMode.REFORMAT;
}
项目:intellij    文件:DelegatingCodeStyleManagerSdkCompatAdapter.java   
@Override
public int adjustLineIndent(
    @NotNull final Document document, final int offset, FormattingMode mode)
    throws IncorrectOperationException {
  if (delegate instanceof FormattingModeAwareIndentAdjuster) {
    return ((FormattingModeAwareIndentAdjuster) delegate)
        .adjustLineIndent(document, offset, mode);
  }
  return offset;
}
项目:intellij    文件:DelegatingCodeStyleManagerSdkCompatAdapter.java   
/** Uses same fallback as {@link CodeStyleManager#getCurrentFormattingMode}. */
@Override
public FormattingMode getCurrentFormattingMode() {
  if (delegate instanceof FormattingModeAwareIndentAdjuster) {
    return ((FormattingModeAwareIndentAdjuster) delegate).getCurrentFormattingMode();
  }
  return FormattingMode.REFORMAT;
}
项目:intellij    文件:DelegatingCodeStyleManagerSdkCompatAdapter.java   
@Override
public int adjustLineIndent(
    @NotNull final Document document, final int offset, FormattingMode mode)
    throws IncorrectOperationException {
  if (delegate instanceof FormattingModeAwareIndentAdjuster) {
    return ((FormattingModeAwareIndentAdjuster) delegate)
        .adjustLineIndent(document, offset, mode);
  }
  return offset;
}
项目:EclipseCodeFormatter    文件:ManualCodeStyleManagerDelegator.java   
@Override
public int adjustLineIndent(@NotNull Document document, int offset, FormattingMode formattingMode) {
    if (original instanceof FormattingModeAwareIndentAdjuster) {
        return ((FormattingModeAwareIndentAdjuster) original).adjustLineIndent(document, offset, formattingMode);
    } else {
        return offset;
    }
}
项目:EclipseCodeFormatter    文件:ManualCodeStyleManagerDelegator.java   
@Override
public FormattingMode getCurrentFormattingMode() {
    if (original instanceof FormattingModeAwareIndentAdjuster) {
        return ((FormattingModeAwareIndentAdjuster) original).getCurrentFormattingMode();
    } else {
        return FormattingMode.REFORMAT;
    }
}
项目:EclipseCodeFormatter    文件:ProxyUtils.java   
@NotNull
private static Class[] getInterfaces() {
    try {
        return new Class[]{FormattingModeAwareIndentAdjuster.class};
    } catch (Throwable e) {
        //old API < IJ ~2017
        return new Class[]{};
    }
}
项目:consulo    文件:FormatterBasedIndentAdjuster.java   
public void run() {
  int lineStart = myDocument.getLineStartOffset(myLine);
  CommandProcessor.getInstance().runUndoTransparentAction(() -> ApplicationManager.getApplication().runWriteAction(() -> {
    CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(myProject);
    if (codeStyleManager instanceof FormattingModeAwareIndentAdjuster) {
      ((FormattingModeAwareIndentAdjuster)codeStyleManager).adjustLineIndent(myDocument, lineStart, FormattingMode.ADJUST_INDENT_ON_ENTER);
    }
  }));
}