Package org.geoforge.guillcogcecl.menu

Source Code of org.geoforge.guillcogcecl.menu.GfrMenPlgsSpotActTloImgsAreSecAbs

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.geoforge.guillcogcecl.menu;

import org.geoforge.guillc.menu.GfrMenPlgsSpotActTloAbs;
import java.util.logging.Logger;
import javax.swing.Action;
import javax.swing.JFrame;
import org.geoforge.guillc.frame.GfrFrmAbs;
import org.geoforge.guillc.menuitem.GfrMimActPlg;
import org.geoforge.guillc.menuitem.GfrMimAbs;
import org.geoforge.guillc.panel.GfrPnlStatusBarMain;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;
import org.geoforge.mgrplg.handler.IGfrHandlerPluginActionsTloImageGalleryAreaSec;
import org.geoforge.mgrplg.handler.IGfrHandlerPlugin;

/**
*
* @author robert
*
*/
abstract public class GfrMenPlgsSpotActTloImgsAreSecAbs extends GfrMenPlgsSpotActTloAbs
{
   // ----
    // begin: instantiate logger for this class
    final private static Logger _LOGGER_ = Logger.getLogger(GfrMenPlgsSpotActTloImgsAreSecAbs.class.getName());

    static
    {
        GfrMenPlgsSpotActTloImgsAreSecAbs._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
    }
  
   
    // ---
   
    private String _strIdViewer_ = null;
  
   protected GfrMenPlgsSpotActTloImgsAreSecAbs(String strIdTlo, String strIdViewer)
   {
      super(strIdTlo);
     
      this._strIdViewer_ = strIdViewer;
   }

   @Override
   protected void _add(IGfrHandlerPlugin plg)
   {
      if (! (plg instanceof IGfrHandlerPluginActionsTloImageGalleryAreaSec))
        return;
     
      if (! plg.isValidPlugin())
            return;
     
      if (_addValidated((IGfrHandlerPluginActionsTloImageGalleryAreaSec) plg))
      {
         if (! super.isEnabled())
            super.setEnabled(true);
      }
   }
  
   protected boolean _addValidated(IGfrHandlerPluginActionsTloImageGalleryAreaSec plg)
   {
      try
      {
         JFrame frmMainApp = GfrFrmAbs.s_getFrameOwner(GfrPnlStatusBarMain.s_getInstance());
         Action[] acts = plg.createActionsPluginTloImageGalleryAreaSec(super._strIdTlo, frmMainApp, this._strIdViewer_);

         for (Action actCur: acts)
         {
            GfrMimAbs mimCur = new GfrMimActPlg(actCur, (IGfrHandlerPlugin) plg);
           
            if (! mimCur.init())
            {
               String strWhat = "! mimCur.init()";
               GfrMenPlgsSpotActTloImgsAreSecAbs._LOGGER_.warning(strWhat);
               super._showDialogFailedPlugin(plg, strWhat);
               return false;
            }
           
            super.add(mimCur);
         }

         if (acts!=null && acts.length>0)
            return true;
        
         return false;
      }

      catch(Exception exc)
      {
         exc.printStackTrace();
         String strWhat = exc.getMessage();
         GfrMenPlgsSpotActTloImgsAreSecAbs._LOGGER_.warning(strWhat);
         super._showDialogFailedPlugin(plg, strWhat);
         return false;
      }

      catch(AbstractMethodError errAbstractMethod)
      {
         errAbstractMethod.printStackTrace();
         String strWhat = errAbstractMethod.getMessage();
         GfrMenPlgsSpotActTloImgsAreSecAbs._LOGGER_.warning(strWhat);
         super._showDialogFailedPlugin(plg, strWhat);
         return false;
      }
   }
}
TOP

Related Classes of org.geoforge.guillcogcecl.menu.GfrMenPlgsSpotActTloImgsAreSecAbs

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.