public OpenPath[] listFiles(String rootRelative) throws IOException { if (DEBUG) Logger.LogDebug("OpenLZMA.listFiles(" + rootRelative + ")"); if (!mFamily.containsKey(rootRelative)) { Logger.LogWarning("No children found for [" + rootRelative + "]"); return new OpenPath[0]; } List<OpenPath> ret = mFamily.get(rootRelative); if (DEBUG) Logger.LogVerbose(ret.size() + " children found for [" + rootRelative + "]"); return ret.toArray(new OpenPath[ret.size()]); }
@Override public OpenPath[] listFiles() throws IOException { if (DEBUG) Logger.LogVerbose("Listing OpenLZMA " + mFile); if (mLZMA == null) return mChildren; getAllEntries(); mChildren = listFiles(""); return mChildren; }
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { if (!isVisible() || isDetached()) return; super.onCreateOptionsMenu(menu, inflater); if (mPath == null || !mPath.isFile() || !IntentManager.isIntentAvailable(mPath, getExplorer())) MenuUtils.setMenuVisible(menu, false, R.id.menu_context_edit, R.id.menu_context_view); Logger.LogVerbose("ContentFragment.onCreateOptionsMenu"); if (!menu.hasVisibleItems()) inflater.inflate(R.menu.content, menu); MenuUtils.setMenuVisible(menu, OpenExplorer.IS_DEBUG_BUILD, R.id.menu_debug); if (!OpenExplorer.BEFORE_HONEYCOMB && OpenExplorer.USE_ACTION_BAR) { MenuUtils.setMenuVisible(menu, false, R.id.menu_more); try { final SearchView mSearchView = (SearchView) menu.findItem(R.id.menu_search).getActionView(); if (mSearchView != null) mSearchView.setOnQueryTextListener( new SearchView.OnQueryTextListener() { @TargetApi(11) public boolean onQueryTextSubmit(String query) { mSearchView.clearFocus(); Intent intent = getExplorer().getIntent(); if (intent == null) intent = new Intent(); intent.setAction(Intent.ACTION_SEARCH); Bundle appData = new Bundle(); appData.putString( "path", getExplorer().getDirContentFragment(false).getPath().getPath()); intent.putExtra(SearchManager.APP_DATA, appData); intent.putExtra(SearchManager.QUERY, query); getExplorer().handleIntent(intent); return true; } public boolean onQueryTextChange(String newText) { return false; } }); } catch (NullPointerException e) { Logger.LogError("Couldn't set up Search ActionView", e); } } }