⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uitabbedpane2.java

📁 It is a java server faces tab component.
💻 JAVA
字号:
package com.cim.jsf.component.tabbedPane2;

import javax.faces.context.FacesContext;
import com.cim.jsf.model.TabNode;
import javax.faces.el.ValueBinding;
import javax.faces.component.UIOutput;


public class UITabbedPane2
		extends UIOutput {
	// ------------------------------------------------------ Manifest Constants
	/**
	 * <p>The standard component type for this component.</p>
	 */
	public static final String COMPONENT_TYPE = "com.cim.jsf.TabbedPane2";

	/**
	 * <p>The standard component family for this component.</p>
	 */
	public static final String COMPONENT_FAMILY = "javax.faces.Output";

	// ------------------------------------------------------------ Constructors
	/**
	 * <p>Create a new {@link UITabbedPane} instance with default property
	 * values.</p>
	 */
	public UITabbedPane2() {
		super();
		setRendererType( "com.cim.jsf.TabbedPane2" );
	}

	// -------------------------------------------------------------- Properties
	public String getFamily() {
		return ( COMPONENT_FAMILY );
	}

	// ------------------------------------------------------ Instance Variables
	private TabNode currentTab = null;

	public TabNode getCurrentTab() {
		return currentTab;
	}

	public void setCurrentTab( TabNode tab ) {
		this.currentTab = tab;
	}

	// ------------------------------------------------------ Instance Variables
	private String currentTabName;

	public void setCurrentTabName( String currentTabName ) {
		this.currentTabName = currentTabName;
	}

	public String getCurrentTabName() {
		if ( this.currentTabName != null ) {
			return ( this.currentTabName );
		}
		ValueBinding vb = getValueBinding( "currentTabName" );
		if ( vb != null ) {
			return ( ( String )vb.getValue( getFacesContext() ) );
		} else {
			return ( null );
		}
	}

	//-----------------
	/**
	 * saveState
	 *
	 * @param context FacesContext
	 * @return Object
	 */
	public Object saveState( FacesContext context ) {
		Object[] values = new Object[2];
		values[0] = super.saveState( context );
		values[1] = currentTabName;
		return values;
	}

	/**
	 * restoreState
	 *
	 * @param context FacesContext
	 * @param state Object
	 */
	public void restoreState( FacesContext context, Object state ) {
		Object[] values = ( Object[] )state;
		super.restoreState( context, values[0] );
		currentTabName = ( String )values[1];
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -