// Path: src/main/java/com/inovex/zabbixmobile/adapters/ChecksApplicationsPagerAdapter.java
// public class ChecksApplicationsPagerAdapter extends
// 		BaseServicePagerAdapter<Application> {
// 
// 	private static final String TAG = ChecksApplicationsPagerAdapter.class
// 			.getSimpleName();
// 
// 	@Override
// 	public CharSequence getPageTitle(int position) {
// 		Application application = getObject(position);
// 		if(application != null){
// 			return application.getName();
// 		} else {
// 			return  "";
// 		}
// 	}
// 
// 	@Override
// 	public Long getItemId(int position) {
// 		if (getObject(position) == null)
// 			return null;
// 		return getObject(position).getId();
// 	}
// 
// 	@Override
// 	protected Fragment getItem(int position) {
// 		ChecksApplicationsPage p = new ChecksApplicationsPage();
// 		Bundle args = new Bundle();
// 		args.putLong("applicationID",getObject(position).getId());
// 		p.setArguments(args);
// 		return p;
// 	}
// 
// 	@Override
// 	public int getItemPosition(Object object) {
// 		// This prevents caching of fragments. We need to disable caching
// 		// because we have only one adapter which is reused when another host is
// 		// selected.
// 		return POSITION_NONE;
// 	}
// 
// }
// 
// 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.R;
import com.inovex.zabbixmobile.adapters.ChecksApplicationsPagerAdapter;
import com.inovex.zabbixmobile.listeners.OnChecksItemSelectedListener;
import com.inovex.zabbixmobile.listeners.OnItemsLoadedListener;
import com.inovex.zabbixmobile.model.Host;
import android.app.Activity;
import android.content.ComponentName;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
/*
This file is part of ZAX.

	ZAX is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	ZAX is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with ZAX.  If not, see <http://www.gnu.org/licenses/>.
*/

package com.inovex.zabbixmobile.activities.fragments;



/**
 * Fragment showing the applications of a particular host.
 * 
 * In particular, this includes a view pager with one page for each application.
 * Each page contains a list of items.
 * 
 */
public class ChecksApplicationsFragment extends BaseServiceConnectedFragment
		implements OnItemsLoadedListener {

	public static final String TAG = ChecksApplicationsFragment.class
			.getSimpleName();

	private Host mHost;
	private boolean mApplicationsProgressBarVisible = true;
	private boolean mItemsLoadingSpinnerVisible = true;

	private static final String ARG_APPLICATIONS_SPINNER_VISIBLE = "arg_applications_spinner_visible";
	private static final String ARG_ITEMS_SPINNER_VISIBLE = "arg_items_spinner_visible";

	private TextView mTitleView;

	protected ViewPager mApplicationsPager;
	protected ChecksApplicationsPagerAdapter mApplicationsPagerAdapter;

// Path: src/main/java/com/inovex/zabbixmobile/adapters/ChecksApplicationsPagerAdapter.java
// public class ChecksApplicationsPagerAdapter extends
// 		BaseServicePagerAdapter<Application> {
// 
// 	private static final String TAG = ChecksApplicationsPagerAdapter.class
// 			.getSimpleName();
// 
// 	@Override
// 	public CharSequence getPageTitle(int position) {
// 		Application application = getObject(position);
// 		if(application != null){
// 			return application.getName();
// 		} else {
// 			return  "";
// 		}
// 	}
// 
// 	@Override
// 	public Long getItemId(int position) {
// 		if (getObject(position) == null)
// 			return null;
// 		return getObject(position).getId();
// 	}
// 
// 	@Override
// 	protected Fragment getItem(int position) {
// 		ChecksApplicationsPage p = new ChecksApplicationsPage();
// 		Bundle args = new Bundle();
// 		args.putLong("applicationID",getObject(position).getId());
// 		p.setArguments(args);
// 		return p;
// 	}
// 
// 	@Override
// 	public int getItemPosition(Object object) {
// 		// This prevents caching of fragments. We need to disable caching
// 		// because we have only one adapter which is reused when another host is
// 		// selected.
// 		return POSITION_NONE;
// 	}
// 
// }
// 
// 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/ChecksApplicationsFragment.java
import com.inovex.zabbixmobile.R;
import com.inovex.zabbixmobile.adapters.ChecksApplicationsPagerAdapter;
import com.inovex.zabbixmobile.listeners.OnChecksItemSelectedListener;
import com.inovex.zabbixmobile.listeners.OnItemsLoadedListener;
import com.inovex.zabbixmobile.model.Host;
import android.app.Activity;
import android.content.ComponentName;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;

/*
This file is part of ZAX.

	ZAX is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	ZAX is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with ZAX.  If not, see <http://www.gnu.org/licenses/>.
*/

package com.inovex.zabbixmobile.activities.fragments;



/**
 * Fragment showing the applications of a particular host.
 * 
 * In particular, this includes a view pager with one page for each application.
 * Each page contains a list of items.
 * 
 */
public class ChecksApplicationsFragment extends BaseServiceConnectedFragment
		implements OnItemsLoadedListener {

	public static final String TAG = ChecksApplicationsFragment.class
			.getSimpleName();

	private Host mHost;
	private boolean mApplicationsProgressBarVisible = true;
	private boolean mItemsLoadingSpinnerVisible = true;

	private static final String ARG_APPLICATIONS_SPINNER_VISIBLE = "arg_applications_spinner_visible";
	private static final String ARG_ITEMS_SPINNER_VISIBLE = "arg_items_spinner_visible";

	private TextView mTitleView;

	protected ViewPager mApplicationsPager;
	protected ChecksApplicationsPagerAdapter mApplicationsPagerAdapter;

	private OnChecksItemSelectedListener mCallbackMain;