Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Auto-correction similar Netbeans?(+Jboss closing tags)
Auto-correction similar Netbeans? [message #756247] Fri, 11 November 2011 16:29 Go to next message
membersound is currently offline membersoundFriend
Messages: 5
Registered: November 2011
Junior Member
Hi,

several questions getting started with Eclipse:

1.) If I use netbeans and write:

String name;
if (name == "membersound") {
}


I'll be getting a hint: "use equals() and reverse operands", beeing able to auto transform it to equals statement.

How can I achieve similar behaviour in eclipse?



2.) Further, using JBoss Tools Palette:
How can I tell eclipse to use closing tags within a statement, eg:
<h:outputText value=""/>

instead of
<h:outputText value=""></h:outputText>

?
If I manually write the tags everything's fine. But using the JBoss Tools Palette Trag+Drop elements, they always include these needless closing tags </h:...>


3.) Again JBoss Tools: how can I use code assistant with EL Expression? For h:, f: tags etc everything works finde, but value="#{}" and pressing ctrl-space results in a blank assistant field, even though having a @ManagedBean declared.
(if I would add my class to managedbean in faces-config, code completion with EL Expression works as expected! but I do want to use annotations, why is completion not working with that?)
/update: I found out that managed beans in xhtml pages are only recognized if they are named. so if I write @ManagedBean(name = "customerBean") it works with content assistent code completion. HOWEVER there is no check performed for the EL Expressions beeing valid. I might aswell write #{customerBean.age} and eclipse does not complain that .age does not exist.


Thanks alot

[Updated on: Sat, 12 November 2011 15:17]

Report message to a moderator

Re: Auto-correction similar Netbeans? [message #756339 is a reply to message #756247] Sat, 12 November 2011 08:24 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 11/11/2011 9:59 PM, membersound wrote:
> Hi,
>
> if I use netbeans and write:
>
> String name;
> if (name == "membersound") {
> }
>
> I'll be getting a hint: "use equals() and reverse operands", beeing able
> to auto transform it to equals statement.
>
> How can I achieve similar behaviour in eclipse?

Place caret on == and press Ctrl+1, you should get a 'Quick Fix/Assist'
popup and the proposal to convert to equals should be there.
Re: Auto-correction similar Netbeans? [message #756368 is a reply to message #756339] Sat, 12 November 2011 12:25 Go to previous messageGo to next message
membersound is currently offline membersoundFriend
Messages: 5
Registered: November 2011
Junior Member
Unfortunatelly there only is getting a popup with:

Exchange left and right operands for infix expression
Extract to local variable
Put '==' expression in parentheses


No equals correction assistent!

Is there some kind of "rule" I could have to enable/could have disabled?
Re: Auto-correction similar Netbeans? [message #756389 is a reply to message #756368] Sat, 12 November 2011 16:21 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
Doh, sorry.. I thought it was there..

However, there is a bug opened for it
https://bugs.eclipse.org/bugs/show_bug.cgi?id=37643. I will take a look
at this.

You can exchange operands of == or equals() by using one of
- Exchange left and right operands for infix expression
- Invert equals
Re: Auto-correction similar Netbeans? [message #756395 is a reply to message #756389] Sat, 12 November 2011 17:16 Go to previous messageGo to next message
membersound is currently offline membersoundFriend
Messages: 5
Registered: November 2011
Junior Member
"'37643.' is not a valid bug number. "

jep I know I can exchange them left<>right. But just looking for that equals replacement.

Thanks for caring!
Re: Auto-correction similar Netbeans? [message #756404 is a reply to message #756395] Sat, 12 November 2011 19:21 Go to previous message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 11/12/2011 10:46 PM, membersound wrote:
> "'37643.' is not a valid bug number. "

https://bugs.eclipse.org/bugs/show_bug.cgi?id=37643
Previous Topic:Copy and Paste does not work on my Mac OS X
Next Topic:setting up eclipse
Goto Forum:
  


Current Time: Thu Apr 25 21:49:42 GMT 2024

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

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

Back to the top