Customize welcome screen options in MPS
Hi,
When we open MPS, we will be getting the initial welcome screen like .I want to customize the available options like removing a menu item (for ex) Open Sample Proj) from here. or adding new action to the existing list.
How can i customize the menus shown here?
Please sign in to leave a comment.
Hello,
Open Sample Project action can be removed by removing MPS/plugins/samples.jar from distribution (or excluding it from build script for standalone MPS).
Removing other actions is harder, because Create New Project and Open Project actions are registered in MPS/lib/mps-workbench.jar!/idea/MPSActionManager.xml (or in sources mps/workbench/mps-workbench/source/idea/MPSActionManager.xml).
And Check out from Version Control is platform action.
But you can easily add your actions here:
There is mps/workbench/resources/source/idea/PlatformActions.xml (or in distribution at MPS/lib/mps-resources.jar!/idea/PlatfromActions.xml) where there are three action groups you can be intrested in:
To add action to one of this groups, you need to create your own group in plugin.xml and add this group to one of groups above by id.
Here is example from samples action
If icon is specified for action, it will be shown, or you can set it by icon parameter for action tag. Same is right for text and description.
Group can be added to several other groups with anchor for general place inside group or relative to other action in combination with relative-to-action parameter (by group id).
Thank you @Victor :)
I am trying to customize the welcome screen in a standalone IDE MPS. These instructions work if I use the existing actions (e.g., jetbrains.mps.workbench.actions.NewMPSProjectAction), but if I tried my custom action it does not work. It says that it cannot find the class: "class with name [..] not found".
Any idea of how to fix this?
Hello Gabriele,
How is your action registered? If you use MPS plugin, than it is probably registered via code, not xml file, and is instantiated only when some project is opened, so action class has not been loaded yet on welcome screen.
Can you try to create plugin.xml with action registration and try if it works?
Look at MPS/plugins/samples.jar/META-INF/plugin.xml for reference.
Hello Victor,
thanks for your help.
To load the action I have edited the build script for the plugin, in order to generate a plugin.xml that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<idea-plugin version="2">
[..]
<actions>
<group id="MPSWelcomeSamplesMenu">
<action id="CreateNewExampleProjectAction"
class="MyIDE.plugin.CreateExampleAction"
text="Create New Example Project"
description="You can create a new project with this action"/>
<add-to-group group-id="WelcomeScreen.QuickStart" anchor="last"/> <!-- group added to WelcomeScreen.QuickStart -->
</group>
</actions>
[..]
</idea-plugin>
However, it gives the error mentioned in my previous comment: it does not find the class.