Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » vertical line numbers
vertical line numbers [message #18342] Sun, 09 December 2007 10:23 Go to next message
Eclipse UserFriend
Originally posted by: special1.gmx.de

Hi

I want to add vertical line numbers to my editor, but i dont know exactly
what to do.
At this time my code looks like this and I thought it could be work:

public class TMEditor extends ScriptEditor {
...
protected void initializeEditor() {

LineNumberRulerColumn ruleCol = new LineNumberRulerColumn();
super.initializeLineNumberRulerColumn(ruleCol);
super.initializeEditor();
}
...
}

but it wont work and i dont know why, can anyone help me ?
what have I to do ?

Thanks
Sebastian
Re: vertical line numbers [message #18359 is a reply to message #18342] Mon, 10 December 2007 05:32 Go to previous messageGo to next message
Andrei Sobolev is currently offline Andrei SobolevFriend
Messages: 72
Registered: July 2009
Member
Hi Sebastian,

Actually all what you need is already implemented in Eclipse, and provided for all text based editor.
Line number columns are initialized from AbstractDecoratedTextEditor class, ScriptExplorer uses it.

Please check what your editor in initializeEditor method sets ruler context menu id.(setRulerContextMenuId call).

Best regards,
Andrei.

> Hi
>
> I want to add vertical line numbers to my editor, but i dont know
> exactly what to do.
> At this time my code looks like this and I thought it could be work:
>
> public class TMEditor extends ScriptEditor {
> ...
> protected void initializeEditor() {
>
> LineNumberRulerColumn ruleCol = new LineNumberRulerColumn();
> super.initializeLineNumberRulerColumn(ruleCol);
> super.initializeEditor();
> }
> ...
> }
>
> but it wont work and i dont know why, can anyone help me ?
> what have I to do ?
>
> Thanks
> Sebastian
Re: vertical line numbers [message #18394 is a reply to message #18359] Sat, 15 December 2007 10:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: special1.gmx.de

Hi,

sorry, it actually dont work. I'm now trying to setup the vertical line
numbers with a boolean in my preference page.
Can you tell me what flag in preferences I should set, or in general, how I
can make the vertical line numbers work and
what i should set in the inintalize method.

Thanks a lot
Sebastian


"Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
news:fjiis2$7ar$1@build.eclipse.org...
> Hi Sebastian,
>
> Actually all what you need is already implemented in Eclipse, and provided
> for all text based editor.
> Line number columns are initialized from AbstractDecoratedTextEditor
> class, ScriptExplorer uses it.
>
> Please check what your editor in initializeEditor method sets ruler
> context menu id.(setRulerContextMenuId call).
>
> Best regards,
> Andrei.
>
>> Hi
>>
>> I want to add vertical line numbers to my editor, but i dont know
>> exactly what to do.
>> At this time my code looks like this and I thought it could be work:
>>
>> public class TMEditor extends ScriptEditor {
>> ...
>> protected void initializeEditor() {
>>
>> LineNumberRulerColumn ruleCol = new LineNumberRulerColumn();
>> super.initializeLineNumberRulerColumn(ruleCol);
>> super.initializeEditor();
>> }
>> ...
>> }
>>
>> but it wont work and i dont know why, can anyone help me ?
>> what have I to do ?
>>
>> Thanks
>> Sebastian
Re: vertical line numbers [message #18411 is a reply to message #18394] Mon, 17 December 2007 04:23 Go to previous messageGo to next message
Andrei Sobolev is currently offline Andrei SobolevFriend
Messages: 72
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------070204060008080209060902
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi Sebastian,

To add support of line numbering in editor you aren't needed to do anything.

Line numbering support are contributed by Eclipse platform.
Your class should extended AbstractDecoratedTextEditor or ScriptEditor.

Linenumbering column are created from AbstractDecoratedTextEditor.createPartControl() method, and uses
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER constant to obtain enablement state.
(Please look at AbstractDeroratedTextEditor.isLineNumberRulerVisible() method for reference).

Then editor are open, it is possible to show line numbering using context menu. ( I've attached screenshot ).

Best regards,
Andrei.

> Hi,
>
> sorry, it actually dont work. I'm now trying to setup the vertical line
> numbers with a boolean in my preference page.
> Can you tell me what flag in preferences I should set, or in general,
> how I can make the vertical line numbers work and
> what i should set in the inintalize method.
>
> Thanks a lot
> Sebastian
>
>
> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
> news:fjiis2$7ar$1@build.eclipse.org...
>> Hi Sebastian,
>>
>> Actually all what you need is already implemented in Eclipse, and
>> provided for all text based editor.
>> Line number columns are initialized from AbstractDecoratedTextEditor
>> class, ScriptExplorer uses it.
>>
>> Please check what your editor in initializeEditor method sets ruler
>> context menu id.(setRulerContextMenuId call).
>>
>> Best regards,
>> Andrei.
>>
>>> Hi
>>>
>>> I want to add vertical line numbers to my editor, but i dont know
>>> exactly what to do.
>>> At this time my code looks like this and I thought it could be work:
>>>
>>> public class TMEditor extends ScriptEditor {
>>> ...
>>> protected void initializeEditor() {
>>>
>>> LineNumberRulerColumn ruleCol = new
>>> LineNumberRulerColumn();
>>> super.initializeLineNumberRulerColumn(ruleCol);
>>> super.initializeEditor();
>>> }
>>> ...
>>> }
>>>
>>> but it wont work and i dont know why, can anyone help me ?
>>> what have I to do ?
>>>
>>> Thanks
>>> Sebastian
>


--------------070204060008080209060902
Content-Type: image/png;
name="line_numbering.png"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="line_numbering.png"

iVBORw0KGgoAAAANSUhEUgAAAU4AAADiCAIAAACumLkfAAAACXBIWXMAAAsT AAALEwEAmpwY
AAAAB3RJTUUH1wwRBBQRra0EtwAAIABJREFUeNrtnXdcFNfax8/szOwu7C4s CwoKKtijXrEh
wQQFbNFYYrCgJmqMJZoYSxIT9er12o0mN94YfTW2JJqoeBNL7AVbLFixBAuC BQQpu7AsW2an
vH8MDOs2FkRZ4Pl++OjsmdPm7PnNc87ZmfNgO7b93KN3H1TCscMHFS16IYTC g/F1CeqJ0Son
/84a3Bw5Zs3ibxt0eaNFQz+mKP9e0lnxGx/0aeyFnKLOy1X5+qFXTmsM3eae OxCY6Iu6n0LL
u6EreeVIBQDuBuHoRJk6nxitcp716C+mycQi/rhl6+YrtmWXKXV3w6xFF0xo bWu0zYSualEH
L+gwQHVF5OhEmTpfl6B2njWvc46l8589Svjj544xAW7bCoJNtjLO6ivIuxUS YWjca2jzFVdT
AUDtsuo8s+fMRQgFtI+dGiSrdq1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yAIAsdJ4rkr+nD5oev5ZaxFtVPm bvzyrVrVcWOH
xO35PZ4giBdXe/rg3kxhIdKa8UBV0K7DNVbqOE4Qbuc0wVLSVvK2ter/DwFu H0AC3zyiAAAA
AElFTkSuQmCC
--------------070204060008080209060902--
Re: vertical line numbers [message #19432 is a reply to message #18411] Sat, 29 December 2007 12:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: special1.gmx.de

Hi, thanks for help

Can you tell me how I can implement my own shortcuts for the editor, too ?
(e.g. comment/uncomment etc...)


Best regards
Sebastian Biedermann





"Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
news:fk4tdl$qfi$1@build.eclipse.org...
> Hi Sebastian,
>
> To add support of line numbering in editor you aren't needed to do
> anything.
>
> Line numbering support are contributed by Eclipse platform.
> Your class should extended AbstractDecoratedTextEditor or ScriptEditor.
>
> Linenumbering column are created from
> AbstractDecoratedTextEditor.createPartControl() method, and uses
> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
> constant to obtain enablement state.
> (Please look at AbstractDeroratedTextEditor.isLineNumberRulerVisible()
> method for reference).
>
> Then editor are open, it is possible to show line numbering using context
> menu. ( I've attached screenshot ).
>
> Best regards,
> Andrei.
>
>> Hi,
>>
>> sorry, it actually dont work. I'm now trying to setup the vertical line
>> numbers with a boolean in my preference page.
>> Can you tell me what flag in preferences I should set, or in general,
>> how I can make the vertical line numbers work and
>> what i should set in the inintalize method.
>>
>> Thanks a lot
>> Sebastian
>>
>>
>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>> news:fjiis2$7ar$1@build.eclipse.org...
>>> Hi Sebastian,
>>>
>>> Actually all what you need is already implemented in Eclipse, and
>>> provided for all text based editor.
>>> Line number columns are initialized from AbstractDecoratedTextEditor
>>> class, ScriptExplorer uses it.
>>>
>>> Please check what your editor in initializeEditor method sets ruler
>>> context menu id.(setRulerContextMenuId call).
>>>
>>> Best regards,
>>> Andrei.
>>>
>>>> Hi
>>>>
>>>> I want to add vertical line numbers to my editor, but i dont know
>>>> exactly what to do.
>>>> At this time my code looks like this and I thought it could be work:
>>>>
>>>> public class TMEditor extends ScriptEditor {
>>>> ...
>>>> protected void initializeEditor() {
>>>>
>>>> LineNumberRulerColumn ruleCol = new
>>>> LineNumberRulerColumn();
>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>> super.initializeEditor();
>>>> }
>>>> ...
>>>> }
>>>>
>>>> but it wont work and i dont know why, can anyone help me ?
>>>> what have I to do ?
>>>>
>>>> Thanks
>>>> Sebastian
>>
>
>
Re: vertical line numbers [message #19477 is a reply to message #19432] Sun, 30 December 2007 19:52 Go to previous messageGo to next message
Jae Gangemi is currently offline Jae GangemiFriend
Messages: 28
Registered: July 2009
Junior Member
funny you should ask that, i just started working on refactoring some
of the code that takes care of adding some of the actions to the editor
and to the appropriate menus (bar and context).

i just checked in some enhancements to the
ScriptSourceViewerConfiguration implementation that handles setting up
the line prefix that will be used for comments. if your language uses
something other then a "#", override the getCommentPrefix() method in
your sub-class.

if you're in a hurry to get this working, take a look at the
'creatActions' method in the ruby editor, you can pretty much cut and
paste that code to get this working in your editor - although the
'add/remove/toggle' comment actions are all redundant at this point.
the single 'toggle comment' action is really all you need (that's all
the jdt offers now for single line comments).


On 2007-12-29 07:47:24 -0500, "Sebastian Biedermann" <special1@gmx.de> said:

> Hi, thanks for help
>
> Can you tell me how I can implement my own shortcuts for the editor,
> too ? (e.g. comment/uncomment etc...)
>
>
> Best regards
> Sebastian Biedermann
>
>
>
>
>
> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
> news:fk4tdl$qfi$1@build.eclipse.org...
>> Hi Sebastian,
>>
>> To add support of line numbering in editor you aren't needed to do anything.
>>
>> Line numbering support are contributed by Eclipse platform.
>> Your class should extended AbstractDecoratedTextEditor or ScriptEditor.
>>
>> Linenumbering column are created from
>> AbstractDecoratedTextEditor.createPartControl() method, and uses
>> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
>> constant to obtain enablement state.
>> (Please look at AbstractDeroratedTextEditor.isLineNumberRulerVisible()
>> method for reference).
>>
>> Then editor are open, it is possible to show line numbering using
>> context menu. ( I've attached screenshot ).
>>
>> Best regards,
>> Andrei.
>>
>>> Hi,
>>>
>>> sorry, it actually dont work. I'm now trying to setup the vertical line
>>> numbers with a boolean in my preference page.
>>> Can you tell me what flag in preferences I should set, or in general,
>>> how I can make the vertical line numbers work and
>>> what i should set in the inintalize method.
>>>
>>> Thanks a lot
>>> Sebastian
>>>
>>>
>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>> news:fjiis2$7ar$1@build.eclipse.org...
>>>> Hi Sebastian,
>>>>
>>>> Actually all what you need is already implemented in Eclipse, and
>>>> provided for all text based editor.
>>>> Line number columns are initialized from AbstractDecoratedTextEditor
>>>> class, ScriptExplorer uses it.
>>>>
>>>> Please check what your editor in initializeEditor method sets ruler
>>>> context menu id.(setRulerContextMenuId call).
>>>>
>>>> Best regards,
>>>> Andrei.
>>>>
>>>>> Hi
>>>>>
>>>>> I want to add vertical line numbers to my editor, but i dont know
>>>>> exactly what to do.
>>>>> At this time my code looks like this and I thought it could be work:
>>>>>
>>>>> public class TMEditor extends ScriptEditor {
>>>>> ...
>>>>> protected void initializeEditor() {
>>>>>
>>>>> LineNumberRulerColumn ruleCol = new
>>>>> LineNumberRulerColumn();
>>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>>> super.initializeEditor();
>>>>> }
>>>>> ...
>>>>> }
>>>>>
>>>>> but it wont work and i dont know why, can anyone help me ?
>>>>> what have I to do ?
>>>>>
>>>>> Thanks
>>>>> Sebastian


--
-jae
Re: vertical line numbers [message #19612 is a reply to message #19477] Thu, 03 January 2008 13:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: special1.gmx.de

Hi,

if i use the createAction from Ruby in my code and overwrite the
createActions method in my editor extending from Scripteditor
with following source code:

protected void createActions() {

super.createActions();

Action action = new
TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
"Comment.", this, ITextOperationTarget.PREFIX);

action.setActionDefinitionId(IScriptEditorActionDefinitionId s.COMMENT);

setAction("Comment", action);
markAsStateDependentAction("Comment", true);

action = new
TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
"Uncomment.", this, ITextOperationTarget.STRIP_PREFIX);

action.setActionDefinitionId(IScriptEditorActionDefinitionId s.UNCOMMENT);
setAction("Uncomment", action);
markAsStateDependentAction("Uncomment", true);

action = new
ToggleCommentAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
"ToggleComment.", this);
action.setActionDefinitionId(IScriptEditorActionDefinitionId s.TOGGLE_COMMENT);
setAction("ToggleComment", action);
markAsStateDependentAction("ToggleComment", true);

ISourceViewer sourceViewer = getSourceViewer();
SourceViewerConfiguration configuration = getSourceViewerConfiguration();
((ToggleCommentAction) action).configure(sourceViewer, configuration);
}


nothing happens when i start my plugin and when i press ctrl + /
i would like to implement this shortcut for comment/uncomment but i dont
know what to do
and where to start

thanks
Sebastian Biedermann



"Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
news:fl8sth$u47$1@build.eclipse.org...
>
> funny you should ask that, i just started working on refactoring some of
> the code that takes care of adding some of the actions to the editor and
> to the appropriate menus (bar and context).
>
> i just checked in some enhancements to the
> ScriptSourceViewerConfiguration implementation that handles setting up the
> line prefix that will be used for comments. if your language uses
> something other then a "#", override the getCommentPrefix() method in your
> sub-class.
>
> if you're in a hurry to get this working, take a look at the
> 'creatActions' method in the ruby editor, you can pretty much cut and
> paste that code to get this working in your editor - although the
> 'add/remove/toggle' comment actions are all redundant at this point. the
> single 'toggle comment' action is really all you need (that's all the jdt
> offers now for single line comments).
>
>
> On 2007-12-29 07:47:24 -0500, "Sebastian Biedermann" <special1@gmx.de>
> said:
>
>> Hi, thanks for help
>>
>> Can you tell me how I can implement my own shortcuts for the editor, too
>> ? (e.g. comment/uncomment etc...)
>>
>>
>> Best regards
>> Sebastian Biedermann
>>
>>
>>
>>
>>
>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>> news:fk4tdl$qfi$1@build.eclipse.org...
>>> Hi Sebastian,
>>>
>>> To add support of line numbering in editor you aren't needed to do
>>> anything.
>>>
>>> Line numbering support are contributed by Eclipse platform.
>>> Your class should extended AbstractDecoratedTextEditor or ScriptEditor.
>>>
>>> Linenumbering column are created from
>>> AbstractDecoratedTextEditor.createPartControl() method, and uses
>>> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
>>> constant to obtain enablement state.
>>> (Please look at AbstractDeroratedTextEditor.isLineNumberRulerVisible()
>>> method for reference).
>>>
>>> Then editor are open, it is possible to show line numbering using
>>> context menu. ( I've attached screenshot ).
>>>
>>> Best regards,
>>> Andrei.
>>>
>>>> Hi,
>>>>
>>>> sorry, it actually dont work. I'm now trying to setup the vertical line
>>>> numbers with a boolean in my preference page.
>>>> Can you tell me what flag in preferences I should set, or in general,
>>>> how I can make the vertical line numbers work and
>>>> what i should set in the inintalize method.
>>>>
>>>> Thanks a lot
>>>> Sebastian
>>>>
>>>>
>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>> news:fjiis2$7ar$1@build.eclipse.org...
>>>>> Hi Sebastian,
>>>>>
>>>>> Actually all what you need is already implemented in Eclipse, and
>>>>> provided for all text based editor.
>>>>> Line number columns are initialized from AbstractDecoratedTextEditor
>>>>> class, ScriptExplorer uses it.
>>>>>
>>>>> Please check what your editor in initializeEditor method sets ruler
>>>>> context menu id.(setRulerContextMenuId call).
>>>>>
>>>>> Best regards,
>>>>> Andrei.
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> I want to add vertical line numbers to my editor, but i dont know
>>>>>> exactly what to do.
>>>>>> At this time my code looks like this and I thought it could be work:
>>>>>>
>>>>>> public class TMEditor extends ScriptEditor {
>>>>>> ...
>>>>>> protected void initializeEditor() {
>>>>>>
>>>>>> LineNumberRulerColumn ruleCol = new
>>>>>> LineNumberRulerColumn();
>>>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>>>> super.initializeEditor();
>>>>>> }
>>>>>> ...
>>>>>> }
>>>>>>
>>>>>> but it wont work and i dont know why, can anyone help me ?
>>>>>> what have I to do ?
>>>>>>
>>>>>> Thanks
>>>>>> Sebastian
>
>
> --
> -jae
>
Re: vertical line numbers [message #19657 is a reply to message #19612] Sat, 05 January 2008 20:03 Go to previous messageGo to next message
Jae Gangemi is currently offline Jae GangemiFriend
Messages: 28
Registered: July 2009
Junior Member
are you working against the head, or one of the exlsting dltk releases?

On 2008-01-03 08:43:46 -0500, "Sebastian Biedermann" <special1@gmx.de> said:

> Hi,
>
> if i use the createAction from Ruby in my code and overwrite the
> createActions method in my editor extending from Scripteditor
> with following source code:
>
> protected void createActions() {
>
> super.createActions();
>
> Action action = new
> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
> "Comment.", this, ITextOperationTarget.PREFIX);
>
> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.COMMENT);
>
> setAction("Comment", action);
> markAsStateDependentAction("Comment", true);
>
> action = new
> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
> "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX);
>
> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.UNCOMMENT);
> setAction("Uncomment", action);
> markAsStateDependentAction("Uncomment", true);
>
> action = new
> ToggleCommentAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
> "ToggleComment.", this);
>
> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.TOGGLE_COMMENT);

>
> setAction("ToggleComment", action);
> markAsStateDependentAction("ToggleComment", true);
>
> ISourceViewer sourceViewer = getSourceViewer();
> SourceViewerConfiguration configuration = getSourceViewerConfiguration();
> ((ToggleCommentAction) action).configure(sourceViewer, configuration);
> }
>
>
> nothing happens when i start my plugin and when i press ctrl + /
> i would like to implement this shortcut for comment/uncomment but i
> dont know what to do
> and where to start
>
> thanks
> Sebastian Biedermann
>
>
>
> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
> news:fl8sth$u47$1@build.eclipse.org...
>>
>> funny you should ask that, i just started working on refactoring some
>> of the code that takes care of adding some of the actions to the editor
>> and to the appropriate menus (bar and context).
>>
>> i just checked in some enhancements to the
>> ScriptSourceViewerConfiguration implementation that handles setting up
>> the line prefix that will be used for comments. if your language uses
>> something other then a "#", override the getCommentPrefix() method in
>> your sub-class.
>>
>> if you're in a hurry to get this working, take a look at the
>> 'creatActions' method in the ruby editor, you can pretty much cut and
>> paste that code to get this working in your editor - although the
>> 'add/remove/toggle' comment actions are all redundant at this point.
>> the single 'toggle comment' action is really all you need (that's all
>> the jdt offers now for single line comments).
>>
>>
>> On 2007-12-29 07:47:24 -0500, "Sebastian Biedermann" <special1@gmx.de> said:
>>
>>> Hi, thanks for help
>>>
>>> Can you tell me how I can implement my own shortcuts for the editor,
>>> too ? (e.g. comment/uncomment etc...)
>>>
>>>
>>> Best regards
>>> Sebastian Biedermann
>>>
>>>
>>>
>>>
>>>
>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>> news:fk4tdl$qfi$1@build.eclipse.org...
>>>> Hi Sebastian,
>>>>
>>>> To add support of line numbering in editor you aren't needed to do anything.
>>>>
>>>> Line numbering support are contributed by Eclipse platform.
>>>> Your class should extended AbstractDecoratedTextEditor or ScriptEditor.
>>>>
>>>> Linenumbering column are created from
>>>> AbstractDecoratedTextEditor.createPartControl() method, and uses
>>>> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
>>>> constant to obtain enablement state.
>>>> (Please look at AbstractDeroratedTextEditor.isLineNumberRulerVisible()
>>>> method for reference).
>>>>
>>>> Then editor are open, it is possible to show line numbering using
>>>> context menu. ( I've attached screenshot ).
>>>>
>>>> Best regards,
>>>> Andrei.
>>>>
>>>>> Hi,
>>>>>
>>>>> sorry, it actually dont work. I'm now trying to setup the vertical line
>>>>> numbers with a boolean in my preference page.
>>>>> Can you tell me what flag in preferences I should set, or in general,
>>>>> how I can make the vertical line numbers work and
>>>>> what i should set in the inintalize method.
>>>>>
>>>>> Thanks a lot
>>>>> Sebastian
>>>>>
>>>>>
>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>> news:fjiis2$7ar$1@build.eclipse.org...
>>>>>> Hi Sebastian,
>>>>>>
>>>>>> Actually all what you need is already implemented in Eclipse, and
>>>>>> provided for all text based editor.
>>>>>> Line number columns are initialized from AbstractDecoratedTextEditor
>>>>>> class, ScriptExplorer uses it.
>>>>>>
>>>>>> Please check what your editor in initializeEditor method sets ruler
>>>>>> context menu id.(setRulerContextMenuId call).
>>>>>>
>>>>>> Best regards,
>>>>>> Andrei.
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> I want to add vertical line numbers to my editor, but i dont know
>>>>>>> exactly what to do.
>>>>>>> At this time my code looks like this and I thought it could be work:
>>>>>>>
>>>>>>> public class TMEditor extends ScriptEditor {
>>>>>>> ...
>>>>>>> protected void initializeEditor() {
>>>>>>>
>>>>>>> LineNumberRulerColumn ruleCol = new
>>>>>>> LineNumberRulerColumn();
>>>>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>>>>> super.initializeEditor();
>>>>>>> }
>>>>>>> ...
>>>>>>> }
>>>>>>>
>>>>>>> but it wont work and i dont know why, can anyone help me ?
>>>>>>> what have I to do ?
>>>>>>>
>>>>>>> Thanks
>>>>>>> Sebastian
>>
>>
>> --
>> -jae


--
-jae
Re: vertical line numbers [message #19702 is a reply to message #19657] Sat, 05 January 2008 22:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: special1.gmx.de

I'm not really working, i'm just playing around with the dltk package, i'm a
student of information technologie.
Or have i missunderstood ? Sorry, i'm not a native english speaker :-(


"Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
news:flonr1$8bg$1@build.eclipse.org...
>
> are you working against the head, or one of the exlsting dltk releases?
>
> On 2008-01-03 08:43:46 -0500, "Sebastian Biedermann" <special1@gmx.de>
> said:
>
>> Hi,
>>
>> if i use the createAction from Ruby in my code and overwrite the
>> createActions method in my editor extending from Scripteditor
>> with following source code:
>>
>> protected void createActions() {
>>
>> super.createActions();
>>
>> Action action = new
>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>> "Comment.", this, ITextOperationTarget.PREFIX);
>>
>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.COMMENT);
>>
>> setAction("Comment", action);
>> markAsStateDependentAction("Comment", true);
>>
>> action = new
>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>> "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX);
>>
>>
>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.UNCOMMENT);
>> setAction("Uncomment", action);
>> markAsStateDependentAction("Uncomment", true);
>>
>> action = new
>> ToggleCommentAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>> "ToggleComment.", this);
>>
>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.TOGGLE_COMMENT);
>
>>
>> setAction("ToggleComment", action);
>> markAsStateDependentAction("ToggleComment", true);
>>
>> ISourceViewer sourceViewer = getSourceViewer();
>> SourceViewerConfiguration configuration =
>> getSourceViewerConfiguration();
>> ((ToggleCommentAction) action).configure(sourceViewer, configuration);
>> }
>>
>>
>> nothing happens when i start my plugin and when i press ctrl + /
>> i would like to implement this shortcut for comment/uncomment but i dont
>> know what to do
>> and where to start
>>
>> thanks
>> Sebastian Biedermann
>>
>>
>>
>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>> news:fl8sth$u47$1@build.eclipse.org...
>>>
>>> funny you should ask that, i just started working on refactoring some
>>> of the code that takes care of adding some of the actions to the editor
>>> and to the appropriate menus (bar and context).
>>>
>>> i just checked in some enhancements to the
>>> ScriptSourceViewerConfiguration implementation that handles setting up
>>> the line prefix that will be used for comments. if your language uses
>>> something other then a "#", override the getCommentPrefix() method in
>>> your sub-class.
>>>
>>> if you're in a hurry to get this working, take a look at the
>>> 'creatActions' method in the ruby editor, you can pretty much cut and
>>> paste that code to get this working in your editor - although the
>>> 'add/remove/toggle' comment actions are all redundant at this point. the
>>> single 'toggle comment' action is really all you need (that's all the
>>> jdt offers now for single line comments).
>>>
>>>
>>> On 2007-12-29 07:47:24 -0500, "Sebastian Biedermann" <special1@gmx.de>
>>> said:
>>>
>>>> Hi, thanks for help
>>>>
>>>> Can you tell me how I can implement my own shortcuts for the editor,
>>>> too ? (e.g. comment/uncomment etc...)
>>>>
>>>>
>>>> Best regards
>>>> Sebastian Biedermann
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>> news:fk4tdl$qfi$1@build.eclipse.org...
>>>>> Hi Sebastian,
>>>>>
>>>>> To add support of line numbering in editor you aren't needed to do
>>>>> anything.
>>>>>
>>>>> Line numbering support are contributed by Eclipse platform.
>>>>> Your class should extended AbstractDecoratedTextEditor or
>>>>> ScriptEditor.
>>>>>
>>>>> Linenumbering column are created from
>>>>> AbstractDecoratedTextEditor.createPartControl() method, and uses
>>>>> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
>>>>> constant to obtain enablement state.
>>>>> (Please look at AbstractDeroratedTextEditor.isLineNumberRulerVisible()
>>>>> method for reference).
>>>>>
>>>>> Then editor are open, it is possible to show line numbering using
>>>>> context menu. ( I've attached screenshot ).
>>>>>
>>>>> Best regards,
>>>>> Andrei.
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> sorry, it actually dont work. I'm now trying to setup the vertical
>>>>>> line
>>>>>> numbers with a boolean in my preference page.
>>>>>> Can you tell me what flag in preferences I should set, or in general,
>>>>>> how I can make the vertical line numbers work and
>>>>>> what i should set in the inintalize method.
>>>>>>
>>>>>> Thanks a lot
>>>>>> Sebastian
>>>>>>
>>>>>>
>>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>>> news:fjiis2$7ar$1@build.eclipse.org...
>>>>>>> Hi Sebastian,
>>>>>>>
>>>>>>> Actually all what you need is already implemented in Eclipse, and
>>>>>>> provided for all text based editor.
>>>>>>> Line number columns are initialized from AbstractDecoratedTextEditor
>>>>>>> class, ScriptExplorer uses it.
>>>>>>>
>>>>>>> Please check what your editor in initializeEditor method sets ruler
>>>>>>> context menu id.(setRulerContextMenuId call).
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Andrei.
>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> I want to add vertical line numbers to my editor, but i dont know
>>>>>>>> exactly what to do.
>>>>>>>> At this time my code looks like this and I thought it could be
>>>>>>>> work:
>>>>>>>>
>>>>>>>> public class TMEditor extends ScriptEditor {
>>>>>>>> ...
>>>>>>>> protected void initializeEditor() {
>>>>>>>>
>>>>>>>> LineNumberRulerColumn ruleCol = new
>>>>>>>> LineNumberRulerColumn();
>>>>>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>>>>>> super.initializeEditor();
>>>>>>>> }
>>>>>>>> ...
>>>>>>>> }
>>>>>>>>
>>>>>>>> but it wont work and i dont know why, can anyone help me ?
>>>>>>>> what have I to do ?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Sebastian
>>>
>>>
>>> --
>>> -jae
>
>
> --
> -jae
>
Re: vertical line numbers [message #19777 is a reply to message #19702] Sun, 06 January 2008 22:16 Go to previous messageGo to next message
Jae Gangemi is currently offline Jae GangemiFriend
Messages: 28
Registered: July 2009
Junior Member
what is the current version of the dtlk code you are using?

do you update from cvs on a regular basis or are you using one of
pre-built releases?

On 2008-01-05 17:01:00 -0500, "Sebastian Biedermann" <special1@gmx.de> said:

> I'm not really working, i'm just playing around with the dltk package,
> i'm a student of information technologie.
> Or have i missunderstood ? Sorry, i'm not a native english speaker :-(
>
>
> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
> news:flonr1$8bg$1@build.eclipse.org...
>>
>> are you working against the head, or one of the exlsting dltk releases?
>>
>> On 2008-01-03 08:43:46 -0500, "Sebastian Biedermann" <special1@gmx.de> said:
>>
>>> Hi,
>>>
>>> if i use the createAction from Ruby in my code and overwrite the
>>> createActions method in my editor extending from Scripteditor
>>> with following source code:
>>>
>>> protected void createActions() {
>>>
>>> super.createActions();
>>>
>>> Action action = new
>>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>> "Comment.", this, ITextOperationTarget.PREFIX);
>>>
>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.COMMENT);
>>>
>>> setAction("Comment", action);
>>> markAsStateDependentAction("Comment", true);
>>>
>>> action = new
>>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>> "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX);
>>>
>>>
>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.UNCOMMENT);
>>> setAction("Uncomment", action);
>>> markAsStateDependentAction("Uncomment", true);
>>>
>>> action = new
>>> ToggleCommentAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>> "ToggleComment.", this);
>>>
>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.TOGGLE_COMMENT);
>>
>>>
>>> setAction("ToggleComment", action);
>>> markAsStateDependentAction("ToggleComment", true);
>>>
>>> ISourceViewer sourceViewer = getSourceViewer();
>>> SourceViewerConfiguration configuration = getSourceViewerConfiguration();
>>> ((ToggleCommentAction) action).configure(sourceViewer, configuration);
>>> }
>>>
>>>
>>> nothing happens when i start my plugin and when i press ctrl + /
>>> i would like to implement this shortcut for comment/uncomment but i
>>> dont know what to do
>>> and where to start
>>>
>>> thanks
>>> Sebastian Biedermann
>>>
>>>
>>>
>>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>>> news:fl8sth$u47$1@build.eclipse.org...
>>>>
>>>> funny you should ask that, i just started working on refactoring some
>>>> of the code that takes care of adding some of the actions to the editor
>>>> and to the appropriate menus (bar and context).
>>>>
>>>> i just checked in some enhancements to the
>>>> ScriptSourceViewerConfiguration implementation that handles setting up
>>>> the line prefix that will be used for comments. if your language uses
>>>> something other then a "#", override the getCommentPrefix() method in
>>>> your sub-class.
>>>>
>>>> if you're in a hurry to get this working, take a look at the
>>>> 'creatActions' method in the ruby editor, you can pretty much cut and
>>>> paste that code to get this working in your editor - although the
>>>> 'add/remove/toggle' comment actions are all redundant at this point.
>>>> the single 'toggle comment' action is really all you need (that's all
>>>> the jdt offers now for single line comments).
>>>>
>>>>
>>>> On 2007-12-29 07:47:24 -0500, "Sebastian Biedermann" <special1@gmx.de> said:
>>>>
>>>>> Hi, thanks for help
>>>>>
>>>>> Can you tell me how I can implement my own shortcuts for the editor,
>>>>> too ? (e.g. comment/uncomment etc...)
>>>>>
>>>>>
>>>>> Best regards
>>>>> Sebastian Biedermann
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>> news:fk4tdl$qfi$1@build.eclipse.org...
>>>>>> Hi Sebastian,
>>>>>>
>>>>>> To add support of line numbering in editor you aren't needed to do anything.
>>>>>>
>>>>>> Line numbering support are contributed by Eclipse platform.
>>>>>> Your class should extended AbstractDecoratedTextEditor or ScriptEditor.
>>>>>>
>>>>>> Linenumbering column are created from
>>>>>> AbstractDecoratedTextEditor.createPartControl() method, and uses
>>>>>> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
>>>>>> constant to obtain enablement state.
>>>>>> (Please look at AbstractDeroratedTextEditor.isLineNumberRulerVisible()
>>>>>> method for reference).
>>>>>>
>>>>>> Then editor are open, it is possible to show line numbering using
>>>>>> context menu. ( I've attached screenshot ).
>>>>>>
>>>>>> Best regards,
>>>>>> Andrei.
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> sorry, it actually dont work. I'm now trying to setup the vertical line
>>>>>>> numbers with a boolean in my preference page.
>>>>>>> Can you tell me what flag in preferences I should set, or in general,
>>>>>>> how I can make the vertical line numbers work and
>>>>>>> what i should set in the inintalize method.
>>>>>>>
>>>>>>> Thanks a lot
>>>>>>> Sebastian
>>>>>>>
>>>>>>>
>>>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>>>> news:fjiis2$7ar$1@build.eclipse.org...
>>>>>>>> Hi Sebastian,
>>>>>>>>
>>>>>>>> Actually all what you need is already implemented in Eclipse, and
>>>>>>>> provided for all text based editor.
>>>>>>>> Line number columns are initialized from AbstractDecoratedTextEditor
>>>>>>>> class, ScriptExplorer uses it.
>>>>>>>>
>>>>>>>> Please check what your editor in initializeEditor method sets ruler
>>>>>>>> context menu id.(setRulerContextMenuId call).
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Andrei.
>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> I want to add vertical line numbers to my editor, but i dont know
>>>>>>>>> exactly what to do.
>>>>>>>>> At this time my code looks like this and I thought it could be work:
>>>>>>>>>
>>>>>>>>> public class TMEditor extends ScriptEditor {
>>>>>>>>> ...
>>>>>>>>> protected void initializeEditor() {
>>>>>>>>>
>>>>>>>>> LineNumberRulerColumn ruleCol = new
>>>>>>>>> LineNumberRulerColumn();
>>>>>>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>>>>>>> super.initializeEditor();
>>>>>>>>> }
>>>>>>>>> ...
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> but it wont work and i dont know why, can anyone help me ?
>>>>>>>>> what have I to do ?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Sebastian
>>>>
>>>>
>>>> --
>>>> -jae
>>
>>
>> --
>> -jae


--
-jae
Re: vertical line numbers [message #19812 is a reply to message #19777] Mon, 07 January 2008 13:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: special1.gmx.de

Hi, sorry

I'm using dltk 0.9.0


"Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
news:flrjvb$ohk$1@build.eclipse.org...
>
> what is the current version of the dtlk code you are using?
>
> do you update from cvs on a regular basis or are you using one of
> pre-built releases?
>
> On 2008-01-05 17:01:00 -0500, "Sebastian Biedermann" <special1@gmx.de>
> said:
>
>> I'm not really working, i'm just playing around with the dltk package,
>> i'm a student of information technologie.
>> Or have i missunderstood ? Sorry, i'm not a native english speaker :-(
>>
>>
>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>> news:flonr1$8bg$1@build.eclipse.org...
>>>
>>> are you working against the head, or one of the exlsting dltk releases?
>>>
>>> On 2008-01-03 08:43:46 -0500, "Sebastian Biedermann" <special1@gmx.de>
>>> said:
>>>
>>>> Hi,
>>>>
>>>> if i use the createAction from Ruby in my code and overwrite the
>>>> createActions method in my editor extending from Scripteditor
>>>> with following source code:
>>>>
>>>> protected void createActions() {
>>>>
>>>> super.createActions();
>>>>
>>>> Action action = new
>>>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>> "Comment.", this, ITextOperationTarget.PREFIX);
>>>>
>>>>
>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.COMMENT);
>>>>
>>>> setAction("Comment", action);
>>>> markAsStateDependentAction("Comment", true);
>>>>
>>>> action = new
>>>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>> "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX);
>>>>
>>>>
>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.UNCOMMENT);
>>>> setAction("Uncomment", action);
>>>> markAsStateDependentAction("Uncomment", true);
>>>>
>>>> action = new
>>>> ToggleCommentAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>> "ToggleComment.", this);
>>>>
>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.TOGGLE_COMMENT);
>>>
>>>>
>>>> setAction("ToggleComment", action);
>>>> markAsStateDependentAction("ToggleComment", true);
>>>>
>>>> ISourceViewer sourceViewer = getSourceViewer();
>>>> SourceViewerConfiguration configuration =
>>>> getSourceViewerConfiguration();
>>>> ((ToggleCommentAction) action).configure(sourceViewer,
>>>> configuration);
>>>> }
>>>>
>>>>
>>>> nothing happens when i start my plugin and when i press ctrl + /
>>>> i would like to implement this shortcut for comment/uncomment but i
>>>> dont know what to do
>>>> and where to start
>>>>
>>>> thanks
>>>> Sebastian Biedermann
>>>>
>>>>
>>>>
>>>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>>>> news:fl8sth$u47$1@build.eclipse.org...
>>>>>
>>>>> funny you should ask that, i just started working on refactoring some
>>>>> of the code that takes care of adding some of the actions to the
>>>>> editor and to the appropriate menus (bar and context).
>>>>>
>>>>> i just checked in some enhancements to the
>>>>> ScriptSourceViewerConfiguration implementation that handles setting up
>>>>> the line prefix that will be used for comments. if your language uses
>>>>> something other then a "#", override the getCommentPrefix() method in
>>>>> your sub-class.
>>>>>
>>>>> if you're in a hurry to get this working, take a look at the
>>>>> 'creatActions' method in the ruby editor, you can pretty much cut and
>>>>> paste that code to get this working in your editor - although the
>>>>> 'add/remove/toggle' comment actions are all redundant at this point.
>>>>> the single 'toggle comment' action is really all you need (that's all
>>>>> the jdt offers now for single line comments).
>>>>>
>>>>>
>>>>> On 2007-12-29 07:47:24 -0500, "Sebastian Biedermann" <special1@gmx.de>
>>>>> said:
>>>>>
>>>>>> Hi, thanks for help
>>>>>>
>>>>>> Can you tell me how I can implement my own shortcuts for the editor,
>>>>>> too ? (e.g. comment/uncomment etc...)
>>>>>>
>>>>>>
>>>>>> Best regards
>>>>>> Sebastian Biedermann
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>>> news:fk4tdl$qfi$1@build.eclipse.org...
>>>>>>> Hi Sebastian,
>>>>>>>
>>>>>>> To add support of line numbering in editor you aren't needed to do
>>>>>>> anything.
>>>>>>>
>>>>>>> Line numbering support are contributed by Eclipse platform.
>>>>>>> Your class should extended AbstractDecoratedTextEditor or
>>>>>>> ScriptEditor.
>>>>>>>
>>>>>>> Linenumbering column are created from
>>>>>>> AbstractDecoratedTextEditor.createPartControl() method, and uses
>>>>>>> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
>>>>>>> constant to obtain enablement state.
>>>>>>> (Please look at
>>>>>>> AbstractDeroratedTextEditor.isLineNumberRulerVisible() method for
>>>>>>> reference).
>>>>>>>
>>>>>>> Then editor are open, it is possible to show line numbering using
>>>>>>> context menu. ( I've attached screenshot ).
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Andrei.
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> sorry, it actually dont work. I'm now trying to setup the vertical
>>>>>>>> line
>>>>>>>> numbers with a boolean in my preference page.
>>>>>>>> Can you tell me what flag in preferences I should set, or in
>>>>>>>> general,
>>>>>>>> how I can make the vertical line numbers work and
>>>>>>>> what i should set in the inintalize method.
>>>>>>>>
>>>>>>>> Thanks a lot
>>>>>>>> Sebastian
>>>>>>>>
>>>>>>>>
>>>>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>>>>> news:fjiis2$7ar$1@build.eclipse.org...
>>>>>>>>> Hi Sebastian,
>>>>>>>>>
>>>>>>>>> Actually all what you need is already implemented in Eclipse, and
>>>>>>>>> provided for all text based editor.
>>>>>>>>> Line number columns are initialized from
>>>>>>>>> AbstractDecoratedTextEditor
>>>>>>>>> class, ScriptExplorer uses it.
>>>>>>>>>
>>>>>>>>> Please check what your editor in initializeEditor method sets
>>>>>>>>> ruler
>>>>>>>>> context menu id.(setRulerContextMenuId call).
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>> Andrei.
>>>>>>>>>
>>>>>>>>>> Hi
>>>>>>>>>>
>>>>>>>>>> I want to add vertical line numbers to my editor, but i dont know
>>>>>>>>>> exactly what to do.
>>>>>>>>>> At this time my code looks like this and I thought it could be
>>>>>>>>>> work:
>>>>>>>>>>
>>>>>>>>>> public class TMEditor extends ScriptEditor {
>>>>>>>>>> ...
>>>>>>>>>> protected void initializeEditor() {
>>>>>>>>>>
>>>>>>>>>> LineNumberRulerColumn ruleCol = new
>>>>>>>>>> LineNumberRulerColumn();
>>>>>>>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>>>>>>>> super.initializeEditor();
>>>>>>>>>> }
>>>>>>>>>> ...
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> but it wont work and i dont know why, can anyone help me ?
>>>>>>>>>> what have I to do ?
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> Sebastian
>>>>>
>>>>>
>>>>> --
>>>>> -jae
>>>
>>>
>>> --
>>> -jae
>
>
> --
> -jae
>
Re: vertical line numbers [message #19857 is a reply to message #19812] Tue, 08 January 2008 15:47 Go to previous messageGo to next message
Jae Gangemi is currently offline Jae GangemiFriend
Messages: 28
Registered: July 2009
Junior Member
oh - then this code definately isn't in the that release.

the 1.0M3 milestone was released a bit back you should definately
upgrade to that, i'd also say you could update to one of the latest
nightlies - once you synced with the other api changes, i believe this
would just start working for you.

if you don't want to do that, you will need to override the
getDefaultPrefixes method in your SourceViewerConfiguration
implementation.

On 2008-01-07 08:33:46 -0500, "Sebastian Biedermann" <special1@gmx.de> said:

> Hi, sorry
>
> I'm using dltk 0.9.0
>
>
> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
> news:flrjvb$ohk$1@build.eclipse.org...
>>
>> what is the current version of the dtlk code you are using?
>>
>> do you update from cvs on a regular basis or are you using one of
>> pre-built releases?
>>
>> On 2008-01-05 17:01:00 -0500, "Sebastian Biedermann" <special1@gmx.de> said:
>>
>>> I'm not really working, i'm just playing around with the dltk package,
>>> i'm a student of information technologie.
>>> Or have i missunderstood ? Sorry, i'm not a native english speaker :-(
>>>
>>>
>>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>>> news:flonr1$8bg$1@build.eclipse.org...
>>>>
>>>> are you working against the head, or one of the exlsting dltk releases?
>>>>
>>>> On 2008-01-03 08:43:46 -0500, "Sebastian Biedermann" <special1@gmx.de> said:
>>>>
>>>>> Hi,
>>>>>
>>>>> if i use the createAction from Ruby in my code and overwrite the
>>>>> createActions method in my editor extending from Scripteditor
>>>>> with following source code:
>>>>>
>>>>> protected void createActions() {
>>>>>
>>>>> super.createActions();
>>>>>
>>>>> Action action = new
>>>>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>>> "Comment.", this, ITextOperationTarget.PREFIX);
>>>>>
>>>>>
>>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.COMMENT);
>>>>>
>>>>> setAction("Comment", action);
>>>>> markAsStateDependentAction("Comment", true);
>>>>>
>>>>> action = new
>>>>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>>> "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX);
>>>>>
>>>>>
>>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.UNCOMMENT);
>>>>> setAction("Uncomment", action);
>>>>> markAsStateDependentAction("Uncomment", true);
>>>>>
>>>>> action = new
>>>>> ToggleCommentAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>>> "ToggleComment.", this);
>>>>>
>>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.TOGGLE_COMMENT);
>>>>
>>>>>
>>>>> setAction("ToggleComment", action);
>>>>> markAsStateDependentAction("ToggleComment", true);
>>>>>
>>>>> ISourceViewer sourceViewer = getSourceViewer();
>>>>> SourceViewerConfiguration configuration = getSourceViewerConfiguration();
>>>>> ((ToggleCommentAction) action).configure(sourceViewer, configuration);
>>>>> }
>>>>>
>>>>>
>>>>> nothing happens when i start my plugin and when i press ctrl + /
>>>>> i would like to implement this shortcut for comment/uncomment but i
>>>>> dont know what to do
>>>>> and where to start
>>>>>
>>>>> thanks
>>>>> Sebastian Biedermann
>>>>>
>>>>>
>>>>>
>>>>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>>>>> news:fl8sth$u47$1@build.eclipse.org...
>>>>>>
>>>>>> funny you should ask that, i just started working on refactoring some
>>>>>> of the code that takes care of adding some of the actions to the editor
>>>>>> and to the appropriate menus (bar and context).
>>>>>>
>>>>>> i just checked in some enhancements to the
>>>>>> ScriptSourceViewerConfiguration implementation that handles setting up
>>>>>> the line prefix that will be used for comments. if your language uses
>>>>>> something other then a "#", override the getCommentPrefix() method in
>>>>>> your sub-class.
>>>>>>
>>>>>> if you're in a hurry to get this working, take a look at the
>>>>>> 'creatActions' method in the ruby editor, you can pretty much cut and
>>>>>> paste that code to get this working in your editor - although the
>>>>>> 'add/remove/toggle' comment actions are all redundant at this point.
>>>>>> the single 'toggle comment' action is really all you need (that's all
>>>>>> the jdt offers now for single line comments).
>>>>>>
>>>>>>
>>>>>> On 2007-12-29 07:47:24 -0500, "Sebastian Biedermann" <special1@gmx.de> said:
>>>>>>
>>>>>>> Hi, thanks for help
>>>>>>>
>>>>>>> Can you tell me how I can implement my own shortcuts for the editor,
>>>>>>> too ? (e.g. comment/uncomment etc...)
>>>>>>>
>>>>>>>
>>>>>>> Best regards
>>>>>>> Sebastian Biedermann
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>>>> news:fk4tdl$qfi$1@build.eclipse.org...
>>>>>>>> Hi Sebastian,
>>>>>>>>
>>>>>>>> To add support of line numbering in editor you aren't needed to do anything.
>>>>>>>>
>>>>>>>> Line numbering support are contributed by Eclipse platform.
>>>>>>>> Your class should extended AbstractDecoratedTextEditor or ScriptEditor.
>>>>>>>>
>>>>>>>> Linenumbering column are created from
>>>>>>>> AbstractDecoratedTextEditor.createPartControl() method, and uses
>>>>>>>> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
>>>>>>>> constant to obtain enablement state.
>>>>>>>> (Please look at AbstractDeroratedTextEditor.isLineNumberRulerVisible()
>>>>>>>> method for reference).
>>>>>>>>
>>>>>>>> Then editor are open, it is possible to show line numbering using
>>>>>>>> context menu. ( I've attached screenshot ).
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Andrei.
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> sorry, it actually dont work. I'm now trying to setup the vertical line
>>>>>>>>> numbers with a boolean in my preference page.
>>>>>>>>> Can you tell me what flag in preferences I should set, or in general,
>>>>>>>>> how I can make the vertical line numbers work and
>>>>>>>>> what i should set in the inintalize method.
>>>>>>>>>
>>>>>>>>> Thanks a lot
>>>>>>>>> Sebastian
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>>>>>> news:fjiis2$7ar$1@build.eclipse.org...
>>>>>>>>>> Hi Sebastian,
>>>>>>>>>>
>>>>>>>>>> Actually all what you need is already implemented in Eclipse, and
>>>>>>>>>> provided for all text based editor.
>>>>>>>>>> Line number columns are initialized from AbstractDecoratedTextEditor
>>>>>>>>>> class, ScriptExplorer uses it.
>>>>>>>>>>
>>>>>>>>>> Please check what your editor in initializeEditor method sets ruler
>>>>>>>>>> context menu id.(setRulerContextMenuId call).
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>> Andrei.
>>>>>>>>>>
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> I want to add vertical line numbers to my editor, but i dont know
>>>>>>>>>>> exactly what to do.
>>>>>>>>>>> At this time my code looks like this and I thought it could be work:
>>>>>>>>>>>
>>>>>>>>>>> public class TMEditor extends ScriptEditor {
>>>>>>>>>>> ...
>>>>>>>>>>> protected void initializeEditor() {
>>>>>>>>>>>
>>>>>>>>>>> LineNumberRulerColumn ruleCol = new
>>>>>>>>>>> LineNumberRulerColumn();
>>>>>>>>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>>>>>>>>> super.initializeEditor();
>>>>>>>>>>> }
>>>>>>>>>>> ...
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> but it wont work and i dont know why, can anyone help me ?
>>>>>>>>>>> what have I to do ?
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>> Sebastian
>>>>>>
>>>>>>
>>>>>> --
>>>>>> -jae
>>>>
>>>>
>>>> --
>>>> -jae
>>
>>
>> --
>> -jae


--
-jae
Re: vertical line numbers [message #19955 is a reply to message #19857] Sun, 20 January 2008 16:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: special1.gmx.de

hi,

i emigrated to version 1.0M4 and everything is working except the shortcuts.
what have i to do in the protected void createActions() method of the
Editor ?
i want just a comment/uncomment shortcut (ctrl + / ) or somthing like that

thanks!
Sebastian



"Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
news:fm05uo$jhd$1@build.eclipse.org...
>
> oh - then this code definately isn't in the that release.
>
> the 1.0M3 milestone was released a bit back you should definately upgrade
> to that, i'd also say you could update to one of the latest nightlies -
> once you synced with the other api changes, i believe this would just
> start working for you.
>
> if you don't want to do that, you will need to override the
> getDefaultPrefixes method in your SourceViewerConfiguration
> implementation.
>
> On 2008-01-07 08:33:46 -0500, "Sebastian Biedermann" <special1@gmx.de>
> said:
>
>> Hi, sorry
>>
>> I'm using dltk 0.9.0
>>
>>
>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>> news:flrjvb$ohk$1@build.eclipse.org...
>>>
>>> what is the current version of the dtlk code you are using?
>>>
>>> do you update from cvs on a regular basis or are you using one of
>>> pre-built releases?
>>>
>>> On 2008-01-05 17:01:00 -0500, "Sebastian Biedermann" <special1@gmx.de>
>>> said:
>>>
>>>> I'm not really working, i'm just playing around with the dltk package,
>>>> i'm a student of information technologie.
>>>> Or have i missunderstood ? Sorry, i'm not a native english speaker :-(
>>>>
>>>>
>>>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>>>> news:flonr1$8bg$1@build.eclipse.org...
>>>>>
>>>>> are you working against the head, or one of the exlsting dltk
>>>>> releases?
>>>>>
>>>>> On 2008-01-03 08:43:46 -0500, "Sebastian Biedermann" <special1@gmx.de>
>>>>> said:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> if i use the createAction from Ruby in my code and overwrite the
>>>>>> createActions method in my editor extending from Scripteditor
>>>>>> with following source code:
>>>>>>
>>>>>> protected void createActions() {
>>>>>>
>>>>>> super.createActions();
>>>>>>
>>>>>> Action action = new
>>>>>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>>>> "Comment.", this, ITextOperationTarget.PREFIX);
>>>>>>
>>>>>>
>>>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.COMMENT);
>>>>>>
>>>>>> setAction("Comment", action);
>>>>>> markAsStateDependentAction("Comment", true);
>>>>>>
>>>>>> action = new
>>>>>> TextOperationAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>>>> "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX);
>>>>>>
>>>>>>
>>>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.UNCOMMENT);
>>>>>> setAction("Uncomment", action);
>>>>>> markAsStateDependentAction("Uncomment", true);
>>>>>>
>>>>>> action = new
>>>>>> ToggleCommentAction(DLTKEditorMessages.getBundleForConstruct edKeys(),
>>>>>> "ToggleComment.", this);
>>>>>>
>>>>>> action.setActionDefinitionId(IScriptEditorActionDefinitionId s.TOGGLE_COMMENT);
>>>>>
>>>>>>
>>>>>> setAction("ToggleComment", action);
>>>>>> markAsStateDependentAction("ToggleComment", true);
>>>>>>
>>>>>> ISourceViewer sourceViewer = getSourceViewer();
>>>>>> SourceViewerConfiguration configuration =
>>>>>> getSourceViewerConfiguration();
>>>>>> ((ToggleCommentAction) action).configure(sourceViewer,
>>>>>> configuration);
>>>>>> }
>>>>>>
>>>>>>
>>>>>> nothing happens when i start my plugin and when i press ctrl + /
>>>>>> i would like to implement this shortcut for comment/uncomment but i
>>>>>> dont know what to do
>>>>>> and where to start
>>>>>>
>>>>>> thanks
>>>>>> Sebastian Biedermann
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Jae Gangemi" <jgangemi@gmail.com> schrieb im Newsbeitrag
>>>>>> news:fl8sth$u47$1@build.eclipse.org...
>>>>>>>
>>>>>>> funny you should ask that, i just started working on refactoring
>>>>>>> some of the code that takes care of adding some of the actions to
>>>>>>> the editor and to the appropriate menus (bar and context).
>>>>>>>
>>>>>>> i just checked in some enhancements to the
>>>>>>> ScriptSourceViewerConfiguration implementation that handles setting
>>>>>>> up the line prefix that will be used for comments. if your language
>>>>>>> uses something other then a "#", override the getCommentPrefix()
>>>>>>> method in your sub-class.
>>>>>>>
>>>>>>> if you're in a hurry to get this working, take a look at the
>>>>>>> 'creatActions' method in the ruby editor, you can pretty much cut
>>>>>>> and paste that code to get this working in your editor - although
>>>>>>> the 'add/remove/toggle' comment actions are all redundant at this
>>>>>>> point. the single 'toggle comment' action is really all you need
>>>>>>> (that's all the jdt offers now for single line comments).
>>>>>>>
>>>>>>>
>>>>>>> On 2007-12-29 07:47:24 -0500, "Sebastian Biedermann"
>>>>>>> <special1@gmx.de> said:
>>>>>>>
>>>>>>>> Hi, thanks for help
>>>>>>>>
>>>>>>>> Can you tell me how I can implement my own shortcuts for the
>>>>>>>> editor, too ? (e.g. comment/uncomment etc...)
>>>>>>>>
>>>>>>>>
>>>>>>>> Best regards
>>>>>>>> Sebastian Biedermann
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>>>>> news:fk4tdl$qfi$1@build.eclipse.org...
>>>>>>>>> Hi Sebastian,
>>>>>>>>>
>>>>>>>>> To add support of line numbering in editor you aren't needed to do
>>>>>>>>> anything.
>>>>>>>>>
>>>>>>>>> Line numbering support are contributed by Eclipse platform.
>>>>>>>>> Your class should extended AbstractDecoratedTextEditor or
>>>>>>>>> ScriptEditor.
>>>>>>>>>
>>>>>>>>> Linenumbering column are created from
>>>>>>>>> AbstractDecoratedTextEditor.createPartControl() method, and uses
>>>>>>>>> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
>>>>>>>>> constant to obtain enablement state.
>>>>>>>>> (Please look at
>>>>>>>>> AbstractDeroratedTextEditor.isLineNumberRulerVisible() method for
>>>>>>>>> reference).
>>>>>>>>>
>>>>>>>>> Then editor are open, it is possible to show line numbering using
>>>>>>>>> context menu. ( I've attached screenshot ).
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>> Andrei.
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> sorry, it actually dont work. I'm now trying to setup the
>>>>>>>>>> vertical line
>>>>>>>>>> numbers with a boolean in my preference page.
>>>>>>>>>> Can you tell me what flag in preferences I should set, or in
>>>>>>>>>> general,
>>>>>>>>>> how I can make the vertical line numbers work and
>>>>>>>>>> what i should set in the inintalize method.
>>>>>>>>>>
>>>>>>>>>> Thanks a lot
>>>>>>>>>> Sebastian
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
>>>>>>>>>> news:fjiis2$7ar$1@build.eclipse.org...
>>>>>>>>>>> Hi Sebastian,
>>>>>>>>>>>
>>>>>>>>>>> Actually all what you need is already implemented in Eclipse,
>>>>>>>>>>> and
>>>>>>>>>>> provided for all text based editor.
>>>>>>>>>>> Line number columns are initialized from
>>>>>>>>>>> AbstractDecoratedTextEditor
>>>>>>>>>>> class, ScriptExplorer uses it.
>>>>>>>>>>>
>>>>>>>>>>> Please check what your editor in initializeEditor method sets
>>>>>>>>>>> ruler
>>>>>>>>>>> context menu id.(setRulerContextMenuId call).
>>>>>>>>>>>
>>>>>>>>>>> Best regards,
>>>>>>>>>>> Andrei.
>>>>>>>>>>>
>>>>>>>>>>>> Hi
>>>>>>>>>>>>
>>>>>>>>>>>> I want to add vertical line numbers to my editor, but i dont
>>>>>>>>>>>> know
>>>>>>>>>>>> exactly what to do.
>>>>>>>>>>>> At this time my code looks like this and I thought it could be
>>>>>>>>>>>> work:
>>>>>>>>>>>>
>>>>>>>>>>>> public class TMEditor extends ScriptEditor {
>>>>>>>>>>>> ...
>>>>>>>>>>>> protected void initializeEditor() {
>>>>>>>>>>>>
>>>>>>>>>>>> LineNumberRulerColumn ruleCol = new
>>>>>>>>>>>> LineNumberRulerColumn();
>>>>>>>>>>>> super.initializeLineNumberRulerColumn(ruleCol);
>>>>>>>>>>>> super.initializeEditor();
>>>>>>>>>>>> }
>>>>>>>>>>>> ...
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> but it wont work and i dont know why, can anyone help me ?
>>>>>>>>>>>> what have I to do ?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks
>>>>>>>>>>>> Sebastian
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> -jae
>>>>>
>>>>>
>>>>> --
>>>>> -jae
>>>
>>>
>>> --
>>> -jae
>
>
> --
> -jae
>
Re: vertical line numbers [message #20077 is a reply to message #19955] Wed, 23 January 2008 13:45 Go to previous message
Andrei Sobolev is currently offline Andrei SobolevFriend
Messages: 72
Registered: July 2009
Member
Hi Sebastian,

Please refer to TclEditor or RubyEditor classes.

Next snippet configures comment/uncomment and toggle comment actions for tcl editor.
>>>>>>>>>>>
protected void createActions() {
super.createActions();

// Comment
Action action = new TextOperationAction(DLTKEditorMessages
.getBundleForConstructedKeys(),
"Comment.", this, ITextOperationTarget.PREFIX); //$NON-NLS-1$
action.setActionDefinitionId(IScriptEditorActionDefinitionId s.COMMENT);
setAction("Comment", action); //$NON-NLS-1$
markAsStateDependentAction("Comment", true); //$NON-NLS-1$

// Uncomment
action = new TextOperationAction(DLTKEditorMessages
.getBundleForConstructedKeys(),
"Uncomment.", this, ITextOperationTarget.STRIP_PREFIX); //$NON-NLS-1$
action.setActionDefinitionId(IScriptEditorActionDefinitionId s.UNCOMMENT);
setAction("Uncomment", action); //$NON-NLS-1$
markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$

// Toggle comment
action = new ToggleCommentAction(DLTKEditorMessages
.getBundleForConstructedKeys(), "ToggleComment.", this); //$NON-NLS-1$
action
.setActionDefinitionId(IScriptEditorActionDefinitionIds.TOGG LE_COMMENT);
setAction("ToggleComment", action); //$NON-NLS-1$
markAsStateDependentAction("ToggleComment", true); //$NON-NLS-1$
configureToggleCommentAction();
}
<<<<<<<<<<<<<<<<<<
Shortcuts are registered from org.eclipse.dltk.ui plugin.

Best Regards,
Andrei Sobolev.
> hi,
>
> i emigrated to version 1.0M4 and everything is working except the
> shortcuts.
> what have i to do in the protected void createActions() method of the
> Editor ?
> i want just a comment/uncomment shortcut (ctrl + / ) or somthing like that
>
> thanks!
> Sebastian
>
Previous Topic:PreferencePages
Next Topic:Adding custom types in SourceModule
Goto Forum:
  


Current Time: Sat Nov 09 04:17:40 GMT 2024

Powered by FUDForum. Page generated in 0.02836 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top