CheckStyle.
authorVincent Veronis <veroni_v@epitech.net>
Thu, 01 Oct 2009 17:43:56 +0200
changeset 427 ac5021ad2ac1
parent 426 7a884504e36c
child 429 aa9991b18ca8
child 431 7c0dcffaf20a
CheckStyle.
src/com/beem/project/beem/ui/AddContact.java
src/com/beem/project/beem/ui/ContactDialog.java
src/com/beem/project/beem/ui/ContactList.java
src/com/beem/project/beem/ui/SendIMDialogSmiley.java
src/com/beem/project/beem/ui/UserInfo.java
--- a/src/com/beem/project/beem/ui/AddContact.java	Thu Oct 01 17:24:45 2009 +0200
+++ b/src/com/beem/project/beem/ui/AddContact.java	Thu Oct 01 17:43:56 2009 +0200
@@ -23,6 +23,7 @@
 import com.beem.project.beem.R;
 import com.beem.project.beem.service.aidl.IXmppFacade;
 import com.beem.project.beem.utils.BeemBroadcastReceiver;
+
 /**
  * This activity is used to add a contact.
  * @author nikita
@@ -43,7 +44,8 @@
     /**
      * Constructor.
      */
-    public AddContact() { }
+    public AddContact() {
+    }
 
     /**
      * {@inheritDoc}
@@ -87,7 +89,8 @@
 	/**
 	 * Constructor.
 	 */
