Click here to load reader

Eclipse RCP 1/2

Embed Size (px)

Citation preview

  • 1. Eclipse RCP ECLIPSE RCP 1/2(V0.9, 12/12/07)http://cafe.naver.com/eclipsepluginhttp://hangumkj.blogspot.com/[email protected]

2. Eclipse RCP? Eclipse Eclipse HelloWorld RCP RCP SWT/JFACE Extensions and Extension Point Commands and Actions Menu and Toolbar View and Editor Selection Services Job and UIJob Label Decorator Perspectives Preference Pages Dialogs and Wizards 3. Eclipse RCP? Eclipse 3.0 UI 4. Eclipse Runtime and OSGi Generic Workbench Plug-ins Startup Sequence 5. Eclipse 6. Eclipse 7. Eclipse RCP 8. (workspace) Target Platform New -> Project New -> Target Definition Software update Eclipse RCP SDK lib lib 9. HelloWorld RCP New PlugIn Project 10. HelloWorld RCP plugin.xml : Plugin . MANIFEST.MF : Bundle , Plugin , ID, Classpath, Plugin . Activator : bundle Application : Workbench, Application UI ApplicationWorkbenchAdvisor : Workbench . ApplicatonWorkbenchWindowAdvisor : , , ApplicationActionBarAdvisor : , , . Perspective : . 11. HelloWorld RCP Overview : plugin Dependencies : Runtime : plugin library(jar) Extensions : plugin Extension Points : . Build : MANIFEST.MF : plugin.xml : build.properties : plugin 12. Product 13. OSGi JVM .Ex)-os ${target.os}-ws ${target.ws}-arch ${target.arch}-nl ${target.nl} RCP nl en . consoleLog, -console, The Eclipse runtime options -debug -noExit osgi . . 14. . (HelloWorld) -> Add Required Plug-Ins. HelloWrold Plug-in .Validate Plug-ins .RUN . 15. RCP 16. SWT/JFACE SWT?(Standard Widget Toolkit)- 2001 .- CPL(Common Public License) , - OS native library Windows, Linux, Unix, Mac OS- www.eclipse.org/swt 17. Extensions and Extension Point . Extensions : plugin Extension Point : - Extensions : RCP Extension() Application org.eclipse.core.runtime.application Perspectives org.eclipse.ui.perspectives 18. Extensions and Extension Point Extension Point 19. Perspectives .-Extensions org.eclipse.ui.perspectives 20. Menu and ToolbarExtension() Menuorg.eclipse.ui.munusToolbar org.eclipse.ui.main.toolbar : -> menu:org.eclipse.ui.main.menu?after=additions after, before . , menu:org.eclipse.ui.main.menu?after=com.study.sample.rcp.mainMenu.file 21. Command and Handler Command Handler Extension() Commandorg.eclipse.ui.commandHandlerorg.eclipse.ui.handlers 22. Commands and Actions -Extension Extensions Workbench window org.eclipse.ui.actionSets Viewerorg.eclipse.ui.viewActions Editororg.eclipse.ui.editorActions Popup Menuorg.eclipse.ui.popupMenus Commandsorg.eclipse.ui.commands 23. Views and Editor Viewer Editor editor editor . . Editor . . . .ExtensionExtensionorg.eclipse.ui.views org.eclipse.ui.editors 24. Views ViewPart.java . public static String ID = "HelloWorld.tableView"; @Override public void createPartControl(Composite parent) { final Label helloWorldLabel = new Label(parent, SWT.NONE); helloWorldLabel.setText("Hello World"); } 25. Views Detail createPartControl(Composite) : dispose() : getAdapter(Class) : saveState(IMemento) : toolbar getViewSite().getActionBars().getToolBarManager() setFocus() : 26. Views Detail Context menu Views PopupMenu Extension : org.eclipse.ui.popupMenus viewContribution : view objectContribution : object 27. EditorExtensionorg.eclipse.ui.editors EditorPart MultiPageEditorPart 28. Editor Detail EditorPart? createPartControl(Composite) : control dispose() doSave(IProgressMonitor) : event(PROP_DIRTY ) doSaveAs() : isDirty() : 29. MultiPageEditorPart Detail MultiPageEditorPart? addPage(Control) : Page addPage(IEditPart, IEditPage) : Page, editorInput createPages() : Page getContainer() : default composite setPageImage(int, image) setPageText(int, text) 30. Selection Services Part : getSite().setSelectionProvider( tableViewer ); : public class TestViewer implement ISelectionListener : getSite().getPage().addSelectionListener(this); ViewerTypeComboViewerIStructuredSelectionListViewer TreeViewer -> CheckboxTreeViewerTableViewer-> CheckboxTableViewer 31. Job and UIJobJob public class JobExample extends Job protected IStatus run(IProgressMonitor monitor) ; public boolean belongsTo(Object lastName) ;Job new JobExample().schedule();Job IJobManager jobManager = Job.getJobManager(); 32. Label Decorator Label .-Extensions org.eclipse.ui.decorators 33. Preference Pages - Extensions org.eclipse.ui.preferencePages org.eclipse.core.runtime.preferencs 34. Preference Page Detail FieldEditorPreferencePage Init(IWorkbench workbench) createFieldEditors() checkState() performOk() performCancel() performDefaults() performApply() 35. Preference Initialize Extension point org.eclipse.core.runtime.preferencespublic class StudyPreferenceInitializer extends AbstractPreferenceInitializer {public StudyPreferenceInitializer() {super();}@Overridepublic void initializeDefaultPreferences() {IPreferenceStore store = Activator.getDefault().getPreferenceStore();store.setDefault(PreferenceDefine.DETAIL_PREFERENCE_ID, " .");}} 36. Preference Page Detail Preference value change Activator.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty() == PreferenceDefine.DETAIL_PREFERENCE_ID) {System.out.println("preference ."); }} }); 37. DialogsPublic class HelloworldDialog extends Dialog {..createDialogArea(Composite parent) {. widget }configureShell(..) { default shell title }okPressed() { ok }cancelPressed() { cancel }createButtonsForButtonBar(..){. } 38. Wizard .. extends Wizard implements INewWizard { Init() ; addPage(); performFinish(); } .. extends WizardPage{ construct() createControl(); updatePageComplete(); } 39. Dialogs and Wizards ErrorDialog MessageDialog InputDialog ProgressMonitorDialog 40. (cvs) ,,, ,47,010-1234-1235, ,48,010-1234-1234, ,500,02-1234-1231, ,498,02-2345-3456, 41. Eclipse Help(http://help.eclipse.org/ganymede/index.jsp) Eclipse RCP http://cafe.naver.com/eclipseplugin http://www.eclipse.org/articles/ http://www.eclipse.org/articles/Article-WorkbenchSelections/article.html http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html http://www.eclipse.org/articles/Article-Decorators/decorators.html