|
1 | 1 | --- |
2 | 2 | layout: post |
3 | | -title: So, I wrote my first IntelliJ plugin to help me bookmark code |
| 3 | +title: My first IntelliJ plugin to help me save code snippets to Codever |
4 | 4 | description: "Shows the basic steps needed to create a simple IntelliJ plugins which eases the saving |
5 | 5 | of code snippets to www.codever.land" |
6 | 6 | author: ama |
@@ -179,7 +179,6 @@ public class SaveToCodeverAction extends AnAction { |
179 | 179 | return null; |
180 | 180 | } |
181 | 181 | } |
182 | | - |
183 | 182 | } |
184 | 183 | ``` |
185 | 184 |
|
@@ -282,42 +281,44 @@ by accessing the `getUrl()` method of the same `VirtualFile`: |
282 | 281 | ``` |
283 | 282 |
|
284 | 283 | ## Registering the action |
| 284 | + |
285 | 285 | There are two main ways to register an action: either by listing it in the `<actions>` section of a plugin's `plugin.xml` file, or through code. |
286 | 286 |
|
287 | 287 | In this plugin we use the configuration ``plugin.xml`` possibility: |
288 | | -``` |
| 288 | + |
| 289 | +```xml |
289 | 290 | <actions> |
290 | 291 | <action |
291 | | - id="BookmarsDev.Save.Editor" |
| 292 | + id="Codever.Save.Editor" |
292 | 293 | class="codever.intellij.plugin.SaveToCodeverAction" |
293 | 294 | text="Save to Codever" |
294 | 295 | description="Save snippet to Codever" |
295 | | - icon="SaveToCodeverPluginIcons.SAVE_TO_BOOKMARKS_DEV_ACTION"> |
| 296 | + icon="SaveToCodeverPluginIcons.CODEVER_ACTION_ICON"> |
296 | 297 | <add-to-group group-id="EditorPopupMenu" anchor="last"/> |
297 | 298 | </action> |
298 | 299 | <action |
299 | | - id="BookmarsDev.Search.Editor" |
| 300 | + id="Codever.Search.Editor" |
300 | 301 | class="codever.intellij.plugin.SearchOnCodeverDialog" |
301 | 302 | text="Search on Codever" |
302 | 303 | description="Launches dialog to input query search on Codever" |
303 | | - icon="SaveToCodeverPluginIcons.SAVE_TO_BOOKMARKS_DEV_ACTION"> |
| 304 | + icon="SaveToCodeverPluginIcons.CODEVER_ACTION_ICON"> |
304 | 305 | <add-to-group group-id="EditorPopupMenu" anchor="last"/> |
305 | 306 | </action> |
306 | 307 | <action |
307 | | - id="BookmarsDev.Save.Console" |
| 308 | + id="Codever.Save.Console" |
308 | 309 | class="codever.intellij.plugin.SaveToCodeverAction" |
309 | 310 | text="Save to Codever" |
310 | 311 | description="Save snippet to Codever" |
311 | | - icon="SaveToCodeverPluginIcons.SAVE_TO_BOOKMARKS_DEV_ACTION"> |
| 312 | + icon="SaveToCodeverPluginIcons.CODEVER_ACTION_ICON"> |
312 | 313 | <add-to-group group-id="ConsoleEditorPopupMenu" anchor="last"/> |
313 | 314 | </action> |
314 | 315 | <action |
315 | | - id="BookmarsDev.Search.Console" |
| 316 | + id="Codever.Search.Console" |
316 | 317 | class="codever.intellij.plugin.SearchOnCodeverDialog" |
317 | 318 | text="Search on Codever" |
318 | 319 | description="Launches dialog to input query search on Codever" |
319 | | - icon="SaveToCodeverPluginIcons.SAVE_TO_BOOKMARKS_DEV_ACTION"> |
320 | | - <add-to-group group-id="EditorPopupMenu" anchor="last"/> |
| 320 | + icon="SaveToCodeverPluginIcons.CODEVER_ACTION_ICON"> |
| 321 | + <add-to-group group-id="ConsoleEditorPopupMenu" anchor="last"/> |
321 | 322 | </action> |
322 | 323 | </actions> |
323 | 324 | ``` |
@@ -368,15 +369,15 @@ manually: |
368 | 369 | ```xml |
369 | 370 | <actions> |
370 | 371 | <action |
371 | | - id="BookmarsDev.Save.Editor" |
| 372 | + id="Codever.Save.Editor" |
372 | 373 | class="dev.bookmarks.intellij.plugin.SaveToBookmarksDevAction" |
373 | 374 | text="Save to Bookmarks.dev" |
374 | 375 | description="Save code snippet to Bookmarks.dev" |
375 | 376 | icon="SaveToBookmarksDevPluginIcons.SAVE_TO_BOOKMARKS_DEV_ACTION"> |
376 | 377 | <add-to-group group-id="EditorPopupMenu" anchor="last"/> |
377 | 378 | </action> |
378 | 379 | <action |
379 | | - id="BookmarsDev.Save.Console" |
| 380 | + id="Codever.Save.Console" |
380 | 381 | class="dev.bookmarks.intellij.plugin.SaveToBookmarksDevAction" |
381 | 382 | text="Save to Bookmarks.dev" |
382 | 383 | description="Save code snippet to Bookmarks.dev" |
|
0 commit comments