How do I set the active selected project in Eclipse plugin - eclipse-plugin

I've developed an Eclipse plugin which allows users to add projects.
I'm looking for a way to automatically select (in the Navigator and Project Explorer) the project that was just created. As it is now, if users create a new project, the selection in Navigator and in Project Explorer are still set to the old project that was selected before we added this new project, while in Package Explorer behaviour is as expected - the new project is chosen.

The simplest way to do this is to call
BasicNewResourceWizard.selectAndReveal(resource, window);
where resource is any IResource derived object (such as an IProject)
and window is the workbench window.
This call is usually included at the end the creation wizard (but can be called anytime).
BasicNewResourceWizard is in the org.eclipse.ui.wizards.newresource package in the org.eclipse.ui.ide plugin.

Related

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

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.

Equivalent of having 2 projects open in my WebStorm workspace?

I open a project, but want to create a module to reference in WebStorm, (mostly so I can do work in 2 projects instead of having 2+ instance of WebStorm open).
In IntelliJ Ultimate or whatnot, it has a modules button. It Kinda looks like modules does not exist for me, or at least I have not see anything.
I have 2 folders which are siblings to each other representing the 2 separate projects I wanted to open in 1 instance of WebStorm.
Where can I find this information for WebStorm?
A lot of the googling was talking about modules but I didn't see that option, and I believe I noticed some posts mentioning this is not a thing in WebStorm.
Thoughts? Guidance?
WebStorm/PhpStorm project consists of a single module only (WEB_MODULE type).
WebStorm cannot open more than one project in single frame. https://youtrack.jetbrains.com/issue/WEB-7968 -- watch this ticket (star/vote/comment) to get notified on any progress.
At the same time it's possible in PhpStorm: https://www.jetbrains.com/help/phpstorm/opening-multiple-projects.html#d197136e31
But it's still will not be full "two separate projects with separate settings" AFAIK. It's more of a "attaching 2nd project so you can see and edit those files in the same frame".
Question is: why exactly you need this? To access files of a second project? If so -- just add such folder(s) as Additional Content Root -- it will be listed as another node in the Project View panel and files will be treated as part of the project itself.
https://www.jetbrains.com/help/phpstorm/configuring-content-roots.html
in Webstrom 2019.2 is it now avilable to open attached project to the current project.
Open multiple projects in one window
When you have a project opened in WebStorm and want to open another one, you can now attach this second project to the opened one, so that you can see both of them in the same IDE window. If you want to close the attached project, right-click its root in the Project view and select Remove from Project View.
https://www.jetbrains.com/webstorm/whatsnew/

Old project don't show current windows in Intellij IDEA

When i open "test" project then "Loop" project gone from window. But I want see my all project in one windows.
From the docs:
The first thing you'll notice when launching IntelliJ IDEA is that it has no workspace concept. This means that you can work with only one project at a time.
It may well be the case that you don't need to switch projects in IntelliJ, since you could create an IntelliJ project which contains multiple modules. However, if you are dealing with distinct projects here then it is possible to switch between currently open projects in IntelliJ using keystrokes or a menu. From the docs:
To switch between the currently opened projects, do one of the following
On the main menu, choose Window | Next Project Window/Previous Project Window.
Press โŒ˜ or โ‡งโŒ˜.
On the main menu, point to Window, and then select the name of the desired project.
For what I know, you can't get multiple projects into one window with JetStorm IDEs.
You can make them in multiple windows with different projects. Or, you can just make a project and add the projects in it.
IntelliJ can indeed only open one project at a time - but you can easily open (and alt-tab) between projects.
If you have 2 projects that are dependent or closely related, you can look at a form of project modularisation.
A popular framework is maven, based on the project object model (pom.xml) specification.
https://maven.apache.org/guides/introduction/introduction-to-the-pom.html
When you have a multi-module maven project in intellij, you can view all modules in the project view (tree based configuration).

How to display all projects in the Project View in PHPStorm?

In eclipse / Zend Studio the project manager displays per default all projects of the workspace (or of one of its Working Sets, if selected):
Now I'm looking for the according configuration in PHPStorm, that shows only one project per window:
How can I see all my projects in the project view of the same window?
PhpStorm does not support multiple independent projects in one window / frame:
https://youtrack.jetbrains.com/issue/WI-15187 -- star/vote/comment to get notified on progress.
But ... you can list files from another project there (in Project View panel). If that is good enough, then just go to Settings | Directories and add desired folder as an Additional Content Root. P.S. This also means that the setting from current project will be applied to all content roots.

Generate manifest for regfree COM from a VB project

I am trying to generate a manifest for a set of COM objects that are being used in our code as registration-free COM.
For that purpose I created a VB project in VS 2010 and added the COM objects DLLs as dependencies. The problem is I do not see them listed as dependencies in the generated manifest. Am I missing something simple like a project setting to generate the proper manifest listing the dependencies?
You left out too many details and the VB.NET IDE hides too much to do this right. It is not automatic.
Starting point is to force it to show more. Locate the "Show All Files" toolbar button in the Solution Explorer window (use the tooltip to find it back). Click it and you now get the "References" node added to the project.
Open it and locate the COM component that you added to the project. Select it and look at the Properties window. Set the "Isolated" property to True. Rebuild the project. Be sure to look in the Output window for any warnings. And to look at the .manifest file on disk instead of the one the IDE shows you if you added a manifest to your project yourself.