Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Problem with Ctrl+Shift+O
Problem with Ctrl+Shift+O [message #683992] Tue, 14 June 2011 20:17 Go to next message
Terry  is currently offline Terry Friend
Messages: 4
Registered: June 2011
Junior Member
Hello everyone! I'm learning to use the Ubuntu version of Eclipse to develop applications on the Android platform. At the 'Hello, Views' tutorial at Android Developers, a tip is provided to "press Ctrl (or Cmd) + Shift + O to import the required packages" after pasting code in to an Eclipse project.

Nothing happens (that I can see) when I press the hotkeys. Does this mean there were no required packages? What should I see? What's an example of a required package? And is there menu option equivalent to Ctrl+Shift+O?
Re: Problem with Ctrl+Shift+O [message #684138 is a reply to message #683992] Wed, 15 June 2011 04:53 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
Yes, it could mean there are no packages to import. It is available in menu item Source->Organize Imports.
Re: Problem with Ctrl+Shift+O [message #684390 is a reply to message #684138] Wed, 15 June 2011 14:16 Go to previous messageGo to next message
Terry  is currently offline Terry Friend
Messages: 4
Registered: June 2011
Junior Member
Thanks for your reply. Could you or someone provide some sample code I could paste into a new java project that would show me Ctrl+Shift+O in action?

Edit:

Actually, I don't have the option 'Organize Imports' in the Source menu. There is Windows > Preferences > Java > Code Style > Organize Imports. But it should be set to whatever the default is. Java is listed in the main box, with a few dozen packages assigned to the java prefix.

Using Eclipse SDK, Version: 3.5.2


[Updated on: Wed, 15 June 2011 14:43]

Report message to a moderator

Re: Problem with Ctrl+Shift+O [message #684494 is a reply to message #684390] Wed, 15 June 2011 16:39 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 6/15/11 10:16 AM, Terry wrote:
> Thanks for your reply. Could you or someone provide some sample code I
> could paste into a new java project that would show me Ctrl+Shift+O in
> action?

List list = new ArrayList();

Ctrl+Shift+O should add these two lines near the top of the class:

import java.util.ArrayList;
import java.util.List;
Re: Problem with Ctrl+Shift+O [message #684638 is a reply to message #684494] Thu, 16 June 2011 00:46 Go to previous message
Terry  is currently offline Terry Friend
Messages: 4
Registered: June 2011
Junior Member
Thank you! That worked like a charm, and really helps to understand what is going on.
Previous Topic:Compare in Installation History presents almost empty dialog
Next Topic:No console out when running MinGW fortran executable
Goto Forum:
  


Current Time: Thu Sep 19 07:53:52 GMT 2024

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

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

Back to the top