001package com.ericlam.mc.eldgui.view;
002
003/**
004 * 跳轉界面
005 */
006public class BukkitRedirectView extends BukkitView<BukkitRedirectView.RedirectView, String> {
007
008    private final boolean customTransition;
009
010    /**
011     *
012     * @param redirectTo 要跳轉的 controller id
013     */
014    public BukkitRedirectView(String redirectTo) {
015        super(RedirectView.class, redirectTo);
016        this.customTransition = false;
017    }
018
019    /**
020     * 連帶轉換界面的跳轉界面
021     * @param transitionView 轉換界面(跳轉過程很快,可能看不見)
022     * @param redirectTo 要跳轉的 controller id
023     */
024    @SuppressWarnings("unchecked")
025    public BukkitRedirectView(Class<? extends RedirectView> transitionView, String redirectTo) {
026        super((Class<RedirectView>) transitionView, redirectTo);
027        this.customTransition = true;
028    }
029
030    public String getRedirectTo(){
031        return getModel();
032    }
033
034    public boolean isCustomTransition() {
035        return customTransition;
036    }
037
038    /**
039     * 跳轉界面接口。如果要跳轉界面,請實作它
040     */
041    public interface RedirectView extends View<String> {
042    }
043
044}