Advanced User Interface Programming Using the Eclipse Rich Client Platform

Similar documents
Workbench and JFace Foundations. Part One, of a two part tutorial series

Foundations of User Interface Programming Using the Eclipse Rich Client Platform

Migration to E4. Eclipse Con France 2016

Getting the Most from Eclipse

20. Eclipse and Framework Extension Languages

Common Navigator Framework

Introduction to Eclipse

Software Architecture Checker

The Eclipse Rich Client Platform

Developing Eclipse Rich-Client Applications Tutorial

A Tour of the Eclipse Environment

Regular Forum of Lreis. Speechmaker: Gao Ang

RAP (The Rich Ajax Platform)

Eclipse and Framework Extension Languages

First Steps in RCP. Jan Blankenhorn, WeigleWilczek GmbH, Stuttgart, Germany. February 19th, 2009

Eclipse 4 Eclipse Day Toulouse 24 mai 2012

Introduction to Eclipse

The Eclipse Rich Ajax Platform

Smart Client development with the Eclipse Rich Client Platform

GMF Tutorial Part 3 - Eclipsepedia

IBM Workplace Client Technology API Toolkit

Programming ArchiTech

Eclipse as a Web 2.0 Application Position Paper

TogoDocClient Plug-ins development manual. TogoDocClient plug-ins development manual

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

Customized Enterprise Installation of IBM Rational ClearCase Using the IBM Rational ClearCase Remote Client plug-in and the Eclipse SDK

Semantic Web T LS Update

Mobile Application Workbench. SAP Mobile Platform 3.0 SP02

In order to support developers, there needs to be a number of tools available which may be involved in the ultimate solution.

Implementation of a 2D Graph Viewer

Introduction to Eclipse Rich Client Platform Support in IBM Rational HATS For IBM System i (5250)

Introduction to Eclipse Rich Client Platform Support in IBM Rational HATS. For IBM System i (5250)

Eclipse on Cell phones?

Europe on a Disk Geodata Processing with Eclipse and OSGi. Harald Wellmann 10 Nov 2008

WindowBuilder Graduation & Release Review

Supervisor : Germán Cancio Meliá. Towards a GUI for CDB-CLI

Adding Support For a New Resource Manager

Workbench Selection 2/15

WPS Workbench. user guide. "To help guide you through using the WPS user interface (Workbench) to create, edit and run programs"

Eclipse Platform Technical Overview

