Add a custom command (with a custom icon) - intellij-idea

Is it possible in IntelliJ/WebStorm to add a custom icon somewhere in a toolbar that runs a custom command, e.g. CLI?
If yes, is it also possible to add this in the projects .idea so that my team members also have this icon without any configuration?
My goal is to add some custom Git commands.

I'm not sure about icons (never used them myself) .. but as far as I'm aware this would not be easily to copy it over (custom toolbar actions) as it would be an IDE-wide setting which you cannot copy as separate file (it will be a part of actual IDE customisation config -- hence uniqueness for each user). Therefore tool buttons are rather user-specific and not recommended way if you want to share this stuff or update it in a future with not much hassle (at very least to have such possibility).
Instead you could just use External Tools functionality for executing your custom CLI commands -- this will also be an IDE-wide setting but each group is stored in separate file.. so others will have to copy such file into IDE config folder. Each such tool can then be accesses via context menus (it has 4 places where such commands can be placed: Tools menu and 3 context menus).
Another alternative (that could be shared as part of the actual project) is to code all your custom CLI commands as Gulp/Grunt/NPM script tasks and execute them that way. Since such files are usually placed in project root (or subfolder) .. they can be easily shared via VCS.
All tasks/scripts are loaded from actual task definition files (package.json/gulpfile.js/etc) .. so they are not stored inside .idea subfolder. But you can create Run/Debug Configurations (to quickly run specific task with possible custom parameters etc) .. and such stuff is placed inside .idea (make sure to mark them as "Shared" .. otherwise they will be stored inside user-specific and not-VCS-shareable workspace.xml file rather than individual files).

Related

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.

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/

MvcBuildViews and locating views

I have enabled MvcBuildViews task in my project file and I have found it finds and tries to build views that aren't in the project.
These views were totally out of date but not knowing whether to delete them or not from source I opted to relocate them (until I can find out) to a new folder called 'Obsolete'.
After relocating the view I try and build the project and it still somehow finds these views in the 'Obsolete' folder now.
How can I instruct the MvcBuildViews task to only compile views found in their usual search location and not everywhere in the project directory?
So after doing some more hunting I find that the MvcBuildViews uses the aspnet_compiler.exe under the hood. It appears the only solution if I want to hand pick the locations is to point it at the specific folders themselves. My other option is to move the views outside of the project.
http://msdn.microsoft.com/en-US/library/ms229863(v=vs.100).aspx

how do i change default sources folder in Netbeans 7.1.2

Does anybody know how to change the default sources folder in Netbeans 7.1.2
I've looked through the files but can't seem to locate where the default directory is stored - I have been through the forums but can't find anything useful..?
currently C:\Users\wayne\Documents\NetBeansProjects\PhpProject7
I have read that if you select a different directory then that becomes the default - this is not the case on my installation
Thanks
If you are using Windows 7 or vista, you are gonna find it here C:\Users\YourUserName\AppData\Roaming\NetBeans\7.1.2\config\Preferences\org\netbeans\modules\projectui.properties.
However if you you are using windowsXP remember the USERPROFILE enviromental variable is not Users but rather Documents and Settings. Enviromental variables change depending on the operating system you are using. To know whats the USERPROFILE variable for yours just open a command prompt window and type SET USERPROFILE. Or you can simply type %USERPROFILE%\AppData\Roaming\NetBeans\$ENTER_YOUR_NETBEANS_VERSION_NUMBER_HERE\config\Preferences\org\netbeans\modules\projectui.properties and that will send you to the correct directory.
It's actually pretty simple.
"C:\Users\wayne\.netbeans\7.1.2\config\Preferences\org\netbeans\modules there is a file called projectui"
is right on the money, but he forgot one detail that you need to keep in mind for changing the directory. If you want to set the default project folder to (in my case):
"C:\Program Files\glassfish-3.1.2.2\glassfish\domains\domain1\docroot"
then you have to double the slashes. Instead of the above link you have to put:
"C:\\Program Files\\glassfish-3.1.2.2\\glassfish\\domains\\domain1\\docroot"
without spaces. I had it that way originally but it hid one of each of them.
In newer versions, right-click on the project you want to move in the 'Projects' tab, and then click 'Move'. This will allow you to move the project to a new directory.
Tip! I found (on Windows 7) that the AppData folder is hidden, so doesn't appear in windows explorer files by default .
To make it visible, open a window for the USERPROFILE directory as above, and use
Organize ->
Folder and Search Options ->
View (tab) ->
Advanced settings list ->
Hidden files and folders radio button to show them.
(Or you can open it via search or run if you type it right)
I hope that saves you the several hours it cost me...

How to set target settings for different builds

In xcode 4.5 how do I select different target settings for different builds for example one target setting for debug, one target setting for release etc, so I can define different icons depending on the build etc.
You have two options, neither perfect. I'm going to focus on the concrete example of using different icons depending on your build configuration, as you suggest, though both techniques can be applied more broadly.
Redirect in your Info.plist
This is the simplest way. Specify your "Icon file" property in your target's Info.plist as e.g. "Icon-${CONFIGURATION}". Then, create two ICNS icons, "Icon-Release.icns" and "Icon-Debug.icns", and add them to your project. That's it. The downside with this approach is that both icons will be copied into your built app every time, rather than just the one it needs.
Use a "Run Script" build phase
This is a little more involved but it gives you a better result. Add a Run Script build phase to your target, with the following script:
cp "$(dirname "${PRODUCT_SETTINGS_PATH}")/Icon-${CONFIGURATION}.icns" "${SCRIPT_OUTPUT_FILE_0}"
Specify its output file as:
$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Icon.icns
And make sure your "Icon file" property in your Info.plist is set to just "Icon".
This relies on your icons sitting in the same folder as your Info.plist within your source tree (though you can edit the script however you like to suit your project's configuration).
Note also that with this approach Xcode won't be able to see that you have the icon set correctly, so for example in the "Summary" tab of your target's settings it'll still show the question mark placeholder for the icon. You'll need to do an actual build to verify it's working.
My solution is pretty close from Wade's first point, you can also add an dynamic suffix using a user-defined settings in you project configuration.
I use this solution to dynamize the icon, the bundle display name and also the bundle identifier of my build to be able to use the version from the app store beside my development version.