TestXPageManager.java :  » XML-UI » XUI » net » xoetrope » xui » test » Java Open Source

Java Open Source » XML UI » XUI 
XUI » net » xoetrope » xui » test » TestXPageManager.java
package net.xoetrope.xui.test;

import java.awt.Container;

import junit.framework.TestCase;
import net.xoetrope.awt.XApplet;
import net.xoetrope.xui.XPage;
import net.xoetrope.xui.XPageDisplay;
import net.xoetrope.xui.XPageManager;
import net.xoetrope.xui.XTarget;
import net.xoetrope.xui.XProjectManager;

/**
 * Title:        XUI
 * Description:
 * Copyright (c) Xoetrope Ltd., 1998-2004
 * @version 1.0
 */
public class TestXPageManager extends TestCase implements XPageDisplay
{
  XPageManager pageMgr;
  public TestXPageManager() {
  }

  public void testLoadPage()
  {
    XApplet testApplet = new XApplet();
    pageMgr = XProjectManager.getPageManager();
    pageMgr.setPackageName( "net.xoetrope.xui.test." );
    pageMgr.setPageDisplay( testApplet );
    pageMgr.showPage( "PageTester" );
  }

  public XPage displayPage( XPage page )
  {
    System.out.println( page.getName() );
    return null;
  }

  public XPage displayPage( XPage page, String target )
  {
    System.out.println( "Page: " + page.getName() + ", target: " + target );
    return null;
  }

  /**
   * Adds a frame to the frameset
   * @param frame the new traget frame
   * @param constraint the BorderLayout constraint
   */
  public void addTarget( XTarget frame, Object constraint )
  {
    System.out.println( "addTarget: " + frame.getName() + ", " + constraint.toString());
  }

  /**
   * Get a named frame/target from the current frameset
   * @param name the name of the frame
   * @return the target frame
   */
  public Container findTarget( String name )
  {
    System.out.println( "findTarget: " + name );
    return null;
  }

  /**
   * Get the number of frame/target from the current frameset
   * @return the number of target frames
   */
  public int getNumTargets()
  {
    System.out.println( "getNumTargets " );
    return 0;
  }

  /**
   * Get the target for a page display request
   * @param idx the target area
   * @return the container to be updated
   */
  public Container getTarget( int idx )
  {
    System.out.println( "getTarget: " + idx );
    return null;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.