// Path: src/main/java/com/inovex/zabbixmobile/adapters/ChecksItemsListAdapter.java
// public class ChecksItemsListAdapter extends BaseServiceAdapter<Item> {
// 
// 	private static final String TAG = ChecksItemsListAdapter.class
// 			.getSimpleName();
// 	private int mTextViewResourceId = R.layout.list_item_items;
// 
// 	/**
// 	 * Constructor.
// 	 * 
// 	 * @param service
// 	 * @param textViewResourceId
// 	 */
// 	public ChecksItemsListAdapter(ZabbixDataService service) {
// 		super(service);
// 	}
// 
// 	@Override
// 	public View getView(int position, View convertView, ViewGroup parent) {
// 		View row = convertView;
// 
// 		if (row == null) {
// 			row = getInflater().inflate(mTextViewResourceId, parent, false);
// 
// 		}
// 
// 		TextView clock = (TextView) row.findViewById(R.id.item_clock);
// 		TextView name = (TextView) row.findViewById(R.id.item_name);
// 		TextView value = (TextView) row.findViewById(R.id.item_value);
// 
// 		Item i = getItem(position);
// 
// 		Calendar cal = Calendar.getInstance();
// 		cal.setTimeInMillis(i.getLastClock());
// 		DateFormat dateFormatter = SimpleDateFormat.getDateTimeInstance(
// 				SimpleDateFormat.SHORT, SimpleDateFormat.SHORT,
// 				Locale.getDefault());
// 		clock.setText(dateFormatter.format(cal.getTime()));
// 		name.setText(i.getDescription());
// 		value.setText(i.getLastValue() + " " + i.getUnits());
// 
// 		return row;
// 	}
// 
// 	@Override
// 	public long getItemId(int position) {
// 		Item item = getItem(position);
// 		if(item != null)
// 			return item.getId();
// 		return 0;
// 	}
// 
// }
// 
// Path: src/main/java/com/inovex/zabbixmobile/listeners/OnChecksItemSelectedListener.java
// public interface OnChecksItemSelectedListener {
// 
// 	/**
// 	 * Callback method for the selection of a host.
// 	 * 
// 	 * @param position
// 	 *            list position
// 	 * @param id
// 	 *            event ID (Zabbix event_id)
// 	 */
// 	public void onHostSelected(int position, long id);
// 
// 	/**
// 	 * Callback method for the selection of an application.
// 	 * 
// 	 * @param position
// 	 *            list position
// 	 */
// 	public void onApplicationSelected(int position);
// 
// 	/**
// 	 * Callback method for the selection of an item.
// 	 * 
// 	 * @param position
// 	 *            list position
// 	 * @param item
// 	 *            the selected item
// 	 * @param showItemDetails
// 	 *            whether or not the item details shall be shown (at activity
// 	 *            startup, the details shall not be shown)
// 	 */
// 	public void onItemSelected(int position, Item item, boolean showItemDetails);
// 
// }


