Associate eclipse plug-in view with a file extension - java

I'm developing an eclipse plug-in and I would like to open files with a certain extension (e.g. .xml) with the View tab of my plug-in. Is this possible? I know this can be done for editors like this In plug-in.xml how to associate a file extension with a particular kind of editor in eclipse plug-in.

The difference between a View and an Editor has diminished with Eclipse 4. This means that you can dock editors outside the shared area on a view stack. Go ahead and try it by dragging an Editor by its title and dropping it on a view stack.
Furthermore, it is very well possible to edit files in views if you want to implement this yourself. For this to happen you have to implement ISaveablePart [1] on the view. When you implement this, the view will play in the change/dirty/save editor lifecycle of the workbench.
[1] http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2FISaveablePart.html

No, it is not possible.
The closest you can get is to add a separate 'open in view' menu item.

Related

Is it possible to delete a view that comes built in in eclipse rcp?

I'm creating a web development framework with Eclipse RCP.
By reimplementing Eclipse's open source, I created a view with added functionality to the existing view.
I want to replace the view provided by default in Eclipse with a view I created.
Is there a way to delete a view that is built-in in eclipse?
You can get a list of views through the ViewRegistry class.
Is there any way to remove the view from here?

eclipse drag and drop on text editor

I have a requirement for creating drag and drop plugin (just like window builder) where I have a view with buttons in it. And if I drag a button and drop from the view I should be able to generate some code on the java text editor.
I want to create this plugin for generating the code. I don't have any knowledge in Eclipse plugin development. I have gone through http://www.eclipse.org/articles/viewArticle/ViewArticle2.html, but I am not sure where to store the code to be generated. Will it be somewhere in a text file, or somewhere else?
A site from 2001 will not help you alot. Today PDE does not need much experience, its self-describing.
Go "File"->"New"->"Others"
Choose "Plug-in Development" -> "Plug-in Project"
Enter a name, press Next,Next
Choose the Template "Plug-in with a View" or "Plug-in with an editor" (what you prefer)
Read and write.
AS per my understaning you want to develop graphical editor for some domain language. Options you have for this
Eclipse GEF
Eclipse GMF
Eclipse Graphiti
basically code will be stored in same file but you will have graphical editor.
PS: Developing graphical editors can be pretty tricky :)

Intellij IDEA multiply windows project explorer

Could somebody tell me if it is possibile to open two instances of the same project in Intellj IDEA or can I for example have two windows with opened different project files with attached project explorer.
I asking for that because I have two monitors and it will be more efficient to navigate on each windows separately.
For now I must drag tab from root window and drop to another window which it is annoying and unhandy.
This is not possible. IntelliJ IDEA has a one project one window paradigm.
Some suggestions, in order of best to worst, that may help:
The navigation bar (Alt+Home or ⌥⇱ {Option Home}) can be used in place of the project tool window. You can use it either in pop-up mode or anchored mode (View > Navigation Bar). When a file is opened via the navigation bar, it opens in the window that has focus. The nav bar is ultimately a horizontal project window. Check the help documents for how to easily navigate through the nav bar. Once you get use to it, you may find you never use the project tool window again.
Have you tried floating the project window and placing it on the edge of one of the monitors so it sites between the two editor windows? While you would still need to drag file to the second editor window, it might prove easier.
You could create a second project with the all the same modules as the first project (just being sure to save the second project's .idea configuration directory in a different location). But this would require keeping two project configurations in sync, and you would need to make sure the "synchronize files on frame activation" setting is on. In the end, I think that is far more hassle then it is worth.
Hope that helps.
(FYI, I may be new to StackOverflow, but I'm a ten year passionate and evangelical IntelliJ IDEA user.)

How to drag a button and autogenerate onclick method in Eclipse? How to find variable/method references in Eclipse?

I'm a c# / visual Studio developer. I'm porting some of my WP7 apps to Android and I have gotten pretty used to Eclipse. I've read some "differences" documents but still have a couple burnning questions . . .
in VS I drag a button to the surface and assign a method name for onclick and it generates the method outline for me in my source file. I can't see how to do this in Eclipse - can I?
in Vs if I put my cursor over a variable or method name I get a dropdown that has a "Go to" option and a "find all references" option. these are really handy. Can I do that in Eclipse?
You're developing Android projects in Eclipse, so I will base my answers on that. I also guess you installed the Android Developer Pack plugin.
In the ADT plugin for Java, you can open a layout.xml and see its "Graphical Layout". You can drag UI components there, but it won't generate you code for handling events.
For the second question, in Eclipse you have to right-click on the variable or method and go to the "References" menu. Or you can learn the keyboard shortcuts and it becomes easier.
Typing onclick and then pressing Ctrl+Space should open up a list of default functions you can override. Double-clicking or pressing Enter on one will bring it up in the editor (I usually type "on" before pressing Ctrl+Space, whenever I'm not sure about everything that can be done in a class.)
Right-clicking a variable will open up a context sensitive menu where you may view the variable's declaration (F3) or type hierarchy (F4); lower down the list is the References menu where you can view all the references to that variable in the workspace (Ctrl+Shift+G) or beyond.
You can also rename most variables by right clicking and choosing Refactor > Rename..., something I started using pretty early.

java with eclipse - lost design page

I am learning Java using Eclipse - started a project with javax.swing and could view a design page with my page layouts shown and various palets for components etc. Now this design page seems to have vanished and I cant discover any option to recover it. I hope someone can get me back on track.
Have you tried Right-click on class (for example MySwingPanel.java) in package editor Open With->WindowBuilder Editor?
The last time you selected something in Open With - this is the editor to open that file on double click.
Have you tried changing the Perspective? Click the arrows next to the DDMS tab in the upper right hand corner of Eclipse and select the 'Java' Perspective.

Categories