Developer Guide for NetBeans
This 文書 述べるs how to 始める,決める up NetBeans for Office Scripting in Java and how to 令状 a simple script using NetBeans. You can download the NetBeans IDE from the NetBeans download page.Contents:
Pre-requisites
- The Office Scripting module 作品 with NetBeans 3.4
- You should have 任命する/導入するd the Office Scripting module during the 取り付け・設備 過程 for the Scripting 枠組み. If you have not 任命する/導入するd it, see the 取り付け・設備 Guide for 指示/教授/教育s on how to 任命する/導入する.
- On Linux, you will need to 確実にする that your DISPLAY 環境 variable is 始める,決める to <your hostname>:0 in the 爆撃する from which you start NetBeans to work around a problem with Java GUIs in Office.
- Create a directory somewhere on your machine in which you will develop your scripts.
Creating a 小包 Recipe
Office scripts are 配達するd in Script 小包s. Like Office 文書s they are zip とじ込み/提出するs. Script 小包s have the .sxp 拡張. Script 小包s are 生成するd from 小包 Recipes where all of the とじ込み/提出するs that are necessary to create the 小包 are put together. To create a new 小包 Recipe:- 権利 click on your 機動力のある filesystem
- Select New/Office Scripting/小包 Recipe
- In the New Wizard window that appears you can enter a 指名する for your 小包 Recipe or you can leave it as default
- Click the Finish button to create your 小包 Recipe
活動/戦闘s 利用できる for 小包 Recipe
If the 使用者 権利 clicks on the 小包 directory they should be able to use the に引き続いて 活動/戦闘s:- 収集する: 収集するs all of the .java とじ込み/提出するs in the 小包 Recipe
- Build: 収集するs all of the .java とじ込み/提出するs in the 小包 Recipe. It then introspects on the 生成するd class とじ込み/提出するs and pops up a dialog which 許すs you to select which methods you wish to 輸出(する) as scripts. Once you have selected the methods to 輸出(する), it creates a <小包 Recipe 指名する>.sxp Script 小包 とじ込み/提出する in the 小包 Recipe directory. You can configure what とじ込み/提出するs are put into the Script 小包 using the とじ込み/提出する Filter 所有物/資産/財産.
- Configure: This pops up the Configure dialog, which 許すs you to select which methods get 輸出(する)d as scripts. Any changes you make in this dialog will only appear in your Script 小包 after you run Build again.
活動/戦闘s 利用できる for Script 小包s
Script 小包s supports only one 活動/戦闘:- (軍隊を)展開する,配備する: This will (軍隊を)展開する,配備する the Script 小包 to an Office 文書 or to an Office 取り付け・設備. If the Script 小包 already 存在するs in the 的, you will be asked whether you want to overwrite.
公式文書,認める: If you (軍隊を)展開する,配備する a Script 小包 to an OpenOffice.org 取り付け・設備 you need to use the 道具s/Refresh 使用者 Scripts (Java) menu item for the new script to appear in the 割り当てる Script dialog.
公式文書,認める: You can also (軍隊を)展開する,配備する to Office 文書s within NetBeans using drag and 減少(する) or 削減(する) and paste.
活動/戦闘s 利用できる for Office 文書s
Office 文書s are also recognised by NetBeans. Any 小包s 含む/封じ込めるd in the 文書 will be 陳列する,発揮するd as nodes of the Office 文書. 削除するing one of these nodes will 除去する the Script 小包 from the 文書. Office 文書s support the 基準 削除する, 削減(する) and Copy 活動/戦闘s and the に引き続いて custom 活動/戦闘s:- Open: This will open the 文書 in Office using the path
in the Office Settings 所有物/資産/財産 to find the Office 取り付け・設備.
If the path to Office is not valid, an error dialog will be popped up 知らせるing the 使用者 that they need to 始める,決める their Path to Office 取り付け・設備 所有物/資産/財産. This setting can be changed by bringing up the 道具s/選択s dialog and changing IDE Configuration/Server and 外部の 道具 Settings/Office Settings
Debugging Office scripts in NetBeans
- Follow the 指示/教授/教育s at Debugging Java 構成要素s in NetBeans/Forte for Java to 始める,決める up your Office 取り付け・設備 to 許す debugging of the JVM.
- Start OpenOffice and run one of your Java scripts. This will make sure the JVM is running.
- Attach to Office JVM using the NetBeans Debug/Start 開会/開廷/会期/Attach... menu 選択.
- 負担 a script source in NetBeans and 始める,決める up breakpoints using Debug/New Breakpoint... menu 選択.
- Run the script in Office.
Troubleshooting
If you 遭遇(する) problems when developing or (軍隊を)展開する,配備するing scripts in NetBeans, one thing you can try is to move your NetBeans settings directory (.netbeans on UNIX, netbeans in Windows - can be 設立する in your home directory) to another 指名する and 再開する NetBeans.
The Choose Methods to 輸出(する) as Scripts dialog only 陳列する,発揮するs methods which are defined within class とじ込み/提出するs, it will not 陳列する,発揮する methods in class とじ込み/提出するs which are within jar とじ込み/提出するs in the 小包 Recipe.
If you 含む 一括 指示的なs in the java source とじ込み/提出するs of your 小包 Recipe, the class とじ込み/提出するs 生成するd when 収集するing will not get placed in subdirectories 反映するing your 一括 指示的な. This is because the default NetBeans compiler 実施 does not use the -d switch to the Java compiler. As a result methods in these classes will not appear in the Choose Methods to 輸出(する) as Scripts dialog.
Last 修正するd: Fri Nov 29 14:19:53 GMT 2002