package seedu.address.ui;

import java.io.IOException;
import java.net.URL;

import javafx.fxml.FXMLLoader;
import seedu.address.MainApp;
import seedu.address.commons.core.EventsCenter;
import seedu.address.commons.events.BaseEvent;

/**
 * Base class for UI parts.
 * A 'UI part' represents a distinct part of the UI. e.g. Windows, dialogs, panels, status bars, etc.
 */
public class UiPart<T> {

    private final FXMLLoader loader;

    public UiPart(URL url) {
        assert url != null;
        loader = new FXMLLoader(url);
        loader.setController(this);
        try {
            loader.load();
        } catch (IOException e) {
            throw new RuntimeException("Unexpected exception occurred while loading " + url + ": " + e);
        }
        EventsCenter.getInstance().registerHandler(this);
    }

    public UiPart(String name) {
        this(MainApp.class.getResource(name));
    }

    /**
     * Raises the event via {@link EventsCenter#post(BaseEvent)}
     * @param event
     */
    protected void raise(BaseEvent event) {
        EventsCenter.getInstance().post(event);
    }

    public T getRoot() {
        return loader.getRoot();
    }
}

@@ -182,55 +182,8 @@
 ter;
-%0Aimport seedu.address.commons.events.BaseEvent;
 %0A%0A/*
@@ -859,208 +859,8 @@
  %7D%0A%0A
-    /**%0A     * Raises the event via %7B@link EventsCenter#post(BaseEvent)%7D%0A     * @param event%0A     */%0A    protected void raise(BaseEvent event) %7B%0A        EventsCenter.getInstance().post(event);%0A    %7D%0A%0A
     

remove raise()