1 19 20 package org.netbeans.spi.editor.completion; 21 22 import java.util.Collection ; 23 import javax.swing.JToolTip ; 24 import org.netbeans.modules.editor.completion.CompletionResultSetImpl; 25 import org.netbeans.modules.editor.completion.CompletionSpiPackageAccessor; 26 27 34 35 public final class CompletionResultSet { 36 37 static { 38 CompletionSpiPackageAccessor.register(new SpiAccessor()); 39 } 40 41 46 public static final int PRIORITY_SORT_TYPE = 0; 47 48 53 public static final int TEXT_SORT_TYPE = 1; 54 55 private CompletionResultSetImpl impl; 56 57 CompletionResultSet(CompletionResultSetImpl impl) { 58 this.impl = impl; 59 impl.setResultSet(this); 60 } 61 62 73 @Deprecated 74 public void setTitle(String title) { 75 impl.setTitle(title); 76 } 77 78 87 public void setAnchorOffset(int anchorOffset) { 88 impl.setAnchorOffset(anchorOffset); 89 } 90 91 106 public boolean addItem(CompletionItem item) { 107 return impl.addItem(item); 108 } 109 110 125 public boolean addAllItems(Collection <? extends CompletionItem> items) { 126 return impl.addAllItems(items); 127 } 128 129 156 public void estimateItems(int estimatedItemCount, int estimatedItemWidth) { 157 impl.estimateItems(estimatedItemCount, estimatedItemWidth); 158 } 159 160 168 public void setDocumentation(CompletionDocumentation documentation) { 169 impl.setDocumentation(documentation); 170 } 171 172 180 public void setToolTip(JToolTip toolTip) { 181 impl.setToolTip(toolTip); 182 } 183 184 188 public void finish() { 189 impl.finish(); 190 } 191 192 198 public boolean isFinished() { 199 return impl.isFinished(); 200 } 201 202 207 public int getSortType() { 208 return impl.getSortType(); 209 } 210 211 226 public void setWaitText(String waitText) { 227 impl.setWaitText(waitText); 228 } 229 230 231 private static final class SpiAccessor extends CompletionSpiPackageAccessor { 232 233 public CompletionResultSet createCompletionResultSet(CompletionResultSetImpl impl) { 234 return new CompletionResultSet(impl); 235 } 236 237 } 238 } 239 | Popular Tags |