package kiyut.alkitab.windows;

import kiyut.alkitab.api.BookViewer;
import kiyut.alkitab.api.SwordURI;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;
import org.openide.windows.TopComponent;

/**
 *
 * 
 */
public abstract class BookViewerTopComponent extends TopComponent {
    protected InstanceContent instanceContent = null;
    
    protected BookViewer bookViewer;
    
    public BookViewerTopComponent() {
        instanceContent = new InstanceContent();
        associateLookup(new AbstractLookup(instanceContent));
    }
    
    public abstract BookViewer getBookViewer();
    
    public abstract void openURI(SwordURI uri);

    
    @Override
    public void componentActivated() {
        
    }
    
    @Override
    public void componentOpened() {
        instanceContent.add(bookViewer);
    }
    
    @Override
    public void componentClosed() {
        instanceContent.remove(bookViewer);
    }
}
