java工作台无法显示_【Eclipse】使用指南(18)搜索工作台
Searching the workbench
搜索工作臺
In this section, you will search the workbench for Java elements.
本小節,你將在工作臺中搜索Java元素。
In the Search dialog, you can perform file, text or Java searches. Java searches operate on the structure of the code. File searches operate on the files by name and/or text content. Java searches are faster, since there is an underlying indexing structure for the code structure. Text searches allow you to find matches inside comments and strings.
在搜索框中,可以搜索文件、文本和Java元素。Java元素是基于代碼結構搜索的,而文件是基于文件名和文本內容搜索的,Java元素搜索更快,因為有內置代碼結構的索引。文本搜索可以讓你找到匹配的注釋和字符串。
Performing a Java search from the workbench
搜索Java元素
In the Java perspective, click the Search (
) button in the workbench toolbar or use Search > Java... from the menu bar.
在視圖中點擊Search (
) 按鈕,或者選擇Search > Java... 菜單。
If it is not already selected, select the Java Search tab.
選擇Java Search選項卡。
In the Search string field, type runTest. In the Search For area, select Method, and in the Limit To area, select References.
Verify that the Scope is set to Workspace.
在輸入框Search string 中輸入runTest,在Search For 區域選擇Method,在Limit To區域選擇References,確保Scope 選擇的是Workspace。
Then click Search. While searching you may click Cancel at any time to stop the search. Partial results will be shown.
然后點擊Search按鈕,在搜索的過程中可以隨時點擊Cancel 取消,已搜索到的結果將會顯示出來。
In the Java perspective, the Search view shows the search results.
在Java視圖中,Search 視圖顯示搜索結果。
Use the Show Next Match (
) and Show Previous Match (
) buttons to navigate to each match. If the file in which the match was found is not currently open, it is opened in an editor.
使用Show Next Match (
)和Show Previous Match (
)在搜索到的結果中切換,并且文件會自動在編輯器中打開。
When you navigate to a search match using the Search view buttons, the file opens in the editor at the position of the match. Search matches are tagged with a search marker in the rulers.
當在匹配到的結果之間切換時,文件會在編輯器中打開并定位到方法引用處,編輯器左側垂直標尺會出現搜索結果標記。
Searching from a Java view
從Java視圖中搜索
Java searches can also be performed from specific views, including the Outline, Type Hierarchy view and the Package Explorer view.
可以在特定的視圖中搜索Java元素,比如Outline視圖、類繼承視圖和包管理器視圖。
In the Package Explorer view, double-click junit.framework.Assert.java to open it in an editor.
在包管理器視圖中,雙擊junit.framework.Assert.java 文件在編輯器中打開。
In the Outline view, select the fail(String) method, and from its context menu, select References > Workspace.
在Outline視圖中,選擇fail(String)方法,右鍵選擇References > Workspace菜單。
Searching from an editor
在編輯器中搜索
From the Package Explorer view, open junit.framework.TestCase.java. In the editor, select the class name TestCase and from the context menu, selectReferences > Workspace.
在包管理器視圖中,打開junit.framework.TestCase.java文件,在編輯器中選擇類名TestCase ,右鍵選擇References > Workspace菜單。
Continuing a search from the search view
在搜索結果中繼續搜索
The Search Results view shows the results for the TestCase search. Select a search result and open the context menu. You can continue searching the selected element's references and declarations.
在搜索結果中選擇一個元素右鍵菜單繼續搜索該元素的引用和聲明。
If you want to follow multiple levels of method calls, you can also use Navigate > Open Call Hierarchy.
如果你想跟蹤多級別的方法調用,可以使用Navigate > Open Call Hierarchy菜單。
Performing a file search
文件搜索
In the Java perspective, click the Search button in the workbench toolbar or select Search > File from the menu bar.
在Java視圖中,點擊Search 按鈕,或選擇Search > File菜單。
If it is not already selected, select the File Search tab.
切換到File Search選項卡。
In the Containing text field, type TestCase. Make sure that the File name patterns field is set to *.java. The Scope should be set to Workspace. Then click Search.
在Containing text 輸入框中輸入TestCase,在File name patterns 輸入框中輸入*.java,Scope 設置為Workspace,然后點擊Search按鈕。
To find all files of a given file name pattern, leave the Containing Text field empty.
Containing Text輸入框為空將搜索所有與名稱匹配的文件。
Viewing previous search results
查看前一次搜索結果
In the Search Results view, click the arrow next to thePrevious Search Results toolbar button to see a menu containing the list of the most recent searches. You can choose items from this menu to view previous searches.? The list can be cleared by choosing Clear History.
在搜索結果視圖中,點擊Previous Search Results 按鈕右邊的下拉方向箭頭查看最近幾次搜索列表,可以選擇一項來查看搜索結果,該列表可以通過Clear History操作清除。
The Previous Search Results button will display a dialog with the list of all previous searches from the current session.
點擊Previous Search Results按鈕將會顯示包含之前搜索列表的對話框。
Selecting a previous search from this dialog will let you view that search.
選擇列表中的一項可以查看之前搜索的結果。
總結
以上是生活随笔為你收集整理的java工作台无法显示_【Eclipse】使用指南(18)搜索工作台的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 苹果智能拨号软件_iPhone智能性升级
- 下一篇: CenOS 配置C/C++语言