📄 verifier.html
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Author" content="Scarlett Hao"> <meta name="GENERATOR" content="Mozilla/4.5 [zh] (X11; I; SunOS 5.7 sun4u) [Netscape]"> <title> I18n Verifier</title></head><body bgcolor="#FFFFFF"><center><pre CLASS="ChapTitle"><img SRC="image/titleduket.gif" height=116 width=661><img SRC="image/coffee.gif" height=88 width=57></pre></center><center><b><font size=+2>Internationalization Verifier</font></b><p><img SRC="image/rainbow.gif" height=1 width=100%></center><p><b><font size=-1><a href="userguide.html">[contents]</a></font></b><p><b><a href="#Introducing the I18n Verifier">Introducing the I18n Verifier</a></b><br><b><a href="#Using the I18n Verifier">Using the I18n Verifier</a></b><ul><b><i><a href="#Getting started with I18n Verifier">Getting Startedwith I18n Verifier</a></i></b><br><b><i><a href="#Menus and buttons">Menus and Buttons</a></i></b><br><b><i><a href="#Finding and dealing with the internationalization problems in J">Findingand dealing with the internationalization problems in Java Source Files</a></i></b><br><b><i><a href="#Outputting Verifier Report">Outputting Verifier Report</a></i></b><br><b><i><a href="#Defining Verifier Policy">Defining Verifier Policy</a></i></b></ul><b><a href="#Verifier command line">Verifier Command-line</a></b><br><b><a href="#Setting Verifier Properties">Setting Verifier Properties</a></b><p>This chapter will introduce how to use <b>I18n Verifier </b>to verifythe internationalization of Java application development.<p><a NAME="Introducing the I18n Verifier"></a><b>Introducing the I18nVerifier</b><p>I18n Verifier helps you to determine whether your program is globallydesigned.<p>The I18n Verifier highlights parts of the original source code thatare locale specific or possibly locale-specific and suggestions solutions.The tool checks:<ul><li>strings</li><li>methods</li><li>classes</li><li>class constants</li></ul>You can correct your programs while using the tool or wait until a latertime.<p>I18n Verifier includes a default system policy to use with the sourcecode; you can customize your own policy by using the "edit policy" menufunction provided.<p><a NAME="Using the I18n Verifier"></a><b>Using the I18n Verifier</b><p><a NAME="Getting started with I18n Verifier"></a><b><i>Getting Startedwith I18n Verifier</i></b><p>You can start <b>I18n Verifier</b> by two means:<ul><li>In command line, type: "verifier <parameters>". Then the <b>I18n Verifier</b>is started in the command line mode. If you only type "verifier" withoutany parameters, the I18n Verifier is started in GUI mode.</li></ul><ul><li>Under the GUI mode, in the Toolkit window of I18n/L10n Toolkit 2.0(figure1),you can start <b>I18n Verifier</b> by selecting the menu item of it, thefunction button or the corresponding popup menu item. Then you can get<b>I18n Verifier</b> window pop-up (figure2).</li></ul><ul><img SRC="image/ver_i18menusele.gif" height=357 width=492><h6>Figure1: Select verifier tool</h6><img SRC="image/ver_main.gif" height=685 width=638><h6>Figure2: I18n Verifier</h6></ul>The file in the above window of figure2 is an editor. The Java source fileis displayed in it. The lower one is Verifier output window.<p>The text in the source code marked with underline means it might notbe internationalized. It is called <b><i>"verifier item"</i></b>. <a NAME="The information table about all verifier items"></a>Theinformation table about all verifier items is listed in the Verifier outputwindow. Double click the verifier item in the editor window, its relatedinformation line will be highlighted in the table of the output window.Select a row in the table of output window, the corresponding verifieritem will be highlighted in the editor window.<p>There are some columns in the table of the output window. They are:<ul><li><b>Line No</b>: indicates the position of the verifier item.</li><li><b>TYPE:</b> describes the type of the verifier item, There are severaltypes:</li><ul><li>String</li><li>Bundle name</li><li>Resource bundle</li><li>Retrieved method</li><li>Locale sensitive method</li></ul><li><b>STATUS:</b> describes the status of the verifier item. There are severaldifferent status:</li><ul><li>Error: The item which should be internationalized. If the type of the itemis "String", it can be converted by the auto convert tool (Message Tool).If the type of the item is "Locale sensitive method", user had better convertit by himself according to the advice given by the Verifier.</li><li>Not sure: Can not decide whether to convert it or not.</li><li>Warning: This is Verifier warning to the user.</li><li>Note: This is Verifier note to the user.</li><li>Frozen: The item should not be converted. For example, the item is a layoutstring.</li><li>Finished: The item has been internationalized.</li></ul><li><b>SOURCE:</b> indicates the source code which is found might not to beinternationalized.</li><li><b>ADVICE</b>: indicates the internationalization suggestion provided by<b>I18nVerifier</b> for the verifier item.</li></ul>Click the title of any column shown in the table, the verifier items willbe sorted by the title clicked. You can also drag and drop the table columnto move it.<p><a NAME="Menus and buttons"></a><b><i>Menus and Buttons</i></b><p>The I18n Verifier UI includes several buttons and menus. They are describedas the following.<ul><li><b>File</b></li><ul><li><b>File->Open</b>: open a java source file.</li><li><b>File->Save</b>: save the current java source file.</li><li><b>File->Save As</b>: save the current java source file as another file.</li><li><b>File->Exit</b>: quit the I18n Verifier.</li></ul><li><b>View</b></li><ul><li><b>View->Refresh</b>: validate the changes in the editor window.</li><li><b>View->First item</b>: find the first verifier item.</li><li><b>View->Next item</b>: find the verifier item next to the current highlighteditem.</li><li><b>View->Prev Item</b>: find the verifier item previous to the currenthighlighted item.</li><li><b>View->Last Item</b>: find the last verifier item.</li></ul><li><b>Edit</b></li><ul><li><b>Edit->Undo</b>: undo the last operation happening in the editor window.</li><li><b>Edit->Redo</b>: redo the last operation happening in the editor window.</li><li><b>Edit->Cut</b>: cut the selected text in the editor window.</li><li><b>Edit->Copy</b>: copy the selected text in the editor window.</li><li><b>Edit->Paste</b>: paste the selected text in the editor window.</li><li><b>Edit->Find</b>: find the specific text in the editor window.</li><li><b>Edit->Find Next</b>: find the specific text again</li><li><b>Edit->Replace</b>: replace the specific text with another text.</li><li><b>Edit->Goto</b>: move the caret to the start position of the specificline.</li><li><b>Edit->Options</b>:</li><br>There are some options for verifier. Select <b>Edit->Option</b> toget the Verifier Options window pop-up(figure3).</ul></ul><ul><ul><img SRC="image/ver_edi_opt.gif" height=337 width=343><h6>Figure3: Verifier Options</h6>In the <b>Verifier Options</b> window, there are two option items.<ul><li><b>Verifier Result</b>: in the "<b><i>Output fields</i></b> " list, thefields shown here are the column names of the table in the output window.</li><br>You can add or remove a field by using <b>Add</b> or <b>Remove </b>button(figure4).</ul></ul><ul><ul><img SRC="image/ver_edioptoutadd.gif" height=140 width=274><h6>Figure4: Add a field</h6><li><a NAME="Editor"></a><b>Editor</b>: the font of the words in the verifiereditor window can be changed. Select the Font, Style and Size as you likeon the window. Then the font in the edit window will be changed(figure5).</li><h6><img SRC="image/ver_opt_edit.gif" height=337 width=343></h6><h6>Figure5: Verifier Option Editor</h6></ul></ul></ul><a NAME="Finding and dealing with the internationalization problems in J"></a><b><i>Findingand dealing with the internationalization problems in Java Source Files</i></b><ol><li>Select <b>File->Open</b>, a file open dialog is displayed.</li><li>Select a java source file to verifier, and click <b>OK</b>. The java sourcefile is displayed in the editor window.</li><li>Look at the areas where there are some internationalization problems bynavigating with the</li><ul><li><b>View</b> menu item</li><li>The mouse</li><li>The corresponding pop up menu</li></ul>You can also look for specific words for locations in the resource file.If you want to find a specific word or row, open <b>Edit->Find</b>. Youcan use:<ul><li><b>Find</b></li><li><b>Find Next</b></li><li><b>Goto</b></li></ul>After you type in the information needed, I18n Verifier will find the wordor row you want.<li>Modify the source code according to advice given by the Verifier.</li><br>You can modify the file in the editor window according to the adviceshown in output window. Not every advice needs to be acted upon now. Somerefer to tools used later in the internationalization process.<li>After you have changed something in your file, remember to select <b>Refresh</b>or<b> File->Save</b> to include your changes in the view window.</li><br>If you select Refresh, you can still use <b>Edit->Undo</b> on yourlast change. Refresh is available from both the View menu or correspondingpopup menu(right mouse).<li>When you have finished changing your file, save the modified source fileby using <b>File->Save</b> or <b>File->Save as</b>.</li><li>Open another resource file or quit.</li></ol><a NAME="Outputting Verifier Report"></a><b><i>Outputting Verifier Report</i></b><p>To get the detail information of verifier items output in a report,<ol><li>Select <b>Output->Report</b>, get <b>Verifier Report Viewer</b> windowpop-up(figure6).</li><br> <p> <p><img SRC="image/ver_out_rep.gif" height=768 width=856><h6>Figure6: Verifier Report Viewer</h6><li>If you want to view the source file, just follow the link of any filenameunder the <b>FILE</b> column of the table and get the source file displayed(figure7).To go back to the report window, press <b>Go->Back</b>.</li><br> <p> <p><img SRC="image/ver_outrepreturn.gif" height=600 width=640><h6>Figure7: Resource file in verifier report viewer</h6><li>You can press <b>File-> open</b>, <b>File->save as</b>, or <b>File-> close</b>to realize the corresponding functions.</li></ol><a NAME="Defining Verifier Policy"></a><b><i>Defining Verifier Policy</i></b><p>There are two kinds of verifier policies: <b>Verifier System Policy</b>and <b>Verifier User Policy</b>. The default policy is <b>Verifier SystemPolicy</b>. The <b>Verifier User Policy</b> has higher priority than thatof <b>Verifier System Policy</b>. It is recommended that user should modifythe Verifier User Policy file if they want to use their own policy.<p><b><font size=-1>Editing Policies</font></b><p>You can edit a policy file, add constructors and methods and removeconstructors and methods in Verifier Policy Files Editor.<ol><li>Select <b>Policies->Edit</b>, get <b>Verifier Policy Files Editor</b> windowpop-up(figure8).</li><br> <p> <p><img SRC="image/ver_poleditor.gif" height=454 width=755><h6>Figure8: Verifier Policy Files Editor</h6><li>Select a policy from <b>Verifier System Policy</b> or <b>Verifier UserPolicy</b>.</li><li>Select a subject from <b>Constructors</b> or <b>Methods</b>. The operationsof editing a constructor and a method are the same, so let's assume thatyou select Constructors, then the following steps will be:</li><li>Select an item in the<b><i> Constructor list</i></b> field, then in the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -