Rich Client Platform
description
Transcript of Rich Client Platform
![Page 2: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/2.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Plan
Przykład RCP: Klient Mail Intro Update site
![Page 9: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/9.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Klient Mailpublic class Activator extends AbstractUIPlugin {
public static final String PLUGIN_ID = "mailClient";
public void start(BundleContext context)
public void stop(BundleContext context)
public static Activator getDefault()
public static ImageDescriptor getImageDescriptor(String path)
![Page 10: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/10.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Klient Mailpublic class Application implements IApplication {
public Object start(IApplicationContext context) {// ...// PlatformUI.createAndRunWorkbench(...);// ...
}
public void stop() {// ...// workbench.close();// ...
}}
![Page 13: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/13.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Ćwiczenie: Podpowiedź
ApplicationActionBarAdvisor:
@Overrideprotected void fillStatusLine(IStatusLineManager statusLine) {
statusLine.add(exitAction);statusLine.add(messagePopupAction);
}
ApplicationWorkbenchWindowAdvisor:
configurer.setShowStatusLine(true);
![Page 14: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/14.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Klient Mail
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer)
{
return new ApplicationWorkbenchWindowAdvisor(configurer);
}
public String getInitialWindowPerspectiveId() { return PERSPECTIVE_ID;}
public void preStartup()
public void postStartup()
public boolean preShutdown()
public void postShutdown()
}Miejsce na
przygotowanie srodowiska
Nasza klasa!
![Page 15: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/15.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Klient Mail
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer)
{ return new ApplicationActionBarAdvisor(configurer);}
public void preWindowOpen() {IWorkbenchWindowConfigurer configurer =
getWindowConfigurer();configurer.setInitialSize(new Point(600, 400));configurer.setShowCoolBar(true);configurer.setShowStatusLine(true);
}
public void postWindowRestore()
public void postWindowCreate()
public void postWindowOpen()
public boolean preWindowShellClose() }
Nasza klasa!
![Page 17: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/17.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
EbayManager
Poznalismy RCP, wracamy do naszej aplikacji
![Page 18: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/18.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Intro
“Hand made” Intro
Universal Intro
![Page 19: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/19.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Intro
Punkt rozszerzeń org.eclipse.ui.intro
Id: org.ess.ebaymanager.product.introClass: org.ess.ebaymanager.product.MyIntroPartIcon: icons/icon.jpg
IntroProductBindingProductId: org.ess.ebaymanager.product.productIntroId: org.ess.ebaymanager.product.intro
![Page 20: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/20.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Intro
Klasa MyIntroPartpublic class MyIntroPart extends IntroPart {public void 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));}
@Overridepublic void setFocus() {}
public void standbyStateChanged(boolean standby) {}}
![Page 21: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/21.jpg)
Jacek Pospychała [email protected] 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
![Page 22: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/22.jpg)
Jacek Pospychała [email protected] 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
![Page 23: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/23.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Update Site
Update Manager zarządza feature'ami Najpierw potrzebujemy Feature!
![Page 24: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/24.jpg)
Jacek Pospychała [email protected] 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
![Page 25: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/25.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Update Site
Nowy Update Site project Nazwa: org.ess.ebaymanager.updatesite Generate a web page listing all features: YES
![Page 26: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/26.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Update Site c.d.
Synchronize -> aktualizacja numerów wersji Build All -> Tworzymy Update Site
![Page 27: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/27.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Update Site c.d.
Sprawdźmy czy działa New Local Site
katalog workspace/org.ess.ebaymanager.updatesite
![Page 28: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/28.jpg)
Jacek Pospychała [email protected] Eclipse Summer School 2007
Update Manager
Pora dodać Update Manager do eBayManager Nowe opcje do menu help pluginu .editor:
<extension point="org.eclipse.ui.actionSets"> <actionSet label="Software Updates" visible="true" id="org.ess.softwareUpdates"> <menu label="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> <action label="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>
![Page 29: Rich Client Platform](https://reader036.fdocuments.us/reader036/viewer/2022062502/56814d12550346895dba4e49/html5/thumbnails/29.jpg)
Jacek Pospychała [email protected] 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());