Index. Symbols. /**, symbol, 73 >> symbol, 21

Workplace Client Technology, Micro Edition. WCTME Enterprise Offering Application Developer s Guide

Comparing graphical DSL editors

The New Generation of the Eclipse Platform. Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék

EMC Documentum Composer

I A D P A T A B L E A N D W O R K B E N C H

About Tom. CEO BestSolution Systemhaus GmbH. Eclipse Committer. Platform UI EMF. Projectlead: UFaceKit, Nebula. Member of the Architectual Council

Moving From Studio to Atelier. Wouter Dupré Sales Engineer

Eclipse Data Binding - Updating RCP Mail 2.0 Handout

Testing Eclipse plug-ins: Tips & Tricks

IBM Workplace Managed Client API Toolkit

IBM. Developing with IBM Rational Application Developer for WebSphere Software V6

Using the Plug in Development Environment

Eclipse 4.x Compatibility Layer: What's hot? What's not?

Creating an Eclipse View

eclipse rich ajax platform (rap)

Building XML-based content for Eclipse Help: a real experience. Christian Kurzke Gustavo de Paula Daniel Moura

DTP Help-Helper for Dynamic Context-Sensitive Help

ECLIPSE RICH CLIENT PLATFORM

IBM. User's Guide. IBM Explorer for z/os. Version 3 Release 0 SC

EMC Documentum Composer

USER GUIDE. MADCAP FLARE 2018 r2. Eclipse Help

Plug-ins, RCP and SWT. Sample Content

Tutorial: Tools for mobile Linux (TmL) Exercises

Extensibility, Componentization, and Infrastructure

VizzAnalyzer goes Eclipse!

Eclipse Building Commercial-Quality Plug-ins Second Edition

Rich Client GUI's with RCP & RAP

Using Command Modeler

WPS Workbench. user guide. To help guide you through using WPS Workbench to create, edit and run programs. Workbench user guide Version 3.

JDT Plug in Developer Guide. Programmer's Guide

Embedded automotive applications are just a few clicks away. Philippe NOEL - STMicroelectronics

OMNeT++ IDE Developers Guide. Version 5.2

Outline. Tutorial III. Eclipse. Basics. Eclipse Plug-in Feature

Web Application development results in the need for integrated tools

Building JavaServer Faces Applications

Embarcadero PowerSQL 1.1 Evaluation Guide. Published: July 14, 2008

Slide 1 CS 170 Java Programming 1 Duration: 00:00:49 Advance mode: Auto

Expeditor Client for Desktop. Client Platform Overview

Your password is: firstpw

i2b2 Workbench Developer s Guide: Eclipse Neon & i2b2 Source Code

EGit/Gerrit Hands-on training #1: Installation and Configuration

ADT: Eclipse development tools for ATL

Web Applica+on Development. Budapes( Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék

From the RCP Book To Reality. Jean-Michel Lemieux IBM Rational, Ottawa, Canada

McAffer_Index.qxd 9/20/2005 9:39 AM Page 495. Index

BPS79- Sample Reports View

Composer Guide for JavaScript Development

IBM. IBM WebSphere Application Server Migration Toolkit. WebSphere Application Server. Version 9.0 Release

Noopur Gupta Eclipse JDT/UI Committer IBM India

Introduction to Eclipse and Eclipse RCP

InfoSphere Data Architect Pluglets

Database Setup in IRI Workbench 1

Component-Based Development

JClone: Syntax tree based clone detection for Java

Adapting JDT to the Cloud. Alex Boyko Pivotal Jay Arthanareeswaran - IBM John Arthorne - IBM

Eclipse in Embedded. Neha Garg : Prerna Rustagi :

The Intel VTune Performance Analyzer: Insights into Converting a GUI from Windows* to Eclipse*

GETTING STARTED WITH ECLIPSE Caitrin Armstrong

EMC Documentum Composer

Transcription:

Advanced User Interface Programming Using the Eclipse Rich Client Platform Tod Creasey IBM Canada Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 1

About the Speaker Tod Creasey Senior Software Developer, Platform UI Committer working with the IBM Rational Software since 1994, and has played an active role in the development of Envy developer, IBM Smalltalk, VisualAge for Java moved on to the Eclipse Platform UI team during the 1.0 development cycle Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 2

Platform Component Structure Workbench Core Resources JFace Core Runtime OSGI SWT Rich Platform Client Platform IDE Components Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 3

Plug-in Structure JFace is dependant on SWT and a small utility jar shared with Core Runtime and OSGi The workbench uses JFace and Core Runtime to build a full-featured application framework integrated with Eclipse The IDE layer adds a dependency on Core Resources and exposes the workspace resource model The IDE is an RCP application Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 4

Applications See org.eclipse.core.runtime.applications You need at least one application to run Eclipse with the Workbench The IDE is an RCP application If you use your own application you may not have access to the IDE classes and extensions org.eclipse.ui.ide assumes that the IDE application is the one running Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 5

Questions and Comments? Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 6

Workbench and IDE Advanced Topics Views Workbench Preferences Editors Commands Wizards Perspectives Startup and Shutdown Jobs Adaptable Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 7

Where We Started and Where We Are Going Created an SWT application to display Images in a directory Converted it to a JFace Dialog Used none of the Platform Core support for integration Now going to integrate it into the Workbench Demo of JFaceImageFileDialog to see where we started Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 8

Extension Points An extension point is an XML markup for elements of the workbench Prevents the need for more API for hooking up an extension All that is required is defined in the schema Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 9

Extension Points Allows the extension provider to decide how to use it For instance the newwizards extension point is used by the File->New internal item PDE tooling uses the schemas to help you define extensions TIP: You should only use classes that are defined in a package that does not have the word internal in it, as these are subject to change at any time. Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 10

Views We use the views extension point from org.eclipse.ui.workbench Create a category and specify it as the category for the view Create a ViewPart subclass to satisfy the schema Move the create contents code from the Dialog take the contents of createdialogarea() in the Dialog move it to createpartcontrol() of the View TIP: When creating extensions the plug-in containing the extension point definition must be listed as a required plugin in order for it to be visible. Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 11

Workbench What is the workbench user interface concept - org.eclipse.ui.workbench defines it What is the workspace core concept - org.eclipse.core.resources defines it What is a resource? What is the workspace root? Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 12

Preferences Extension point to hook into the Workbench preferences dialog Define a preference page in an extension point Create a page for the preference This page will show up in the preference dialog Can be used to set up anything you like Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 13

Where Are Preferences Stored? Wherever you like Eclipse has a preferences mechanism Initialized using an PreferenceInitializer Any subclass of AbstractUIPlugin has an IPreferenceStore TIP: Be sure to initialize your preference store using a PreferenceInitializer, as it will only get populated if you access it. Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 14

Preferences First define a PreferenceInitializer to be run when the plug-ins preference store is first accessed use the org.eclipse.core.runtime.preferences extension point to define the initializer pre 3.0 we set these up on plug-in startup, but this is inefficient if the preference is never referenced, and adds to startup time Now add a preference listener to the view, so the refresh will occur as soon as the preference changes Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 15

ImageFileView Demo Questions and Comments? Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 16

Editors Workbench windows reserve an editor area for you We want to re-use the image canvas from the previous dialog in an editor Define an editor using the editors extension point this is used by several views to determine editors associated with the file they are displaying based on file extensions Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 17

Editors and IResource The contents of the Workspace are defined in terms of IResource IResource can be based on files As our editor is displaying the contents of a file, we will use the resources plug-in from core This lets us use the contents of the Resource Navigator and anything else that shows files (like the Package Explorer) Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 18

Actions for Opening an Editor This editor will also be used by the Resource Navigator and Package Explorer, as they build their editor list from the editors extension point Look for the editor in the Open With context menu for a gif file from the Resource Navigator If we register an editor, we will get a context menu entry for it in any viewer that builds the Open With menu from the registry Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 19

Demo of ImageEditor and Comments Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 20

Commands/Keys Define a command in the extension point (org.eclipse.ui.commands for the action and provide a key binding in the org.eclipse.ui.bindings extension point bind to our action that opened the filter settings dialog provide a key binding for the command (Ctrl+Alt+Shift+I) TIP: Eclipse applications must share key bindings between plug-ins, so it is easy to run out of available key sequences. As the user can set these themselves using the Keys Preference Page, it is not a requirement that you define key sequences for all of your commands. Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 21

Commands Extensions org.eclipse.ui.commands extension point provides: Commands represents a request from the user org.eclipse.ui.handlers Defines how a command will be executed Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 22

Command and Handler Definition <extension point="org.eclipse.ui.commands"> <command description="allows setting of filter options for images" id="org.eclipse.ui.rcptalk.imagesfilter" name="image Filter Settings"/> </extension> <extension point="org.eclipse.ui.handlers"> <handler class="org.eclipse.ui.rcptalks.workbench.imagefilterhandler" commandid="org.eclipse.ui.rcptalk.imagesfilter"> </handler> </extension> Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 23

Bindings org.eclipse.ui.bindings specified binding between commands and key sequences <extension point="org.eclipse.ui.bindings"> <key commandid="org.eclipse.ui.rcptalk.imagesfilter" contextid="org.eclipse.ui.contexts.window" schemeid="org.eclipse.ui.defaultacceleratorconfiguration" sequence="m1+m2+m3+i"/> </extension> TIP: When defining a key sequence, it is better to use M1 (instead of Ctrl) and M2 (instead of Shift) for better portability across platforms Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 24

Wizards The workbench has three wizard types defined in extension points New Import Export When one of the wizard actions are invoked, we open a WizardDialog which provides a selection page (generated internally from the extension points) to choose one of the wizards defined in the extension points Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 25

Demo of the Command, Questions and Comments Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 26

Wizards The workbench has three wizard types defined in extension points New Import Export When one of the wizard actions are invoked we open a WizardDialog, which provides a selection page (generated internally from the extension points) to choose one of the wizards defined in the extension points Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 27

New Wizards New wizards have a series of re-usable first pages BasicNewResourceWizard (abstract) BasicNewFileResourceWizard BasicNewFolderResourceWizard BasicNewProjectResourceWizard Use these in your resource based wizards so that the resource is already created for you Although the extensions are in the Workbench, these classes are in the IDE plug-in so you may not have access to them if you define your own application. Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 28

Import/Export Wizards Several classes are provided to assist In building an import or export wizard WizardResourceImportPage / WizardResourceExportPage provides basic layout for source and destination provides an options group FileSystemStructureProvider provides structure for the ImportOperation based on java.io.file ImportOperation/ExportOperation basic operations for performing imports and exports see ImageImportPage Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 29

Perspectives Can also define our own perspectives Use a PageLayout positions parts and setup other standard menus, etc. Create an Image Navigation perspective Define our own IPerspectiveFactory Add our view in the Page Layout Add the TasksView as a fast view Add the Navigator View to the short list of views Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 30

Demo of the Wizards, Image Perspective Questions and Comments Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 31

Startup and Shutdown The workbench tries to avoid loading other plugins by allowing all required information to be defined in the XML of an extension point Use the startup() and shutdown() methods in your plug-in to initialize the things you want to load, such as Images, Colors, etc. Plug-in loading should be avoided in general, but it is particularly noticeable when it slows down startup. You can avoid this by a lazy initialization approach whenever possible. Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 32

Jobs SWT and JFace must be accessed in the main Thread Without creating Jobs or Threads, Eclipse is single Threaded (referred to as the UI or main Thread) We want to process long operations that do not require SWT in a background Thread using a Job Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 33

Jobs Progress reporting is done in the progress area and the progress view Any work done in a Job does not block the main Thread, which makes the UI more responsive as it does not stop the user from working Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 34

IAdaptable What is it? IAdaptable is a mechanism for accessing an Object of one type via another Object of a different type, without using interfaces if (object instanceof IAdaptable) {//See if it supports IAdaptable //See if it adapts to IFile Object resource = ((IAdaptable) object).getadapter(ifile.class); if (resource == null)//returns null if not return; } //Now we can safely cast to IFile and continue dofileoperation((ifile) resource); Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 35

IAdaptable Why do you care? this is a good way to give access to an object without defining additional interfaces JDT uses this for CompilationUnits (IFile), Packages (IFolder) and Java Projects (IProject) Not just for IResource you can adapt any Object to any other Object using the org.eclipse.core.runtime.adapters extension point Do we need it here? no - we are using resources directly Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 36

The End Questions? Tod Creasey Advanced User Interface Programming Using the Eclipse Rich Client Platform Page 37