/platform/lang-impl/src/com/intellij/codeInsight/editorActions/enter/EnterHandlerDelegate.java

https://bitbucket.org/nbargnesi/idea · Java · 43 lines · 19 code · 6 blank · 18 comment · 0 complexity · 5dd6345570a3e8075e8fa0a51bd7f7ae MD5 · raw file

  1. /*
  2. * Copyright 2000-2009 JetBrains s.r.o.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.intellij.codeInsight.editorActions.enter;
  17. import com.intellij.openapi.extensions.ExtensionPointName;
  18. import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
  19. import com.intellij.openapi.editor.Editor;
  20. import com.intellij.openapi.actionSystem.DataContext;
  21. import com.intellij.openapi.util.Ref;
  22. import com.intellij.psi.PsiFile;
  23. import org.jetbrains.annotations.NotNull;
  24. import org.jetbrains.annotations.Nullable;
  25. /**
  26. * @author yole
  27. */
  28. public interface EnterHandlerDelegate {
  29. ExtensionPointName<EnterHandlerDelegate> EP_NAME = ExtensionPointName.create("com.intellij.enterHandlerDelegate");
  30. enum Result {
  31. Default, Continue, DefaultForceIndent, DefaultSkipIndent, Stop
  32. }
  33. Result preprocessEnter(@NotNull final PsiFile file, @NotNull final Editor editor, @NotNull final Ref<Integer> caretOffset,
  34. @NotNull final Ref<Integer> caretAdvance, @NotNull final DataContext dataContext,
  35. @Nullable final EditorActionHandler originalHandler);
  36. Result postProcessEnter(@NotNull PsiFile file, @NotNull Editor editor, @NotNull DataContext dataContext);
  37. }