Preferences in Eclipse 3.0 Present by Kun-Tse Wu.

Slides:



Advertisements
Similar presentations
Extending Eclipse Kai-Uwe Mätzel IBM OTI Labs Zurich
Advertisements

COMP 121 Week 9: AbstractList and ArrayList. Objectives List common operations and properties of Lists as distinct from Collections Extend the AbstractCollection.
XS - Platform What is XS – Manager ?
 2005 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Developing an Eclipse Plug-in David Gallardo. Platform Runtime Workspace Help Team Workbench JFace SWT Eclipse Project Java Development Tools (JDT) Their.
Goals Give you a feeling of what Eclipse is.
Week 11 - Friday.  What did we talk about last time?  Object methods  Accessors  Mutators  Constructors  Defining classes.
DictionaryADT and Trees. Overview What is the DictionaryADT? What are trees? Implementing DictionaryADT with binary trees Balanced trees DictionaryADT.
 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Eclipse Architecture Dwight Deugo Nesa Matic
1 l Class and Method Definitions l Information Hiding and Encapsulation l Objects and Reference l Parameter passing org.eclipse.core.resources.
1 Packaging and delivering Eclipse based products.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L15 (Chapter 22) Java Collections.
Preferences in the Eclipse Workbench UI Present by Kun-Tse Wu.
Views Dwight Deugo Nesa Matic
1 Plug-in Development Environment (PDE) Guide. 2 Introduction to PDE l What is PDE: »a tool designed to help you develop platform plug-ins while working.
Using Ant to build J2EE Applications Kumar
Maps A map is an object that maps keys to values Each key can map to at most one value, and a map cannot contain duplicate keys KeyValue Map Examples Dictionaries:
Set, TreeSet, TreeMap, Comparable, Comparator. Def: The abstract data type set is a structure that holds objects and satifies ARC: Objects can be added.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Google Maps Android API v2 吳俊興 國立高雄大學 資訊工程學系 CSF645 – Mobile Computing 行動計算
M1G Introduction to Programming 2 4. Enhancing a class:Room.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
© 2005 by IBM; made available under the EPL v1.0 | March 1, 2005 Tim deBoer Gorkem Ercan Extend WTP Server Tools for your.
Introduction to Eclipse Plug-in Development. Who am I? Scott Kellicker Java, C++, JNI, Eclipse.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Oct 26, 2005 CDT DOM Roadmap Doug Schaefer. Parser History  CDT 1.0 ► JavaCC based parser  Used to populate CModel and Structure Compare ► ctags based.
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,
The Generic Gaming Engine Andrew Burke Advisor: Prof. Aaron Cass Abstract Games have long been a source of fascination. Their inherent complexity has challenged.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
Jan Hatje, DESY CSS ITER March 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
Copyright © 2002, Systems and Computer Engineering, Carleton University Hashtable.ppt * Object-Oriented Software Development Unit 8.
Welcome To Eclipse. Basic Concepts Workspace – directory where your projects are stored –Projects grouping of related works –Resources generic term to.
ABC of Platform Workspace | Copyright © IBM Corp., All rights reserved. Source code in this presentation is made available under the EPL, v1.0, remainder.
Chapter 10 Defining Classes. The Internal Structure of Classes and Objects Object – collection of data and operations, in which the data can be accessed.
First Venture into the Android World Chapter 1 Part 2.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
U n i v e r s i t y o f H a i l 1 ICS 202  2011 spring  Data Structures and Algorithms 
WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Types and Interfaces COMP.
Session 1 Module 1: Introduction to Data Integrity
Jan Hatje, DESY CSS GSI Feb. 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
CPSC 871 John D. McGregor Process – an introduction Module 0 Session 3.
Build Systems Presentation December 14, 2015 Noon-1pm Kathy Lee Simunich Bldg. 203/ D120 Brought to you by: Argonne Java.
“The world’s most misunderstood language has become the world’s most popular programming language” Akshay Arora
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
Data Structure and Algorithms
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
CHAPTER 9 File Storage Shared Preferences SQLite.
Objectives Update IDE used to develop AWIPS2 plugins  Learn about API Baseline/Target Platform  Configure formatter and code templates.
Building Java Programs Generics, hashing reading: 18.1.
Editing a Twitter search. Viewing search results in a browser.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
TK1924 Program Design & Problem Solving Session 2011/2012
Python’s Modules Noah Black.
3 Introduction to Classes and Objects.
Java Primer 1: Types, Classes and Operators
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
An Introduction to Java – Part I, language basics
Eclipse Plug-in Development
Cordova & Cordova Plugin Installation and Management
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Preference Activity class
Presentation transcript:

Preferences in Eclipse 3.0 Present by Kun-Tse Wu

Outline Introduction Introduction Runtime preferences Runtime preferences Preference scope Preference scope Preference service Preference service Using scopes and nodes Using scopes and nodes Extending the scopes Extending the scopes

Introduction Plug-in preferences are key/value pairs, where the key describes the name of the preference, and the value is one of several different types (boolean, double, float, int, long, or string). Plug-in preferences are key/value pairs, where the key describes the name of the preference, and the value is one of several different types (boolean, double, float, int, long, or string).

Runtime preferences In Eclipse 3.0, it provides core support for Eclipse preferences. In Eclipse 3.0, it provides core support for Eclipse preferences. Package org.eclipse.core.runtime.preferences specifies API for defining and accessing preferences in the runtime. Package org.eclipse.core.runtime.preferences specifies API for defining and accessing preferences in the runtime.

