Author Topic: Java package view not working  (Read 6785 times)

FullyArticulate

  • Community Member
  • Posts: 21
  • Hero Points: 4
Java package view not working
« on: February 18, 2008, 07:08:32 pm »
I'm new to using Slickedit with Java, so it's possible something much more is wrong here...

I have two Java projects--one depends on the other. When I import the smaller project, package view works exactly as you'd expect.

When I import the larger project, it's in some weird not-quite-package view and does not resolve the packages properly. This other mode will not allow me to do simple Java things like right click on a package and select "Add->Class". The menu appears, but nothing happens when it's clicked.

Any suggestions? Thanks!
http://www.engarde.com/broken_package_view.png

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Java package view not working
« Reply #1 on: February 18, 2008, 10:05:17 pm »
Can you provide more details on how you defined the Projects and imported them? One important detail with SlickEdit is that it is absolutely essential that you start off with the right project type. When you select Project > New, be sure you select one of the Java project types. If you select "(Generic)" you will have a hard time configuring things to work as expected.

FullyArticulate

  • Community Member
  • Posts: 21
  • Hero Points: 4
Re: Java package view not working
« Reply #2 on: February 18, 2008, 11:31:03 pm »
I just made this video so you can see the exact sequence. Ignore the extraneous mouse clicks and just pay attention to the window sequence--Robodemo gets confused pretty easily about mouse events. :-(

« Last Edit: February 18, 2008, 11:32:57 pm by FullyArticulate »

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Java package view not working
« Reply #3 on: February 19, 2008, 04:04:16 pm »
Well it looks like PositionFileIO is in the correct subdirectory for it's package, so I think Package View should definitely be working for this project.

I'm still looking at the video to see if there's anything about the directory structure of where the source is located to see if it could be confusing SlickEdit, but what happens when you right-click on the Project and go to Auto Folder?  Is it on Package View?  If not, what happens when you select that?  Does anything happen when you refresh the Project by right-clicking on it and selecting Refresh?

- Ryan

EDIT:  Hero point because I give hero points for videos.

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Java package view not working
« Reply #4 on: February 19, 2008, 04:08:05 pm »
The video was a great help to allow me to see what you were doing. But I still don't know why you got the result you did. The new project is being displayed in Folder view. Can you try switching it to Package view, by right-clicking on the vpj file and selecting Auto Folder > Package View?

I suspect that will render some of your items as packages and some as folders. SlickEdit only renders an item as a package if all of the files in that directory match the package structure. So, if I have a file with no package statement in a subdirectory structure like ...\com\foo\bar, the items in that subdirectory will appear in the Project tab under a folder labeled "com\foo\bar" rather than in a package labelled "com.foo.bar".

I wonder if there is a similar kind of logic going on for the overall view. If there are too many items that it has to render as folders then maybe it switches to folder view. That's the only reason I can guess that the DataIO package was rendered as a folder. The PositionFileIO.java file has the appropriate package statement to match the directory structure.

Try switching to Package view and also look at some of the other files and see if their package statements match the directories. Let us know what you come up with

FullyArticulate

  • Community Member
  • Posts: 21
  • Hero Points: 4
Re: Java package view not working
« Reply #5 on: February 19, 2008, 06:05:32 pm »
It's not really in directory mode either--that looks different. Here's another video, this time showing me switching from the default package view to directory view and back.

The other directories do match the package statements--this project was originally in Eclipse (and I believe is required to have packages match directories there) and is one I update and maintain regularly.

« Last Edit: February 19, 2008, 06:08:06 pm by FullyArticulate »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
Re: Java package view not working
« Reply #6 on: February 20, 2008, 10:28:29 pm »
Does everything look normal in the Symbols tool window if you drill down to the "DataIO" and your other packages within the new project?

What shows up in the "Defs" tool window for PositionFileIO.java?

FullyArticulate

  • Community Member
  • Posts: 21
  • Hero Points: 4
Re: Java package view not working
« Reply #7 on: February 21, 2008, 01:02:47 am »
The Symbols and Defs windows look right. (I'm brand new to Java in SlickEdit, so I don't know if they ARE right, just that they look about right) :-)

I've included a screenshot of the Defs tab.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Java package view not working
« Reply #8 on: February 21, 2008, 10:05:56 pm »
Any chance you could send the entire project, zipped up, to support@slickedit.com?  If we had the project we could reproduce your problem and get to work on fixing it...otherwise we'll have to continue to debug this one remotely :(.

- Ryan

FullyArticulate

  • Community Member
  • Posts: 21
  • Hero Points: 4
Re: Java package view not working
« Reply #9 on: February 22, 2008, 06:25:10 pm »
I'm afraid I can't share it--it's ~100k lines of proprietary code. I'm happy to try anything you'd like remotely, however, and I appreciate your help so far. :-)


Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Java package view not working
« Reply #10 on: March 10, 2008, 08:33:54 pm »
Thought I left you for dead, didn't you  ;)?

I think I've found the issue, and while I keep investigating it, I want you to try something for me as a test:

Create a sample workspace where you can reproduce the problem, adding the project and source files exactly as you did in that first video.  Now, when you go to create the MadOptions project and add it to the current workspace, try not manually modifying the Location field to append MadOptions/src...just leave the Location field as the project root.  Then add the source files via Add Tree as before, and see if they appear in the appropriate packages in the Projects tool window.

Let me know what you find...thanks.

- Ryan