Java 學習

          堅持不懈,打通-->軟件—控制—機械
          posts - 5, comments - 3, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          Rich Client Tutorial Part 1(翻譯)

          Posted on 2006-06-30 18:27 燕然 閱讀(990) 評論(1)  編輯  收藏 所屬分類: eclipse
          Rich Client Tutorial是Eclipse官方網站的RCP開發指南。原文地址為: http://www.eclipse.org/articles/Article-RCP-1/tutorial1.html
          第一次翻譯,有錯誤,歡迎指正。

          Rich Client Tutorial Part 1

          The Rich Client Platform (RCP) is an exciting new way to build Java applications that can compete with native applications on any platform. This tutorial is designed to get you started building RCP applications quickly. It has been updated for Eclipse 3.1.2

          富客戶端平臺( RCP )是一個令人興奮的創建 java 應用程序的新方式,她可以與任何平臺下的本地應用程序相媲美。這份指南目的在于讓你快速的構建 rcp 應用程序。本指南已更新,適用于 Eclipse 3.1.2

          Introduction

          Try this experiment: Show Eclipse to some friends or co-workers who haven't seen it before and ask them to guess what language it is written in. Chances are, they'll guess VB, C++, or C#, because those languages are used most often for high quality client side applications. Then watch the look on their faces when you tell them it was created in Java, especially if they are Java programmers.

          Because of its unique open source license, you can use the technologies that went into Eclipse to create your own commercial quality programs. Before version 3.0, this was possible but difficult, especially when you wanted to heavily customize the menus, layouts, and other user interface elements. That was because the "IDE-ness" of Eclipse was hard-wired into it. Version 3.0 introduced the Rich Client Platform (RCP), which is basically a refactoring of the fundamental parts of Eclipse's UI, allowing it to be used for non-IDE applications. Version 3.1 updated RCP with new capabilities, and, most importantly, new tooling support to make it easier to create than before.

          If you want to cut to the chase and look at the code for this part you can find it in the accompanying zip file . Otherwise, let's take a look at how to construct an RCP application.

          引言

          嘗試做這個實驗:把 Eclipse 展示給你的那些以前沒見過 Eclipse 的朋友或合作伙伴,讓他們猜猜這是用何種語言編寫的。很有可能,他們會說是 VB C++ 或者 C# ,因為這些語言經常被用來作為高質量客戶端方面的應用程序。當你告訴他們是用 java 編寫時,察看他們臉上的表情,尤其當他們是 java 程序員的話。

          因為 Eclipse 是唯一 開放源代碼許可的,你可以用 Eclipse 這個技術來創建你自己商業質量的程序。在 3.0 版本以前,這是可能的,但也是困難的,尤其當你想要訂制菜單,多層和其他用戶界面元素時。那是因為很難接觸到 Eclipse IDE 核心。 3.0 版本的 Eclipse 引入了富客戶端編程( RCP ),這基本上是 Eclipse UI 的重新構建,也就允許 Eclipse UI 被應用到非 Eclipse IDE 的應用程序中。 3.1 版本的 Eclipse 用新特性升級了 RCP ,最重要的是,新的工具使的創建 RCP 應用程序比以前更加容易。

          如果你想要研究 Rich Client Tutorial Part 1 的代碼,你可以到 accompanying zip file 下載。另外,讓我們一步步來看看如何創建一個 RCP 應用程序。

          Getting started

          開始

          RCP applications are based on the familiar Eclipse plug-in architecture, (if it's not familiar to you, see the references section). Therefore, you'll need to create a plug-in to be your main program. Eclipse's Plug-in Development Environment (PDE) provides a number of wizards and editors that take some of the drudgery out of the process. PDE is included with the Eclipse SDK download so that is the package you should be using. Here are the steps you should follow to get started.

          RCP 應用程序基于熟悉的 Eclipse 插件機制,(如果你不熟悉,請查看參考書目部分)。因此,你要創建一個插件來作為你的主程序。 Eclipse 的插件開發環境( PDE )提供了大量的控件和編輯器來使得開發過程脫離苦海。 PDE 包括在了 Eclipse SDK ,所以 PDE 開發包你可以直接使用。以下是開始開發的步驟:

          First, bring up Eclipse and select File > New > Project, then expand Plug-in Development and double-click Plug-in Project to bring up the Plug-in Project wizard. On the subsequent pages, enter a Project name such as org.eclipse.ui.tutorials.rcp.part1, indicate you want a Java project, select the version of Eclipse you're targeting (at least 3.1), and enable the option to Create an OSGi bundle manifest. Then click Next >.

          首先,啟動 Eclipse ,選擇File > New > Project接下來選中 Plug-in Development雙擊來打開插件工程向導。在彈出的頁面中,鍵入工程名(例如: org.eclipse.ui.tutorials.rcp.part1),指明你要一個 java工程,選擇你想創建適用的 Eclise的版本,并選中使用 OSGI包。接下來點擊 Next>

          note:Beginning in Eclipse 3.1 you will get best results by using the OSGi bundle manifest. In contrast to previous versions, this is now the default.

          In the next page of the Wizard you can change the Plug-in ID and other parameters. Of particular importance is the question, "Would you like to create a rich client application?". Select Yes. The generated plug-in class is optional but for this example just leave all the other options at their default values. Click Next > to continue.

          注: 通過使用 Eclipse 3.1 OSGI 包,你會獲得很好的結果。與以前的版本相比, OSGi 現在是默認的了。

          在下一頁向導中,你可以更改插件的 ID 號和其他參數。尤其要關注一個問題:“你想要創建一個富客戶端的應用程序嗎?”,選擇“是”。生成的插件類是可選的,但對于這個例子,一切其他的可選項都設為默認值。單擊Next >到下一頁

          note: If you get a dialog asking if Eclipse can switch to the Plug-in Development Perspective click Remember my decision and select Yes (this is optional).

          注:如果你得到一個對話框,詢問 Eclipse 是否切換到插件開發透視圖。這時單擊記住我的選擇并選擇“是”(這是可選的)。

          Starting with Eclipse 3.1, several templates have been provided to make creating an RCP application a breeze. We'll use the simplest one available and see how it works. Make sure the option to Create a plug-in using one of the templates is enabled, then select the Hello RCP template. This is RCP's equivalent of "Hello, world". Click Finish to accept all the defaults and generate the project (see Figure 1). Eclipse will open the Plug-in Manifest Editor. The Plug-in Manifest editor puts a friendly face on the various configuration files that control your RCP application.

          Eclipse 3.1 開始,提供了幾個模板使得創建 RCP 應用程序相當容易。我們使用最簡單的一個模板來觀察這是如何工作的。確保創建一個插件使用模板之一是允許的,接著選擇“ Hello RCP ”模板。這是 RCP 應用程序中的“ Hello, world ”。選擇“完成”來創建工程(見圖一)。 Eclipse 將會打開插件編輯器。插件編輯器提供了友好的界面,擁有多樣的配置文件來控制你的RCP應用程序。



          Figure 1. The Hello World RCP project was created by a PDE wizard.

          圖一,PDE向導創建的Hello World工程

          (未完,待續)


          評論

          # re: Rich Client Tutorial Part 1(翻譯)  回復  更多評論   

          2006-09-13 15:38 by ak_zct
          這篇文章寫得好!
          主站蜘蛛池模板: 札达县| 得荣县| 龙江县| 富顺县| 县级市| 绩溪县| 新宁县| 吴旗县| 陈巴尔虎旗| 克山县| 汶上县| 宁都县| 郎溪县| 平阳县| 正蓝旗| 佛坪县| 中卫市| 监利县| 天长市| 房山区| 凯里市| 南通市| 中卫市| 莲花县| 伊通| 将乐县| 四川省| 务川| 图们市| 蓝山县| 德江县| 察隅县| 霍州市| 武川县| 商都县| 汽车| 玛多县| 吴旗县| 平南县| 高青县| 江西省|