I'm working on an eclipse rcp application and want to avoid this effect when opening a new editor:
http://www.fotos-hochladen.net/stackededitorsfcpt3zoq.png
and want to achieve this effect programmatically:
http://www.fotos-hochladen.net/separareeditorsmv58nzua.png
Has anyone an idea how this can be achieved?
Thanks! :-)
As far as I can tell from reading the Eclipse Javadoc, your editors will always open as tabs. It's up to your users to drag and drop one of the editors, so the editors are side by side.
You can submit a request to the Eclipse organization for this feature, if you wish.
Yeah, it is possible, I did it once. Just take a look at the following example:
http://snippets.dzone.com/posts/show/6277
As I remember, the code will open editors, one on top of the other but the code can be easily adapted so that editors are opened side by side.
Just post here if it doesn't work and I'll help you with it :)
Oh, I almost forgot... there is no "legal" way to implement your feature so you will have to call "Discouraged access" code.
This is not available as a default behavior. It is a nice view for those of us with wide enough monitors but Eclipse leaves that choice to the user because most people who are using monitors that are < 22" do not want to see editors side-by-side.
Related
I am trying to have my custom file type .vrs (which for all intents and purposes is an rich text format).
I am pleased with what I have since I am self taught.
But am having difficulties associating that file with my program so that when a user double clicks it, it automatically open my document editor.
All searches so far have come up with either right clicking and setting the association, but this is not what I would need.
I may not have explained as well as needed so think Photoshop's .psd when you install Photoshop all psd files are automatically set to open when you double click them.
Hopefully I have been clear enough for you to help.
Also whilst the question is regarding Java any resource be it for C# C++ etc, would also be appreciated.
Thanks for your time and any responses.
This functionality is system dependent, and in Windows involves the registry. If you really want to delve into this, take a look at this post, which goes into great detail on how to accomplish programmatically setting a file extension association using C++. If this is helpful, please write back telling us how you solved the problem in your individual situation.
If that isn't helpful I would try this link instead, as it links to more resources and demonstrates a little C# code.
I want to know if there is a way to write my own code completion in a java swing environment. I have a program and would like to provide hints for the user while he is typing. I am already giving them some hints through a popup menu. But, the problem is that it is in the way. It is a menu, so it does not feel as optional as eclipse's code completion. Do you know of a better way than a popup menu?
Thanks,
Get a look at RSyntaxTextArea. It supports code completion (with CTRL+SPACE), syntax highlighting, line numbering, bracket matching... much of the basic features you expect from a code editor component.
I tried to search the internet for examples for doing that, but can not find a good one. Also I checking eclipse IDE source code, but it's a bit too big to filter out what I need for an example.
What I would need is something similar to Eclipse File Association page below.
My plan is later to replace File types list with a combo and add more values/controls per combo selection.
I would be very thankful for an example or a link to an example that does that or has a same concept with working preference store.
Thank you!
You can take a look at the Google Eclipse plugin source code. I had to achieve something similar to your needs, and inspired myself from there. It is properly designed. You can take a look at the repository right here.
In my case, I needed checkboxes instead of combos, and used a CheckboxTableViewer from the JFace library, there are plenty of example onlines (e.g: JFace snippets).
As Alex said, first, works on Eclipse preferences concept... when you got it, it will just stay some pure UI tasks.
Well, I think that it is nothing more then simple preferences page with two Lists which just represents conformity between file types and editors.
The example how to implement your own preferences page is here: Eclipse Preferences - Tutorial
If you want to have Combo - there is no problem - you just replace upper ListEditor woth your ComboFieldEditor and proceed with adding more conrols. The file associations are stored in Eclipse preferences and you can access them whenever you try to open some file to retrieve corresponding editor.
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.
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)