background image
C H A P T E R 1 5
Filing
Using the Filing Service
15-13
Specifying the Target
15
The
GetTargetInfo
method identifies the current target and target view to the
system. Depending on your needs, you can use the default version of this method
or override it.
If you use the default version, your application's base view must supply
target
and
targetView
slots that you update whenever the target or target view
changes. If you override this method, you provide these slots in the result frame
that it returns, rather than in your application's base view. These slots provide the
same information regardless of whether they reside in the
GetTargetInfo
method's result frame or in the application's base view.
Creating the Target Slot
15
The
target
slot contains the data item with which the user is working, such as the
soup entry that represents the currently displayed note to file. If there is no active
item, this slot must have the value
nil
.
Your application must update the value of the
target
slot every time the user
views a new item. Because the selection of a new item is an application-specific
detail, it is difficult to recommend a means of updating this slot that is appropriate
for every application; however, it is common to update the value of this slot from
the
ViewClickScript
method of the active view.
Creating the TargetView Slot
15
The
targetView
slot contains the view that receives messages from the Filing
service and can manipulate the target. The application's base view is usually an
appropriate value for this slot.
Overriding the GetTargetInfo Method
15
You can implement your own
GetTargetInfo
method if the default version
supplied by the system is not suitable for your application's needs. For example, if
your application images data items in floating windows or displays more than one
data item at a time, you probably need to supply a
GetTargetInfo
method that
can return an appropriate target and target view in those situations.
You must override the
GetTargetInfo
method in order to move an item to
another store when it is filed. The result frame returned by your
GetTargetInfo
override can include an optional
targetStore
slot that specifies the store on
which an item is to reside when it is filed.
To override this method, create in your application base view a slot named
GetTargetInfo
and implement this method as specified in the description of
the
GetTargetInfo
method (page 12-11) in
Newton Programmer's
Reference
.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна