Is there something equivalent or similar to Jad/JadClipse for Scala? It would be nice to be able to view the source for Lift from within Eclipse via "Open Declaration".
I don't know of any decompiler, but I think what you want to do just attach the source to the jar containing classes.
Just right-click on the lift-jar in the package explorer and choose properties. There you can specify a source location. I believe that an attached source location will override an installed jad-plugin.
If you're using maven and m2eclipse, you can simply right-click the lift-dep. -> Maven -> download sources. That will download the -sources.jar and automatically attach.
I man not sure you could get back the exact scala source, but at least you could try and see what the nsc bytecode looks like in Java.
This thread mentions (not tested myself) the Soot Eclipse plugin.
So I might settle on the Eclipse plugin for Soot, which can for example display bytecode using the Grimp notation (well, the following screenshot shows Jimple, but conveys the idea):
Related
I'm trying to understand how a basic Lift 2.5 project works. I'm working from the lift_basic application template, and going over the SimplyLift tutorial. When following the tutorial I find that most things seem to work fine, but I'm struggling to understand the why. In particular:
Menu.i("Home") / "index" >> User.AddUserMenusAfter
When I look at the Lift API for Menu, no function i is listed for Menu, nor any function that seems to define /. (This may refer to a function on String, but the API for that seems to only reference / as operating on a token that follows; I'm not sure if i produces a String.) My basic question is; how do I determine what i() is doing, both here in the specific (what is Menu doing at this point in the process) and in general (when I come across a clearly-working function that is not mentioned in the API)?
As an aside, I'm currently using Eclipse as my IDE, with an sbt build that is actually compiling and loading the webapp locally. Eclipse doesn't seem to do a good job of inferring what objects/functions mean, since the build path does not contain the Lift libraries - they're loaded by sbt. Is it possible to make Eclipse aware of these without polluting the repo and maintaining the library configuration in two places?
i is defined in the companion object, not in the actual class. You can see the definition in the source here Menu.i or in the scaladoc:
/**
* A convenient way to define a Menu item that has the same name as its localized LinkText.
* <pre>Menu.i("Home") / "index"</pre> is short-hand for <pre>Menu("Home", S.loc("Home", Text("Home")) / "index"</pre>
*/
def i(nameAndLink: String): PreMenu = Menu.apply(nameAndLink, S.loc(nameAndLink, scala.xml.Text(nameAndLink)))
/ is defined as part of PreMenu and it allows you to specify where the menu loc gets served from.
If you are using eclipse, you can try the sbteclipse plugin which should help make eclipse aware of your dependencies.
about the second issue. Did you generate the project structure with SBT? Here's the full info: https://github.com/typesafehub/sbteclipse/
In short, I'd remove anything already-created from the folder and launched eclipse with-source=true After that "imported the project" into eclipse and see it just working.)
I'm trying to practice spring using Spring Tool Suite(Eclipse).
Everything is fine, except i want to see the api doc inside the IDE.
For example,
Application context = new ....
context.getBean() -> i want to see the explanation about this method directly from the eclipse.
but it says.
Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found
Any good idea?
Go to the build path, where you have added jars. There select the jar, expand it and select source attachment. Now click on edit and add the source attachment.
Also you can use build tools like maven, which download source code automatically.
When we import the external library to eclipse Java project, we can use the auto-correction feature of eclipse for the imported methods from new libraries but we can't see what the methods specifically do. We have to import library's documentation.
Question1: How can I import documentation into eclipse project?
Question2: What does Java Documentation look like?
Question3: Which file format does Java documentation use?
Right click on your project->properties->java build path
select the libraries (its generally .jar file)
click on the dropdown of the libraries to expand the settings-> select source attachment none and click on edit
select the source to the doc ( java documents generally represented by JavaDoc)
click okay.
Question1: How can I import documentation into eclipse project?
In the project explorer, right-click on the library and select Properties. In the resulting dialog, choose "Javadoc Location" and complete the information.
Question2: What is Java Documentation looks like?
A set of directories with HTML files for each class. There is typically an index.hml at the root, plus often a package-list file too. Eclipse searches for these when you "validate" the location.
Question3: Which file format java documentation using?
Eclipse accepts a URL (to a file or a web page), a ZIP or a JAR.
In your package explorer (and most likely on other places as well) you can see your jar file (the external library). Right click on that and choose 'properties'. There you've got the options to attach the sources and the javadoc. After you've done that you can view their javadoc as you view your own (i.e. hover, 'javadoc-view', F3 ...)
Formatted text
Javadoc http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html
as far as i know for your Question1: How can i import documentation into eclipse project?
suppose you are using AXIS.jar and u want to get its doc properties then :
In the Package Explorer view expand your project and its library folder for the Axis library.
Right-click the Axis jar and select Properties.
In the Properties dialog, select Javadoc Location in the tree on the left.
With the Javadoc URL option selected, click Browse.
Navigate to the appropriate folder (see table that follows) and click OK twice to exit the Properties dialog.
Question2: What is Java Documentation looks like? and Question3:Which file format java documentation using?
HTML,zip or jar i guess :))
and
COvayurt, you cannot see what methods do specifically because you have added libraries for those methods not the java docoumentation for those libraries, so in order to add java doc for libraries simply provide the path of your docs location(if you have got docs for those libraries).
right click on your project then under properties set the javadoc path.
java documentation are html files created from the standard classes.you can create java doc for your own project too. see this link
and if you want to see standard java api documentation here-it-is
I want to look at the sources of the "New Web Service Client (from WSDL)" functionality. I thought it was the Axis 2.0 ws Code Generator plugin, but it is not, it's another code generator and I can't figure out its name or where is it located in eclipse sources.
Any hint on where should i look for?
EDIT: using ALT+SHIFT+F1 I found out the "contributing plugin" to the wizard I'm interested in is org.eclipse.wst.command.env.ui, but i can't find the source files of this package...
There is a neat tool in Eclipse for checking where a particular piece of functionality (such as a wizard or a view) comes from. Just focus on what you want to check and press ALT+SHIFT+F1. You will get a popup with information about your selection, including which plugin contributes it.
I use javadoc to document my classes and methods. I would like to add some overview information to my packages, too. I like how Eclipse creates a stub of a matching Doc Comment for each class or method once I type /**<Enter>. Does Eclipse have an easy way to generate a package.html file, too?
Update 4 years later (Oct. 2013)
javabeangrinder's answer (upvoted) mentions the following trick:
To create a package-info.java file in an existing package:
Right click on the package where you want a package-info.java.
Select new->package.
Check the Create package.info.java check box.
Click on Finish
Original answer (May 2009)
There is no template or wizard to easily create a package.html file.
As mmyers said in his comment, since Java1.5, the correct file to create would be package-info.java.
That file can be used not only for javadocs, but also for package-level annotations (as illustrated here).
There is an opened Bug (#86168) for demanding a wizard for the creation of package-info.java (since the class wizard does not allow the package-info name).
The reflections on that topic are on since... 2005! The problem is that any solution should
be implemented in a way that it also helps with 1.4 code.
The current workaround is to create a package-info.java as a text file.
From that point forward, package-info.java behaves as a normal Java class, and Eclipse places a package-info.class file in the output folder.
The Javadocs are correctly built using package-info.java, and not the package.html file.
(source: developpez.com)
Note (in response to Strawberry's comment):
bug 77451 (2004!, for package.html)
bug 163633 and bug 163926 (2006, for package-info.java)
both wish a preview of the package overview in package-info.java in the Javadoc
view.
So far, no patch has been proposed/implemented.
There is simply not enough demands for that feature to be added.
In eclipse
Since package-info.java isn't a valid identifier for a class it cannot be created as a class in Eclipse.
I found that when you create a new package there is a check box to check if you want a package-info.java.
To create a package-info.java file in an existing package:
Right click on the package where you want a package-info.java.
Select new->package.
Check the Create package.info.java check box.
Click on Finish
The JAutodoc plugin does a great job of this, as well as all your other documentation needs. Install and configure the plugin and right click the package and click JAutodoc > Add Package Javadoc
There are configurations and templates available for the .java or .html package documentation.
This plugin also does a great job of standardizing all your Javadoc needs, with a great deal of customization.
http://jautodoc.sourceforge.net/
There's a plugin that seems to create package.html files. I haven't used it but someone landing here might find it useful.
http://sourceforge.net/projects/package-javadoc/