public class DataDetailsActivity extends MenuActivity
It is "controlled" by an instance of the DetailsController
class.
Each data field of the record that is involved by the implementation subclass,
is associated with one of the View descendants, owning to the android.widget package, that are wrapped by a
subclass of the Term
class. The constructor of the subclass of Term, must be used to instantiate
each field wrapper in the overriding of the onCreate
method: the constructor receives all the parameters
to specify the responsibility of field data and view type.
On the onCreate method this class retrieves a reference to its controller from the stack hosted by the "top"
DataMainActivity
object, accessible by the m_dataMainActivity
member and pushes itself
into the JotyApp.m_dataDetailsActivityStack
stack.
The instance of the class can live in two different states identified by the truth of the m_editing
boolean member.
If the state is "not in editing" the various Term
objects let the wrapped view disabled and the action bar
shows first the "edit" and the "delete" commands.
If the state is "in editing" the various Term
objects let the wrapped view enabled and the action bar
shows first the "save" and the "cancel" commands.
The class dispatches the four actions above to respective protected methods that, all, implement a concrete behavior.
The instance can start to edit a new record (this is detected during the creation using the controller method: in this case the instance starts in editing mode and all the default value stored in the Term objects are made effective in the wrapped view. Then each Term object, if involved in some change by the user, notifies its dirty state and, at last, on the "save" command, the class performs the expected action. The "cancel" command bring the navigation back to the previous activity (the host of the "new record" command).
The storing of information leverages on an instance of WResultSet that, once received data and metadata from
the visual scenario, builds the statement or the accessor coordinates, packages these information into a BasicPostStatement object;
at last the call of the JotyApp.commitTrans
method perform the actual forwarding to the JotyServer through the WebClient object.
If all goes successfully the Activity reaches the "not in editing" state else a convenient message is presented to the user and the Activity stays in editing.
If the instance of this class, instead, start in "not in editing" it does it for rendering an existing record of data: the "edit" command makes the Activity to switch into the "in editing" mode and the "save" command carries the execution along a flow similar to the one of the "new record" circumstance except the final statement generated. The "cancel" command restores the "non in editing" state and this, if some datum was changed into any widget, is performed with a reloading of the record.
The Activity "Resume" event is the target for processing what, possibly has been "selected" from a DataResultActivity
instance launched as "selector" of the
value for some widget, so that the overriding of onResume
takes care of it.
Lastly it is worthwhile to note that the openDetails
method opens another instance of type DataDetailsActivity that can be made to swich to a related record.
DetailsController
,
MenuActivity
,
DataResultActivity
,
WResultSet
,
WebClient
MenuActivity.Action, MenuActivity.Permission
JotyActivity.AccessorCoordinates, JotyActivity.WaitCursor
Modifier and Type | Field and Description |
---|---|
boolean |
m_asSelector |
protected boolean |
m_autoIncrementByAddNew |
protected java.util.Vector<org.joty.data.WrappedField> |
m_delayedWfields |
protected JotyCursor |
m_descriptorOnLoad |
protected DetailsController |
m_detailsController |
protected boolean |
m_editing |
boolean |
m_furtherDetailsInspecting |
long |
m_identifyingID |
protected boolean |
m_idFieldAutoIncrement |
protected boolean |
m_isDeleting |
protected boolean |
m_isSaving |
org.joty.gui.WFieldSet |
m_keyElems |
protected boolean |
m_newRecord |
boolean |
m_preIdGeneration |
boolean |
m_selectionIsRunning |
protected Term |
m_selectionTarget |
protected java.lang.String |
m_seq_name |
protected boolean |
m_wasEditingOnPause |
m_accessorCoordinates, m_accessorMode, m_contextActivity, m_mainActivity, m_paramContext, m_permission, m_stockedMenuItems
m_app, m_common, m_extras, m_termMap, m_terms, m_waitCursor
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_EXTERNAL_SERVICE, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CARRIER_CONFIG_SERVICE, CLIPBOARD_SERVICE, COMPANION_DEVICE_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, FINGERPRINT_SERVICE, HARDWARE_PROPERTIES_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MIDI_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_NO_LOCALIZED_COLLATORS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_STATS_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, RECEIVER_VISIBLE_TO_INSTANT_APPS, RESTRICTIONS_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SHORTCUT_SERVICE, STORAGE_SERVICE, STORAGE_STATS_SERVICE, SYSTEM_HEALTH_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TELEPHONY_SUBSCRIPTION_SERVICE, TEXT_CLASSIFICATION_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_AWARE_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
Constructor and Description |
---|
DataDetailsActivity() |
Modifier and Type | Method and Description |
---|---|
protected void |
addIntermediateOptions(android.view.Menu menu) |
protected void |
beforeFinish(boolean forRenewing) |
protected void |
cancel() |
protected boolean |
checkForIdentifyingId() |
protected void |
checkForTermsNewlyGeneratedValues() |
boolean |
costraintViolationMsgOnDelete() |
boolean |
costraintViolationMsgOnUpdate() |
protected void |
delete() |
protected boolean |
deleteIsAllowed() |
protected void |
doDeletion() |
protected boolean |
doStoreData(boolean result,
WResultSet rs,
org.joty.common.BasicPostStatement postStatement) |
protected boolean |
doUpdate(boolean isNewRecord,
WResultSet rs) |
protected void |
doWithData(WResultSet rs) |
protected void |
edit() |
protected boolean |
editIsAllowed() |
protected void |
enableWidgets(boolean truth) |
void |
forwardExtraExtras() |
java.lang.String |
getId() |
protected boolean |
isDeletable() |
protected org.joty.data.WrappedField |
keyElem(int index) |
protected org.joty.data.WrappedField |
keyElem(java.lang.String keyName) |
void |
lookForDataStructure(WResultSet rs) |
protected void |
manageNewId(long id) |
protected boolean |
navigationNeeded() |
protected void |
nonManagedRollback() |
protected void |
onCreate(android.os.Bundle savedInstanceState) |
boolean |
onCreateOptionsMenu(android.view.Menu menu) |
protected void |
onDataLoaded() |
protected void |
onPause() |
protected void |
onResume() |
protected void |
openDetails(java.lang.String id,
java.lang.Class activityClass,
java.lang.String accessorMainCoordinate,
int selectionTargetResId) |
protected void |
openResultPrepare(long id) |
void |
processData() |
protected void |
save()
The method accomplishes its task defining a Desktop Delayed Transaction like the Joty workstation application does.
|
protected void |
saveEffects() |
protected void |
selectionCallBack(Term target) |
protected void |
setContextValueFromParam(Term term,
java.lang.String paramName) |
protected void |
setDelayed(org.joty.data.WrappedField wfield,
boolean predicate) |
protected void |
setEditing(boolean truth) |
protected void |
setId(WResultSet rs) |
void |
setIntegerKeyElemVal(java.lang.String fieldName,
long Val) |
protected void |
setLangTitle(java.lang.String literal) |
protected void |
setNotBoundFields(WResultSet rs) |
protected void |
setTermsDefaults() |
protected void |
setTermsOnContext() |
protected void |
setWFieldAsReturnedValue(org.joty.data.WrappedField wfield) |
protected void |
storeData(JotyApp.ResponseHandlersManager prmRespManager) |
protected void |
storeWFieldsData(WResultSet rs) |
protected boolean |
updatableFieldsHaveDescriptorsAvailable() |
protected boolean |
validateComponents() |
accessIsAllowed, accessorMode, addHome, addItemAsSubMenu, addMenuItemsToAppMenu, addMenuItemToAppMenu, addMenuItemToAppMenu, addMenuItemToAppMenu, addMenuItemToAppMenu, addNewRecordMenu, createContextPostStatement, createParamContext, createParamContext, doBackAction, enableRole, finish, finish, getMaxPermission, hasPermission, mainActivity, newRecord, onOptionsItemSelected, openImage, putFieldAsExtra, setBack, setContextActivity, setContextParams, setHint, setItem, setLangHint, setLangText, setText
addExtrasInOpenActivity, getRespManager, getRespManagerKey, guiDataExchange, guiDataExchange, home, isPortrait, jotyLang, lockRotation, onBackPressed, onPostCreate, onSaveInstanceState, onWidgetClick, onWidgetItemSelected, postInit, resetDirtyStatus, setContentView, setWaitCursor, startActivity, startActivity, startActivity, term
addContentView, dispatchKeyEvent, findViewById, getDelegate, getDrawerToggleDelegate, getMenuInflater, getResources, getSupportActionBar, getSupportParentActivityIntent, invalidateOptionsMenu, onConfigurationChanged, onContentChanged, onCreateSupportNavigateUpTaskStack, onDestroy, onMenuItemSelected, onMenuOpened, onPanelClosed, onPostResume, onPrepareSupportNavigateUpTaskStack, onStart, onStop, onSupportActionModeFinished, onSupportActionModeStarted, onSupportContentChanged, onSupportNavigateUp, onTitleChanged, onWindowStartingSupportActionMode, setContentView, setContentView, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, setTheme, startSupportActionMode, supportInvalidateOptionsMenu, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask
dump, getLastCustomNonConfigurationInstance, getSupportFragmentManager, getSupportLoaderManager, onActivityResult, onAttachFragment, onCreatePanelMenu, onLowMemory, onMultiWindowModeChanged, onNewIntent, onPictureInPictureModeChanged, onPrepareOptionsPanel, onPreparePanel, onRequestPermissionsResult, onResumeFragments, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance, onStateNotSaved, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityForResult, startActivityFromFragment, startActivityFromFragment, startIntentSenderFromFragment, supportFinishAfterTransition, supportPostponeEnterTransition, supportStartPostponedEnterTransition, validateRequestPermissionsRequestCode
closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dispatchGenericMotionEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, enterPictureInPictureMode, enterPictureInPictureMode, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMaxNumPictureInPictureActions, getMediaController, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, isActivityTransitionRunning, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLocalVoiceInteractionSupported, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onChildTitleChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreatePanelView, onCreateThumbnail, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onMultiWindowModeChanged, onNavigateUp, onNavigateUpFromChild, onOptionsMenuClosed, onPictureInPictureModeChanged, onPostCreate, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onProvideAssistContent, onProvideAssistData, onProvideKeyboardShortcuts, onProvideReferrer, onRestart, onRestoreInstanceState, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, postponeEnterTransition, recreate, registerForContextMenu, releaseInstance, removeDialog, reportFullyDrawn, requestDragAndDropPermissions, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, runOnUiThread, setActionBar, setContentTransitionManager, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setMediaController, setPictureInPictureParams, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTaskDescription, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, setVrModeEnabled, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderFromChild, startIntentSenderFromChild, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
applyOverrideConfiguration, attachBaseContext, getAssets, getTheme
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createContextForSplit, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDataDir, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getSystemServiceName, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startForegroundService, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
getColor, getColorStateList, getDrawable, getString, getString, getSystemService, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
protected boolean m_editing
protected boolean m_wasEditingOnPause
public long m_identifyingID
protected java.util.Vector<org.joty.data.WrappedField> m_delayedWfields
public boolean m_selectionIsRunning
public boolean m_furtherDetailsInspecting
protected boolean m_isDeleting
protected boolean m_isSaving
protected boolean m_newRecord
protected Term m_selectionTarget
protected boolean m_idFieldAutoIncrement
protected boolean m_autoIncrementByAddNew
protected java.lang.String m_seq_name
protected DetailsController m_detailsController
protected JotyCursor m_descriptorOnLoad
public org.joty.gui.WFieldSet m_keyElems
public boolean m_preIdGeneration
public boolean m_asSelector
public java.lang.String getId()
protected void onCreate(android.os.Bundle savedInstanceState)
onCreate
in class MenuActivity
public void processData()
protected void doWithData(WResultSet rs)
public void lookForDataStructure(WResultSet rs)
protected void onDataLoaded()
public boolean onCreateOptionsMenu(android.view.Menu menu)
onCreateOptionsMenu
in class MenuActivity
protected void addIntermediateOptions(android.view.Menu menu)
protected void edit()
protected void setEditing(boolean truth)
protected boolean navigationNeeded()
navigationNeeded
in class MenuActivity
protected void delete()
protected void doDeletion()
protected boolean isDeletable()
protected void cancel()
protected boolean validateComponents()
protected void save()
ResponseHandlersManager
class. The outer one is needed because, along the invocation of the
"forwarding part", that is the invocation of the storeData
method, the configuration of the
Joty application may be such that a fresh copy of the fields metadata is desired (this happens when
the "reuseMetadataOnLoadForStore" configuration item is 'false'): in this case an
inquiry takes place and as such it must (in Joty 2.0 Mobile) be managed by means of a QueryResponseHandlersManager
object that allows its handling part to execute the handle
method of the handler located in the
outer manager, method that, finally, executes the commit command, that, at its turn, realizes the
transaction forwarding, by relying on another instance of ResponseHandlersManager
.
This asset seemed to be visually understandable to the developer, as decoupling two different access
to the Joty server, the first one of which, an inquiry, is unusual but, nevertheless, to be supported by the framework.
The stack of one only ResponseHandlersManager
object could have been used, instead, but
the presence of the possibility of an inquiry access to the server, during the building of the Delayed Desktop Transaction,
would have been less apparent.
protected void saveEffects()
protected void checkForTermsNewlyGeneratedValues()
protected org.joty.data.WrappedField keyElem(int index)
protected org.joty.data.WrappedField keyElem(java.lang.String keyName)
protected boolean checkForIdentifyingId()
public boolean costraintViolationMsgOnDelete()
public boolean costraintViolationMsgOnUpdate()
protected void manageNewId(long id)
public void setIntegerKeyElemVal(java.lang.String fieldName, long Val)
protected boolean updatableFieldsHaveDescriptorsAvailable()
protected void setId(WResultSet rs)
protected void setWFieldAsReturnedValue(org.joty.data.WrappedField wfield)
protected void setDelayed(org.joty.data.WrappedField wfield, boolean predicate)
protected boolean doUpdate(boolean isNewRecord, WResultSet rs)
protected void setNotBoundFields(WResultSet rs)
protected void storeWFieldsData(WResultSet rs)
protected void storeData(JotyApp.ResponseHandlersManager prmRespManager)
protected boolean doStoreData(boolean result, WResultSet rs, org.joty.common.BasicPostStatement postStatement)
protected void nonManagedRollback()
protected void enableWidgets(boolean truth)
protected boolean editIsAllowed()
protected boolean deleteIsAllowed()
protected void onResume()
onResume
in class JotyActivity
protected void onPause()
onPause
in class android.support.v4.app.FragmentActivity
protected void selectionCallBack(Term target)
protected void setContextValueFromParam(Term term, java.lang.String paramName)
protected void setTermsDefaults()
protected void setTermsOnContext()
protected void setLangTitle(java.lang.String literal)
protected void beforeFinish(boolean forRenewing)
beforeFinish
in class MenuActivity
protected void openResultPrepare(long id)
protected void openDetails(java.lang.String id, java.lang.Class activityClass, java.lang.String accessorMainCoordinate, int selectionTargetResId)
public void forwardExtraExtras()