diff options
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java')
-rw-r--r-- | jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java deleted file mode 100644 index 7b1414b72..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2005 Sybase, Inc. and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sybase, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.facesconfig.ui.pageflow.util; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -/** - * utility class for JSP related information. - * - * @author Yang Liu - */ -public class JSPUtil { - - /** - * get the action list in the jsp file - * @param jspFileName - * - * @return - action list - */ - public static List getActionListInJSPFile(String jspFileName) { - /** jsp dom adapter */ - - List actions = new ArrayList(); - - // convert the relative directory to project directory, e.g., /a.jsp to - // /testproject/webroot/a.sjp - String physicalJspPath = jspFileName; - if (physicalJspPath != null && physicalJspPath.length() > 0) - { - IPath jspPath = new Path(physicalJspPath); - IFile jspFile = ResourcesPlugin.getWorkspace().getRoot().getFile( - jspPath); - - if (jspFile != null && jspFile.exists()) - { - JSPDomAdapter jspAdapter = null; - try - { - jspAdapter = new JSPDomAdapter(); - // initialize the adapter to initialize the model of jsp - if (jspAdapter.initialize(jspFile)) - { - // the prefix of JSF HTML TagLib - String prefix = jspAdapter - .getTagLibPrefix(JSPDomAdapter.JSF_HTML_TAGLIB); - - // get the command butonns - List buttonActions = jspAdapter.getElementsByTagNameNS( - prefix, "commandButton");//$NON-NLS-1$ - if (buttonActions != null) - actions.addAll(buttonActions); - - // get the command links - List linkActions = jspAdapter.getElementsByTagNameNS( - prefix, "commandLink");//$NON-NLS-1$ - if (linkActions != null) - actions.addAll(linkActions); - } - } - finally - { - if (jspAdapter != null) - { - jspAdapter.releaseModel(); - } - } - } - } - return actions; - } -} |