Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » inserting a package statement
inserting a package statement [message #178830] Tue, 21 September 2004 17:03 Go to next message
Eclipse UserFriend
Originally posted by: jwoofy.hotmail.com

I am moving from using the default package to a classic package structure.
The response to my earlier post explained how to set up the packages using
Eclipse. Now I face a problem that none of my 100 or so source files have a
package statement in them. When I use the Move command to put the source
files into a package, the package command is not inserted, as I had hoped.

I could insert the package command with a Unix shell script or a Java
program. However, I'd like to increase my Eclipse skills. Does Eclipse
offer a way to insert the package command into my source files without
manually editing them all?

Thanks

--
Jeff
Re: inserting a package statement [message #178846 is a reply to message #178830] Tue, 21 September 2004 17:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

To do the move first have the default package with the class in it still
existing.

Then from a PackageExplorer or ProjectExplorer in Java or JavaBrowsing
Perspective, select the .java files in the default package, bring up
popup menu and select Refactor->Move. This will put the package stmt in
for you.

--
Thanks, Rich Kulp

Re: inserting a package statement [message #178866 is a reply to message #178846] Tue, 21 September 2004 20:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jwoofy.hotmail.com

Thanks, but I don't have Refactor->Move as an option. I tried both
selecting the files in the default package then right clicking and the
Refactor menu directly. All the choices in the Refactor menu are greyed.
Is there an alternative?

"Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
news:ciq75p$c9t$1@eclipse.org...
> To do the move first have the default package with the class in it still
> existing.
>
> Then from a PackageExplorer or ProjectExplorer in Java or JavaBrowsing
> Perspective, select the .java files in the default package, bring up
> popup menu and select Refactor->Move. This will put the package stmt in
> for you.
>
> --
> Thanks, Rich Kulp
> 
>
Re: inserting a package statement [message #178962 is a reply to message #178866] Wed, 22 September 2004 10:04 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

Jeff wrote:

> Thanks, but I don't have Refactor->Move as an option. I tried both
> selecting the files in the default package then right clicking and the
> Refactor menu directly. All the choices in the Refactor menu are greyed.
> Is there an alternative?

Hmm, it sounds as if your Eclipse project may not be configured to
recognize those classes (but I would think you would have noticed that
before now).
Can you outline the directory structure of your project, like this:

ProjectRoot/
build/
lib/
source/
com/
company/
foo/
SomeClass.java
...
...

Also, can you describe what the Java Build Path properties are for your
project, especially the source folders that are set?

Eric
Previous Topic:Customizing the short cut keys...
Next Topic:build fails in eclipse 3.0.0 after half job is done
Goto Forum:
  


Current Time: Sat May 03 01:44:11 EDT 2025

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

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

Back to the top