
org.japura.debug.DebugWindowController Maven / Gradle / Ivy
Show all versions of japura-debug Show documentation
package org.japura.debug;
import org.japura.controller.Context;
import org.japura.controller.Controller;
import org.japura.controller.DefaultController;
import org.japura.controller.annotations.ContextName;
import org.japura.controller.annotations.GroupName;
import org.japura.controller.annotations.Singleton;
import org.japura.debug.controllers.DebugControllerManager;
import org.japura.debug.tasks.DebugTasks;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
*
* Copyright (C) 2012-2015 Carlos Eduardo Leite de Andrade
*
* This library is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This program 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see www.gnu.org/licenses/
*
* For more information, contact: www.japura.org
*
*
* @author Carlos Eduardo Leite de Andrade
*/
@Singleton
@ContextName(name = "DEBUG")
@GroupName(name = "DebugWindow")
public class DebugWindowController extends DefaultController {
public DebugWindowController(Context context, Controller parentController) {
super(context, parentController);
setControllerName("DebugWindow");
createChild(DebugControllerManager.class);
createChild(DebugTasks.class);
}
@Override
public DebugWindow buildComponent() {
DebugWindow component = new DebugWindow();
component.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
free();
}
});
return component;
}
public void show() {
getComponent().setVisible(true);
getComponent().updateTabTitles();
}
}