public class FormCategoryFragment extends FormAbstractFragment
FormAbstractFragment.FormExitListener, FormAbstractFragment.OnObjectSaveListener
Constructor and Description |
---|
FormCategoryFragment() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canExitForm()
Checks if the user can exit the form (no unsaved changes)
|
protected int |
getContentLayout()
Returns the form content layout
|
static FormCategoryFragment |
newInstance(java.lang.Long categoryId)
Instance creation
|
void |
onActivityCreated(Bundle savedInstanceState)
Restores saved input states after a configuration change
|
View |
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) |
void |
onPause()
Closes all open inputs before destroying the fragment
|
void |
onSaveInstanceState(Bundle outState)
Saves input states before a configuration change
|
protected void |
resetInputUpdatedByUserFlags()
Resets the "wasChangedByUser" flags in all the form inputs
|
protected void |
saveObject()
Saves the model object somewhere.
|
protected void |
setObjectValuesFromInputs()
Retrieves all values from the inputs and sets them in the model object
|
protected java.lang.String |
validateObject()
Checks if the form object is correct.
|
manageExitFromForm, onMenuItemClick, setOnObjectSaveListener
public static FormCategoryFragment newInstance(java.lang.Long categoryId)
categoryId
- category ID parameter (null if adding a new category, the category to edit otherwise)public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
onCreateView
in class FormAbstractFragment
protected boolean canExitForm()
canExitForm
in class FormAbstractFragment
protected void resetInputUpdatedByUserFlags()
resetInputUpdatedByUserFlags
in class FormAbstractFragment
public void onActivityCreated(Bundle savedInstanceState)
public void onSaveInstanceState(Bundle outState)
public void onPause()
protected int getContentLayout()
getContentLayout
in class FormAbstractFragment
protected void setObjectValuesFromInputs()
setObjectValuesFromInputs
in class FormAbstractFragment
protected java.lang.String validateObject()
FormAbstractFragment.setObjectValuesFromInputs()
so that the model object already has all the fields setvalidateObject
in class FormAbstractFragment
protected void saveObject()
FormAbstractFragment.setObjectValuesFromInputs()
(the model object already has all the fields set) and only if FormAbstractFragment.validateObject()
returns nullsaveObject
in class FormAbstractFragment