import com.inovex.zabbixmobile.listeners.OnChecksItemSelectedListener;
import com.inovex.zabbixmobile.listeners.OnItemsLoadedListener;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.inovex.zabbixmobile.R;
import com.inovex.zabbixmobile.adapters.ChecksItemsListAdapter;
	protected void setupListAdapter() {
		if(mListAdapter == null){
			mZabbixDataService.loadItemsByApplicationId(
					mApplicationID, this);
			showListLoadingSpinner();
		}
	}

	@Override
	public void onListItemClick(ListView l, View v, int position, long id) {
		mCallbackMain.onItemSelected(position, mListAdapter.getItem(position),
				true);
	}

	public void setTitle(String title) {
		this.mTitle = title;
	}

	public String getTitle() {
		return mTitle;
	}

	public void uncheckCurrentItem() {
		if (getView() != null && getListView() != null)
			getListView().setItemChecked(mListAdapter.getCurrentPosition(),
					false);
	}

	@Override
	public void onItemsLoaded() {
// Path: src/main/java/com/inovex/zabbixmobile/adapters/ChecksItemsListAdapter.java
// public class ChecksItemsListAdapter extends BaseServiceAdapter<Item> {
// 
// 	private static final String TAG = ChecksItemsListAdapter.class
// 			.getSimpleName();
// 	private int mTextViewResourceId = R.layout.list_item_items;
// 
// 	/**
// 	 * Constructor.
// 	 * 
// 	 * @param service
// 	 * @param textViewResourceId
// 	 */
// 	public ChecksItemsListAdapter(ZabbixDataService service) {
// 		super(service);
// 	}
// 
// 	@Override
// 	public View getView(int position, View convertView, ViewGroup parent) {
// 		View row = convertView;
// 
// 		if (row == null) {
// 			row = getInflater().inflate(mTextViewResourceId, parent, false);
// 
// 		}
// 
// 		TextView clock = (TextView) row.findViewById(R.id.item_clock);
// 		TextView name = (TextView) row.findViewById(R.id.item_name);
// 		TextView value = (TextView) row.findViewById(R.id.item_value);
// 
// 		Item i = getItem(position);
// 
// 		Calendar cal = Calendar.getInstance();
// 		cal.setTimeInMillis(i.getLastClock());
// 		DateFormat dateFormatter = SimpleDateFormat.getDateTimeInstance(
// 				SimpleDateFormat.SHORT, SimpleDateFormat.SHORT,
// 				Locale.getDefault());
// 		clock.setText(dateFormatter.format(cal.getTime()));
// 		name.setText(i.getDescription());
// 		value.setText(i.getLastValue() + " " + i.getUnits());
// 
// 		return row;
// 	}
// 
// 	@Override
// 	public long getItemId(int position) {
// 		Item item = getItem(position);
// 		if(item != null)
// 			return item.getId();
// 		return 0;
// 	}
// 
// }
// 
// Path: src/main/java/com/inovex/zabbixmobile/listeners/OnChecksItemSelectedListener.java
// public interface OnChecksItemSelectedListener {
// 
// 	/**
// 	 * Callback method for the selection of a host.
// 	 * 
// 	 * @param position
// 	 *            list position
// 	 * @param id
// 	 *            event ID (Zabbix event_id)
// 	 */
// 	public void onHostSelected(int position, long id);
// 
// 	/**
// 	 * Callback method for the selection of an application.
// 	 * 
// 	 * @param position
// 	 *            list position
// 	 */
// 	public void onApplicationSelected(int position);
// 
// 	/**
// 	 * Callback method for the selection of an item.
// 	 * 
// 	 * @param position
// 	 *            list position
// 	 * @param item
// 	 *            the selected item
// 	 * @param showItemDetails
// 	 *            whether or not the item details shall be shown (at activity
// 	 *            startup, the details shall not be shown)
// 	 */
// 	public void onItemSelected(int position, Item item, boolean showItemDetails);
// 
// }


// Path: src/main/java/com/inovex/zabbixmobile/activities/fragments/ChecksApplicationsPage.java
import com.inovex.zabbixmobile.listeners.OnChecksItemSelectedListener;
import com.inovex.zabbixmobile.listeners.OnItemsLoadedListener;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.inovex.zabbixmobile.R;
import com.inovex.zabbixmobile.adapters.ChecksItemsListAdapter;

	protected void setupListAdapter() {
		if(mListAdapter == null){
			mZabbixDataService.loadItemsByApplicationId(
					mApplicationID, this);
			showListLoadingSpinner();
		}
	}

	@Override
	public void onListItemClick(ListView l, View v, int position, long id) {
		mCallbackMain.onItemSelected(position, mListAdapter.getItem(position),
				true);
	}

	public void setTitle(String title) {
		this.mTitle = title;
	}

	public String getTitle() {
		return mTitle;
	}

	public void uncheckCurrentItem() {
		if (getView() != null && getListView() != null)
			getListView().setItemChecked(mListAdapter.getCurrentPosition(),
					false);
	}

	@Override
	public void onItemsLoaded() {
		this.mListAdapter = mZabbixDataService.getChecksItemsListAdapter(mApplicationID);