package kiyut.sketsa.modules.emoticonsymbol;

import kiyut.sketsa.api.symbollibrary.SymbolLibrary;
import org.openide.modules.ModuleInstall;
import org.openide.util.Lookup;

/**
 *
 * @author Kiyut
 */
public class EmoticonSymbolModuleInstall extends ModuleInstall {
    
    SmileSymbol smileSymbol = new SmileSymbol();
    FrownSymbol frownSymbol = new FrownSymbol();
    AngrySymbol angrySymbol = new AngrySymbol();
    
    /** Add emoticon symbols to the SymbolLibrary
     * {@inheritDoc} */
    @Override
    public void restored() {
        super.restored();
        
        SymbolLibrary lib = (SymbolLibrary)Lookup.getDefault().lookup(SymbolLibrary.class);
        lib.addSymbol(smileSymbol);
        lib.addSymbol(frownSymbol);
        lib.addSymbol(angrySymbol);
    }
    
    /** Remove the added emoticon symbols  
     * {@inheritDoc} */
    @Override
    public void uninstalled() {
        SymbolLibrary lib = (SymbolLibrary)Lookup.getDefault().lookup(SymbolLibrary.class);
        lib.removeSymbol(smileSymbol);
        lib.removeSymbol(frownSymbol);
        lib.removeSymbol(angrySymbol);
    }
    
}
