User can now add custom icons, path ignore regex now works on relative path to project base dir #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's now possible to add custom icons in the settings (#7), the dialogs I added can also be used to modify plugin models in the future. (#9)
I also changed the regex textfield in the settings to an EditorTextField, so it now also highlights the regex. The regex also matches the relative path to the project base directory now, not just
parent/filename
.The settings now look as follows, there's a new JTabbedPane that divides plugin and user icons:
Upon clicking the add button in the user icons tab, a new dialog opens:
It's possible to set a description, a type, and add an icon (.svg, .png) via the Choose icon button that opens a new file chooser.
When the + button in the conditions tab is clicked, this dialog opens:
It allows the user to create a new model condition, the regex textfield is a syntax highlighted field as well, and the regex is being checked in doValidate() of the DialogWrapper class.
After adding a description, selecting a type, adding an icon and adding at least one condition, the model will be added to the custom model list. The icon is serialized to Base64 (for SVG, the original file will be encoded, for PNG a 16px or 32px big image will be encoded). The resulting models don't have an ID because they can be disabled / enabled by setting the re-introduced
enabled
variable in the Model class.I also added a new checkbox in the Project settings that allows to either append the user icons on the project level to the user icons on the IDE level, and it is selected by default. If it's deselected, the user icons on the IDE level will be ignored and just the ones on the project level will be used:
isModified in SettingsForm is now calculated on the fly instead of utilizing a
modified
field.Lastly I added a new field to model that allows to use IntelliJ icon objects in the Model and I used it for the angular.json file. (It now uses IntelliJ's
AngularJSIcons.Angular2
icon)The only bug that I found was that the enabled state for user icons gets reset if you don't press apply after clicking checkboxes but not clicking apply before adding or editing models.