Android Open Source - codemap Find Declaration Task






From Project

Back to project page codemap.

License

The source code is released under:

GNU General Public License

If you think the Android project codemap listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.hdweiss.codemap.view.workspace;
//from   w w w.  ja  va2  s. c  o m
import java.util.ArrayList;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

import com.hdweiss.codemap.data.CscopeEntry;

public class FindDeclarationTask extends AsyncTask<Object, Object, Object>
{
  private ProgressDialog dialog;

  private Context context;
  private FindDeclarationCallback callback;
  private String url;
  private WorkspaceController controller;

  private ArrayList<CscopeEntry> entries;


  
  public FindDeclarationTask(String url, FindDeclarationCallback callback,
      WorkspaceController controller, Context context) {
    this.url = url;
    this.callback = callback;
    this.controller = controller;
    this.context = context;
  }
  
  @Override
  protected Object doInBackground(final Object... urls) {
    try {
      this.entries = controller.getUrlEntries(url);
    } catch (IllegalArgumentException e) {
      Log.e("CodeMap",
          "Error getting entries for url: " + url + " "
              + e.getLocalizedMessage());
    }
    return null;
  }

  @Override
  protected void onPostExecute(final Object result) {
    super.onPostExecute(result);
    hideDialog();
    if (this.entries != null)
      callback.onSuccess(entries);
    else
      callback.onFailure();
  }

    @Override
    protected void onPreExecute()
    {
      super.onPreExecute();
      showDialog();
    }
    
    private void showDialog() {
      this.dialog = new ProgressDialog(context);
      dialog.setMessage("Finding declarations for: \"" + url + "\"");
      dialog.setIndeterminate(false);
      dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      dialog.show();
    }
    
    private void hideDialog() {
      dialog.dismiss();
    }
    
    public interface FindDeclarationCallback {
      public void onSuccess(ArrayList<CscopeEntry> entries);
      public void onFailure();
    }
}




Java Source Code List

com.hdweiss.codemap.data.CodeMapApp.java
com.hdweiss.codemap.data.CscopeEntry.java
com.hdweiss.codemap.data.CscopeWrapper.java
com.hdweiss.codemap.data.Cscope.java
com.hdweiss.codemap.data.ICodeMapItem.java
com.hdweiss.codemap.data.JGitWrapper.java
com.hdweiss.codemap.data.ProjectController.java
com.hdweiss.codemap.data.Project.java
com.hdweiss.codemap.data.SerializableItem.java
com.hdweiss.codemap.data.SerializableLink.java
com.hdweiss.codemap.util.AbsoluteLayout.java
com.hdweiss.codemap.util.CodeMapCursorPoint.java
com.hdweiss.codemap.util.CodeMapPoint.java
com.hdweiss.codemap.util.FlowLayout.java
com.hdweiss.codemap.util.ObjectSerializer.java
com.hdweiss.codemap.util.SpanUtils.java
com.hdweiss.codemap.util.SyntaxHighlighter.java
com.hdweiss.codemap.util.Utils.java
com.hdweiss.codemap.util.ZoomableAbsoluteLayout.java
com.hdweiss.codemap.util.ZoomableLinearLayout.java
com.hdweiss.codemap.view.CodeMapActivity.java
com.hdweiss.codemap.view.CodeMapTabListener.java
com.hdweiss.codemap.view.Preferences.java
com.hdweiss.codemap.view.project.ProjectAdapter.java
com.hdweiss.codemap.view.project.ProjectBrowser.java
com.hdweiss.codemap.view.project.ProjectItemView.java
com.hdweiss.codemap.view.project.ProjectWizard.java
com.hdweiss.codemap.view.workspace.CollisionManager.java
com.hdweiss.codemap.view.workspace.FindDeclarationTask.java
com.hdweiss.codemap.view.workspace.WorkspaceController.java
com.hdweiss.codemap.view.workspace.WorkspaceFragment.java
com.hdweiss.codemap.view.workspace.WorkspaceStateLoader.java
com.hdweiss.codemap.view.workspace.WorkspaceState.java
com.hdweiss.codemap.view.workspace.WorkspaceViewListeners.java
com.hdweiss.codemap.view.workspace.WorkspaceView.java
com.hdweiss.codemap.view.workspace.browser.WorkspaceBrowserAdapter.java
com.hdweiss.codemap.view.workspace.browser.WorkspaceBrowser.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapAnnotation.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapFunction.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapImage.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapItem.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapLink.java
com.hdweiss.codemap.view.workspace.fragments.FunctionLinkSpan.java
com.hdweiss.codemap.view.workspace.outline.CscopeEntryAdapter.java
com.hdweiss.codemap.view.workspace.outline.OutlineAdapter.java
com.hdweiss.codemap.view.workspace.outline.OutlineBrowser.java
com.hdweiss.codemap.view.workspace.outline.OutlineItemComparator.java
com.hdweiss.codemap.view.workspace.outline.OutlineItemView.java
com.hdweiss.codemap.view.workspace.outline.OutlineItem.java