Workbenchadvisor public

This preview shows page 28 - 35 out of 110 pages.

Rich Client Application Development | A Tutorial | © 2006 by IBM; made available under the EPL v1.0 WorkbenchAdvisor org.eclipsercp.hyperbola/ApplicationWorkbenchWindowAdvisor public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { public ApplicationWorkbenchWindowAdvisor( IWorkbenchWindowConfigurer configurer) { super(configurer); } public ActionBarAdvisor createActionBarAdvisor( IActionBarConfigurer configurer) { return new ApplicationActionBarAdvisor (configurer); } public void preWindowOpen() { IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); configurer.setInitialSize(new Point(250, 350)); configurer.setShowCoolBar(false); configurer.setShowStatusLine(false); configurer.setTitle(“Hyperbola”); } } Must extend ActionBarAdvisor defines the toolbars, menus, … Control the general look of the window
Image of page 28
29 Rich Client Application Development | A Tutorial | © 2006 by IBM; made available under the EPL v1.0 ActionBarAdvisor org.eclipsercp.hyperbola/ApplicationActionBarAdvisor public class ApplicationActionBarAdvisor extends ActionBarAdvisor { public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) { super(configurer); } protected void makeActions (IWorkbenchWindow window) { } protected void fillMenuBar (IMenuManager menuBar) { } } Must extend Create the various actions needed by this window Add the actions to the menu bar
Image of page 29
30 Rich Client Application Development | A Tutorial | © 2006 by IBM; made available under the EPL v1.0 The Extension Registry square4 Extension Registry : declarative relationships between plug-ins square4 Extension Point : plug-ins open themselves for configuration/extension square4 Extension : plug-in extends another by contributing an extension “Plug-ins can contribute actionSets extensions that define actions with an id, a label, an icon, and a class that implements the interface IActionDelegate . The UI will present that label and icon to the user, and when the user clicks on the item, the UI will instantiate the given action class, cast it to IActionDelegate , and call its run() method.”
Image of page 30
31 Rich Client Application Development | A Tutorial | © 2006 by IBM; made available under the EPL v1.0 Defining the application The application is defined as an extension org.eclipsercp.hyperbola/plugin.xml <extension id=" application " point=" org.eclipse.core.runtime.applications " name="Hyperbola Application"> <application> <run class=" org.eclipsercp.hyperbola.Application " /> </application> </extension> Application id Extension point being extended Class to run
Image of page 31
32 Rich Client Application Development | A Tutorial | © 2006 by IBM; made available under the EPL v1.0 Running the application square4 Run eclipse and pick the application eclipse -application org.eclipsercp.hyperbola.application square4 Run the JRE and pick the application java -jar startup.jar -application org.eclipsercp.hyperbola.application Full application id is plug-in id + extension id
Image of page 32
33 Rich Client Application Development | A Tutorial | © 2006 by IBM; made available under the EPL v1.0 Perspectives, Actions, and Views 60 minutes
Image of page 33
34 Rich Client Application Development | A Tutorial | © 2006 by IBM; made available under the EPL v1.0 Perspectives, Actions, Views, and all that At this stage, you’ve ween the skeleton for Hyperbola.
Image of page 34
Image of page 35

You've reached the end of your free preview.

Want to read all 110 pages?

  • Winter '16
  • Willy Brown
  • Plug-in, fat client, rich client platform, client application development,  Learn

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture