eclipse unable to generate design view from java source - java

I have the following situation
I have one swt class which displays a simple window in one project. In this project i am able to see the design view and code view separately. Now in another project i am copying and pasting the class that i developed in previous project (same IDE at a same time). As a result it is not able to show the design view for the swt class.
Another scenario of the problem is that when one swt class is designed on one machine and if i import that project in my IDE from other machine using external media then also it is not able to show me the designer view for the swt class.
How can i solve this problem? Is there any standard solution to this problem?
Thanks in advance.

Well, after being familiar with eclipse one day i come to know that we can do Open With -> GWT Designer to view the design part of the SWT form in eclipse.

maybe this is a stupid question, but did you try to do right click, and open with a visual Editor, or something like that?
Or maybe you copy only the code in a not-visual class...

Related

Netbeans - Design view not available

I'm following a tutorial on using SOAP web services and for this i must edit my file WelcomeSOAP.java using design view, however design view is not available, only the 'source' and 'history' views are on the bar to the top; also if i go to view > editors they are the only two options. I have come across this question:
Netbeans design view?
However, both my laptop and computer are running netbeans 7.4 and the design view is available on my desktop, but I need to be able to use it on my laptop too. Does anyone know how to enable design view?
EDIT:
I have tried deactivating and reactivating the GUI plugin, and also re-installed netbeans, both of which did not work for me.
Tools->Plugins->Available plugins, search for 'GUI' if you need Then check: Spring framework for Java SE. It works for me on NetBeans 8.0.2
In the Menu Bar Go to -
View > (Check) Show Editor Toolbar
Done.
Alright i've found the answer. When you are in your source package, right click and there should be options for "forms"
search for 'web service' and make sure that 'Java Web and EE' is active
Open Java Application, then right click on "Source Packages" - "New" - "Other" - (Categories) "Swing GUI Form" - (File Type) "JApplet Form"
Job Done.......
(I tried thin with 8.0.2)
Hmm.. It might be because you're not using the latest version of NetBeans (I had the same issue). Get NetBeans 8.0.2 and reinstall the GUI plugin. it should work then.
You have to install the plugin named web services. You can find it in this path and search for it there in the search box in top right corner.
tools->plugins->available plugins
Tools->Plugins->Available plugins, search for 'web service' if you need
Then check:
RESTFUL Web Service,
SOAP Web Service.
It works for me
Error : "Design view cannot be rendered."
Below procedure worked for me:
Close the file that has the design view (Web Services folder -> YourService)
Close the netbeans
Open Netbeans
Open the file again
Make sure you have not deleted the ".Form" file (Thats's what I did while rearranging everything). It is the file that lets you edit the form in netbeans. I couldn't find how to recover.

Is it possible to add a Java Editing area to an Eclipse RCP Part?

I want to add a java editing area to my Eclipse RCP application where the user can create some java code. I have found a good tutorial here where I can open a java editor without a file so the user can implement some code, but instead of opening the java editor I would like it to be embedded on my Part.
Much like you would attach a Text area to the Part using Text textArea = new Text(parent, SWT.BORDER) is it possible to do the same with an instance of an editor? There doesn't seem to be any API to set the parent of it.
Your problem isn't really easy to be solved. JDT is really complicated and cannot be so easy ported to a ViewPart. There are many Parts, that are dependent with the IEditorPart. There is a similar question on Stackoverflow here.
UPDATE:
I just saw in PlanetEclipse, that Tom Schindl is playing with the creation of a FX java editor. You might give it a try and integrate it in your View. It seems to be possible to integrate Java FX components in SWT. Please give a feedback, if that's possible ;)

How does Eclipse know whether the Swing Designer is available for a JFrame-derived class?

I am using Google Web Toolkit's Swing Designer in Eclipse to create and edit components like custom JFrame's.
The problem is that the Design View is sometimes broken for my class (probably because the project is also being edited by another person in a different platform), and I want to know how to restore it. In other words, I am able to edit the code for a custom JFrame, but I cannot use the visual editor to modify the JFrame anymore. I notice that the icon for my JFrame's source code also changes to a normal java-source-code icon when the design view is broken.
In which file does Eclipse keep track of what JFrame's can be edited using the visual editor and which ones not?
Thanks in advance.
If you want to open a file in the designer, but that's not happening by default, then use right-click Open With>WindowBuilder Editor.
If you don't see the Design tab, that means that you are just using the standard Eclipse Java Editor rather than the WindowBuilder editor. Eclipse allows you to use different editors via the Open With command. This is very basic Eclipse behavior, so it is something you should learn about. This is also covered in the WB docs and FAQ.

Is there a way to find out the class of form using eclipse?

I am working on a large undocumented application written in swing/awt. I have to make changes to it and i need to find out what class a form belongs to when i open it. Is there a way to do this via eclipse?
For example: I open the application and to do something with the app such that some frame opens. How do i find out the class of that form? Can this be done through eclipse?
I know i can comb trough the logic but this is a very laborious and largely ineffective process, chunks of the logic are either in jar files or obfuscated.
Thanks.
For figuring out how a given Swing frame is put together, I have found Swing Explorer to be VERY helpful.
https://swingexplorer.dev.java.net/
After installing the Eclipse plugin, note that you need to "Run as ->" to invoke Swing Explorer properly.
I don't know if this is what you need, but maybe you should try searching(MainMenu-->Search) your entire Project for the specific Window title (String) that comes up with this particular window.

Questions about IntelliJ to Eclipse transition

I just started using eclipse for some personal projects and am finding the transition from IntelliJ (what I use at work) kind of annoying. I hope it's kosher to ask a few different questions in the same thread. Here goes:
1) How do I get "views" (I'm not sure if this is the term. I mean windows such as Project Explorer, Servers, Console, etc) to stay expanded and on top even after I've clicked back on the editor or another view. I'm pretty sure that right now all of these tabs are "quick views" that I have minimized and then docked, so I may not be doing this right to begin with. In IntelliJ, I would simply just pin the tab.
2) How can I open a file (for instance, an ant build.xml) without having to make it part of an eclipse project? I want the syntax highlighting and Ctrl-click ability that the IDE will give me (not to mention being able to use eclipse's built-in ant), but I don't need to associate the file with any others and so don't see the point of having to make it a part of a project.
3) Is it just me (wouldn't be surprised) or does eclipse have a bug with parsing empty html tags within the body of html tags of the same type. I've only tested this in a JSP, and it doesn't happen with JSF tags. For example: <div id="foo"><div id="bar"/></div>. Eclipse will give a warning saying the first div tag has no end tag. This is with the most recent version of eclipse for Java EE, no plugins have been installed.
4) Finally, a general question: Any best practices or resources to look at for organizing the eclipse interface and perspectives/views? What about workspaces/projects? Is there some tutorial out there that would be really informative that I could read through in less than an hour?
I appreciate any answers and tips/tricks.
First of all, please acknowledge that there are different people in the world and there are people who don't work the "Eclipse way". Even if I was paid for it (and I am), I couldn't work with IDEA. So if Eclipse rubs you the wrong way, it may not be for you. That out of the way, your answers:
In Eclipse, you open a view and let it stay where it is. In IDEA, the view changes all the time, things pop up and go away. Eclipse is static unless you specifically move things around. There are two ways to move things: You can minimize a part (a part is something which contains tabbed views). This moves the part into the closest border. Or you can maximize the current part (Ctrl-M). This pushes all other parts out of the way. Another Ctrl-M will restore the view.
This is a good place to show the difference between IDEA and Eclipse. IDEA tries to anticipate what you're doing and to be helpful. For me, this means it always gets in my way. It will start to format source as I type, things move, etc. That freaks me out. Eclipse is like a toolbox. Everything is there but you have to pick it up. A toolbox doesn't move on its own accord and it doesn't try to be smart.
Eclipse is based on the idea of a workspace. The workspace is the universe and nothing outside exists. If you need to go outside, you must first create a file or folder. In the "New File/Folder" wizard, you can open the advanced options (at the bottom) and link this resource to a real file/folder in the file system. May sound like a lot of effort but it allows Eclipse to display virtually anything in the explorer since it just shows "resources" in there, not actually files.
Smells like a bug. Please report it at https://bugs.eclipse.org/bugs/
I'm not aware of anything.
[EDIT] 3. As cletus pointed out, is not valid HTML. So that might cause the warning.
An Eclipse Perspective is a collection Views and their position. You can customize or create new perspectives, but the existing ones are good enough for a start (Java, J2EE, Java Browsing etc.). I recommend to stick with the default layout for a while until you've managed to use the quick view feature (which, personally, i find quite annoying). On small screens, i simply like to use Ctrl-M to switch the Editor to fullscreen mode and back, without the need of minimizing single views or move them around.
Yes, you can run external build scripts as well and it's called External Tool in Eclipse. Go to Run > External Tools > External Tools Configurations. Create either a new Ant-based config or a native executable (Program). The location of the build script or executable can either be workspace-relative (Browse Workspace) or absolute on the file system (Browse File System)

Categories