-
Notifications
You must be signed in to change notification settings - Fork 263
Editing and Selecting Data with Contexts
A context is the environment in which something exists or occurs. A context can also be seen as a circumstance in an application. ATF has interfaces and classes to provide services for an application's data and operations in various contexts. The term context is often used to refer to an instance of a context interface or class. For general information on contexts, see ATF Contexts and particularly that section's topic What is a Context.
An editor can devise context classes that provide services for editors, and they do this primarily by implementing various ATF interfaces. Two of the services provided in these contexts are creating new instances of data objects and selecting items to be edited. Creating new instances is discussed in Creating Data Instances.
Context classes are very frequently DOM adapters, because the ability to adapt application data to a context's interfaces is very useful. For more details, see DOM Adapter Context Classes. For more information on using DOM adapters in an editor, see Role Playing with Adaptation.
The class Sce.Atf.Dom.EditingContext
is a generic editing context for applications and derives from HistoryContext
, which derives from TransactionContext
. This allows editing to be done in a transaction, so changes can be rolled back. In addition, EditingContext
has a Selection
property which is implemented as an AdaptableSelection
, a collection representing a selection. It's easy to implement selection handling with AdaptableSelection
. Many of the ATF samples base their editing context classes on EditingContext
. For more information about this useful class, see General Purpose EditingContext Class. Note that EditingContext
is a DOM adapter.
The ATF Simple DOM Editor Sample's EventContext
class derives from EditingContext
and is used for editing an event in a sequence. In this editor, it means editing the resources associated with an event, which are displayed in a ListView
control. EventContext
implements several interfaces to enable this editing. For example, IListView
provides an enumeration of objects that can be used as tags, one per row, in a list control, so it's ready made for a ListView
. For more information on this and other interfaces used by EventContext
, see IListView and IItemView Interfaces. For a discussion of what EventContext
does, see EventContext Class.
Creating an Editor Application
- Designing the Application Data Model with the DOM: Define an application data model that works with the ATF DOM in a data definition language, such as an XML Schema.
- Creating Documents for Application Data: Develop classes that work with documents, using the ATF document interfaces.
- Editing and Selecting Data with Contexts: Create contexts with services for editing and selecting data.
- Creating Data Instances: Create new data instances with the instancing framework.
- Editing Data Properties: Edit properties of data types using property editor components.
-
Role Playing with Adaptation: DOM adapters allow
DomNode
s to play many roles.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC