comparison dwtx/jface/text/source/SourceViewerConfiguration.d @ 145:02cd5f1224d3

...
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 22:31:00 +0200
parents 65801ad2b265
children f70d9508c95c
comparison
equal deleted inserted replaced
144:16a71f577815 145:02cd5f1224d3
241 * @param contentType the content type for which the strategies are applicable 241 * @param contentType the content type for which the strategies are applicable
242 * @return the auto edit strategies or <code>null</code> if automatic editing is not to be enabled 242 * @return the auto edit strategies or <code>null</code> if automatic editing is not to be enabled
243 * @since 3.1 243 * @since 3.1
244 */ 244 */
245 public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { 245 public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
246 return new IAutoEditStrategy[] { getAutoIndentStrategy(sourceViewer, contentType) }; 246 return [ getAutoIndentStrategy(sourceViewer, contentType) ];
247 } 247 }
248 248
249 /** 249 /**
250 * Returns the default prefixes to be used by the line-prefix operation 250 * Returns the default prefixes to be used by the line-prefix operation
251 * in the given source viewer for text of the given content type. This implementation always 251 * in the given source viewer for text of the given content type. This implementation always
284 * @param sourceViewer the source viewer to be configured by this configuration 284 * @param sourceViewer the source viewer to be configured by this configuration
285 * @param contentType the content type for which the prefix is applicable 285 * @param contentType the content type for which the prefix is applicable
286 * @return the prefixes or <code>null</code> if the prefix operation should not be supported 286 * @return the prefixes or <code>null</code> if the prefix operation should not be supported
287 */ 287 */
288 public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) { 288 public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
289 return new String[] { "\t", " ", "" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 289 return [ "\t", " ", "" ]; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
290 } 290 }
291 291
292 /** 292 /**
293 * Computes and returns the indent prefixes for tab indentation 293 * Computes and returns the indent prefixes for tab indentation
294 * which is represented as <code>tabSizeInSpaces</code>. 294 * which is represented as <code>tabSizeInSpaces</code>.
295 * 295 *
296 * @param tabWidth the display tab width 296 * @param tabWidth the display tab width
297 * @return the indent prefixes 297 * @return the indent prefixes
298 * @see #getIndentPrefixes(ISourceViewer, String) 298 * @see #getIndentPrefixes(ISourceViewer, String)
299 * @since 3.3 299 * @since 3.3
300 */ 300 */
424 * 424 *
425 * @param sourceViewer the source viewer to be configured by this configuration 425 * @param sourceViewer the source viewer to be configured by this configuration
426 * @return the configured content types for the given viewer 426 * @return the configured content types for the given viewer
427 */ 427 */
428 public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { 428 public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
429 return new String[] { IDocument.DEFAULT_CONTENT_TYPE }; 429 return [ IDocument.DEFAULT_CONTENT_TYPE ];
430 } 430 }
431 431
432 /** 432 /**
433 * Returns the configured partitioning for the given source viewer. The partitioning is 433 * Returns the configured partitioning for the given source viewer. The partitioning is
434 * used when the querying content types from the source viewer's input document. This 434 * used when the querying content types from the source viewer's input document. This
454 */ 454 */
455 public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { 455 public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
456 if (sourceViewer is null) 456 if (sourceViewer is null)
457 return null; 457 return null;
458 458
459 return new IHyperlinkDetector[] { new URLHyperlinkDetector() }; 459 return [ new URLHyperlinkDetector() ];
460 } 460 }
461 461
462 /** 462 /**
463 * Returns the hyperlink presenter for the given source viewer. 463 * Returns the hyperlink presenter for the given source viewer.
464 * This implementation always returns the {@link DefaultHyperlinkPresenter}. 464 * This implementation always returns the {@link DefaultHyperlinkPresenter}.