Cannot add menu to org.eclipse.ui.main.menu through Model Fragment Definition in Eclipse 4 model editor - eclipse-plugin

I have a eclipse-rcp application developed with Eclipse 4. This application is modularized with several plugins and features. This application is built with maven-tycho using pomless. The project structure follows the guidelines proposed by vogella for Eclipse Tycho.
This project has a main Application model defined in the plugin app.rcp (Application.e4xmi). It has several plugins that extend this application model through several fragment.e4xmi files. Specifically, in one of them, I modify the application model to add a menu to the application main menu with the following line in the frament.e4xmi:
Extended Element-ID: org.eclipse.ui.main.menu
Feature Name: children
Position in list: index:1000
This model fragment allows me to add menus, handled menus and so on without any problem through the Eclipse 4 model editor.
At this point, my objective is to build a separate feature, which is not in the same project, to add a similar menu to the application main menu, which will be installed in the original application using a p2 update site.
For this, I have created a plug-in with an application model fragment (fragment.e4xmi). I try to modify the file with the Eclipse 4 model editor pushing Find... of Extended Element-ID field. However, when I select Menu in Container-Type, there is no item that I can select. In the other plugin I can select the Main menu (org.eclipse.ui.main.menu) and other created menus.
I have tried to add dependencies to the plugins of the main application. The project compiles in the command line (mvn clean verify), but in Eclipse IDE it shows that it cannot find the plug-ins of the main application.
EDIT:
The problem here is that the combo to add Menu, MenuSeparator, HandledMenuItem, etc is disabled, so I have no way of adding any of it. When I push the add button, it does nothing. I have tried to use a text editor to change the fragment.e4xmi file directly, but I haven't been able to test if that works.
The combo box that I refer to is located below the "Position in list" field of the model fragment ( see Model Fragment editor image)

You must add the menu to the 'Imports' section in the fragment.e4xmi to make the 'Find' dialog work.
You can also just add the id manually, it should still be resolved properly when the model is being loaded.

Related

Can I customize the "New File" menu in PhpStorm?

I would like to add some other options, like "PHP Enum" or "PHP Interface" directly to this menu. Also, I would like to put PHP-related options first. It is possible tu customize this in PhpStorm? I'm using last version (2022.3.2) with the new UI enabled.
I tried using Appearance & Behaviour -> Menus & Toolbars but that didn't work for me.
Do you know that you can use the universal PHP Class entry and just change the type of the object (and therefore the file template) there? That can be done right away when typing the file or class name -- just use Arrow Up / Down keys:
(GREEN rectangle area is where that Up / Down key will work; RED rectangle shows my custom file templates)
P.S. The template for PHP Enums is also there, it just the screenshot was taken in a project with PHP 8.0 language level (need 8.1 for enums to appear).
P.P.S. The IDE will remember the last used template when you invoke this dialog again.
https://www.jetbrains.com/help/phpstorm/creating-php-classes.html
You can add new entries to this menu by creating custom File Templates at Settings/Preferences | Editor | File and Code Templates
https://www.jetbrains.com/help/phpstorm/settings-file-and-code-templates.html
Here are my test custom file templates:
And this is how they appear in that menu:
Customizing this menu (removing items, changing their order)
This is not possible at the moment. https://youtrack.jetbrains.com/issue/IDEA-143090 -- watch this ticket (star/vote/comment) to get notified with any progress.

JavaFX exe wont run

I have recently finished building a mini-app using IntelliJ IDEA in javaFx. It is my first time using this ide and language, so I am having difficulties manufacturing an exe file. I watched all sorts of youtube videos and different methods.
It does generate an exe file but when I click it, nothing happens.
Any idea?
I do know that with IntelliJ Ultimate edition you can build down with an EXE file.
There are a couple things you need to double check.
First, is that in your project structure under artifacts, you have the "Type:" set to JavaFx Application(which is on the top right of the window).
Secondly, switch to the Java FX tab and make sure Application class is set to your main class.
Thirdly, Select "all" under Native bundle: which is located towards the bottom of the window.
Lastly, Select the Output Layout tab and move all your available elements to output root then click on the module of your application and look at the settings that appear at the bottom. "Make sure that main class setting is in fact the main class to your application.
Side note: make sure you delete your artifacts build folder just to start from a clean slate. Also make sure your Environment variables are set to the system path correctly.

IntelliJ file new move Java Class on top

When I do a file new in my IntelliJ idea. I see a menu like this one
I want to see classes from Java and Scala on the top. I don't want to uninstall plugins for ruby etc. But these should not be on the top. I mostly code in java and scala and therefore want these classes to be one top.
When I want to create a new Java class, I activate the "Project" view. Then I select the package to which the new class shall belong to. Then press Alt+Insert. This popup menu is shown:
Please ensure that the directory you're creating a class in is under a module source root. You can navigate to it in Project View, right-click on it or any its parent and choose Mark As... | Source Root

Customize existing menu/toolbar Item

I am building a netbeans platform application. This application is project based. I need to customize existing menu/toolbar items.
For instance, when a java project is selected, the "New File" button on the toolbar brings a standard wizard. But when a custom project (my project type) is selected, I would like that same button to bring my own dialog/wizard.
How do I achieve this?
I have been struggling with this for quite some time, any pointer would be greatly appreciated.

add different plugins to different tab on multipage editor

I'm developing two GEF plugin and one RCP eclipse plugin, I have the next problem:
I have one plugin with multitab editor and i would like to open the editor of plugin on first tab and open the editor of second plugin on second tab.
I mean if I open the file in first tab it uses the editor A, but if I open the same file in second tab, it uses the editor B of second tab.
The rcp pluging only serves as a base for GEF plugins.
is it possible?
regards
I haven't tried it, but you can use the extension org.eclipse.ui.editors.documentProviders in order to implement your logic. Here is a link of the eclipse online help.
EDIT: The problem you would have is to synchronize the both instances, when you open them.Or you can use one with change listeners