Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How can I comment out a method?
How can I comment out a method? [message #708471] Tue, 02 August 2011 21:10 Go to next message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
Hi there,

I have been looking through the jdt core api and the dom api also. I can't find out how to comment out a method from my source code programmatically. Can this be done? If so, how?

Many thanks for your help,
Regards
(no subject) [message #708829 is a reply to message #708471] Wed, 03 August 2011 07:31 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 02.08.2011 23:10, john doe wrote:
> Hi there,
>
> I have been looking through the jdt core api and the dom api also. I
> can't find out how to comment out a method from my source code
> programmatically. Can this be done? If so, how?
Change the source.

Dani
>
> Many thanks for your help,
> Regards
Re: (no subject) [message #708970 is a reply to message #708829] Wed, 03 August 2011 10:51 Go to previous messageGo to next message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
Why bother wasting resources to post such a condescending reply? I have a genuine question, which I thought would merit a genuine response. Anyway, I have reported your post to the mods.

[Updated on: Wed, 03 August 2011 11:15]

Report message to a moderator

Re: (no subject) [message #709051 is a reply to message #708970] Wed, 03 August 2011 12:56 Go to previous messageGo to next message
Denis Roy is currently offline Denis RoyFriend
Messages: 484
Registered: October 2004
Location: Ottawa, Ontario, Canada
Senior Member

While this forum doesn't have moderators per se, I do agree that Dani's response is not helpful, and I wonder why one would even bother writing something like that.

Hopefully someone else will respond with a bit more insight.


Denis Roy
Eclipse Webmaster -- webmaster@eclipse.org
Re: (no subject) [message #709111 is a reply to message #709051] Wed, 03 August 2011 13:56 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 03.08.2011 14:56, Denis Roy wrote:
> While this forum doesn't have moderators per se, I do agree that
> Dani's response is not helpful, and I wonder why one would even bother
> writing something like that.
Because that is the right answer - though maybe a bit too short. There
is no API to comment code. You need to comment out the code by adding
the corresponding things to the source code. There are several API/ways
to change the source code in JDT Core.

Dani
>
> Hopefully someone else will respond with a bit more insight.
Re: (no subject) [message #709157 is a reply to message #709111] Wed, 03 August 2011 14:22 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I guess looking on how CTRL+/ is implemented by guide the way how to do it.

Tom

Am 03.08.11 15:56, schrieb Daniel Megert:
> On 03.08.2011 14:56, Denis Roy wrote:
>> While this forum doesn't have moderators per se, I do agree that
>> Dani's response is not helpful, and I wonder why one would even bother
>> writing something like that.
> Because that is the right answer - though maybe a bit too short. There
> is no API to comment code. You need to comment out the code by adding
> the corresponding things to the source code. There are several API/ways
> to change the source code in JDT Core.
>
> Dani
>>
>> Hopefully someone else will respond with a bit more insight.
Re: (no subject) [message #709158 is a reply to message #709111] Wed, 03 August 2011 14:22 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I guess looking on how CTRL+/ is implemented by guide the way how to do it.

Tom

Am 03.08.11 15:56, schrieb Daniel Megert:
> On 03.08.2011 14:56, Denis Roy wrote:
>> While this forum doesn't have moderators per se, I do agree that
>> Dani's response is not helpful, and I wonder why one would even bother
>> writing something like that.
> Because that is the right answer - though maybe a bit too short. There
> is no API to comment code. You need to comment out the code by adding
> the corresponding things to the source code. There are several API/ways
> to change the source code in JDT Core.
>
> Dani
>>
>> Hopefully someone else will respond with a bit more insight.
Re: (no subject) [message #709335 is a reply to message #709158] Wed, 03 August 2011 20:13 Go to previous messageGo to next message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
Thanks for this Tom. Do you have a link for this?
Best Regards,
JD
Re: (no subject) [message #714216 is a reply to message #709335] Wed, 10 August 2011 04:32 Go to previous messageGo to next message
rezecib  is currently offline rezecib Friend
Messages: 6
Registered: August 2011
Junior Member
What do you mean by programmatically? As in, you want to disable a method during run-time from your program? I'm pretty sure that can't be done with a compiled language like Java. For that, you need an interpreted language. You may be able to achieve the same effect by setting a boolean value, and only executing that method if the boolean value is true...

[Updated on: Wed, 10 August 2011 04:32]

Report message to a moderator

Re: (no subject) [message #715400 is a reply to message #714216] Sat, 13 August 2011 18:53 Go to previous message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
Is there a way, through the api (programatically) that I can assign a comment '//' to a line of code? No, I do not mean "disable a method".

[Updated on: Sat, 13 August 2011 18:53]

Report message to a moderator

Previous Topic:google app engine
Next Topic:How to apply change to source code?
Goto Forum:
  


Current Time: Sat Apr 27 00:39:33 GMT 2024

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

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

Back to the top