/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* https://opensso.dev.java.net/public/CDDLv1.0.html or
* opensso/legal/CDDLv1.0.txt
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: CCOrderedListTag.java,v 1.1 2008/07/02 17:21:46 veiming Exp $
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
package com.sun.identity.console.ui.taglib;
import com.iplanet.jato.view.View;
import com.sun.identity.console.ui.model.CCOrderedListModel;
import com.sun.identity.console.ui.view.CCOrderedList;
import com.sun.web.ui.common.CCJavascript;
import com.sun.web.ui.common.CCStyle;
import com.sun.web.ui.model.CCEditableListModelInterface;
import com.sun.web.ui.model.CCOrderedListModelBaseInterface;
import com.sun.web.ui.taglib.html.CCButtonTag;
import com.sun.web.ui.taglib.html.CCTextFieldTag;
import com.sun.web.ui.taglib.orderablelist.CCOrderableListTag;
import com.sun.web.ui.view.html.CCButton;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.Tag;
/**
* This is the corresponding tag for CCOrderedListView
.
*/
public class CCOrderedListTag extends CCOrderableListTag {
private CCTextFieldTag textfieldTag;
private CCButtonTag addButtonTag;
private CCButtonTag deleteButtonTag;
private View textfield;
private CCButton addButton;
private CCButton deleteButton;
private String addBtnString;
private String deleteBtnString;
private String textfieldString;
public void reset() {
super.reset();
addButtonTag = null;
deleteButtonTag = null;
textfieldTag = null;
}
protected String getHTMLStringInternal(
Tag parent,
PageContext pageContext,
View view
) throws JspException {
CCOrderedList field = (CCOrderedList)
super.init(parent, pageContext, view, CCOrderedList.class);
initChildViews(field);
String strHTML = super.getHTMLStringInternal(parent, pageContext, view);
includeJavascriptFile(CCJavascript.EDITABLELIST_JS);
int idx = strHTML.lastIndexOf("class=\"Btn2Dis\"");
idx = strHTML.indexOf("/>", idx) + 2;
strHTML = strHTML.substring(0, idx) +
"\n
" + textfieldString + " " + addBtnString + " |