310 likes | 447 Views
Rich Client Platform. Plan. Przykład RCP: Klient Mail Intro Update site. Przykład RCP: Klient Mail. Przykład RCP: Klient Mail. Przykład RCP: Klient Mail. Przykład RCP: Klient Mail. Przykład RCP: Klient Mail. Klient Mail. Klient Mail. public class Activator extends AbstractUIPlugin {
E N D
Eclipse Summer School 2007 Rich Client Platform
Eclipse Summer School 2007 Plan • Przykład RCP: Klient Mail • Intro • Update site
Eclipse Summer School 2007 Przykład RCP: Klient Mail
Eclipse Summer School 2007 Przykład RCP: Klient Mail
Eclipse Summer School 2007 Przykład RCP: Klient Mail
Eclipse Summer School 2007 Przykład RCP: Klient Mail
Eclipse Summer School 2007 Przykład RCP: Klient Mail
Eclipse Summer School 2007 Klient Mail
Eclipse Summer School 2007 Klient Mail publicclass Activator extends AbstractUIPlugin { publicstaticfinal String PLUGIN_ID = "mailClient"; publicvoid start(BundleContext context) publicvoid stop(BundleContext context) publicstatic Activator getDefault() publicstatic ImageDescriptor getImageDescriptor(String path)
Eclipse Summer School 2007 Klient Mail publicclass Application implements IApplication { public Object start(IApplicationContext context) { // ... // PlatformUI.createAndRunWorkbench(...); // ... } publicvoid stop() { // ... // workbench.close(); // ... } }
Eclipse Summer School 2007 Klient Mail
Eclipse Summer School 2007 Ćwiczenie
Eclipse Summer School 2007 Ćwiczenie: Podpowiedź ApplicationActionBarAdvisor: @Override protectedvoid fillStatusLine(IStatusLineManager statusLine) { statusLine.add(exitAction); statusLine.add(messagePopupAction); } ApplicationWorkbenchWindowAdvisor: configurer.setShowStatusLine(true);
Eclipse Summer School 2007 Klient Mail publicclass ApplicationWorkbenchAdvisor extends WorkbenchAdvisor { public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor (IWorkbenchWindowConfigurer configurer) { returnnew ApplicationWorkbenchWindowAdvisor (configurer); } public String getInitialWindowPerspectiveId() { returnPERSPECTIVE_ID; } publicvoid preStartup() publicvoid postStartup() publicboolean preShutdown() publicvoid postShutdown() } Nasza klasa! Miejsce na przygotowanie srodowiska
Eclipse Summer School 2007 Klient Mail publicclass ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { public ActionBarAdvisor createActionBarAdvisor (IActionBarConfigurer configurer) { returnnew ApplicationActionBarAdvisor(configurer); } publicvoid preWindowOpen() { IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); configurer.setInitialSize(new Point(600, 400)); configurer.setShowCoolBar(true); configurer.setShowStatusLine(true); } publicvoid postWindowRestore() publicvoid postWindowCreate() publicvoid postWindowOpen() publicboolean preWindowShellClose() } Nasza klasa!
Eclipse Summer School 2007 Klient Mail To już było!!!
Eclipse Summer School 2007 EbayManager Poznalismy RCP, wracamy do naszej aplikacji
Eclipse Summer School 2007 Intro • “Hand made” Intro • Universal Intro
Eclipse Summer School 2007 Intro • Punkt rozszerzeń • org.eclipse.ui.intro Id: org.ess.ebaymanager.product.intro Class: org.ess.ebaymanager.product.MyIntroPart Icon: icons/icon.jpg • IntroProductBinding ProductId: org.ess.ebaymanager.product.product IntroId: org.ess.ebaymanager.product.intro
Eclipse Summer School 2007 Intro • Klasa MyIntroPart publicclass MyIntroPart extends IntroPart { publicvoid createPartControl(Composite parent) { Composite outerContainer = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(); outerContainer.setLayout(gridLayout); outerContainer.setBackground(outerContainer.getDisplay().getSystemColor( SWT.COLOR_TITLE_BACKGROUND_GRADIENT)); Label label = new Label(outerContainer, SWT.CENTER); label.setText("WELCOME TO ECLIPSE"); GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); gd.horizontalAlignment = GridData.CENTER; gd.verticalAlignment = GridData.CENTER; label.setLayoutData(gd); label.setBackground(outerContainer.getDisplay().getSystemColor( SWT.COLOR_TITLE_BACKGROUND_GRADIENT)); } @Override publicvoid setFocus() { } publicvoid standbyStateChanged(boolean standby) { } }
Eclipse Summer School 2007 Universal Intro • IntroId: org.eclipse.ui.intro.universal • Wymagany plugin: org.eclipse.ui.intro.universal • W org.ess.ebaymanager.product/plugin.xml • Rozszerzenie org.eclipse.core.runtime.products • Dodajemy properties: • IntroTitle = Welcome To eBayManager • IntroBrandingImage = product:splash.bmp • IntroBrandingImageText = eBayManager Alternatywny napis zamiast obrazka
Eclipse Summer School 2007 Universal Intro • IntroId: org.eclipse.ui.intro.universal • Wymagany plugin: org.eclipse.ui.intro.universal • W org.ess.ebaymanager.product/plugin.xml • Rozszerzenie org.eclipse.core.runtime.products • Dodajemy properties: • IntroTitle = Welcome To eBayManager • IntroBrandingImage = product:splash.bmp • IntroBrandingImageText = eBayManager Alternatywny napis zamiast obrazka
Eclipse Summer School 2007 Update Site • Update Manager zarządza feature'ami • Najpierw potrzebujemy Feature!
Eclipse Summer School 2007 Feature • Nowy Feature Project: org.ess.ebaymanager.feature • Pluginy: org.ess.ebaymanager.* • Uzupełniamy Information • Plugins -> Download Size/Installation Size • Gotowe! • Co dalej? • Patrz karta Overview
Eclipse Summer School 2007 Update Site • Nowy Update Site project • Nazwa: org.ess.ebaymanager.updatesite • Generate a web page listing all features: YES
Eclipse Summer School 2007 Update Site c.d. • Synchronize -> aktualizacja numerów wersji • Build All -> Tworzymy Update Site
Eclipse Summer School 2007 Update Site c.d. • Sprawdźmy czy działa • New Local Site • katalog workspace/org.ess.ebaymanager.updatesite
Eclipse Summer School 2007 Update Manager • Pora dodać Update Manager do eBayManager • Nowe opcje do menu help pluginu .editor: <extensionpoint="org.eclipse.ui.actionSets"> <actionSetlabel="Software Updates" visible="true" id="org.ess.softwareUpdates"> <menulabel="Software Updates" path="help/helpEnd" id="org.ess.updateMenu"> <separator name="group0"> </separator> <separator name="group1"> </separator> </menu> <action class="org.ess.ebaymanager.actions.ConfigurationManagerAction" helpContextId="org.eclipse.update.ui.newUpdates" id="my.rcp.app.ui.configManager" label="Manage Configuration..." menubarPath="help/org.ess.updateMenu/group0"> </action> <actionlabel="Find and Install..." helpContextId="org.ess.newUpdates" class="org.ess.ebaymanager.actions.FindInstallAction" menubarPath="help/org.ess.updateMenu/group0" id="my.rcp.app.ui.newUpdates"> </action> </actionSet> </extension>
Eclipse Summer School 2007 Update Manager: Akcje • W pakiecie org.ess.ebaymanager.actions Tworzymy klasy: • ConfigureManagerAction • FindInstallAction • Brakujące zależnosci w plugin.xml: FindInstallAction.run(): UpdateManagerUI.openInstaller(window.getShell()); ConfigureManagerAction.run(): UpdateManagerUI.openConfigurationManager(window.getShell());
Eclipse Summer School 2007 Update Manager
Eclipse Summer School 2007 Pytania? Dziękuję za uwagę!