de.unikassel.android.sdcframework.app.scheduler
Class SDCFSchedulerActivity

Package class diagram package SDCFSchedulerActivity
java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.view.ContextThemeWrapper
              extended by android.app.Activity
                  extended by de.unikassel.android.sdcframework.app.scheduler.SDCFSchedulerActivity
All Implemented Interfaces:
ComponentCallbacks, KeyEvent.Callback, LayoutInflater.Factory, View.OnCreateContextMenuListener, Window.Callback

public final class SDCFSchedulerActivity
extends Activity

Scheduler for the the SDCF weekly time schedule.


Field Summary
private  Button btnAdd
          The add entry button.
private  Button btnSave
          The add save schedule button.
private static int EDIT_OLD_ENTRY
          Constant to request changes for an existing schedule entry.
private  WeekdayScheduleEntry editedEntry
          Currently edited entry.
private  Map<View,WeekdaySchedule> mapView2Schedule
          The view to weekday schedule mapping.
private  ApplicationPreferenceManager prefManager
          The preference manager
private static int REQUEST_NEW_ENTRY
          Constant to request a new schedule entry.
private  WeeklySchedule schedule
          The schedule.
 
Fields inherited from class android.app.Activity
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
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_NOT_FOREGROUND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, TELEPHONY_SERVICE, UI_MODE_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
SDCFSchedulerActivity()
          Constructor
 
Method Summary
protected  void addNewEntry(Intent data)
          Method to create a new entry from intent data.
private  boolean deleteEntry(AdapterView.AdapterContextMenuInfo info)
          Delete entry context menu handler.
protected  void deleteEntry(WeekdayScheduleEntry entry)
          Method to delete an entry.
private  boolean editEntry(AdapterView.AdapterContextMenuInfo info)
          Edit entry context menu handler.
private  Map.Entry<View,WeekdaySchedule> getWeekdayScheduleEntry(String val)
          Method to request weekday entry value for a string description value.
protected  WeeklySchedule loadSchedule()
          Does load the schedule from the service preferences.
protected  void onActivityResult(int requestCode, int resultCode, Intent data)
           
private  boolean onAddEntry()
          Handler for add entry.
private  boolean onClearSchedule()
          Method to save a schedule and leave
 boolean onContextItemSelected(MenuItem item)
           
protected  void onCreate(Bundle savedInstanceState)
           
 void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo)
           
 boolean onCreateOptionsMenu(Menu menu)
           
protected  void onDestroy()
           
private  boolean onEditEntry(WeekdayScheduleEntry entry)
          Handler for edit entry.
 boolean onOptionsItemSelected(MenuItem item)
           
protected  void onPause()
           
 boolean onPrepareOptionsMenu(Menu menu)
           
protected  void onResume()
           
private  boolean onSaveSchedule()
          Method to save a schedule and leave
protected  void refreshView()
          Method to update button states
 void setSchedule(WeeklySchedule newSchedule)
           
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, finish, finishActivity, finishActivityFromChild, finishFromChild, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getInstanceCount, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLocalClassName, getMenuInflater, getParent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, getWindow, getWindowManager, hasWindowFocus, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, onApplyThemeResource, onAttachedToWindow, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextMenuClosed, onCreateDescription, onCreateDialog, onCreateDialog, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onDetachedFromWindow, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNewIntent, onOptionsMenuClosed, onPanelClosed, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPreparePanel, onRestart, onRestoreInstanceState, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, overridePendingTransition, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setIntent, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, showDialog, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startIntentSender, startIntentSenderForResult, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
 
Methods inherited from class android.view.ContextThemeWrapper
attachBaseContext, getTheme, setTheme
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalFilesDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_NEW_ENTRY

private static final int REQUEST_NEW_ENTRY
Constant to request a new schedule entry.

See Also:
Constant Field Values

EDIT_OLD_ENTRY

private static final int EDIT_OLD_ENTRY
Constant to request changes for an existing schedule entry.

See Also:
Constant Field Values

schedule

private WeeklySchedule schedule
The schedule.


mapView2Schedule

private final Map<View,WeekdaySchedule> mapView2Schedule
The view to weekday schedule mapping.


editedEntry

private WeekdayScheduleEntry editedEntry
Currently edited entry.


prefManager

private final ApplicationPreferenceManager prefManager
The preference manager


btnAdd

private Button btnAdd
The add entry button.


btnSave

private Button btnSave
The add save schedule button.

Constructor Detail

SDCFSchedulerActivity

public SDCFSchedulerActivity()
Constructor

Method Detail

onCreate

protected void onCreate(Bundle savedInstanceState)
Overrides:
onCreate in class Activity

setSchedule

public void setSchedule(WeeklySchedule newSchedule)
Parameters:
newSchedule - the new schedule to set

refreshView

protected void refreshView()
Method to update button states


loadSchedule

protected WeeklySchedule loadSchedule()
Does load the schedule from the service preferences.

Returns:
the weekly schedule

onCreateOptionsMenu

public boolean onCreateOptionsMenu(Menu menu)
Overrides:
onCreateOptionsMenu in class Activity

onPrepareOptionsMenu

public boolean onPrepareOptionsMenu(Menu menu)
Overrides:
onPrepareOptionsMenu in class Activity

onOptionsItemSelected

public boolean onOptionsItemSelected(MenuItem item)
Overrides:
onOptionsItemSelected in class Activity

onClearSchedule

private boolean onClearSchedule()
Method to save a schedule and leave

Returns:
true if successful, false otherwise.

onSaveSchedule

private boolean onSaveSchedule()
Method to save a schedule and leave

Returns:
true if successful, false otherwise.

onAddEntry

private boolean onAddEntry()
Handler for add entry.

Returns:
true if successful, false otherwise

onEditEntry

private boolean onEditEntry(WeekdayScheduleEntry entry)
Handler for edit entry.

Parameters:
entry - the entry to wedit
Returns:
true if successful, false otherwise

onActivityResult

protected void onActivityResult(int requestCode,
                                int resultCode,
                                Intent data)
Overrides:
onActivityResult in class Activity

addNewEntry

protected void addNewEntry(Intent data)
Method to create a new entry from intent data.

Parameters:
data - the intent data to create new entry from

getWeekdayScheduleEntry

private Map.Entry<View,WeekdaySchedule> getWeekdayScheduleEntry(String val)
Method to request weekday entry value for a string description value.

Parameters:
val - the value to get an entry for
Returns:
the entry for the given value or null

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class Activity

onResume

protected void onResume()
Overrides:
onResume in class Activity

onPause

protected void onPause()
Overrides:
onPause in class Activity

onCreateContextMenu

public void onCreateContextMenu(ContextMenu menu,
                                View v,
                                ContextMenu.ContextMenuInfo menuInfo)
Specified by:
onCreateContextMenu in interface View.OnCreateContextMenuListener
Overrides:
onCreateContextMenu in class Activity

onContextItemSelected

public boolean onContextItemSelected(MenuItem item)
Overrides:
onContextItemSelected in class Activity

deleteEntry

private boolean deleteEntry(AdapterView.AdapterContextMenuInfo info)
Delete entry context menu handler.

Parameters:
info - the context menu info
Returns:
true if successful, false otherwise

deleteEntry

protected void deleteEntry(WeekdayScheduleEntry entry)
Method to delete an entry.

Parameters:
entry - the entry to delete

editEntry

private boolean editEntry(AdapterView.AdapterContextMenuInfo info)
Edit entry context menu handler.

Parameters:
info - the context menu info
Returns:
true if successful, false otherwise