Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » How to display the libraries node in ScriptExplorer?
How to display the libraries node in ScriptExplorer? [message #540172] Tue, 15 June 2010 09:12 Go to next message
Jan F. is currently offline Jan F.Friend
Messages: 6
Registered: June 2010
Junior Member
It seems that the display of library node is disabled in the ScriptExplorerPart - the line that pushes the flag to the content provider is commented out:

ScriptExplorerPart.java:724

// fContentProvider.setShowLibrariesNode(fShowLibrariesNode);


is there a reason for this (and thus I should create my own view for the project), or is there a way to make this work without hacking it?

[Updated on: Tue, 15 June 2010 09:47]

Report message to a moderator

Re: How to display the libraries node in ScriptExplorer? [message #540330 is a reply to message #540172] Tue, 15 June 2010 17:07 Go to previous messageGo to next message
Jan F. is currently offline Jan F.Friend
Messages: 6
Registered: June 2010
Junior Member
After experimenting with build paths and using different new*Entry methods in DLTKCore, I noticed, by accident, that when I use the DLTKCore.newContainerEntry, the library pops up in the ScriptExplorer, cool.

However, I am realising that I do not really understand the ideas behind handling of the different build path entry types, I somehow assumed that the newLibEntry would have this effect, but it is not the case - if anyone could quickly shed some light here, I would really appreciate it.

Also, even though the library node now appears in the Script Explorer, it is empty and its name is the "<path> unknown", so I have not yet got it to work - posting as an update anyway, as this might be interesting info for people who come across this thread.

Will post more when I get farther.
Re: How to display the libraries node in ScriptExplorer? [message #540394 is a reply to message #540330] Wed, 16 June 2010 01:28 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Jan,

I would like to help, but I am not sure I understand the particular problem you are working on.
Could you please describe what exactly you are trying to do?
As at the moment I am not sure if some functionality is missing in DLTK or there is another way to solve your problem.

Thank you,
Alex
Re: How to display the libraries node in ScriptExplorer? [message #540470 is a reply to message #540394] Wed, 16 June 2010 09:43 Go to previous messageGo to next message
Jan F. is currently offline Jan F.Friend
Messages: 6
Registered: June 2010
Junior Member
Hi Alex,

yeah, I should have bean clearer in my original post - I was already started with the assumption that the commented out code does what I need, which is why I focused on that part.

I am trying to do a fairly standard thing here - in the Script Explorer, display the Libraries node, which would contain standard SDK code - similarly to JDT the user should be able to browse the classes, Goto Definition would open classes from here, etc.

I also need the SDK classes to be indexed and part of the model.

What I figured out so far is:

- in the code that creates new projects I setup the buildpath of the new project via IScriptProject.setRawBuildpath - include DLTKCore.newSourceEntry and DLTKCore.newContainerEntry (with a symbolic name), so that both the project sources and the SDK are included on the build path (this results in the .buildpath file to be created inside the project root)

- use buildpathContainerInitializer extension point to map the symbolic name from above to a instance of the IBuildpathContainer, and set it via DLTKCore.setBuildpathContainer

- in my instance of the IBuildpathContainer in the method getBuildpathEntries I create a new library using DLTKCore.newLibraryEntry

Let me know if this feels right.

For now I am trying to figure out how to construct the IPath for the library to pass to the newLibraryEntry method - it is an external folder (i.e. not in workspace) - I am passing it a simple new Path ("/Users/.../../...") - and it ends up ignored down in EnvironmentPathUtils, which checks that the device in the Path is not null and contains "/" (I am on Mac, so the device is null for absolute paths). Here's the assert:

java.lang.IllegalArgumentException:
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:47)
at org.eclipse.dltk.internal.core.BuildpathEntry.<init>(BuildpathEntry.java:187)
at org.eclipse.dltk.core.DLTKCore.newLibraryEntry(DLTKCore.java :2375)
at org.eclipse.dltk.core.DLTKCore.newExtLibraryEntry(DLTKCore.j ava:2251)

[Updated on: Wed, 16 June 2010 09:51]

Report message to a moderator

Re: How to display the libraries node in ScriptExplorer? [message #540473 is a reply to message #540470] Wed, 16 June 2010 10:03 Go to previous messageGo to next message
Jan F. is currently offline Jan F.Friend
Messages: 6
Registered: June 2010
Junior Member
Figured it out:

new Path ("org.eclipse.dltk.core.environment.localEnvironment/:", "/Users/......")

and boom! everything started working, indexing, display, etc... I love this - it takes a day of frustration to figure out how to do something, but the reward at the end is sweet Smile
Re: How to display the libraries node in ScriptExplorer? [message #540479 is a reply to message #540473] Wed, 16 June 2010 10:25 Go to previous message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
The standard way is
EnvironmentPathUtils.getFullPath(EnvironmentManager.getLocalEnvironment(), new Path("/users/..."))
Previous Topic:Kill mailing list
Next Topic:Change interpreter for project
Goto Forum:
  


Current Time: Fri Mar 29 00:23:37 GMT 2024

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

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

Back to the top