1 11 package org.eclipse.jface.text; 12 13 import org.eclipse.swt.custom.StyledText; 14 import org.eclipse.swt.graphics.Color; 15 import org.eclipse.swt.graphics.Point; 16 17 import org.eclipse.jface.viewers.ISelectionProvider; 18 19 20 112 public interface ITextViewer { 113 114 115 116 117 127 StyledText getTextWidget(); 128 129 130 131 132 137 void setUndoManager(IUndoManager undoManager); 138 139 145 void setTextDoubleClickStrategy(ITextDoubleClickStrategy strategy, String contentType); 146 147 167 void setAutoIndentStrategy(IAutoIndentStrategy strategy, String contentType); 168 169 184 void setTextHover(ITextHover textViewerHover, String contentType); 185 186 190 void activatePlugins(); 191 192 199 void resetPlugins(); 200 201 202 203 204 205 213 void addViewportListener(IViewportListener listener); 214 215 222 void removeViewportListener(IViewportListener listener); 223 224 230 void addTextListener(ITextListener listener); 231 232 239 void removeTextListener(ITextListener listener); 240 241 247 void addTextInputListener(ITextInputListener listener); 248 249 256 void removeTextInputListener(ITextInputListener listener); 257 258 259 260 261 262 269 void setDocument(IDocument document); 270 271 276 IDocument getDocument(); 277 278 279 280 281 289 void setEventConsumer(IEventConsumer consumer); 290 291 296 void setEditable(boolean editable); 297 298 303 boolean isEditable(); 304 305 306 307 308 319 void setDocument(IDocument document, int modelRangeOffset, int modelRangeLength); 320 321 329 void setVisibleRegion(int offset, int length); 330 331 335 void resetVisibleRegion(); 336 337 350 IRegion getVisibleRegion(); 351 352 366 boolean overlapsWithVisibleRegion(int offset, int length); 367 368 369 370 371 372 382 void changeTextPresentation(TextPresentation presentation, boolean controlRedraw); 383 384 395 void invalidateTextPresentation(); 396 397 403 void setTextColor(Color color); 404 405 415 void setTextColor(Color color, int offset, int length, boolean controlRedraw); 416 417 418 419 420 425 ITextOperationTarget getTextOperationTarget(); 426 427 432 IFindReplaceTarget getFindReplaceTarget(); 433 434 444 void setDefaultPrefixes(String [] defaultPrefixes, String contentType); 445 446 456 void setIndentPrefixes(String [] indentPrefixes, String contentType); 457 458 459 460 461 462 468 void setSelectedRange(int offset, int length); 469 470 475 Point getSelectedRange(); 476 477 483 ISelectionProvider getSelectionProvider(); 484 485 486 487 488 494 void revealRange(int offset, int length); 495 496 502 void setTopIndex(int index); 503 504 509 int getTopIndex(); 510 511 516 int getTopIndexStartOffset(); 517 518 523 int getBottomIndex(); 524 525 533 int getBottomIndexEndOffset(); 534 535 540 int getTopInset(); 541 } 542 | Popular Tags |