|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.swt.client.sdata.datasource.DefaultDataSource
com.sage.swt.client.sdata.datasource.DefaultPreferenceStore
public class DefaultPreferenceStore
Default implementation of a PreferenceStore
. This default
implementation is currently a DefaultDataSource
and works with SData.
Field Summary |
---|
Fields inherited from interface com.sage.swt.client.sdata.DataSource |
---|
ACTION_DELETE, ACTION_GETENTITIES, ACTION_GETENTITIES_ALL, ACTION_GETENTITIES_FROMKEY, ACTION_INSERT, ACTION_MOVEFIRST, ACTION_MOVELAST, ACTION_MOVENEXT, ACTION_MOVEPREVIOUS, ACTION_MOVETO, ACTION_MOVETOINSERT, ACTION_MOVETOKEY, ACTION_MOVETOSPECIFIED, ACTION_UPDATE |
Fields inherited from interface com.sage.swt.client.sdata.BindableDataProvider |
---|
PROPERTY_NAME_SEGMENT_ESCAPE_SEPARATOR, PROPERTY_NAME_SEGMENT_SEPARATOR, PROPERTY_NAME_SEGMENT_SPLITTER |
Constructor Summary | |
---|---|
DefaultPreferenceStore(TypeInfo typeInfo,
java.lang.String application,
java.lang.String dataURL,
SwtRequestDispatcher requestDispatcher,
SwtErrorStack errorStack)
Constructs a default PreferenceStore with the specified type information, application, initial query, and request dispatcher. |
Method Summary | |
---|---|
boolean |
containsProperty(java.lang.String propertyName)
Tests if the specified property name is a property (key) in this preference store. |
boolean |
containsProperty(java.lang.String parentWidgetKey,
java.lang.String propertyName)
Tests if the specified property name is a property (key) in this preference store. |
java.lang.Object |
getPropertyValue(java.lang.String propertyName)
Gets the value of the specified property in the current entity of this bindable data provider. |
java.lang.Object |
getPropertyValue(java.lang.String parentWidgetKey,
java.lang.String propertyName)
Gets the value of the specified property in the current entity of this preference store. |
void |
insert(DataRequestCallback callback)
Inserts a new entity. |
void |
moveToDefault(java.lang.String applicationId,
DataRequestCallback callback)
Moves the cursor to the given key in the current result set, where the objectId segment of that key uses the default value (of "default"). |
void |
moveToDefault(java.lang.String applicationId,
java.lang.String objectId,
DataRequestCallback callback)
Moves the cursor to the given key in the current result set |
void |
removePreference(java.lang.String preferenceName)
Removes preference/properties in the current entity of this preference store |
void |
setPrimaryKeyValue(java.lang.String applicationId)
Sets the values of the Primary key fields, using the default objectId value (of "default") for the objectId part of that key. |
void |
setPrimaryKeyValue(java.lang.String applicationId,
java.lang.String objectId)
Sets the values of the Primary key fields |
void |
setPropertyValue(java.lang.String propertyName,
java.lang.Object value)
Sets the value of a property in the current entity of this bindable data provider. |
void |
setPropertyValue(java.lang.String propertyName,
java.lang.Object value,
DataRequestCallback callback)
Sets the value of a property in the current entity of this bindable data provider. |
void |
setPropertyValue(java.lang.String parentWidgetKey,
java.lang.String propertyName,
java.lang.Object value)
Sets the value of a preference in the current entity of this bindable data provider. |
void |
update(DataRequestCallback callback)
Sends to the server any updated data that was set by BindableDataProvider.setPropertyValue(String, Object) or via a child datasource. |
Methods inherited from class com.sage.swt.client.sdata.datasource.DefaultDataSource |
---|
addBindableDataChangedHandler, addBindableDataChangingAsyncHandler, addBindableDataChangingHandler, addDataSourceCursorMovedHandler, addDataSourceCursorMovingHandler, addDataSourceDataChangedHandler, addDataSourceDataChangingHandler, checkDirty, clearCache, delete, equals, fireEvent, getChildDataSource, getCopy, getCurrentEntity, getDataSource, getEntities, getEntities, getEntities, getMetaData, getSort, getTypeInfo, hashCode, isDeleted, isInserting, moveFirst, moveLast, moveNext, movePrevious, moveTo, moveTo, moveToByPropertyName, moveToCurrent, moveToInsert, parseSDataPayload, setFilter, setSelected, setSort, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sage.swt.client.sdata.DataSource |
---|
addDataSourceCursorMovedHandler, addDataSourceDataChangedHandler, checkDirty, delete, getChildDataSource, getCopy, getCurrentEntity, getDataSource, getEntities, getEntities, getEntities, getSort, isDeleted, isInserting, moveFirst, moveLast, moveNext, movePrevious, moveTo, moveTo, moveToByPropertyName, moveToCurrent, moveToInsert, setFilter, setSort |
Methods inherited from interface com.sage.swt.client.sdata.BindableDataProvider |
---|
getMetaData, getTypeInfo, shutdown |
Methods inherited from interface com.sage.swt.client.sdata.HasBindableDataChangedHandlers |
---|
addBindableDataChangedHandler |
Methods inherited from interface com.sage.swt.client.sdata.HasBindableDataChangingHandlers |
---|
addBindableDataChangingHandler |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.sage.swt.client.sdata.HasBindableDataChangingAsyncHandlers |
---|
addBindableDataChangingAsyncHandler |
Methods inherited from interface com.sage.swt.client.sdata.HasDataSourceCursorMovingHandlers |
---|
addDataSourceCursorMovingHandler |
Methods inherited from interface com.sage.swt.client.sdata.HasDataSourceDataChangingHandlers |
---|
addDataSourceDataChangingHandler |
Constructor Detail |
---|
public DefaultPreferenceStore(TypeInfo typeInfo, java.lang.String application, java.lang.String dataURL, SwtRequestDispatcher requestDispatcher, SwtErrorStack errorStack)
typeInfo
- The type information object that describes the structure of the
data accessed by this PreferenceStore.application
- The SData application that the PreferenceStore connects to.dataURL
- The SData URL for the ResourceKindrequestDispatcher
- The server request dispatcher used for making requests to move
data back and forth between the client and the server.errorStack
- The UI's stack of SWT errors.Method Detail |
---|
public java.lang.Object getPropertyValue(java.lang.String propertyName)
Gets the value of the specified property in the current entity of this bindable data provider.
getPropertyValue
in interface BindableDataProvider
getPropertyValue
in class DefaultDataSource
propertyName
- The name of the property in question.
public java.lang.Object getPropertyValue(java.lang.String parentWidgetKey, java.lang.String propertyName)
Gets the value of the specified property in the current entity of this preference store.
This method is similar to BindableDataProvider.getPropertyValue(String)
method but
enables the preference store to bind/link several widgets together. E.G. A
SwtQueryPanel is comprised of several different widgets (FilterPanel,
QueryFieldListBox, etc). This method enables a widget like SwtQueryPanel
which is a composite/aggregate of several widgets to associate values with
correct widgets.
getPropertyValue
in interface PreferenceStore
parentWidgetKey
- The key of the parent widget (e.g. the SwtQueryPanel)propertyName
- The name of the property in question.
public void setPropertyValue(java.lang.String parentWidgetKey, java.lang.String propertyName, java.lang.Object value)
Sets the value of a preference in the current entity of this bindable data provider.
This method is similar to BindableDataProvider.setPropertyValue(String, Object)
method
but enables the preference store to bind/link several widgets together.
E.G. A SwtQueryPanel is comprised of several different widgets
(FilterPanel, QueryFieldListBox, etc). This method enables a widget like
SwtQueryPanel which is a composite/aggregate of several widgets to
associate values with correct widgets.
setPropertyValue
in interface PreferenceStore
parentWidgetKey
- The key of the parent widget (e.g. the SwtQueryPanel)propertyName
- The name of the property in question.value
- The new value of the property.public void setPropertyValue(java.lang.String propertyName, java.lang.Object value)
Sets the value of a property in the current entity of this bindable data provider.
setPropertyValue
in interface BindableDataProvider
setPropertyValue
in class DefaultDataSource
propertyName
- The name of the property in question.value
- The new value of the property.public void setPropertyValue(java.lang.String propertyName, java.lang.Object value, DataRequestCallback callback)
Sets the value of a property in the current entity of this bindable data provider.
setPropertyValue
in interface BindableDataProvider
setPropertyValue
in class DefaultDataSource
propertyName
- The name of the property in question.value
- The new value of the property.callback
- The callback for success and failure notification of the
property set.public void removePreference(java.lang.String preferenceName)
Removes preference/properties in the current entity of this preference store
removePreference
in interface PreferenceStore
preferenceName
- The preference/data source property to remove.public void moveToDefault(java.lang.String applicationId, DataRequestCallback callback)
Moves the cursor to the given key in the current result set, where the objectId segment of that key uses the default value (of "default").
Cursor move operations are asynchronous. Between the time a cursor move
method is called and the callback is invoked, the position of the cursor
is undefined. Therefore, the behaviour of DataSource.getCurrentEntity()
,
BindableDataProvider.getPropertyValue(String)
and
BindableDataProvider.setPropertyValue(String, Object)
are undefined during that time.
moveToDefault
in interface PreferenceStore
applicationId
- The applicationId part of key to move the cursor to in the
current result set.callback
- The callback for receiving the notification that this is donepublic void moveToDefault(java.lang.String applicationId, java.lang.String objectId, DataRequestCallback callback)
Moves the cursor to the given key in the current result set
Cursor move operations are asynchronous. Between the time a cursor move
method is called and the callback is invoked, the position of the cursor
is undefined. Therefore, the behaviour of DataSource.getCurrentEntity()
,
BindableDataProvider.getPropertyValue(String)
and
BindableDataProvider.setPropertyValue(String, Object)
are undefined during that time.
moveToDefault
in interface PreferenceStore
applicationId
- The applicationId part of the key to move the cursor to in the
current result set.objectId
- The objectId part of the key to move the cursor to in the
current result set.callback
- The callback for receiving the notification that this is donepublic void setPrimaryKeyValue(java.lang.String applicationId)
setPrimaryKeyValue
in interface PreferenceStore
applicationId
- The new value for the applicationId fieldpublic void setPrimaryKeyValue(java.lang.String applicationId, java.lang.String objectId)
setPrimaryKeyValue
in interface PreferenceStore
applicationId
- The new value for the applicationId fieldobjectId
- The new value for the objectId fieldpublic boolean containsProperty(java.lang.String parentWidgetKey, java.lang.String propertyName)
Tests if the specified property name is a property (key) in this preference store.
containsProperty
in interface PreferenceStore
parentWidgetKey
- The key of the parent widget (e.g. the SwtQueryPanel)propertyName
- The name of the property in question.
public boolean containsProperty(java.lang.String propertyName)
Tests if the specified property name is a property (key) in this preference store.
containsProperty
in interface PreferenceStore
propertyName
- The name of the property in question.
public void update(DataRequestCallback callback)
BindableDataProvider.setPropertyValue(String, Object)
or via a child datasource.
update
in interface DataSource
update
in class DefaultDataSource
callback
- The callback for receiving the notification that the update is
done.public void insert(DataRequestCallback callback)
Inserts a new entity.
This method can only be called when the cursor is on an "insert" entity.
insert
in interface DataSource
insert
in class DefaultDataSource
callback
- The callback for receiving the notification that the insertion
is done.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |