|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectandroid.content.Context
android.content.ContextWrapper
android.view.ContextThemeWrapper
android.app.Activity
net.sf.dictccfe.and.DictAndActivity
public final class DictAndActivity
Main android app class.
| Nested Class Summary | |
|---|---|
private class |
DictAndActivity.DictSelector
Listener for the dialog box for selecting or loading the dictionary. |
private class |
DictAndActivity.ExcpShower
For showing the given exception from a background thread. |
private class |
DictAndActivity.ListViewKeyListener
Exact searching if the D-Pad center or Enter key has been pressed in the ListView in the lower part of the window. |
private class |
DictAndActivity.LVUpdater
Used for updating the list view. |
private class |
DictAndActivity.ProgrShower
|
private class |
DictAndActivity.TextViewKeyListener
Calls search exact if the D-Pad center or Enter key has been pressed in the TextView above. |
| Field Summary | |
|---|---|
private android.database.sqlite.SQLiteDatabase |
m_db
The dictionary index database. |
private java.lang.CharSequence |
m_dictname
The name of the dictionary currently used. |
private DictAndActivity.ExcpShower |
m_excpshow
Used for showing exceptions from possibly background threads. |
private android.os.Handler |
m_handler
For doing UI operations from background threads. |
private IdxLoader |
m_idxloader
For loading the index files into the dictionary index database. |
private DictAndActivity.LVUpdater |
m_lvupdater
Results ListView updater. |
private android.content.SharedPreferences |
m_prefs
The last configuration used by the application. |
private DictAndActivity.ProgrShower |
m_progrshow
For showing a progress of a background application. |
private java.util.ArrayList<java.lang.CharSequence> |
m_resultarr
Array of search results, The list view is synchronized with this array. |
private Search |
m_srch
The search engine. |
| 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, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, 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, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE |
| Constructor Summary | |
|---|---|
DictAndActivity()
The constructor initializes local variables. |
|
| Method Summary | |
|---|---|
void |
addResult(java.lang.CharSequence aResult)
Called for single results found while searching. |
void |
endProgress(int aProgress)
Closes the progress showing gauge window. |
void |
endResults()
Called if a search engine starts returning results. |
private void |
loadDictionary()
Creates a submenu allowing the user to load a dictionary. |
void |
loadDictionary(java.lang.String aDictionaryName)
Starts loading the dictionary index file. |
void |
onCancel(android.content.DialogInterface aDialog)
Called if the progress dialog is cancelled. |
void |
onCreate(android.os.Bundle savedInstanceState)
Called when the activity is first created. |
boolean |
onCreateOptionsMenu(android.view.Menu menu)
Creates the application menu. |
void |
onDestroy()
|
void |
onLowMemory()
|
boolean |
onOptionsItemSelected(android.view.MenuItem aMenuItem)
Reacts on menu selections. |
void |
onStop()
|
private void |
searchexact(java.lang.CharSequence aKeyword)
Starts exact searching for a description of a keyword. |
private void |
searchexactlv(int aPos)
Starts exact searching for the description in the list view control. |
private void |
searchexacttv()
Starts exact searching for the description in the text view control. |
private void |
searchsimilar()
Starts similar searching for the description in the text view control. |
private void |
searchsimilar(java.lang.CharSequence aKeyword)
Starts searching for similar keywords. |
private void |
selectDictionary()
Creates a submenu allowing the user to select a loaded dictionary. |
void |
selectDictionary(java.lang.String aDictionaryName)
Selects a dictionary with the given name. |
void |
showException(java.lang.Exception anExcp)
Shows exception in a separate dialog window. |
void |
showProgress(int aProgress)
Shows progress in a progress showing gauge window. |
void |
startProgress(int aProgress)
Starts a progress showing gauge window. |
void |
startResults()
Called if a search engine starts returning results. |
private void |
stop()
Stops any currently running background operations. |
private void |
stopall()
Stops currently running background jobs and closes the dictionary. |
| Methods inherited from class android.app.Activity |
|---|
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, finalize, 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, onActivityResult, onApplyThemeResource, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onKeyDown, onKeyMultiple, onKeyUp, onMenuItemSelected, onMenuOpened, onNewIntent, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPrepareOptionsMenu, onPreparePanel, onRestart, onRestoreInstanceState, onResume, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onTitleChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, 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, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, 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, 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, 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.ArrayList<java.lang.CharSequence> m_resultarr
private android.os.Handler m_handler
private DictAndActivity.LVUpdater m_lvupdater
private final DictAndActivity.ExcpShower m_excpshow
private final DictAndActivity.ProgrShower m_progrshow
private java.lang.CharSequence m_dictname
private IdxLoader m_idxloader
private Search m_srch
private android.database.sqlite.SQLiteDatabase m_db
private android.content.SharedPreferences m_prefs
| Constructor Detail |
|---|
public DictAndActivity()
| Method Detail |
|---|
private void stop()
private void stopall()
private void searchexacttv()
private void searchexactlv(int aPos)
aPos - the position (o-based) of the clicked row in the list view.private void searchsimilar()
private void searchexact(java.lang.CharSequence aKeyword)
aKeyword - the keyword.private void searchsimilar(java.lang.CharSequence aKeyword)
aKeyword - the keyword pattern for which to find
similar keywords.private void loadDictionary()
private void selectDictionary()
public final void loadDictionary(java.lang.String aDictionaryName)
aDictionaryName - the name of the dictionary to load.public final void selectDictionary(java.lang.String aDictionaryName)
aDictionaryName - the name of the dictionary to load.public final void onCreate(android.os.Bundle savedInstanceState)
onCreate in class android.app.ActivitysavedInstanceState - ignoredpublic final void onLowMemory()
onLowMemory in interface android.content.ComponentCallbacksonLowMemory in class android.app.Activitypublic final void onStop()
onStop in class android.app.Activitypublic final void onDestroy()
onDestroy in class android.app.Activitypublic final boolean onCreateOptionsMenu(android.view.Menu menu)
onCreateOptionsMenu in class android.app.Activitymenu - the in which to place our items.
public final boolean onOptionsItemSelected(android.view.MenuItem aMenuItem)
onOptionsItemSelected in class android.app.ActivityaMenuItem - the selected menu item.
public final void startResults()
startResults in interface ISearchResultpublic final void addResult(java.lang.CharSequence aResult)
addResult in interface ISearchResultaResult - the single result found by the search engine.
Added to the list view.
been cancelled.public final void endResults()
endResults in interface ISearchResultpublic final void startProgress(int aProgress)
startProgress in interface IProgressaProgress - the initial progress in percents.public final void showProgress(int aProgress)
showProgress in interface IProgressaProgress - the progress.public final void endProgress(int aProgress)
endProgress in interface IProgressaProgress - the final progress to show.public final void showException(java.lang.Exception anExcp)
showException in interface IProgressshowException in interface ISearchResultanExcp - the exception to show.public final void onCancel(android.content.DialogInterface aDialog)
onCancel in interface android.content.DialogInterface.OnCancelListeneraDialog - ignored
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||