I am making an Eclipse product which contains the Xtext plugin.I followed this tutorial https://kthoms.wordpress.com/2010/11/12/setting-up-a-rcp-product-for-a-dsl/ and I made a running product.
I created a platform runtime feature with the "needed" plugins. Most plugins are useless and I remove them one by one. But I can't remove Java from the RCP application and some others useless plugins.
When I tried to remove jdt, for example, Xtext doesn't work anymore.
How can I remove Java from the application? Is it implement by a plugin?
Thank you for your help guys :)
If you want to remove something from platform, you can use "activities".
Open your plugin.xml, Extensions tab then add the extension org.eclipse.ui.activities
Create an activitypatternbinding child as the extension, give it an ID of your choice, then fill the pattern attribute with the eclipse id of the element you want to hide. If you want to hide java perspective, this should be something like org.eclipse.jdt.ui.JavaPerspective.
More infos here and here
Related
due to reasons I am working with undocumented java library code that I cannot alter in any way or write into. Im using eclipse 2020-06 and I would like to leaves some notes for myself to make things easier. Is there a way to do that? or maybe an eclipse extension?
You can use bookmarks. They work somewhat similarly to breakpoints, without pausing execution when you're debugging.
You can add them via the context menu.
If I recall, you're a bit limited by the amount of information you can add. It's basically just a single text box.
See the help section on bookmarks
Maybe there's some plugins which extend the functionality (e.g. this one for adding keyboard shortcuts)
There are occasions when there is some code in a file that does not have any extension. Such files will have code written in a single language, but each such file may be written using a different language (like C, C++, assembly language, wiki markup, and HTML for example). Similarly, the problem also happens when there is a common extension in the file name, but different files use different programming languages.
The problem I want to solve is to avoid making each individual developer that has checked out a workspace from having to figure out what kind of file a source file is (there is either no extension, or the extension does not imply the source language used). To do so, the author of the file has the responsibility of putting the right magic in the file to let the file be opened properly. Since Eclipse has the ability to disable the formatter based on some embedded text in the file, I thought it should be possible to specify the file type as well. The Open With feature allows an individual developer to change how a file is interpreted, but must be done again each time a new workspace is checked out.
In Emacs or Vim, I can place magic strings at the top of the file to indicate how I want the file to be rendered within the editor. For example:
/* -*- c++ -*- */
/* vim: set ft=cpp: */
Is there some equivalent magic for Eclipse? My attempts at finding a solution constantly pointed out how to disable the formatter. Clearly, my inexperience with Eclipse is capping my Google-Fu.
If there is no file extension, then things are a little harder. Instead of double-clicking to open the file, right-click -> Open with... -> other -> C++ editor. This will remember your choice for that file only.
ref:Quick way to set custom syntax highlighting in Eclipse
Of all the free plugins providing Vim functionality within Eclipse that are available as of 8 November 2013, namely
Vrapper
ViPlugin
Vimplugin
Eclim
...none seem to support modelines. Nevertheless, a Vrapper user asked more than a year ago if such support existed.
Note that Eclim is a special case. It might solve your problem since it allows you to use Vim as an embedded Eclipse editor. However, from within the Vim instance, Eclipse's key bindings will not work. I guess it's a trade-off between access to features and convenience. From Eclim's website:
Please be aware that the embedded vim does not behave like a standard
eclipse editor. It's a separate program (vim) embedded into eclipse,
so eclipse features are provided by eclim's vim plugins and not the
usual eclipse key bindings, context menus, etc. For those that just
want vim like key bindings in their eclipse editors, vrapper is an
excellent alternative which provides exactly that.
There used to be a commercial plugin called Viable but development seems to have stalled since 2011. Also, some users report that it breaks under Juno.
Finally, although your question is about Eclipse, it turns out NetBeans does have a plugin that supports modelines. It's called jVi. Another plugin for Netbeans is VIEX, in case you're interested.
Hope that helps!
Sources:
What vim plugins are available for Eclipse?
What are some good plugins for developing Java in VIM?
I'm not aware of any Eclipse plugin able to deal with vim-style modelines. However, AnyEdit gives you a pretty precise control over tab size and related prefs. And you can always search the marketplace.
In my current work, I want provide xText editor support ( because of its code completion, syntax high-lighting) to the programmers of my domain specific language. I have written grammar in xText.
To provide xText editor support, I am going to provide programmers with full eclipse IDE with xText plugin installed (available on xText website). However, I get xText editor facility at the cost of the the following manual manual steps (as discussed in 5 mins xText tutorial).
The programmers have to go to File -> New -> Project - > xText Project
The programmers have to replace “hello world” example grammars by my language grammar.
They have to go to RunAs -> Generate Xtext Artifacts.
Finally, they have to do : run -> Eclipse Application to take editor support . So, they can write dsl specification.
My question is that is there any way, which can atomize (with minimum effort) these tasks (any scripting or any other thing) in a single click?
OK I'm really not sure I understand your question. So I'll re-state what I think you're asking, and answer that. Apologies if I've misunderstood - please let me know.
So - I think you're saying:
You've developed an xtext grammar for your language
You want your users to be able to use the editor xtext has generated for the language
right now, the only way you know how to do this is to have your users emulate what you did (install xtext, create a new project,
copy in your grammar, run the generator, create a runtime instance &
then finally create files in your DSL)
You want to fix step 3. So your users can just create a new project then create a new file with your DSL extension and start editing.
If that's correct then the easiest approach is:
Select File->Export...->Plug-in Development->Deployable Features & click Next
Select your DSL project in the list of features (<your.dsl>.sdk)
Select a directory for the resulting repository and click Finish
Eclipse will generate an installable feature for you in the target dir. You then need to make the repository dir available to your users by publishing somewhere they can access. This is your Repository URL.
Your users then need to:
Install a standard eclipse distribution (the modeling tools one is suitable)
Select Help->Install New Software
Click Add to add a new repository, and enter your Repository URL
Select your feature in the list & install
From there they can create new projects & files. If they create a file with your DSL extension, your xtext-generated editor will be loaded automatically.
You can make their job even easier by generating an eclipse product. To do that you'll first need to create a product specification then use the File->Export->Plugin Development->Eclipse Product. That will create a standalone eclipse IDE with your plugin pre-installed. So your users can just install and go. There's a good tutorial here for this.
hth.
There are three options that would do such automation for you:
1- Use a general macro recording software such as AutoHotkey or Sikuli Script, so you can record these steps and replay them back. You can find similar software as well in this Wikipedia article
2- Use eclipse macro plug-in such as Practically Macro, which is an open source plugin for eclipse
3- Write your own implementation using Java Robot class which simply can generate events that are needed for automation such as keyPress, mousePress and mouseMove
I am doing this for the first time i have eclipsejee-helios-3.6. I want to create an RCP project it doesnot ask me "Would you like to create a rich client application?" it just ask me to make an activator class. when i do this i can see only one class in my project . I am following this example.
hey please give me any solution.
First of all, I would suggest you a better tutorial, which I used to learn RCP development.
Check it out - it is the most up to date tut for RCP dev. (based on Helios)
It gives very detailed, easy to follow step by step instructions & some explanation about the ideas behind the framework.
Hope it helps!
PS. just checked: If you got your installation right, in the create new plugin wizard, you are asked if you want to create an RCP application right below the activator class input field
it was my mistake i was selecting the wrong Target Platform. It should be the "Eclipse version" not "an OSGi framework". Now its working fine. So always see for the Target platform.
I want to develop a Java editor eclipse plugin which is slightly different than the normal Java Editor. Is it possible to extend the Normal Java Editor itself? Thanks in advance
In eclipse you usually do not extend (subclass) an editor (or another feature) but use existing extension points to contribute additional functionality or behaviour.
The eclipse SDKs Help contains a book named 'JDT Plug-In developer guide' with a chapter 'Reference/Extension Points Reference'. There you can find the JDT plugin extension points.
As Andreas said, you don't extend editors.
However, you can reuse the editor configuration and many of the JDT tools.
Here are some things you may want to look at for helpful editor info:
http://www.realsolve.co.uk/site/tech/jface-text.php
http://www.ibm.com/developerworks/edu/os-dw-os-ecl-commplgin1.html
(and parts 2 and 3)
http://www.ibm.com/developerworks/opensource/library/os-ecjdt/
http://wiki.eclipse.org/FAQ_How_do_I_extend_the_JDT%3F