Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » autocomplete not acting as I expect(control-space is not giving me options, I get a yellow background and red foreground intermittently )
autocomplete not acting as I expect [message #712145] Sun, 07 August 2011 03:41 Go to next message
Ralph Cook is currently offline Ralph Cook
Messages: 5
Registered: July 2009
Junior Member
I am using Eclipse Indigo, and programming a method that starts this way:

  public void display()
  {
    JLabel label1 = new JLabel("one");

    JScrollPane scrollPane1 = new JScrollPane(label1);
    
    JLabel txtMessages = new JLabel("These are the times that fry men's soles.");
    
    
    JPanel bigCourtInfoPanel = new JPanel();
    bigCourtInfoPanel.setLayout(new BoxLayout(bigCourtInfoPanel, BoxLayout.Y_AXIS));


Right under the "JLabel txtMessages" line, I can type "txtMessages.", and I would expect an content assist with the methods available for the txtMessages variable. None appear. I would also expect content assist if I enter control-space, but none appear then either.

What I do get, intermittently, is a yellow background and red foreground highlight on the rest of the method. I don't know what that means.

1. What is the yellow/red highlighting?

2. How do I get my list of content-assist methods?
Re: autocomplete not acting as I expect [message #712647 is a reply to message #712145] Sun, 07 August 2011 14:33 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 08/06/2011 10:41 PM, Ralph Cook wrote:
> I am using Eclipse Indigo, and programming a method that starts this way:
>
> public void display()
> {
> JLabel label1 = new JLabel("one");
>
> JScrollPane scrollPane1 = new JScrollPane(label1);
> JLabel txtMessages = new JLabel("These are the times that fry men's
> soles.");
> JPanel bigCourtInfoPanel = new JPanel();
> bigCourtInfoPanel.setLayout(new BoxLayout(bigCourtInfoPanel,
> BoxLayout.Y_AXIS));
>
> Right under the "JLabel txtMessages" line, I can type "txtMessages.",
> and I would expect an content assist with the methods available for the
> txtMessages variable. None appear. I would also expect content assist if
> I enter control-space, but none appear then either.
>
> What I do get, intermittently, is a yellow background and red foreground
> highlight on the rest of the method. I don't know what that means.
>
> 1. What is the yellow/red highlighting?
>
> 2. How do I get my list of content-assist methods?
Have you added an import for JLabel? If not, then JLabel won't be able
to be resolved so it won't be possible to provide content assist.
Re: autocomplete not acting as I expect [message #713158 is a reply to message #712145] Mon, 08 August 2011 06:53 Go to previous message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 07.08.2011 05:41, Ralph Cook wrote:
> I am using Eclipse Indigo, and programming a method that starts this way:
>
> public void display()
> {
> JLabel label1 = new JLabel("one");
>
> JScrollPane scrollPane1 = new JScrollPane(label1);
> JLabel txtMessages = new JLabel("These are the times that fry
> men's soles.");
> JPanel bigCourtInfoPanel = new JPanel();
> bigCourtInfoPanel.setLayout(new BoxLayout(bigCourtInfoPanel,
> BoxLayout.Y_AXIS));
>
> Right under the "JLabel txtMessages" line, I can type "txtMessages.",
> and I would expect an content assist with the methods available for
> the txtMessages variable. None appear. I would also expect content
> assist if I enter control-space, but none appear then either.
>
> What I do get, intermittently, is a yellow background and red
> foreground highlight on the rest of the method. I don't know what
> that means.
>
> 1. What is the yellow/red highlighting?
This normally appears to the right and means that that this text will be
replaced when inserting the proposal.
>
> 2. How do I get my list of content-assist methods?
You should get it if you place the caret after the "textMessages." and
invoke Ctrl+Space. If that is not the case then please file a bug
against JDT Text
(https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT;component=Text).

Dani
Previous Topic:swing app in intranet
Next Topic:Accessing Debugging Information
Goto Forum:
  


Current Time: Wed Oct 22 12:24:54 GMT 2014

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

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