You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EditorAdapter.java 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v 2.0
  7. * which accompanies this distribution and is available at
  8. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * ******************************************************************/
  13. package org.aspectj.ajde;
  14. import java.io.IOException;
  15. import java.util.List;
  16. import org.aspectj.bridge.ISourceLocation;
  17. /**
  18. * @author Mik Kersten
  19. */
  20. public interface EditorAdapter {
  21. /**
  22. * Seek the editor to a source line in the file specified.
  23. */
  24. void showSourceLine(String filePath, int lineNumber, boolean highlight);
  25. /**
  26. * Seek the editor to a SourceLocation and highlight if specified.
  27. */
  28. void showSourceLine(ISourceLocation sourceLocation, boolean highlight);
  29. /**
  30. * Seek the editor to a source line in the current file.
  31. */
  32. void showSourceLine(int lineNumber, boolean highlight);
  33. /**
  34. * @return full path to the file currently being edited.
  35. */
  36. String getCurrFile();
  37. /**
  38. * Save the contents of the current file being edited.
  39. */
  40. void saveContents() throws IOException;
  41. /**
  42. * Paste text into the current caret position of the editor.
  43. */
  44. void pasteToCaretPos(String text);
  45. /**
  46. * Implement if inline annotations are supported by the editor. Make null
  47. * implementation if inline annotations are not supported.
  48. *
  49. * @param filePath path to the file that should get the annotation
  50. * @param lineNumber line number for the annotation
  51. * @param items list of relations to be rendered as the annotation
  52. */
  53. void showSourcelineAnnotation(String filePath, int lineNumber, List items);
  54. /**
  55. * Implement if multipe editor views are supported by the editor. Make null
  56. * implementation if multiple editor views are not supported.
  57. *
  58. * @param filePath path to the source file
  59. * @param lineNumber line number of the sourceline
  60. */
  61. //public void addEditorViewForSourceLine(String filePath, int lineNumber);
  62. }