Package org.geoforge.plgbackuprestore4gfr

Source Code of org.geoforge.plgbackuprestore4gfr.GfrPlgImplActsBckRstSpcWrk

/*
*  Copyright (C) 2011-2014 GeoForge Project
*
*  This program 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 2
*  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, write to the Free Software
*  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package org.geoforge.plgbackuprestore4gfr;

import java.util.Arrays;
import java.util.HashSet;
import javax.help.HelpBroker;
import javax.swing.Action;
import javax.swing.ImageIcon;
import net.xeoh.plugins.base.annotations.PluginImplementation;
import org.geoforge.java.enumeration.GfrEnuSystemPropertiesKeys;
import org.geoforge.mgrplg.handler.IGfrHandlerPluginActionsTopSpaceRoot;
import org.geoforge.mgrplg.handler.IGfrHandlerPluginHelp;
import org.geoforge.mgrplg.impl.GfrPlgImplActsAbs;
import org.geoforge.plgbackuprestore4gfr.awt.image.GfrFactoryIconPlg;
import org.geoforge.plgbackuprestore4gfr.swing.action.GfrActPlgBckRstSpcWrks;
import org.geoforge.plgbackuprestore4gfr.swing.help.GfrHlpPlgBackupRestore;

/**
*
* @author bantchao@gmail.com
*
* !!! "Acts": not needed !!!
*/
@PluginImplementation // ATTN: required, even if already added in superclass
public class GfrPlgImplActsBckRstSpcWrk extends GfrPlgImplActsAbs implements
        IGfrHandlerPluginActionsTopSpaceRoot,
        IGfrHandlerPluginHelp
{
   final static private String _STR_VERSION_THIS_ = "0.1";
  
   public GfrPlgImplActsBckRstSpcWrk()
   {
      super(_STR_VERSION_THIS_);
   }
  
   @Override
    public String getUrlHomePagePlugin()
    {
        return System.getProperty(GfrEnuSystemPropertiesKeys.URL_HOME_ORG.getLabel());
    }

    @Override
    public String getEmailAddressContactPlugin()
    {
        return System.getProperty(GfrEnuSystemPropertiesKeys.EMAIL_CONTACT_ORG.getLabel());
    }

   @Override
   public String getNamePlugin() { return "Backup/Restore workspaces"; }

   @Override
   public String getAuthorPlugin() { return "bantchao@geoforge.org"; }
  
   @Override
   public String getDescriptionPlugin()
   {
      return "All in title ...";
   }

   @Override
   public Action[] createActionsPluginTopSpaceRoot() throws Exception
   {
      Action[] acts =
      {
         new GfrActPlgBckRstSpcWrks()
      };
     
      super._hstActions.addAll(Arrays.asList(acts));    
      return acts;
   }

   @Override
   public void destroyActionsPluginTopSpaceRoot(Action[] actsSource)
   {
      if (super._hstActions==null || super._hstActions.isEmpty())
         return;
     
      HashSet<Action> hstToDestroy = new HashSet<Action>();
     
      for (Action actCurTarget: super._hstActions)
      {
         for (Action actCurSource: actsSource)
         {
            if (actCurSource != actCurTarget)
               continue;
           
            hstToDestroy.add(actCurSource);
            break;
         }
      }
     
      for (Action actCur: hstToDestroy)
         super._hstActions.remove(actCur);
   }
  
   @Override
   public HelpBroker getHelpBrokerHelpPlugin()
   {
      return GfrHlpPlgBackupRestore.s_getInstance().getHelpBroker();
   }

   @Override
   public String getIdHelpPlugin()
   {
      return GfrHlpPlgBackupRestore.s_getInstance().getId();
   }

   @Override
   public String getLabelHelpPlugin()
   {
      return GfrHlpPlgBackupRestore.s_getInstance().getLabel();
   }

   @Override
   public ImageIcon getImageIconHelpPlugin()
   {
      return GfrFactoryIconPlg.s_getIconBackupRestore();
   }
}
TOP

Related Classes of org.geoforge.plgbackuprestore4gfr.GfrPlgImplActsBckRstSpcWrk

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.