• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
ABC of Platform Workspace
 

ABC of Platform Workspace

on

  • 254 views

Presented @ EclipseCon 2008 in Santa Clara, CA

Presented @ EclipseCon 2008 in Santa Clara, CA

Statistics

Views

Total Views
254
Views on SlideShare
254
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    ABC of Platform Workspace ABC of Platform Workspace Presentation Transcript

    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license. | 2008-03-17ABC of Platform WorkspaceSzymon BrandysTomasz ZarnaIBM Krakow Software Lab
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Introduction• Workspace components Resources Compare Team CVS
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Resources overview• An essential plug-in for Eclipse IDE applications is the resources plug-in (namedorg.eclipse.core.resources).• The resources plug-in provides services for accessing the projects, folders, and files that auser is working on.• The resources plug-in provides services for managing meta-data associated with resources(Markers: breakpoints, tasks, bookmarks, etc and Properties: arbitrary objects associatedwith resources)
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Compare, Team and CVS overview• Compare comparison of alternate states of a file system• Team repository tooling integration into Eclipse• CVS implementation of a CVS client
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Agenda• Resources Workspace Resources Properties Preferences Content types Linked resources Markers Natures Builders Alternate file systems Demo• Team/Compare Repository Integration Framwork Compare Framework Demo• Summary and questions
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Workspace• Workspace is a central hub for user’s files• The workspace contains a collection ofresources. From the user perspectivethere are three different types ofresources: projects, folders, files.Resources are organized in a tree.• The resources plug-in provides APIs forcreating, navigating, and manipulatingresources in a workspace. The workbenchuses these APIs to provide thisfunctionality to the user. Your plug-in canalso use these APIs.• Derived resourcesare resources that are not original data,and can be recreated from their sourcefiles. It is common for derived files to beexcluded from certain kinds ofprocessing.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Resources API© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Some useful toolsSee the modules in dev.eclipse.org repositoryorg.eclipse.core.toolsorg.eclipse.core.tools.resources
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Basic plug-inDependency to org.eclipse.core.runtimeContent typesDependency to org.eclipse.core.resourcesResource operationsBuilder frameworkNaturesDependency to org.eclipse.core.filesystemEFS
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.PropertiesProperties can be used to store meta-information about the resource. This mechanism can be used inuser plug-ins to hold information specific for that plug-in.When a resource is deleted, its properties are deleted too.There are two kinds of properties• Session properties allow your plug-ins to easily cache information about a resource in key-value pairs the values are arbitrary objects these properties are maintained in memory and lost when a resource is deleted from theworkspace, or when the project or workspace is closed• Persistent properties store information on disc in the workspace metadata the value of a persistent property is an arbitrary string the strings are intended to be short (under 2KB) Properties are maintained across platform shutdown and restartTo manipulate properties API is provided (see IResource class)
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Project preferences• Preferences in Eclipse (short overview)Eclipse provide the infrastructure for defining and storing preferences with different scopesand org.eclipse.core.runtime.preferences extension can be used to define additional scopesfor preferences.Preferences typically map to settings controlled by the user on the Preferences page,although this is not required by the underlying infrastructure. Plug-in preferences arekey/value pairs, where the key describes the name of the preference, and the value is one ofseveral different types (boolean, double, float, int, long, or string). Preferences can be storedand retrieved by the platform from the file system. The exact location of the savedpreferences depends upon the scope of the preference.• The platform resources plug-in defines its own preference scope for projects. Project-scopedpreferences are stored in a file located inside the project.• Using project scope preference
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Content types• What is content type?• There are some features ofEclipsethat are content-sensitive, such asautomatic encodingdetermination, editor selection,and menu contributions.• The content type registry isextensible so plug-ins cancontribute new content typedefinitions.• How to define new content type© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Linked resourcesLinked resources are provided so thatfiles and folders inside a project can bestored in a file system outside of theprojects location.© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Markers• What is Marker?A marker is an extra note stuck to aresource. On the marker you canrecord information about a problem ora task to be done.• How to manipulate markers?• How to add new marker typePlug-ins can declare their own markertypes using theorg.eclipse.core.resources.markersextension point.© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Markers (subtypes)© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Natures• Project natures allow to mark a project as a specifickind of project. This mechanism can be used to adda specific behaviour to projects.• A project can have more than one nature. However,when you define a project nature, you can definespecial constraints for the natureConstraints: one-of-nature requires-nature• Plug-ins can contribute implementations for naturesusing the org.eclipse.core.resources.naturesextension point and supplying a class whichimplements IProjectNature© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Natures – why use them?• Configure and deconfigure when a nature is added/removed to aproject (oportunity to add additional attributes to projest. Modify itsmetadata, add builders)• propertyPages and popupMenus have filter mechanism whichrecognizes natures
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Linked resources and naturesWhat if a plug-in is not able tohandle linked resources?© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Content types and naturesNatures can declare affinity with arbitrarycontent types, affecting the way contenttype determination happens for files inthe workspace.In case of conflicts, the content typehaving affinity with any of the naturesconfigured for the corresponding projectwill be chosen.© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Builders• An incremental project builder is an object that manipulates the resources in a project in aparticular way.Builders can apply a transformation on resources.Resources created by a builder are typically marked as derived resources.• From an API point of view, the platform defines two basic types of builds: A full build An incremental build• Plug-ins can contribute implementations for builder using the org.eclipse.core.resources.buildersextension point and supplying a class which extends IncrementalProjectBuilder.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Builders and UI
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Alternate file systems• What is EFS?EFS (The Eclipse FileSystem) is an abstract filesystem API thatallows to work with other filesystems e.g. FTP, zip files, in-memoryfilesystem, and even CVS.• File system providersBy default, the org.eclipse.core.filesystem plug-in only includes afile system implementation for the local file system.Plug-ins can contribute implementations for other file systemsusing the org.eclipse.core.filesystem.filesystems extension point.File system providers must provide subclasses of FileStore andFileSystem.• UI support for EFSThere are several places in the UI where the user can select filesystem, e.g. wizards.The UI support for EFS can be added via theorg.eclipse.ui.ide.fileSystemSupport extension point.The class attribute of these schema must be aorg.eclipse.ui.ide.fileSystem.FileSystemContributor which is usedto supply validation and browsing of the other file systems.• Additional resources on EFShttp://wiki.eclipse.org/index.php/EFS© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Demo
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Additional info and details• Eclipse SDK Help Platform Plug-in Developer Guide > Programmer’s Guide >Resource Overview Platform Plug-in Developer Guide > Programmer’s Guide >Advanced Resource Concepts• Examples org.eclipse.ui.examples.filesystem
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Overview• The Repository Integration Framework• The Compare Framework• Demo
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Repository Integration Framework• Goal Integrate the workflow that your repository users know withthe concepts defined in the workbench (not just API)• Example The CVS client as a case study for integrating a teamprovider with the platform
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Repository Provider• Define a RepositoryProvider org.eclipse.team.core.repository Subclass org.eclipse.team.core.RepositoryProvider• Provide a configuration wizard for sharing projects org.eclipse.team.ui.configurationWizard
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Functionality in a resource’s menu• Add actions to the Teammenu org.eclipse.ui.popupMenus
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Decorate resources• Decorate resources with team specific information org.eclipse.ui.decorators org.eclipse.team.ui.teamDecorators
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Views• Provide customized view withteam specific information CVS Editors CVS Repositories History Synchronize• org.eclipse.ui.views
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Perspectives• Team oriented perspective org.eclipse.ui.perspectives
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Wizards• Import/Export org.eclipse.ui.importWizards org.eclipse.ui.exportWizards• New org.eclipse.ui.newWizards• Share org.eclipse.team.ui.configurationWizards• Synchronize org.eclipse.ui.synchornizeWizards
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Preferences• org.eclipse.ui.preferencePages• Category: org.eclipse.team.ui.TeamPreferences
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Help
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Additional info and details• Eclipse SDK Help Platform Plug-in Developer Guide > Team Support > RichTeam Integration http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.do• Examples: org.eclipse.team.examples.filesystem org.eclipse.team.cvs.*• Repository projects supporting Eclipse http://www.eclipse.org/community/team.php
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.The Compare Framework• What is the purpose of the Compare framework? Support comparison of alternate states of a file system ordata store• What does the Compare framework provide? API to define the input to a comparison Extensions for associating viewers with input types Containers to host comparisons in the UI
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Overview of Compare ArchitectureCompare ContainerFile System Repository DatabaseCompare InputCompare ViewersJDTrightleftancestorClientsEMFModel Providers
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Compare/Merge viewers• A simple text merge viewer and the JDT merge viewer
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.How to create the simplest compare editor?• Ingredients: A CompareItem that implements ITypedElement for name, image and content type of the object IModificationDate for timestamp IStreamContentAccessor to supply the content CompareEditorInput subclass DiffNode computed in a CompareEditorInput subclass To specify which of the panes is editable useCompareConfiguration An action to open the editor A contribution in org.eclipse.ui.popupMenus extension point
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.The input and the action© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.The item and the popup menu entry© Copyright 2008 IBM Corp. All rights reserved. This source code ismade available under the terms of the Eclipse Public License, v1.0.
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.The result
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.How do I provide a structure merge viewer?• Add an extension of structureMergeViewer Provide instance or subclass of StructureDiffViewer• Add an extension of structureCreator Provide a instance of IStructureCreator Provides the structure of a single element (e.g. file)i.e. a tree representation of the elementNodes are subclasses of DocumentRangeNodeNeed a unique type (“java2” for java) Also provides API to write changes back to the element Subclass StructureCreator to be file buffer aware Viewer uses the differencing engine to create a treerepresentation of the differences
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.The Panes of a Compare Editor Input
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.The Panes of the Apply Patch wizard
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.The Ancestor pane in the Apply Patch wizard
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Demo
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Additional info and details• Eclipse SDK Help Platform Plug-in Developer Guide > Programmer’s Guide >Compare support• Examples org.eclipse.compare.examples org.eclipse.compare.examples.xml
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Web resources and contact• Web http://www.eclipse.org http://wiki.eclipse.org/Workspace_Team http://polishineclipse.blogspot.com• Repository :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse• IRC: #eclipse, #eclipse-dev SzymonB, z4z4• Mail: Szymon.Brandys@pl.ibm.com Tomasz.Zarna@pl.ibm.com
    • ABC of Platform Workspace | Copyright © IBM Corp., 2008. All rights reserved. Source code in this presentation is made availableunder the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Legal Notice IBM and the IBM logo are trademarks or registeredtrademarks of IBM Corporation, in the United States, othercountries or both. Java and all Java-based marks, among others, aretrademarks or registered trademarks of Sun Microsystems inthe United States, other countries or both. Eclipse and the Eclipse logo are trademarks of EclipseFoundation, Inc. Other company, product and service names may betrademarks or service marks of others.