Please follow the below steps to sort out the issue.
1) As you have already installed fastcode plugin: please follow below steps to take latest jar:
i: Download the latest jar from https://sourceforge.net/projects/fast-code/files/updates/java/plugins/
ii: Copy the downloaded jar to plugins folder of your eclipse installation directory and restart eclipse.
2) Create dummy java project and a java class or any file via eclipse (as fastcode needs a java project to work).
3.) Then you can try creating the below template :
Windows -> Preference ->Fast Code -->Templates--
4.) open the class/file created in step 2, invoke the above template using Ctrl + Alt +Shift +T
5) You can create more classes and files. Here is a sample
add your template by going to Windows -> Preference ->Fast Code -->Templates--Select New and add the template.
<template name="CREATE_NEW_CLASS">
<description>Used to Create class in the specified package.</description>
<allowed-file-names>. </allowed-file-names>
<first-template-item number-required-items="1">package</first-template-item>
<additional-parameters>className</additional-parameters>
<template-body></template-body></template>
public class ${className} {
public static void main(String[] args) {
}
static int solve() {
}
}
<fc:class type="test" name="${className}Test" package="${package.name}" project="${projectName}">
public class ${className}Test {
@Test
int test1(){
Assert.assertEquals(0, ${className}.solve());
}
}
</fc:class>
]]>
6) Once the above template is added via GUI, please do Export Templates to save the template in workspace.
7) Then Open a editor, use short cut key Ctrl-Alt-Shift-T to invoke the new template created.
8) Hope this helps you. Please get back to us in case you have any trouble with our plugin.
(please use the Fast code menu from class/file that is in some path rather than those in the default path)
Last edit: Support 2014-09-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know, that this plugin is meant for Spring application, but I think the usage is/can be broader...
My story is:
In standard Java project in Eclipse I want to create two classes using template (concrete requirements I described on SO - http://stackoverflow.com/questions/25083870/java-template-for-a-project-in-eclipse.
I do not know if those are bugs or it is just not supported, but I do not know how to open new bugs here anyway...
Current problems:
Please create source folder and test folder and then try again.As of now, we need source folder and test folder for things to work.
Please follow the below steps to sort out the issue.
1) As you have already installed fastcode plugin: please follow below steps to take latest jar:
i: Download the latest jar from https://sourceforge.net/projects/fast-code/files/updates/java/plugins/
ii: Copy the downloaded jar to plugins folder of your eclipse installation directory and restart eclipse.
2) Create dummy java project and a java class or any file via eclipse (as fastcode needs a java project to work).
3.) Then you can try creating the below template :
Windows -> Preference ->Fast Code -->Templates--
additional parameter -- projectName (value="TestFCProjectTag" )
allowed-file-names -- *
template body --
<fc:project name="${projectName}" type="java" srcpath="src/main/java src/test/java">
<fc:files names="build.properties plugin.xml" project="${projectName}">
<fc:files names="test-props.properties temp-config.xml" folder="resource" project="${projectName}">
<fc:file name="color.properties" folder="resource" project="${projectName}">
<fc:file name="kcolork.properties" dir="myres" project="${projectName}">
<fc:file name="testing.properties" dir="NewResource/test1" project="${projectName}">
<fc:class name="MyTestClassInDef" project="${projectName}">
<fc:file name="build1.xml" folder="folder_A/folder_B" project="${projectName}" optional="true">
<fc:class name="MyTestClassInPack" package="com.example.mypackage" project="${projectName}">
<fc:class name="MyTestClassTestA" type="test" project="${projectName}">
<fc:class name="MyTestClassTestB" type="test" package="com.example" project="${projectName}"></fc:class></fc:class></fc:class></fc:file></fc:class></fc:file></fc:file></fc:file></fc:files></fc:files></fc:project>
you may check this link to see a small demo of the above template
http://3pintech.com/products/fast-code/sample-template-demo.htm
4.) open the class/file created in step 2, invoke the above template using Ctrl + Alt +Shift +T
5) You can create more classes and files. Here is a sample
add your template by going to Windows -> Preference ->Fast Code -->Templates--Select New and add the template.
<template name="CREATE_NEW_CLASS">
public class ${className} { public static void main(String[] args) { } static int solve() { } } <fc:class type="test" name="${className}Test" package="${package.name}" project="${projectName}"> public class ${className}Test { @Test int test1(){ Assert.assertEquals(0, ${className}.solve()); } } </fc:class> ]]><description>Used to Create class in the specified package.</description>
<allowed-file-names>. </allowed-file-names>
<first-template-item number-required-items="1">package</first-template-item>
<additional-parameters>className</additional-parameters>
<template-body></template-body></template>
6) Once the above template is added via GUI, please do Export Templates to save the template in workspace.
7) Then Open a editor, use short cut key Ctrl-Alt-Shift-T to invoke the new template created.
8) Hope this helps you. Please get back to us in case you have any trouble with our plugin.
(please use the Fast code menu from class/file that is in some path rather than those in the default path)
Last edit: Support 2014-09-12
Hi,
We hope that the workaround was useful and you were able to use the plugin.
If this is not the case, please revert to us...