MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Zscipio
Post subject: Can't get java template to work in myeclipse or eclipse Mac  PostPosted: Apr 06, 2012 - 08:50 PM
Registered Member
Registered Member


Joined: Dec 30, 2011
Posts: 7

I can't get java templates to work. For example if an "if" statement is wanted I looked in Preferences-->Java-->Editor-->Templates--if and the check box is checked next to "if" and the Preview says
Code:
if (${condition:var(boolean)}) {
   ${line_selection}${cursor}
}

I then edit a class and try to use the template.
I have tried typing 'if' then pressing command+space and nothing happens.
I have tried selecting the 'if' then pressing command+space and nothing happens.
If I type 'if' then select it and press control+space the choice of 'runnable' is available and when chosen inserts the code
Code:
new Runnable() {
   public void run() {
      if
   }

Any suggestions?
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: Apr 09, 2012 - 10:55 AM



Joined: Mar 09, 2011
Posts: 715

Zscipio,

This functionality is base eclipse functionality, so you may get better support by posting in an eclipse user forum. However, I couldn't replicate the problem with either eclipse or MyEclipse on Mac OS X Lion.

Note that the content assist key combination is Ctrl-Space, which is not one of the combinations you mentioned. Command-Space opens the Mac Spotlight search box. If you select some text and then hit Ctrl-Space, the content assist operates in a different mode, though it's hard to understand why it would offer Runnable, in your case. If you select a full if statement (or any other statement or block of statements) then a Runnable choice seems reasonable.

Note that Ctrl-Space actually cycles through various sets of proposals. Note the message at the bottom of the pop-up which shows which set of proposals will come up next if you hit Ctrl-Space again.

The key combinations can be changed in the preferences, so you might want to check that.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Zscipio
Post subject: Meaning of "Context" in Preferences-->Templates  PostPosted: Apr 11, 2012 - 09:51 PM
Registered Member
Registered Member


Joined: Dec 30, 2011
Posts: 7

You reply gave me enough hints so that the Content Assist now works. But I don't understand why the process works. I went into the templates and changed the "Context" value of the "if" template from "Java statements" to "Java". What do the values in the "Context" column mean? The values in this column are:
1. Java
2. Java statements
3. SWT statements
4. Javadoc
5. Java type members
I have done a Google search on the meanings of the entries in the "Context" column but to no avail.

Thank you for your help.
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject:   PostPosted: Apr 12, 2012 - 11:54 AM



Joined: Nov 11, 2010
Posts: 2154


_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits