All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.solovyev.android.menu.EnumMenu Maven / Gradle / Ivy

There is a newer version: 1.1.18
Show newest version
/*
 * Copyright (c) 2009-2011. Created by serso aka se.solovyev.
 * For more information, please, contact [email protected]
 * or visit http://se.solovyev.org
 */

package org.solovyev.android.menu;

import android.content.Context;
import org.jetbrains.annotations.NotNull;

/**
 * User: serso
 * Date: 12/18/11
 * Time: 1:34 PM
 */
public class EnumMenu, D> implements AMenu {

	@NotNull
	private final AMenu menu;

	@NotNull
	public static , D> AMenu newInstance(@NotNull Class enumClass) {
		return new EnumMenu(enumClass);
	}

	private EnumMenu(Class enumClass) {
		this.menu = MenuImpl.newInstance(enumClass.getEnumConstants());
	}

	@Override
	public T itemAt(int i) {
		return this.menu.itemAt(i);
	}

	@NotNull
	@Override
	public CharSequence[] getMenuCaptions(@NotNull final Context context) {
		return this.menu.getMenuCaptions(context);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy