extensions/net.sf.basedb.opengrid/trunk/src/net/sf/basedb/opengrid/service/OpenGridServiceConfigureFactory.java

Code
Comments
Other
Rev Date Author Line
4314 20 Jan 17 nicklas 1 package net.sf.basedb.opengrid.service;
4314 20 Jan 17 nicklas 2
4314 20 Jan 17 nicklas 3 import net.sf.basedb.clients.web.extensions.toolbar.ButtonAction;
4314 20 Jan 17 nicklas 4 import net.sf.basedb.clients.web.extensions.toolbar.FixedButtonFactory;
4314 20 Jan 17 nicklas 5 import net.sf.basedb.util.extensions.ActionFactory;
4314 20 Jan 17 nicklas 6 import net.sf.basedb.util.extensions.InvokationContext;
4314 20 Jan 17 nicklas 7
4314 20 Jan 17 nicklas 8 /**
4314 20 Jan 17 nicklas 9   Action factory that creates a "Configure" button in the "Action" 
4314 20 Jan 17 nicklas 10   column for the Open Grid service. This extension is intended to 
4314 20 Jan 17 nicklas 11   be added to the "net.sf.basedb.clients.web.services.list.actions"
4314 20 Jan 17 nicklas 12   extension point and adds the button if the current action is
4314 20 Jan 17 nicklas 13   an instance of {@link OpenGridServiceFactory.OpenGridServiceControllerAction}.
4314 20 Jan 17 nicklas 14
4314 20 Jan 17 nicklas 15   @author nicklas
4314 20 Jan 17 nicklas 16   @since 1.0
4314 20 Jan 17 nicklas 17 */
4314 20 Jan 17 nicklas 18 public class OpenGridServiceConfigureFactory 
4314 20 Jan 17 nicklas 19   extends FixedButtonFactory
4314 20 Jan 17 nicklas 20   implements ActionFactory<ButtonAction>
4314 20 Jan 17 nicklas 21 {
4314 20 Jan 17 nicklas 22
4314 20 Jan 17 nicklas 23   public OpenGridServiceConfigureFactory()
4314 20 Jan 17 nicklas 24   {}
4314 20 Jan 17 nicklas 25   
4314 20 Jan 17 nicklas 26   /*
4314 20 Jan 17 nicklas 27     From the ActionFactory interface
4314 20 Jan 17 nicklas 28     --------------------------------
4314 20 Jan 17 nicklas 29   */
4314 20 Jan 17 nicklas 30   @Override
4314 20 Jan 17 nicklas 31   public ButtonAction[] getActions(InvokationContext<? super ButtonAction> context)
4314 20 Jan 17 nicklas 32   {
4314 20 Jan 17 nicklas 33     ButtonAction[] actions = null;
4314 20 Jan 17 nicklas 34     if (context.getClientContext().getCurrentItem() instanceof OpenGridServiceFactory.OpenGridServiceControllerAction)
4314 20 Jan 17 nicklas 35     {
4314 20 Jan 17 nicklas 36       actions = super.getActions(context);
4314 20 Jan 17 nicklas 37     }
4314 20 Jan 17 nicklas 38     return actions;
4314 20 Jan 17 nicklas 39   }
4314 20 Jan 17 nicklas 40   // ---------------------------------------------
4314 20 Jan 17 nicklas 41
4314 20 Jan 17 nicklas 42
4314 20 Jan 17 nicklas 43 }