GWT Java Emulation - gwt

I have some code which uses java.awt.Color. I want to translate my Java Code to GWT.
So I will emulate java.awt.Color in my GWT Project.
One approach is to write a module called
java.AWT.gwt.xml whose source path is awt and a class called java.awt.Color.
The other approach is to create a folder
com.google.gwt.emul.java.awt
and create java.awt.Color class inside that path. Eclipse will show errors. But compiler will work.
Which one is appropriate way to add java.awt.Color for GWT?

You'd rather create a subfolder (say 'super') in whichever module you want (probably the module for the code you want to make "translatable") and declare it as a super-source in your module's gwt.xml:
<super-source path="super" />
And you'd put your java/awt/Color.java in there.
The Eclipse errors are normal, it's not source code that should be compiled (by javac, to a *.class file), only code for the GWT compile, which works from the *.java file. So you'd want to exclude the super subfolder from your build path.
That's it!
See also the Overriding one package implementation with another subsection at http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml

Related

Why does Eclipse show incomplete Scala classes in the Outline view?

Context: Scala project with imported library such as akka-http.
IDE: Eclipse (mars) + Scala-IDE 4.3
OS: Windows
I've configured sbt to download source code related to dependent projects, so I can view/inspect libraries more fully.
When I bring up akka.http.scaladsl.server.Directive I see only the first few members of that class in the Outline view. I can see additional members in the code that are not displayed in the Outline.
Why am I not seeing the full outline?
Short Answer
Right click on the project to open Properties -> Resource -> Text file encoding, and set to UTF-8.
This can also be set for the workspace properties; it's not clear to me if changing the workspace properties auto-sets existing projects, I'm guess it doesn't.
Why?
Admittedly a guess, but...
The problem seems to be associated with the combination of Scala IDE 4.3 (for Eclipse), Windows, and assumptions about source files and text encodings:
The Eclipse Scala-IDE 4.3 has a new Outline view, which seems to render a better representation of Scala classes by deferring to source. And it fails to do that properly when it doesn't grok the text encoding.
In Eclipse the default text file encoding is "Inherited from container" for the workspace. I presume existing projects inherit that setting from the workspace.
The Windows text file encoding (the container mentioned previously) is ISO-8859-1, or possibly something else... but not UTF-8.
In my problem Outline view, it turns out that the last member displayed for a class contains a unicode '⇒' (syntactically equivalent to '=>' in Scala).
silent boom

Eclipse Class Editor Formatting

Eclipse's class editor has no formatting or collapsable fields / methods. How can I make the class editor have the same text formatting as the java editor? Or at least make it more readable and user friendly, such as the one in Netbeans.
Opening a class in Netbeans:
Opening a class in ECLIPSE:
I would like to make classes more readable in Eclipse, is there any way to do that? I have tried attaching a source / javadocs before with no luck. I am hoping there is a simpler way
You want to see a source like representation of a .class file. Although not exactly what you are looking for JD-Eclipse can be used for that purpose. Addmitedly the scope is broader, because it is a full blown decompiler, that will actually show you the code, but should work for you.
When installed it will by default open .class files and present the code instead of default view that only presents somewhat raw results of parsing bytecode.
Another option is Bytecode Outline that is not a decompiler, it only deassemples bytecodes in the editor, but can make debugging a bit easier, because it seems to handle line numbers in sync with the debugger, unlike JD-Eclipse, which just outputs line number comments.

Intellij IDEA how to run a class not the entire project?

is there a way to run (not only compile) a single class (with a main method) instead to run the entire project as does Intellij IDEA?
And, is it possible to open different projects in the same window instead to opening them in a new window or in place of the current project?
You can only have 1 project per window. However, you can load multiple modules into 1 project. Each module can have it's own compiler, language, or any other set up.
If you right click inside the main method of your class, you should have an option to "create MyClass run/debug" or an option to just run it without creating a launch config.

Flex 4 clicking on functions and vars from an source path class

In my main project I have many libraries referenced by source path instead of referenced through the Library path. These are libs that I want to use in other projects too. Since I am allways changing them I use them as source path. I find it more practical and faster then moving to another project and looking for a class and then back to the main one ... and so on.
Problem is that when I click on a function or a member var to access the source class (ctr click), I get the error Resource '/bla/bla.as' does not exist. Isn't there a way to reference the sourcepath so when I "ctrl click" it opens the right class without showing this problem.
Thanks
Right click > properties > build path > libraries > (Expand the library to which you want to set source) > source attachment > edit(In the right menu)
You will see something like this below. Attach it.

Symfony and Eclipse: I can not go to the function or class using F3

I'm using Eclipse (Build id: 20090920-1017) to write my Symfony web application and in many cases I can not "go" to the declaration of functions or classes (you know placing the cursor where the class or the function is called and then pressing F3).
For example: I have this class:
class UsuarioFormFilter extends BaseUsuarioFormFilter{
}
When I try to go to BaseUsuarioFormFilter it doesn't work.
How can I make it work?
Your project is configured like php project?
<nature>org.eclipse.php.core.PHPNature</nature>
This works: I just go to the folder that contains BaseUsuarioFormFilter and right click on it and then "Build Path">"Use as source folder".
Nice =)
Also, i think you can use "lib" like source folder.