Writing /volume1/Web/Public/dokuwiki/data/log/deprecated/2024-11-14.log failed
useful hot key
Here is some useful hot keys for Netbeans. But I prefer eclipse to netbeans personally.
Netbeans | Eclipse | |
---|---|---|
Run to cursor | F4 | Ctrl+R |
Starts debugger | F5 | |
Lanches the midlet without debugging | F6 | |
Step in | F7 | F5 |
Step over | F8 | F6 |
Resume(Debug) | Ctrl+F5 | F8 |
Compiles the code | F9 | |
Builds main project | F11 | |
Cleans and rebuilds the main project | Shift+F11 | |
Step out | Ctrl+F7 | |
Ends debug session | Shift+F5 | |
Continues debug session when paused | Ctrl+F5 | |
New watch | Ctrl+Shift+F7 | |
Organize imports | Alt+Shift+F | Ctrl+Shift+O |
Format | Ctrl+Shift+F | Ctrl+Shift+F |
Add Comments | Ctrl+Shift+T | Ctrl+/ |
Delete Comments | Ctrl+Shift+D | Ctrl+/ |
Code Assistant | Ctrl+Space | Ctrl+Space |
Search in project | Ctrl+Shift+P | Ctrl+H |
Run Test | Alt+F6 | Ctrl+F11 |
title=NetBeans useful hot key and overriding build-impl.xml ~~
Overriding build-impl.xml
Netbeansは自動的にbuild.xmlを生成してくれるのだが、さらに自分好みのbuild.xmlファイルの作成も支援している。
例として、struts-config.xmlを作成するAntタスクをここに紹介する。
<?xml version="1.0" encoding="UTF-8"?> <!-- You may freely edit this file. See commented blocks below for --> <!-- some examples of how to customize the build. --> <!-- (If you delete it and reopen the project it will be recreated.) --> <project name="Eric" default="" basedir="."> <description>Builds, tests, and runs the project Eric.</description> <import file="nbproject/build-impl.xml"/> <property file="build.properties"/> <property environment="env"/> <!-- There exist several targets which are by default empty and which can be used for execution of your tasks. These targets are usually executed before and after some main targets. They are: -pre-init: called before initialization of project properties -post-init: called after initialization of project properties -pre-compile: called before javac compilation -post-compile: called after javac compilation -pre-compile-single: called before javac compilation of single file -post-compile-single: called after javac compilation of single file -pre-compile-test: called before javac compilation of JUnit tests -post-compile-test: called after javac compilation of JUnit tests -pre-compile-test-single: called before javac compilation of single JUnit test -post-compile-test-single: called after javac compilation of single JUunit test -pre-dist: called before jar building -post-dist: called after jar building -post-clean: called after cleaning build products Example of pluging an obfuscator after the compilation could look like <target name="post-compile"> <obfuscate> <fileset dir="${build.classes.dir}"/> </obfuscate> </target> For list of available properties check the imported nbproject/build-impl.xml file. Other way how to customize the build is by overriding existing main targets. The target of interest are: init-macrodef-javac: defines macro for javac compilation init-macrodef-junit: defines macro for junit execution init-macrodef-debug: defines macro for class debugging do-dist: jar archive building run: execution of project javadoc-build: javadoc generation Example of overriding the target for project execution could look like <target name="run" depends="<PROJNAME>-impl.jar"> <exec dir="bin" executable="launcher.exe"> <arg file="${dist.jar}"/> </exec> </target> Notice that overridden target depends on jar target and not only on compile target as regular run target does. Again, for list of available properties which you can use check the target you are overriding in nbproject/build-impl.xml file. --> <target name="-post-init"> <property file="nbproject/private/private.properties"/> <path id="xdoclet.class.path"> <fileset dir="${lib.xdoclet.dir}" includes="**/*.jar"></fileset> <fileset dir="${web.dir}/lib" includes="**/*.jar"></fileset> <pathelement path="${j2ee.platform.classpath}"/> </path> </target> <!-- ================================= target: strutsgenerateDD ================================= --> <target name="strutsgenerateDD" depends="-post-init"> <!--<path id="pathid"> <fileset dir="${src.dir}"> <include name="**/person/**" /> </fileset> </path> <property name="test" refid="pathid"/> <echo message="${test}"/>--> <delete> <fileset dir="${web.dir}"> <include name="struts-config-person.xml"/> <include name="web.xml"/> </fileset> </delete> <taskdef name="webdoclet" classname="xdoclet.modules.web.WebDocletTask" classpathref="xdoclet.class.path" /> <webdoclet destDir="${web.dir}" mergeDir="${merge.dir}" verbose="true" excludedTags="@author,@see,@since, @version,@todo,@param,@return,@exception,@Test,@Before,@Override"> <fileset dir="${src.dir}"> <include name="**/person/**/*Form.java" /> <include name="**/person/**/*Action.java" /> </fileset> <deploymentdescriptor servletspec="2.3" destdir="${web.dir}" mergeDir="${merge.dir}" displayname="Eric deployment descriptor" sessiontimeout="30"> </deploymentdescriptor> <strutsconfigxml version="1.2" destdir="${web.dir}" mergedir="${merge.dir}/person" destinationFile="struts-config-person.xml" /> </webdoclet> </target> <target name="-post-compile"> <antcall target="strutsgenerateDD"/> </target> </project>
コメント