/platform/platform-api/src/com/intellij/ide/OccurenceNavigator.java

https://bitbucket.org/nbargnesi/idea · Java · 59 lines · 35 code · 9 blank · 15 comment · 0 complexity · 7635bd36ec9c883f7ffad55350733df0 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.ide;
  17. import com.intellij.pom.Navigatable;
  18. public interface OccurenceNavigator {
  19. class OccurenceInfo {
  20. private final Navigatable myNavigateable;
  21. private final int myOccurenceNumber;
  22. private final int myOccurencesCount;
  23. public OccurenceInfo(Navigatable navigateable, int occurenceNumber, int occurencesCount) {
  24. myNavigateable = navigateable;
  25. myOccurenceNumber = occurenceNumber;
  26. myOccurencesCount = occurencesCount;
  27. }
  28. private OccurenceInfo(int occurenceNumber, int occurencesCount) {
  29. this(null, occurenceNumber, occurencesCount);
  30. }
  31. public static OccurenceInfo position(int occurenceNumber, int occurencesCount) {
  32. return new OccurenceInfo(occurenceNumber, occurencesCount);
  33. }
  34. public Navigatable getNavigateable() {
  35. return myNavigateable;
  36. }
  37. public int getOccurenceNumber() {
  38. return myOccurenceNumber;
  39. }
  40. public int getOccurencesCount() {
  41. return myOccurencesCount;
  42. }
  43. }
  44. boolean hasNextOccurence();
  45. boolean hasPreviousOccurence();
  46. OccurenceInfo goNextOccurence();
  47. OccurenceInfo goPreviousOccurence();
  48. String getNextOccurenceActionName();
  49. String getPreviousOccurenceActionName();
  50. }