[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: TextEditor problem.

Hi,

Line prefix operation ==  Comment line (prefix the line with //)
Line shift operation == Tab / Shift+Tab


Take a look at the TextViewer.doOperation(int op) .
>>
case SHIFT_RIGHT:
	shift(false, true, false);
	break;
case SHIFT_LEFT:
	shift(false, false, false);
	break;
case PREFIX:
	shift(true, true, true);
	break;


The shift() method can be configured to use a specific defaultPrefix (//
or # ...) and indentPrefix (\t or space ...).
The SourceViewerConfiguration is used to configure the source viewer
(ISourceViewer#configure(SourceViewerConfiguration)).


Valère.


Dollyn a écrit :
> In the SourceViewerConfiguration class, There is 2 method,
> getDefaultPrefix and getIndentPrefixes. The questions are:
> 1. about the getDefaultPrefix. The document says that "Returns the
> default prefixes to be used by the line-prefix operation", so, what is
> the line-prefix operation?
> 2. about the getIndentPrefixes. The document says that "Returns the
> prefixes to be used by the line-shift operation", and what is the
> line-shift operation.(Is it the auto indent??).
> 
> Any example is welecome.
> 
> Thanks.