generated from JetBrains/intellij-platform-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00bc23d
commit fbdaed5
Showing
11 changed files
with
110 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/kotlin/com/github/saundefined/bitrix_idea/actions/CreateGitignoreAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.github.saundefined.bitrix_idea.actions | ||
|
||
import com.intellij.ide.fileTemplates.FileTemplateManager | ||
import com.intellij.ide.fileTemplates.FileTemplateUtil | ||
import com.intellij.ide.util.DirectoryChooserUtil | ||
import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.actionSystem.LangDataKeys | ||
import com.intellij.openapi.application.ApplicationManager | ||
import com.intellij.openapi.project.Project | ||
import org.jetbrains.annotations.NotNull | ||
|
||
class CreateGitignoreAction : AnAction() { | ||
override fun actionPerformed(@NotNull event: AnActionEvent) { | ||
val view = event.getData(LangDataKeys.IDE_VIEW) | ||
if (view === null) { | ||
return | ||
} | ||
|
||
val project: Project? = event.project | ||
if (project === null) { | ||
return | ||
} | ||
|
||
val directory = DirectoryChooserUtil.getOrChooseDirectory(view) | ||
if (directory === null) { | ||
return | ||
} | ||
|
||
val templateManager = FileTemplateManager.getInstance(project) | ||
|
||
ApplicationManager.getApplication().runWriteAction { | ||
try { | ||
val template = templateManager.getJ2eeTemplate("Bitrix Module .gitignore") | ||
FileTemplateUtil.createFromTemplate(template, ".gitignore", null, directory) | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
} | ||
} | ||
} | ||
|
||
override fun getActionUpdateThread(): ActionUpdateThread { | ||
return ActionUpdateThread.EDT | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
src/main/kotlin/com/github/saundefined/bitrix_idea/icons/BitrixIdeaIcons.kt
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...ithub/saundefined/bitrix_idea/templates/gitignore/BitrixModuleFileTemplateGroupFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.github.saundefined.bitrix_idea.templates.gitignore | ||
|
||
import icons.BitrixIdeaIcons | ||
import com.intellij.ide.fileTemplates.FileTemplateDescriptor | ||
import com.intellij.ide.fileTemplates.FileTemplateGroupDescriptor | ||
import com.intellij.ide.fileTemplates.FileTemplateGroupDescriptorFactory | ||
|
||
class BitrixModuleFileTemplateGroupFactory : FileTemplateGroupDescriptorFactory { | ||
override fun getFileTemplatesDescriptor(): FileTemplateGroupDescriptor { | ||
val group = FileTemplateGroupDescriptor("Bitrix Module", BitrixIdeaIcons.Bitrix) | ||
group.addTemplate(FileTemplateDescriptor(BITRIX_MODULE_GITIGNORE_TEMPLATE)) | ||
|
||
return group | ||
} | ||
|
||
companion object { | ||
const val BITRIX_MODULE_GITIGNORE_TEMPLATE = "Bitrix Module .gitignore" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...m/github/saundefined/bitrix_idea/templates/module/BitrixModuleFileTemplateGroupFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d/bitrix_idea/templates/simple_component/BitrixSimpleComponentFileTemplateGroupFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...thub/saundefined/bitrix_idea/templates/template/BitrixTemplateFileTemplateGroupFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package icons | ||
|
||
import com.intellij.openapi.util.IconLoader.getIcon | ||
|
||
object BitrixIdeaIcons { | ||
@JvmField | ||
val Bitrix = getIcon("/icons/bitrix.svg", javaClass) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/resources/fileTemplates/j2ee/Bitrix Module .gitignore.ft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.idea | ||
/bitrix/* | ||
/bitrix/*/* | ||
!/bitrix/composer.json | ||
!/bitrix/composer.lock | ||
!/bitrix/composer-bx.json | ||
upload/ | ||
!.gitignore | ||
/.htaccess | ||
/*.xml | ||
/*.txt | ||
/*.json | ||
/*.log | ||
/web.config |