hyperlinks in console

Questions and answers regarding the use of eclipse environment as seen in Servoy Developer

hyperlinks in console

Postby mboegem » Fri Nov 27, 2009 3:27 pm

Some error messages, or for example SVN log will show up in the Eclipse console with hyperlinks to methods/forms of the solution.
Is there anyway to create those from Servoy methods as well?

My goal: I'm busy writing some unit tests (Servoy 5) and would very much like to reference the 'fail' locations in the console.
This makes it much easier & faster to solve the problems.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: hyperlinks in console

Postby rgansevles » Tue Dec 01, 2009 11:36 am

Mark,

I think the servoy console interprets the outputed data and tries to create links from them, try this:
Code: Select all
application.output("a\n\tat /home/rob/servoy_workspace/testsolution/globals.js:20")

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: hyperlinks in console

Postby mboegem » Tue Dec 01, 2009 12:17 pm

thnkx Rob, this works!

Now I just have to find the active workspace location from eclipse... it'll definitely be somewhere in a file... any idea?
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: hyperlinks in console

Postby jcompagner » Mon Dec 07, 2009 4:03 pm

why not just "throw 'it fails because of this'" ?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: hyperlinks in console

Postby mboegem » Mon Dec 07, 2009 4:43 pm

jcompagner wrote:why not just "throw 'it fails because of this'" ?


speed!
I've been implementing a few unit test methods to check certain properties of forms/elements based on the context they're in.
Of course I already throw kind of 'it fails because of this' messages, but it would be very convenient to "just click" and be at the problem location...

I can just set a user property with the workspace location, but it will be nicer to have it determined on the fly.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: hyperlinks in console

Postby jcompagner » Mon Dec 07, 2009 4:57 pm

but if you throw an exception
then hyperlinks are created... so you can quickly click on them.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: hyperlinks in console

Postby mboegem » Mon Dec 07, 2009 6:10 pm

hmmm have to investigate that a bit more.
I don't think it will work, as I'm not really in a method on this particular location if this happens...

It's more that I'm testing if 'showInMenu' is ticked for particular forms.
This is done by looping through all forms and using the solutionModel to get this property value.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: hyperlinks in console

Postby jcompagner » Mon Dec 07, 2009 6:34 pm

function throwError(event)
{
throw "an error!!";
}

will result in

an error!! (C:\servoy50\workspace\Test\forms\Test.js#66)
at C:\servoy50\workspace\Test\forms\Test.js:66 (throwError)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Eclipse Environment

Who is online

Users browsing this forum: No registered users and 2 guests

cron