RCP项目建立流程

  • 格式:doc
  • 大小:43.00 KB
  • 文档页数:5

Create a rich client applicationCreate a plug-inDefine a plug-in based productCustomize a productExport an RCP productDefine a feature-based productCreate a plug-in0, IntroductionThis cheat sheet will demonstrate how to create and run an RCP application using PDE.1, Open the plug-in development perspectiveTo open the plug-in development perspective, select Window->Open Perspective->Other... and choose Plug-in Development.2, Create the plug-inTo create the plug-in, perform the following steps:2.1 Select "File->New->Project..." from the main menu, expand the "Plug-in Development" category within the resulting "New Project" dialog box, and choose "Plug-in Project"2.2 Input "com.example.rcpapp" into the "Project Name" text box on the "Plug-in Project" page and click "Next >"2.3 Select the "Yes" radio button under the "Rich Client Application" heading on the "Plug-in Content" page and click "Next >"2.4 Select the "Hello RCP" template from the list of "Available Templates" and click "Finish" 3, Run the RCP applicationTo run the RCP application, perform the following steps:3.1 Select the "com.example.rcpapp" plug-in editor from the workbench and select the "Overview" tab within it3.2 Click the "Launch an Eclipse application" hyperlink under the "Testing" heading3.3 Verify that you see an empty window with a window title of "Hello RCP"3.4 Exit the RCP application4, Modify the plug-in sourceIn this step, we want to suppress the Hello RCP text in the window title bar of our RCP application.To modify the plug-in source accordingly, perform the following steps:4.1 Open "ApplicationWorkbenchWindowAdvisor.java" by locating it in the "src" folder of the "com.example.rcpapp" package in the "Package Explorer" view and double-clicking it4.2 Comment out 'configurer.setTitle("Hello RCP");' in the "preWindowOpen()" method4.3 Select "File->Save" from the main menu5, Test the RCP applicationTo test the RCP application, perform the following steps:5.1 Select the "com.example.rcpapp" plug-in editor from the workbench and select the "Overview" tab within it5.2 Click the "Launch an Eclipse application" hyperlink under the "Testing" heading5.3 Verify that you see an empty window with no window title5.4 Exit the RCP applicationDefine a plug-in based productThis cheat sheet will demonstrate how to define and run a plug-in based product configuration.0, IntroductionThis cheat sheet will demonstrate how to define a plug-in based product configuration for an RCP application and run an RCP application product using PDE.1, Open the plug-in development perspectiveTo open the plug-in development perspective, select Window->Open Perspective->Other... and choose Plug-in Development.2, Create the product configurationTo create the product configuration, perform the following steps:2.1 Select "File->New->Product Configuration" from the main menu2.2 Select "com.example.rcpapp" in the resulting "New Product Configuration" wizard page2.3 Input "rcpapp.product" into the "File name" text box2.4 Select the "Use a launch configuration" radio button inside the "Initialize the file content" group and verify that "com.example.rcpapp.application" is selected in the combo box. Click "Finish"3, Open the product editorTo open the product editor (if it is not already open), expand the com.example.rcpapp tree dialog in the Package Explorer view and double-click on the rcpapp.product file (the Overview page should be open initially).4, Define the productTo define the product, perform the following steps:4.1 Click the "New..." button next to the "Product ID" drop down menu to open the "New Product Definition" dialog box4.2 Input "RCP Application" into the "Product Name" text box4.3 Verify "com.example.rcpapp" is the value entered for the "Defining Plug-in" text box4.4 Verify "product" is the value entered for the "Product ID" text box4.5 Accept the defaults and click "Finish"4.6 Select "File->Save" from the main menu5, Synchronize the product configuration with the defining plug-inProduct configurations and their constituent files may become unsynchronized. This situation is apparent when changes made using the product editor are not reflected in the application.To synchronize the product configuration with the defining plug-in, click the Synchronize hyperlink under the Testing heading on the product editor Overview page.Note: PDE automatically synchronizes the product configuration when the Launch an Eclipse Application hyperlinks under the Testing heading are used.6, Run the RCP productTo run the RCP product, perform the following steps:6.1 Click the "Launch an Eclipse application" hyperlink under the "Testing" heading6.2 Note: "RCP Application" now shows up in the window title bar6.3 Exit the RCP applicationCustomize a product0, IntroductionThis cheat sheet will demonstrate how to add window images, add a splash screen and customize a launcher for an RCP application using PDE.1, Open the plug-in development perspectiveTo open the plug-in development perspective, select Window->Open Perspective->Other... and choose Plug-in Development.2, Open the product editorTo open the product editor (if it is not already open), expand the com.example.rcpapp tree dialog in the Package Explorer view and double-click on the rcpapp.product file (the Overview page should be open initially).3, Add window imagesTo add window images, perform the following steps:3.1 Select the "Branding" tab within the product editor to display the "Branding" page3.2 Click the "Browse" button adjacent to the "16x16" text box under the "Window Images" heading3.3 Fully expand the "com.example.rcpapp" tree in the "Image Selection" dialog box and select "alt_window_16.gif" and click "OK"3.4 Click the "Browse" button adjacent to the "32x32" text box under the "Window Images" heading3.5 Fully expand the "com.example.rcpapp" tree in the "Image Selection" dialog box and select "alt_window_32.gif" and click "OK"3.6 Select "File->Save" from the main menu4, Test the RCP productTo test the RCP product, perform the following steps:4.1 Select the "Overview" tab within the product editor to display the "Overview" page4.2 Click the "Launch an Eclipse Application" hyperlink under the "Testing" heading4.3 Note the image in the window title bar (if applicable on your platform)4.4 Exit the RCP application5, Add a splash screenTo add a splash screen, perform the following steps:5.1 Select the "Splash" tab within the product editor to display the "Splash" page5.2 Click the "Browse..." button adjacent to the "Plug-in" text box under the "Location" heading5.3 Select the "com.example.rcpapp" entry in the "Plug-in Selection" dialog box and click "OK"5.4 Select "File->Save" from the main menu5.5 Note: Eclipse expects a file called "splash.bmp" to be located in the root of the specified plug-in. Verify that the root folder of "com.example.rcpapp" plug-in has the "splash.bmp".6, Test the RCP productTo test the RCP product, perform the following steps:6.1 Select the "Overview" tab within the product editor to display the "Overview" page6.2 Click the "Launch an Eclipse Application" hyperlink under the "Testing" heading6.3 Note the splash screen displayed before the RCP application window is visible6.4 Exit the RCP application7, Customize the launcherWe will walk through this task assuming we are working on a Windows platform (Similar steps may be followed for other platforms).To customize the launcher, perform the following steps:7.1 Select the "Launching" tab within the product editor to display the "Launching" page7.2 Input "rcpapp" into the "Launcher Name" text box under the "Program Launcher" heading7.3 Select the "win32" tab under the "Program Launcher" heading7.4 Select the "Use a single ICO file containing 6 images as specified above" radio button7.5 Click the "Browse..." button adjacent to the "File" text box7.6 Fully expand the "com.example.rcpapp" tree in the "Image Selection" dialog box and select "alt_launcher.ico" and click "OK"7.7 Select "File->Save" from the main menuExport an RCP product0, IntroductionThis cheat sheet will demonstrate how to modify a build configuration and export an RCP product using PDE.1, Open the plug-in development perspectiveTo open the plug-in development perspective, select Window->Open Perspective->Other... and choose Plug-in Development.2, Open the build configuration editorTo open the build configuration editor, expand the com.example.rcpapp tree dialog in the Package Explorer view and double-click on the build.properties file.Select the Build tab to display the Build Configuration page if it is not the initial page.3, Modify the build configurationIn order to control what files are deployed with our packaged RCP application, we need to modify the build configuration.To modify the build configuration, perform the following steps:3.1 Select the checkbox corresponding to the "icons" directory under the "Binary Build" heading3.2 Select the checkbox corresponding to the "splash.bmp" file under the "Binary Build"heading3.3 Select "File->Save" from the main menu4, Open the product editorTo open the product editor (if it is not already open), expand the com.example.rcpapp tree dialog in the Package Explorer view and double-click on the rcpapp.product file.5, Export the plug-in based productTo export the plug-in based product, perform the following steps:5.1 Select the "Overview" tab within the product editor to display the "Overview" page5.2 Click the "Eclipse Product export wizard" hyperlink under the "Exporting" heading to launch the "Export" dialog box5.3 Verify that "/com.example.rcpapp/rcpapp.product" is entered in the "Configuration" combo box within the "Product Configuration" group5.4 Input "rcpapp_plugin-based" in the "Root directory" text box contained in the "Product Configuration" group5.5 Input a destination directory in the "Directory" text box under the "Destination" group(e.g. "C:\" for Windows) and click "Finish"6, Browse the exported plug-in based product directoryTo browse the exported plug-in based product directory, perform the following steps:6.1 Navigate your file system to the destination directory specified in the previous step (e.g. "C:\" for Windows)6.2 Note the presence of the "rcpapp_plugin-based" directory in the destination directory and open it6.3 Note the presence of the "com.example.rcpapp" plug-in along with many other RCP plug-ins it depends upon within the "plugins" sub-directory6.4 Note the "rcpapp" launcher with a branded icon ("rcpapp.exe" on Windows)6.5 Run the "rcpapp" launcher6.6 Observe the plug-in based RCP application you created that is fully executable outside the Eclipse workspace6.7 Exit the RCP application。