« Return to Thread: Transforming a query in variable and vice-versa

Re: Transforming a query in variable and vice-versa

by GregHauptmann :: Rate this Message:

Reply to Author | View in Thread

doh!  Thanks heaps for pointing this out Tor   :)     I think as I did some java coding prior to Ruby I didn't see the forrest for the trees.   I actually did know about this syntax for string variables in Ruby but it never clicked when I was doing the copy/paste SQL thing into Ruby.  
Regards
Greg


Tor Norbye wrote:
On Sep 8, 2008, at 12:52 PM, GregHauptmann wrote:

>
> thanks Wade - this is fantastic...except...   :)
>
> I work in Ruby and have downloaded the Ruby only version of  
> Netbeans.   I
> don't suppose you know how to get the plugin to work here. It  
> installed fine
> however in a Ruby file it does not show up as an option. I thought  
> of using
> a java file temporarily however in the Ruby version of Netbeans you  
> don't
> seem to be able to create one.  Any way to make this very useful text
> changing plugin work with Ruby files in the Ruby download of the  
> Netbeans
> IDE?

In Ruby you shouldn't have to do any of this - you can insert multi  
string literals.

Just type
x = <<FOO

and hit return - that will insert

x = <<FOO
|     <- your caret is there. Now paste your multiline section.
FOO

e.g. you can have

     mycode = <<EOF
Query:
Select field1,
  field2,
  field3
from table1
where condition
EOF

-- Tor

>
>
> thanks
>
>
> Wade Chandler wrote:
>>
>> Yes, this is on the plugin portal which just got easier to use in  
>> NB 6.0 I
>> see.
>>
>> 1) In NB 6.0 go to Tools|Plugins
>> 2) On the available plugins tab in the Search field type:
>> Java Text
>> that is "Java<space>Text"
>> 3) You should see my module called "Java Text Copy Paste Module"
>> 4) Click the check box to install it
>> 5) Click the install button
>> ... follow the common section below
>>
>> If that doesn't work all one has to do is:
>> 1) Go to
>> http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=2748
>> 2) Click the download button.
>> 3) Save it to disk and remember the location
>> 4) In NB go to Tools|Plugins
>> 5) Go to the Downloaded tab
>> 6) Click the "Add Plugins" button
>> 7) Go find the saved .nbm in the folder you saved it
>> 8) Select it and press OK
>> 9) Click install
>> ... follow the common section below
>>
>> 1) Click "Next>" on the screen where it shows you the module it  
>> will be
>> installing
>> 2) Read the license and click the "I accept the terms in all the  
>> license
>> agreements." choice button
>> 3) Click Install
>> 4) It will start installing and then a pop up will pop up and say
>> validation failed and the module is not signed
>> 5) Hit continue as this doesn't really matter and it will finish
>> 6) Click Finish and you are ready to use it
>>
>> The module lets you select Java code and can reformat it back into  
>> text
>> which isn't Java code and copy it into the clipboard or it will let  
>> you
>> paste plain text as Java code. Once you have it installed in the Java
>> editor there will be new actions for this stuff, and you'll have to  
>> play
>> around with it to get used to it. To access the actions right click  
>> in the
>> editor and notice near the copy and paste operations a new action set
>> called "Java Text Copy and Paste" with sub-actions. I suggest  
>> installing
>> it and playing with those actions to see how they work. If it does  
>> what
>> you like please rate it for me...many have downloaded it 820+ yet  
>> only 2
>> or 3 have rated it. It works for SQL, HTML (with or without  
>> JavaScript),
>> XML, or any other plain text you would like to get into the Java  
>> code or
>> get out of Java code, and as it uses the clipboard it works well  
>> with your
>> favorite SQL, XML, or other text tools.
>>
>> Thanks,
>>
>> Wade
>>
>> ==================
>> Wade Chandler, CCE
>> Software Engineer and Developer, Certified Forensic Computer  
>> Examiner,
>> NetBeans Dream Team Member, and NetBeans Board Member
>> http://www.certified-computer-examiner.com
>> http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
>> http://www.netbeans.org
>>
>> ----- Original Message ----
>> From: David Van Couvering <david@vancouvering.com>
>> To: nbusers@netbeans.org; Wade Chandler <hwchandler@yahoo.com>
>> Sent: Thursday, January 24, 2008 1:29:35 PM
>> Subject: Re: [nbusers] Transforming a query in variable and vice-
>> versa
>>
>>
>> I know that Wade Chandler was working on a module that translated
>> between "query mode" and "Java mode".  Wade?
>>
>> On Jan 24, 2008 5:12 AM, Ranieri Oliveira <ranieri85@gmail.com>  
>> wrote:
>>> Hello guys...
>>>
>>> When I'm developing a software, many times I need to transform a
>> query in
>>> variable, so I do it by hand like below:
>>>
>>> Query:
>>> Select field1,
>>> field2,
>>> field3
>>> from table1
>>> where condition
>>>
>>> Variable:
>>> String myquery = "Select field1,"
>>> +" field2,"
>>> +" field3"
>>> +" from table1"
>>> +" where condition";
>>>
>>> This process can be very boring when the query is very large, I want
>> to know
>>> if someone have a trick to do this process more easy and fast or a
>> way to
>>> avoid this process.
>>>
>>> Thanks
>>>
>>
>>
>>
>> --
>> David W. Van Couvering
>> http://davidvancouvering.blogspot.com
>>
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Transforming-a-query-in-variable-and-vice-versa-tp15064880p19379857.html
> Sent from the Netbeans - Users mailing list archive at Nabble.com.
>

 « Return to Thread: Transforming a query in variable and vice-versa