📄 jahiatreeviewpagewrapper.java
字号:
// $Id: JahiaTreeViewPageWrapper.java,v 1.2 2002/04/04 08:13:26 pmartin Exp $//// ____.// __/\ ______| |__/\. _______// __ .____| | \ | +----+ \// _______| /--| | | - \ _ | : - \_________// \\______: :---| : : | : | \________>// |__\---\_____________:______: :____|____:_____\// /_____|//// . . . i n j a h i a w e t r u s t . . .//package org.jahia.services.pages;import org.jahia.exceptions.JahiaException;/** * This class serves as a wrapper for a {@link JahiaPage} object, adding tree display information. * In a tree view, page titles can be displayed either as a terminal node, as an * collapsed or as an expanded branch node. * * Copyright: Copyright (c) 2002 * Company: Jahia Ltd * * @author Mikha雔 Janson * @version 1.0 */public class JahiaTreeViewPageWrapper implements PageInfoInterface{ /** Display as a terminal leaf. */ public static final int TERMINAL_STATE = 0; /** Display as a collapsed tree node. */ public static final int COLLAPSED_STATE = 1; /** Display as an expanded tree node. */ public static final int EXPANDED_STATE = 2; private JahiaPage mPage; private int mDisplayState = TERMINAL_STATE; /** * Constructor * * @param page The contained page */ protected JahiaTreeViewPageWrapper (JahiaPage page) throws JahiaException { mPage = page; } /** * Constructor * * @param page The contained page * @param displayState Ehether to display as a terminal, collapsed or expanded tree node */ protected JahiaTreeViewPageWrapper (JahiaPage page, int displayState) throws JahiaException { mPage = page; mDisplayState = displayState; } /** @return A reference to the contained {@link JahiaPage} object. */ public final JahiaPage getPage() { return mPage; } /** @return The ID of the contained {@link JahiaPage} object. */ public final int getID() { return mPage.getID(); } /** @return The type of the contained {@link JahiaPage} object. */ public final int getPageType() { return mPage.getPageType(); } /** @return The title of the contained {@link JahiaPage} object. */ public final String getTitle() { return mPage.getTitle(); } /** @return The URL of the contained {@link JahiaPage} object. */ public final String getURL() throws JahiaException { return mPage.getUrl(); } /** * @return <code>true</code> if the page is an expanded node, * <code>false</code> if it is collapsed. */ public final boolean isExpanded() { return (mDisplayState == EXPANDED_STATE); } /** * @return <code>true</code> if the page is a terminal node, * <code>false</code> otherwise. */ public final boolean isTerminal() { return (mDisplayState == TERMINAL_STATE); } /** Set the display state to expanded. */ public final void expand() { mDisplayState = EXPANDED_STATE; } /** Set the display state to collaped. */ public final void collapse() { mDisplayState = COLLAPSED_STATE; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -