// Path: at.attentec.com/android/at.attentec.client/src/com/attentec/Status.java
// class StatusIterator implements Iterator<Status> {
// 	//Start on online instead of offline since it is weird to set you own status to offline when you are online.
// 	private int current = STATUS_ONLINE;
// 	private Status status;
// 
// 	/**
// 	 * Create an iterator.
// 	 * @param myStatus the status that should be cloned for iterating through.
// 	 */
// 	public StatusIterator(final Status myStatus) {
// 		try {
// 			status = myStatus.clone();
// 		} catch (CloneNotSupportedException e) {
// 			Log.e(TAG, "StatusIterator can't clone MyStatus:" + e.getMessage());
// 		}
// 	}
// 
// 	/**
// 	 * Checks if there are any more status type to fetch.
// 	 * @return true if has next
// 	 */
// 	public boolean hasNext() {
// 		return current <= Status.STATUS_AWAY;
// 	}
// 
// 	/**
// 	 * Get the next status.
// 	 * @return next status
// 	 */
// 	public Status next() {
// 		if (hasNext()) {
// 			status.updateStatus(current++, "");
// 			return status;
// 		} else {
// 			return null;
// 		}
// 	}
// 
// 	/**
// 	 * Is not implemented.
// 	 */
// 	public void remove() {
// 		//DO nothing
// 	}
// }


import com.attentec.Status.StatusIterator;
import java.util.ArrayList;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
/***
 * Copyright (c) 2010 Attentec AB, http://www.attentec.se
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.attentec;





/**
 * Creates Status dialog.
 * @author David Granqvist
 * @author Malte Lenz
 * @author Johannes Nordkvist
 *
 */
public class StatusDialogCreator {
		/** Tag used for logging. */
		private static final String TAG = "Attentec->StatusDialogCreator";

		private Context mContext;
		private Status mStatus;

		/**
		 * Constructor for creating status dialog.
		 * @param ctx the contect
		 * @param myStatus The my status object that should be changed.
		 */
		public StatusDialogCreator(final Context ctx, final Status myStatus) {
			mContext = ctx;
			mStatus = myStatus;
		}

		/**
		 * Create the dialog that should be shown and return it.
		 * @return the dialog
		 */
		public final Dialog getDialog() {
			Dialog dialog;
			AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
			Resources mRes = mContext.getResources();
			builder.setIcon(android.R.color.transparent);
			builder.setTitle(mRes.getString(R.string.my_status));

			builder.setNegativeButton(mContext.getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
				public void onClick(final DialogInterface dialog, final int whichButton) {
					dialog.cancel();
				}
			});

			final ArrayList<Status> items = new ArrayList<Status>();

// Path: at.attentec.com/android/at.attentec.client/src/com/attentec/Status.java
// class StatusIterator implements Iterator<Status> {
// 	//Start on online instead of offline since it is weird to set you own status to offline when you are online.
// 	private int current = STATUS_ONLINE;
// 	private Status status;
// 
// 	/**
// 	 * Create an iterator.
// 	 * @param myStatus the status that should be cloned for iterating through.
// 	 */
// 	public StatusIterator(final Status myStatus) {
// 		try {
// 			status = myStatus.clone();
// 		} catch (CloneNotSupportedException e) {
// 			Log.e(TAG, "StatusIterator can't clone MyStatus:" + e.getMessage());
// 		}
// 	}
// 
// 	/**
// 	 * Checks if there are any more status type to fetch.
// 	 * @return true if has next
// 	 */
// 	public boolean hasNext() {
// 		return current <= Status.STATUS_AWAY;
// 	}
// 
// 	/**
// 	 * Get the next status.
// 	 * @return next status
// 	 */
// 	public Status next() {
// 		if (hasNext()) {
// 			status.updateStatus(current++, "");
// 			return status;
// 		} else {
// 			return null;
// 		}
// 	}
// 
// 	/**
// 	 * Is not implemented.
// 	 */
// 	public void remove() {
// 		//DO nothing
// 	}
// }


// Path: at.attentec.com/android/at.attentec.client/src/com/attentec/StatusDialogCreator.java
import com.attentec.Status.StatusIterator;
import java.util.ArrayList;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

/***
 * Copyright (c) 2010 Attentec AB, http://www.attentec.se
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.attentec;





/**
 * Creates Status dialog.
 * @author David Granqvist
 * @author Malte Lenz
 * @author Johannes Nordkvist
 *
 */
public class StatusDialogCreator {
		/** Tag used for logging. */
		private static final String TAG = "Attentec->StatusDialogCreator";

		private Context mContext;
		private Status mStatus;

		/**
		 * Constructor for creating status dialog.
		 * @param ctx the contect
		 * @param myStatus The my status object that should be changed.
		 */
		public StatusDialogCreator(final Context ctx, final Status myStatus) {
			mContext = ctx;
			mStatus = myStatus;
		}

		/**
		 * Create the dialog that should be shown and return it.
		 * @return the dialog
		 */
		public final Dialog getDialog() {
			Dialog dialog;
			AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
			Resources mRes = mContext.getResources();
			builder.setIcon(android.R.color.transparent);
			builder.setTitle(mRes.getString(R.string.my_status));

			builder.setNegativeButton(mContext.getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
				public void onClick(final DialogInterface dialog, final int whichButton) {
					dialog.cancel();
				}
			});

			final ArrayList<Status> items = new ArrayList<Status>();

			StatusIterator statusIterator = mStatus.getIterator();