-	public BeemServiceConnection() { }
+	public BeemServiceConnection() {
+	}
 
 	@Override
 	public void onServiceConnected(ComponentName name, IBinder service) {
@@ -123,7 +126,7 @@
 	    boolean isEmail = Pattern.matches("[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+.)+[a-zA-Z]{2,4}", login);
 	    if (!isEmail) {
 		Toast.makeText(AddContact.this, getString(R.string.AddCContactAddedLoginError), Toast.LENGTH_SHORT)
-		.show();
+		    .show();
 		return;
 	    }
 	    String alias;
@@ -134,14 +137,13 @@
 		if (mXmppFacade != null) {
 		    if (mXmppFacade.getRoster().getContact(login) != null)
 			mGroup.addAll(mXmppFacade.getRoster().getContact(login).getGroups());
-		    if (mXmppFacade.getRoster().addContact(login, alias,
-			mGroup.toArray(new String[mGroup.size()])) == null) {
+		    if (mXmppFacade.getRoster().addContact(login, alias, mGroup.toArray(new String[mGroup.size()])) == null) {
 			Toast.makeText(AddContact.this, getString(R.string.AddCContactAddedError), Toast.LENGTH_SHORT)
-			.show();
+			    .show();
 			return;
 		    } else {
 			Toast.makeText(AddContact.this, getString(R.string.AddCContactAdded), Toast.LENGTH_SHORT)
-			.show();
+			    .show();
 			finish();
 		    }
 		}
--- a/src/com/beem/project/beem/ui/ContactDialog.java	Thu Oct 01 17:24:45 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactDialog.java	Thu Oct 01 17:43:56 2009 +0200
@@ -1,50 +1,50 @@
 package com.beem.project.beem.ui;
 
-import org.jivesoftware.smack.packet.Presence;
-
 import android.app.Activity;
-import android.app.AlertDialog;
 import android.app.Dialog;
 import android.app.Service;
 import android.content.ComponentName;
 import android.content.Context;
-import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.ServiceConnection;
 import android.os.IBinder;
 import android.os.RemoteException;
-import android.util.Log;
 import android.view.View;
 import android.widget.Button;
 
 import com.beem.project.beem.BeemService;
 import com.beem.project.beem.R;
 import com.beem.project.beem.service.Contact;
-import com.beem.project.beem.service.PresenceAdapter;
 import com.beem.project.beem.service.aidl.IXmppFacade;
 
+/**
+ * This activity class provides the view to show dialog when long click on contact list.
+ * @author marseille
+ */
 public class ContactDialog extends Dialog {
 
-    public static final String TAG = "Option Dialog";
     private final Contact mContact;
-    private final String mGroup;
     private final Context mContext;
-    private IXmppFacade mXmppFacade = null;
+    private IXmppFacade mXmppFacade;
     private final ServiceConnection mServConn = new BeemServiceConnection();
 
-    public ContactDialog(final Context context, Contact curContact, String group) {
+    /**
+     * Constructor.
+     * @param context context where is call the dialog.
+     * @param curContact current contact.
+     */
+    public ContactDialog(final Context context, final Contact curContact) {
 	super(context);
 	mContext = context;
 
 	setContentView(R.layout.contactdialog);
 	mContact = curContact;
-	mGroup = group;
 	setTitle(curContact.getJID());
 
 	Button button = (Button) findViewById(R.id.CDChat);
-	button.setOnClickListener(new chatListener());
+	button.setOnClickListener(new ChatListener());
 	button = (Button) findViewById(R.id.CDInfos);
-	button.setOnClickListener(new infosListener());
+	button.setOnClickListener(new InfosListener());
 	button = (Button) findViewById(R.id.CDCall);
 	button.setOnClickListener(new CallListener());
 
@@ -57,50 +57,38 @@
 	mContext.unbindService(mServConn);
     }
 
+    /**
+     * Event simple click on call button.
+     */
     class CallListener implements View.OnClickListener {
 
+	/**
+	 * Constructor.
+	 */
+	public CallListener() {
+	}
+
 	@Override
 	public void onClick(View v) {
 	    try {
-		//TODO: permettre a l'user de choisir a quel ressource il veut faire le call.
+		//TODO permettre a l'user de choisir a quel ressource il veut faire le call.
 		mXmppFacade.call(mContact.getJID() + "/BEEM");
 	    } catch (RemoteException e) {
-		// TODO Auto-generated catch block
-		e.printStackTrace();
-	    }
-	    
-	}
-	
-    }
-    
-    class aliasListener implements View.OnClickListener {
-
-	@Override
-	public void onClick(View v) {
-/*
-	    ContactDialogAliasDialog dialog = new ContactDialogAliasDialog(mContext, mContact);
-	    dialog.setOwnerActivity(ContactDialog.this.getOwnerActivity());
-	    dialog.initService(mXmppFacade);
-	    dialog.show();
-	    */
-	}
-
-    }
-
-    class blockListener implements View.OnClickListener {
-
-	@Override
-	public void onClick(View v) {
-	    try {
-		mXmppFacade.blockUser(mContact.getJID());
-	    } catch (RemoteException e) {
 		e.printStackTrace();
 	    }
-	    dismiss();
-	}	
+	}
     }
 
-    class chatListener implements View.OnClickListener {
+    /**
+     * Event simple click on chat button.
+     */
+    class ChatListener implements View.OnClickListener {
+
+	/**
+	 * Constructor.
+	 */
+	public ChatListener() {
+	}
 
 	@Override
 	public void onClick(View v) {
@@ -113,7 +101,16 @@
 
     }
 
-    class infosListener implements View.OnClickListener {
+    /**
+     * Event simple click on info button.
+     */
+    class InfosListener implements View.OnClickListener {
+
+	/**
+	 * Constructor.
+	 */
+	public InfosListener() {
+	}
 
 	@Override
 	public void onClick(View v) {
@@ -126,8 +123,17 @@
 
     }
 
+    /**
+     * The service connection used to connect to the Beem service.
+     */
     private class BeemServiceConnection implements ServiceConnection {
 
+	/**
+	 * Constructor.
+	 */
+	public BeemServiceConnection() {
+	}
+
 	@Override
 	public void onServiceConnected(ComponentName name, IBinder service) {
 	    mXmppFacade = IXmppFacade.Stub.asInterface(service);
--- a/src/com/beem/project/beem/ui/ContactList.java	Thu Oct 01 17:24:45 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java	Thu Oct 01 17:43:56 2009 +0200
@@ -50,7 +50,7 @@
  */
 public class ContactList extends Activity {
 
-    //private static final String TAG = "CONTACTLIST_ACT";
+    // private static final String TAG = "CONTACTLIST_ACT";
     private static final Intent SERVICE_INTENT = new Intent();
     private static final int REQUEST_CODE = 1;
     private BeemContactList mAdapterContactList;
@@ -166,7 +166,7 @@
      */
     @Override
     protected void onStop() {
-	Log.d("CONTACTLIST","onStop");
+	Log.d("CONTACTLIST", "onStop");
 	super.onStop();
 	if (mReceiver.isBinded())
 	    unbindService(mServConn);
@@ -280,7 +280,7 @@
 	@Override
 	public boolean onItemLongClick(AdapterView<?> arg0, View v, int pos, long lpos) {
 	    Contact c = mListContact.get(pos);
-	    ContactDialog dialogContact = new ContactDialog(ContactList.this, c, mCurGroup);
+	    ContactDialog dialogContact = new ContactDialog(ContactList.this, c);
 	    dialogContact.setOwnerActivity(ContactList.this);
 	    dialogContact.show();
 	    return true;
@@ -528,7 +528,7 @@
 			break;
 		    default:
 			imageDrawable = getResources().getDrawable(R.drawable.error);
-		    break;
+			break;
 		}
 		imgV.setImageDrawable(imageDrawable);
 
--- a/src/com/beem/project/beem/ui/SendIMDialogSmiley.java	Thu Oct 01 17:24:45 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIMDialogSmiley.java	Thu Oct 01 17:43:56 2009 +0200
@@ -5,6 +5,9 @@
 
 import com.beem.project.beem.R;
 
+/**
+ * Class to show smiley in sendim.
+ */
 public class SendIMDialogSmiley extends Dialog {
 
     @SuppressWarnings("unused")
@@ -12,7 +15,12 @@
     @SuppressWarnings("unused")
     private SharedPreferences mSet;
 
-    public SendIMDialogSmiley(SendIM sendim, SharedPreferences settings) {
+    /**
+     * Constructor.
+     * @param sendim unused
+     * @param settings unused
+     */
+    public SendIMDialogSmiley(final SendIM sendim, final SharedPreferences settings) {
 	super(sendim);
 	this.mSendIM = sendim;
 	this.mSet = settings;
--- a/src/com/beem/project/beem/ui/UserInfo.java	Thu Oct 01 17:24:45 2009 +0200
+++ b/src/com/beem/project/beem/ui/UserInfo.java	Thu Oct 01 17:43:56 2009 +0200
@@ -16,7 +16,6 @@
 import android.os.Bundle;
 import android.os.IBinder;
 import android.os.RemoteException;
-import android.util.Log;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.BaseAdapter;
@@ -116,6 +115,9 @@
 
     }
 
+    /**
+     * Create dialog alias.
+     */
     public class DialogAlias extends Dialog {
 
 	/**
@@ -134,8 +136,17 @@
 	    ok.setOnClickListener(new ContactDialogAliasDialogOK());
 	}
 
+	/**
+	 * Event click on the button OK.
+	 */
 	private class ContactDialogAliasDialogOK implements View.OnClickListener {
 
+	    /**
+	     * Constructor.
+	     */
+	    public ContactDialogAliasDialogOK() {
+	    }
+
 	    @Override
 	    public void onClick(View v) {
 		IRoster r;
@@ -168,8 +179,9 @@
 	/**
 	 * Constructor.
 	 * @param c context activity.
+	 * @param listGroup the user group list.
 	 */
-	public BeemGroups(final Context c, List<String> listGroup) {
+	public BeemGroups(final Context c, final List<String> listGroup) {
 	    mContext = c;
 	    if (listGroup.size() == 0)
 		listGroup.add("No Group");
@@ -238,7 +250,7 @@
     }
 
     /**
-     * Event simple click on layout delete
+     * Event simple click on layout delete.
      */
     class DeleteListener implements View.OnClickListener {