Add Factory templates plus documentation on how to install

Signed-off-by: WimVelzeboer <wimvelzeboer@protonmail.com>
This commit is contained in:
WimVelzeboer
2022-03-16 20:43:10 +00:00
parent fc94ac565c
commit 74456fe573
10 changed files with 70 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
# JetBrains Assets Installation guide
1. Find your [local configuration folder](https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory), which is different for each system.
<br/> Use a file explorer to find the exact sub-folder name and copy the full path
2. Make a local copy of this repository. <br/>
Open a terminal and execute the following in a temporary folder
```bash
git clone https://github.com/wimvelzeboer/fflib-apex-extensions.git
```
3. Now copy the fileTemplates to the configuration folder
```bash
cp -R cp ./fflib-apex-extensions/dev-tools/assets/intelliJ/fileTemplates ~/.config/JetBrains/WebStorm2021.3/
```
4. Restart IntelliJ / Webstorm (or which ever Jetbrains tool you are using)
5. Go to Preferences (or File->Settings in Linux) and search for "file and code templates",
<br/> Scroll all the way down and double check if all the file names of the have their proper name.
<br/> If not, then add the right name in the filename field (FOR ONLY THE CHILD FILES!!)
![Tux, the Linux mascot](Screenshot.png)
Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

@@ -0,0 +1,12 @@
public with sharing class ${NAME}
{
public static void generateSomething()
{
factory().generateSomething();
}
private static I${NAME} factory()
{
return (I${NAME}) Application.Factories.newInstance(I${NAME}.class);
}
}
@@ -0,0 +1 @@
#parse("AEPE ApexClassMeta.xml")
@@ -0,0 +1,12 @@
public inherited sharing class ${NAME}Impl
extends fflib_SObjectFactory
implements I${NAME}
{
/**
* Method doSomething
*/
public void generateSomething()
{
// doSomething
}
}
@@ -0,0 +1 @@
#parse("AEPE ApexClassMeta.xml")
@@ -0,0 +1,7 @@
public interface I${NAME} extends fflib_ISObjectFactory
{
/**
* Method generateSomething
*/
void generateSomething();
}
@@ -0,0 +1,13 @@
@IsTest
private class ${NAME}Test
{
@IsTest
static void testBehavior()
{
System.Test.startTest();
${NAME}.generateSomething();
System.Test.stopTest();
}
}
@@ -0,0 +1 @@
#parse("AEPE ApexClassMeta.xml")
@@ -0,0 +1 @@
#parse("AEPE ApexClassMeta.xml")