Preference scope The preference service uses the notion of preference scopes to describe the various areas where preferences can be saved. The preference service uses the notion of preference scopes to describe the various areas where preferences can be saved. The platform includes the following four preference scopes: The platform includes the following four preference scopes: Configuration scope Configuration scope Instance scope Instance scope Default scope Default scope Project scope Project scope

Configuration scope Configuration scoped preferences are stored per installation of the platform. They are shared between workspaces. Configuration scoped preferences are stored per installation of the platform. They are shared between workspaces. For example, if a user has a single installation of the platform, but runs several different workspaces, preferences scoped at the configuration level will be shared between the workspaces. For example, if a user has a single installation of the platform, but runs several different workspaces, preferences scoped at the configuration level will be shared between the workspaces.

Instance scope Preferences in this scope are stored per workspace, or running the instance of per platform. Preferences in this scope are stored per workspace, or running the instance of per platform. The old API method getPluginPreferences on Plugin stores its preferences at this scope. The old API method getPluginPreferences on Plugin stores its preferences at this scope.

Default scope Default scoped preferences represent the default values for preferences. These are not changed or stored by the platform. Default scoped preferences represent the default values for preferences. These are not changed or stored by the platform. However, the values originate from files stored with the plug-in's product or primary feature. However, the values originate from files stored with the plug-in's product or primary feature. When values are not found in other scopes, the default scope is consulted last to provide reasonable default values. When values are not found in other scopes, the default scope is consulted last to provide reasonable default values.

Project scope This scope stores values that are specific to a single project in your workspace, such as code formatter and compiler settings. This scope stores values that are specific to a single project in your workspace, such as code formatter and compiler settings. Note that this scope is provided by the org.eclipse.core.resources plug-in, which is not included in the Eclipse Rich Client Platform. This scope will not exist in applications that don ’ t explicitly include the resources plug-in. Note that this scope is provided by the org.eclipse.core.resources plug-in, which is not included in the Eclipse Rich Client Platform. This scope will not exist in applications that don ’ t explicitly include the resources plug-in.

Order of the scopes The default preference search look-up order as defined by the plaform is: The default preference search look-up order as defined by the plaform is: Project Project Instance Instance Configuration Configuration default default

Preference Service Preference service new in Eclipse 3.0 can be used to store preferences in different places. Preference service new in Eclipse 3.0 can be used to store preferences in different places. Once the preference service is obtained, preference values can be queried by name using any of get... methods provided in IPreferencesService. Once the preference service is obtained, preference values can be queried by name using any of get... methods provided in IPreferencesService. IPreferencesService IPreferencesService service = Platform.getPreferencesService(); boolean value = service.getBoolean("com.example.myplugin", "MyPreference", true, null );

Using Scopes and Nodes (1/2) If a plug-in needs finer control over the scope search order, classes that represent the scopes can be used to access the actual node that represents the preference at a particular scope. If a plug-in needs finer control over the scope search order, classes that represent the scopes can be used to access the actual node that represents the preference at a particular scope. … IPreferencesService service = Platform.getPreferencesService(); Preferences configurationNode = new ConfigurationScope().getNode("com.example.myplugin"); Preferences instanceNode = new InstanceScope().getNode("com.example.myplugin"); Preferences[] nodes = new Preferences[] {configurationNode, instanceNode}; stringValue = service.get("MyPreference", "true", nodes); //do something with the value. …

Using Scopes and Nodes (2/2) The root node of the preference tree can be obtained from the preferences service. The scope classes can be used to further traverse the tree. The root node of the preference tree can be obtained from the preferences service. The scope classes can be used to further traverse the tree. … IPreferencesService service = Platform.getPreferencesService(); Preferences root = service.getRootNode(); Preferences myInstanceNode = root.node(InstanceScope.SCOPE).node("com.example.myplugin"); if (myInstanceNode != null) { value = node.getBoolean("MyPreference", "true"); //do something with the value. } …

Extending the scopes (1/3) Plug-ins can define their own preference scopes, using the org.eclipse.core.runtime.preferences extension point. Plug-ins can define their own preference scopes, using the org.eclipse.core.runtime.preferences extension point. If you define your own scope, you can control how and where your preferences are loaded and stored. However, for most clients, the four built in scopes will be sufficient. If you define your own scope, you can control how and where your preferences are loaded and stored. However, for most clients, the four built in scopes will be sufficient.

Extending the scopes (2/3) <!ATTLIST extension point CDATA #REQUIRED id CDATA #IMPLIED name CDATA #IMPLIED> Element describing a client's definition of a new preference scope. <!ATTLIST scope name CDATA #REQUIRED class CDATA #REQUIRED> Element which defines the class to use for runtime preference initialization. <!ATTLIST initializer class CDATA #REQUIRED> name - The name of the scope. class - The name of the class.

Extending the scopes (3/3) The org.eclipse.core.runtime.preferences extension point is being used a new preferences initializer has been added. This solves the problem where default preferences where stored/updated only when the preferences pages where visited. The org.eclipse.core.runtime.preferences extension point is being used a new preferences initializer has been added. This solves the problem where default preferences where stored/updated only when the preferences pages where visited. Following is an example of a preference scope declaration. Following is an example of a preference scope declaration.

Example This example declares that this plug-in will provide a preference implementation for the scope "foo". This example declares that this plug-in will provide a preference implementation for the scope "foo". The class MyPreferenceInitializer contains code to be run to initialize preference default values at runtime. The class MyPreferenceInitializer contains code to be run to initialize preference default values at runtime.