Title: Rich Client Platform
1Rich Client Platform
2Plan
- Przyklad RCP Klient Mail
- Intro
- Update site
3Przyklad RCP Klient Mail
4Przyklad RCP Klient Mail
5Przyklad RCP Klient Mail
6Przyklad RCP Klient Mail
7Przyklad RCP Klient Mail
8Klient Mail
9Klient Mail
public 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)
10Klient Mail
public class Application implements IApplication
public Object start(IApplicationContext
context) // ... // PlatformUI.createAndRunWo
rkbench(...) // ... public void stop()
// ... // workbench.close() // ...
11Klient Mail
12Cwiczenie
13Cwiczenie Podpowiedz
ApplicationActionBarAdvisor _at_Override protected
void fillStatusLine(IStatusLineManager
statusLine) statusLine.add(exitAction) status
Line.add(messagePopupAction) ApplicationWorkb
enchWindowAdvisor configurer.setShowStatusLine(t
rue)
14Klient Mail
public class ApplicationWorkbenchAdvisor
extends WorkbenchAdvisor public
WorkbenchWindowAdvisor createWorkbenchWindowAdv
isor (IWorkbenchWindowConfigurer configurer)
return new ApplicationWorkbenchWindowAd
visor (configurer) public String
getInitialWindowPerspectiveId() return
PERSPECTIVE_ID public void
preStartup() public void postStartup() public
boolean preShutdown() public void
postShutdown()
Nasza klasa!
Miejsce na przygotowanie srodowiska
15Klient Mail
public class ApplicationWorkbenchWindowAdvisor
extends WorkbenchWindowAdvisor public
ActionBarAdvisor createActionBarAdvisor (IActionB
arConfigurer configurer) return new
ApplicationActionBarAdvisor(configurer)
public void preWindowOpen() IWorkbenchWindowC
onfigurer configurer getWindowConfigurer() con
figurer.setInitialSize(new Point(600,
400)) configurer.setShowCoolBar(true) configur
er.setShowStatusLine(true) public void
postWindowRestore() public void
postWindowCreate() public void
postWindowOpen() public boolean
preWindowShellClose()
Nasza klasa!
16Klient Mail
To juz bylo!!!
17EbayManager
Poznalismy RCP, wracamy do naszej aplikacji
18Intro
- Hand made Intro
- Universal Intro
19Intro
- Punkt rozszerzen
- 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
20Intro
public 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.getDis
play().getSystemColor( SWT.COLOR_TITLE_BAC
KGROUND_GRADIENT)) Label label new
Label(outerContainer, SWT.CENTER)
label.setText("WELCOME TO ECLIPSE") GridData
gd new GridData(GridData.GRAB_HORIZONTAL
GridData.GRAB_VERTICAL) gd.horizontalAlignmen
t GridData.CENTER gd.verticalAlignment
GridData.CENTER label.setLayoutData(gd)
label.setBackground(outerContainer.getDisplay().ge
tSystemColor( SWT.COLOR_TITLE_BACKGROUND_G
RADIENT)) _at_Override public void setFocus()
public void standbyStateChanged(boolean
standby)
21Universal 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 productsplash.bmp
- IntroBrandingImageText eBayManager
Alternatywny napis zamiast obrazka
22Universal 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 productsplash.bmp
- IntroBrandingImageText eBayManager
Alternatywny napis zamiast obrazka
23Update Site
- Update Manager zarzadza feature'ami
- Najpierw potrzebujemy Feature!
24Feature
- Nowy Feature Project org.ess.ebaymanager.feature
- Pluginy org.ess.ebaymanager.
- Uzupelniamy Information
- Plugins -gt Download Size/Installation Size
- Gotowe!
- Co dalej?
- Patrz karta Overview
25Update Site
- Nowy Update Site project
- Nazwa org.ess.ebaymanager.updatesite
- Generate a web page listing all features YES
26Update Site c.d.
- Synchronize -gt aktualizacja numerów wersji
- Build All -gt Tworzymy Update Site
27Update Site c.d.
- Sprawdzmy czy dziala
- New Local Site
- katalog workspace/org.ess.ebaymanager.updatesite
28Update Manager
- Pora dodac Update Manager do eBayManager
- Nowe opcje do menu help pluginu .editor
ltextension point"org.eclipse.ui.actionSets"gt
ltactionSet label"Software Updates"
visible"true"
id"org.ess.softwareUpdates"gt ltmenu
label"Software Updates"
path"help/helpEnd"
id"org.ess.updateMenu"gt ltseparator
name"group0"gt lt/separatorgt
ltseparator name"group1"gt lt/separatorgt
lt/menugt ltaction
class"org.ess.ebaymanager.actions.ConfigurationMa
nagerAction" helpContextId"org.
eclipse.update.ui.newUpdates"
id"my.rcp.app.ui.configManager"
label"Manage Configuration..."
menubarPath"help/org.ess.updateMenu/group0"gt
lt/actiongt ltaction
label"Find and Install..."
helpContextId"org.ess.newUpdates"
class"org.ess.ebaymanager.actions.FindInstal
lAction" menubarPath"help/org
.ess.updateMenu/group0"
id"my.rcp.app.ui.newUpdates"gt
lt/actiongt lt/actionSetgt
lt/extensiongt
29Update Manager Akcje
- W pakiecie org.ess.ebaymanager.actions Tworzymy
klasy - ConfigureManagerAction
- FindInstallAction
- Brakujace zaleznosci w plugin.xml
FindInstallAction.run() UpdateManagerUI.openInst
aller(window.getShell()) ConfigureManagerAction
.run() UpdateManagerUI.openConfigurationManager(w
indow.getShell())
30Update Manager
31Pytania?