// ---------------------------------------------------------------------------
// This file has been generated by the Web Dynpro Code Generator
// DON'T MODIFY!!! CHANGES WILL BE LOST WHENEVER THE FILE GETS GENERATED AGAIN
// ---------------------------------------------------------------------------
package uwl.rss.subscriptions.ui.wdp;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import com.sap.tc.logging.Location;
import com.sap.tc.webdynpro.progmodel.api.*;
import com.sap.tc.webdynpro.progmodel.gci.*;
import com.sap.tc.webdynpro.progmodel.context.*;
import com.sap.tc.webdynpro.progmodel.gci.*;
import com.sap.tc.webdynpro.services.exceptions.WDRuntimeException;

public class InternalRssSubscriptions
  implements IPrivateRssSubscriptions, com.sap.tc.webdynpro.progmodel.gci.IGCIComponentDelegate
{

  /**
   * Location for this controller.
   */
  private static final Location logger = Location.getLocation(InternalRssSubscriptions.class);

  /**
   * Framework implementation of Controller that delegates to this.
   */
  private final com.sap.tc.webdynpro.progmodel.gci.IGCIComponent wdAlterEgo;

  /**
   * Delegate that implements application defined logic
   */
  private final uwl.rss.subscriptions.ui.RssSubscriptions delegate;


  // ---- Context --------------------------------------------------------------

  IGCINodeInfo infoContext;

  {

    infoContext = GCIContext.createNode("Context", null, true, true, false, true, false, true, null,
      (IGCIAttributeInfo[])null, // no attributes
      (IGCINodeInfo[])null // no child nodes
    );

  }
  
  private IContextNode contextNode;

  private void wdInitContextNode() {
    contextNode = new IContextNode(this, infoContext, (Node)null);
  }

  public IWDNode wdGetRootNode() {
    return contextNode;
  }

  public IContextNode wdGetContext() {
    return contextNode;
  }


  // ---- Actions --------------------------------------------------------------

  /**
   * Create a new action for this controller. A unique name for the action is generated automatially.
   * @param eventHandler is the action's eventhandler with proper signature
   * @param text is the text displayed in the UI element triggering this action
   */
  public IWDAction wdCreateAction(WDActionEventHandler eventHandler, String text) {
    return wdAlterEgo.createAction(null, eventHandler, text, null);
  }

  /**
   * Create a new action with the given name for this controller
   * @param eventHandler is the action's eventhandler with proper signature
   * @param name is the action's name
   * @param text is the text displayed in the UI element triggering this action
   */
  public IWDAction wdCreateNamedAction(WDActionEventHandler eventHandler, String name, String text) {
    return wdAlterEgo.createAction(name, eventHandler, text, null);
  }

  // ---- Controller part ------------------------------------------------------

  /**
   * Creates a new instance of this controller.
   */
  public InternalRssSubscriptions(com.sap.tc.webdynpro.progmodel.gci.IGCIComponent alterEgo) {
    this.wdAlterEgo = alterEgo;
    wdInitContextNode();
    this.delegate = new uwl.rss.subscriptions.ui.RssSubscriptions((IPrivateRssSubscriptions) this);
  }

  /**
   * Returns the public API for this controller instance.
   */
  public com.sap.tc.webdynpro.progmodel.api.IWDComponent wdGetAPI() {
    return (com.sap.tc.webdynpro.progmodel.api.IWDComponent) wdAlterEgo;
  }

  /**
   * Hook method called to initialize component controller.
   */
  public void wdDoInit() {
    logger.pathT("entering: wdDoInit");
    delegate.wdDoInit();
    logger.pathT("exiting: wdDoInit"); 
  }

  /**
   * Hook method called to clean up component controller.
   */
  public void wdDoExit() {
    logger.pathT("entering: wdDoExit");
    delegate.wdDoExit();
    logger.pathT("exiting: wdDoExit"); 
  }

  /**
   * Hook called by framework in a request/response cycle each time before rendering starts
   */
  public void wdDoPostProcessing(boolean isCurrentRoot) {
    logger.pathT("entering: wdDoPostProcessing");
    delegate.wdDoPostProcessing(isCurrentRoot);
    logger.pathT("exiting: wdDoPostProcessing"); 
  }

  /**
   * Hook called by framework in a request/response cycle each time before the navigation queue is processed
   */
  public void wdDoBeforeNavigation(boolean isCurrentRoot) {
    logger.pathT("entering: wdDoBeforeNavigation");
    delegate.wdDoBeforeNavigation(isCurrentRoot);
    logger.pathT("exiting: wdDoBeforeNavigation"); 
  }

  public Object wdInvokeEventHandler(String handlerName, IWDCustomEvent event)
    throws NoSuchMethodException {
    
    logger.pathT("entering: wdInvokeEventHandler", new Object[] { handlerName } );
    try {
      throw new NoSuchMethodException("Eventhandler " + handlerName + " not found for event " + event.getName());
    } finally {
      logger.pathT("exiting: wdInvokeEventHandler"); 
    }
  }


  public com.sap.tc.webdynpro.progmodel.api.IWDExternalControllerInterface wdGetExternalInterface() {
    return null;
  }
}
