1 19 20 package org.netbeans.modules.editor.fold; 21 22 import javax.swing.event.DocumentEvent ; 23 import javax.swing.text.BadLocationException ; 24 import javax.swing.text.Document ; 25 import org.netbeans.api.editor.fold.Fold; 26 import org.netbeans.api.editor.fold.FoldHierarchy; 27 import org.netbeans.api.editor.fold.FoldHierarchyEvent; 28 import org.netbeans.api.editor.fold.FoldStateChange; 29 import org.netbeans.api.editor.fold.FoldType; 30 31 37 38 public abstract class ApiPackageAccessor { 39 40 private static ApiPackageAccessor INSTANCE; 41 42 public static ApiPackageAccessor get() { 43 return INSTANCE; 44 } 45 46 52 public static void register(ApiPackageAccessor accessor) { 53 if (INSTANCE != null) { 54 throw new IllegalStateException ("Already registered"); } 56 INSTANCE = accessor; 57 } 58 59 public abstract FoldHierarchy createFoldHierarchy(FoldHierarchyExecution execution); 60 61 public abstract Fold createFold(FoldOperationImpl operation, 62 FoldType type, String description, boolean collapsed, 63 Document doc, int startOffset, int endOffset, 64 int startGuardedLength, int endGuardedLength, 65 Object extraInfo) 66 throws BadLocationException ; 67 68 public abstract FoldHierarchyEvent createFoldHierarchyEvent(FoldHierarchy source, 69 Fold[] removedFolds, Fold[] addedFolds, FoldStateChange[] foldStateChanges, 70 int affectedStartOffset, int affectedEndOffset); 71 72 public abstract FoldStateChange createFoldStateChange(Fold fold); 73 74 public abstract void foldSetCollapsed(Fold fold, boolean collapsed); 75 76 public abstract void foldSetParent(Fold fold, Fold parent); 77 78 public abstract void foldExtractToChildren(Fold fold, int index, int length, Fold targetFold); 79 80 public abstract Fold foldReplaceByChildren(Fold fold, int index); 81 82 public abstract void foldSetDescription(Fold fold, String description); 83 84 public abstract void foldSetStartOffset(Fold fold, Document doc, int startOffset) 85 throws BadLocationException ; 86 87 public abstract void foldSetEndOffset(Fold fold, Document doc, int endOffset) 88 throws BadLocationException ; 89 90 public abstract boolean foldIsStartDamaged(Fold fold); 91 92 public abstract boolean foldIsEndDamaged(Fold fold); 93 94 public abstract boolean foldIsExpandNecessary(Fold fold); 95 96 public abstract void foldInsertUpdate(Fold fold, DocumentEvent evt); 97 98 public abstract void foldRemoveUpdate(Fold fold, DocumentEvent evt); 99 100 public abstract FoldOperationImpl foldGetOperation(Fold fold); 101 102 public abstract int foldGetRawIndex(Fold fold); 103 104 public abstract void foldSetRawIndex(Fold fold, int rawIndex); 105 106 public abstract void foldUpdateRawIndex(Fold fold, int rawIndexDelta); 107 108 public abstract Object foldGetExtraInfo(Fold fold); 109 110 public abstract void foldStateChangeCollapsedChanged(FoldStateChange fsc); 111 112 public abstract void foldStateChangeDescriptionChanged(FoldStateChange fsc); 113 114 public abstract void foldStateChangeStartOffsetChanged(FoldStateChange fsc, 115 int originalStartOffset); 116 117 public abstract void foldStateChangeEndOffsetChanged(FoldStateChange fsc, 118 int originalEndOffset); 119 120 } 121 | Popular Tags |