diff options
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache')
34 files changed, 0 insertions, 7028 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/ITrinidadConstants.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/ITrinidadConstants.java deleted file mode 100644 index cbb8d88e1..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/ITrinidadConstants.java +++ /dev/null @@ -1,2557 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport; - -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; - -/** - * Trinidad-related constants. - * - * @author Ian Trimble - Oracle - */ -public interface ITrinidadConstants { - - /** - * Trinidad "core" URI. - */ - public static final String URI_CORE = "http://myfaces.apache.org/trinidad"; //$NON-NLS-1$ - - /** - * Trinidad "html" URI. - */ - public static final String URI_HTML = "http://myfaces.apache.org/trinidad/html"; //$NON-NLS-1$ - - // "Core" tags - /** - * Tag name for "tr:forEach" - */ - public static final String TAG_FOREACH = "forEach"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:forEach" - */ - public static final TagIdentifier TAG_IDENTIFIER_FOREACH = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_FOREACH); - - /** - * Tag name for "tr:setActionListener" - */ - public static final String TAG_SETACTIONLISTENER = "setActionListener"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:setActionListener" - */ - public static final TagIdentifier TAG_IDENTIFIER_SETACTIONLISTENER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SETACTIONLISTENER); - - /** - * Tag name for "tr:fileDownloadActionListener" - */ - public static final String TAG_FILEDOWNLOADACTIONLISTENER = "fileDownloadActionListener"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:fileDownloadActionListener" - */ - public static final TagIdentifier TAG_IDENTIFIER_FILEDOWNLOADACTIONLISTENER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_FILEDOWNLOADACTIONLISTENER); - - /** - * Tag name for "tr:returnActionListener" - */ - public static final String TAG_RETURNACTIONLISTENER = "returnActionListener"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:returnActionListener" - */ - public static final TagIdentifier TAG_IDENTIFIER_RETURNACTIONLISTENER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_RETURNACTIONLISTENER); - - /** - * Tag name for "tr:resetActionListener" - */ - public static final String TAG_RESETACTIONLISTENER = "resetActionListener"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:resetActionListener" - */ - public static final TagIdentifier TAG_IDENTIFIER_RESETACTIONLISTENER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_RESETACTIONLISTENER); - - /** - * Tag name for "tr:componentRef" - */ - public static final String TAG_COMPONENTREF = "componentRef"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:componentRef" - */ - public static final TagIdentifier TAG_IDENTIFIER_COMPONENTREF = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_COMPONENTREF); - - /** - * Tag name for "tr:componentDef" - */ - public static final String TAG_COMPONENTDEF = "componentDef"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:componentDef" - */ - public static final TagIdentifier TAG_IDENTIFIER_COMPONENTDEF = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_COMPONENTDEF); - - /** - * Tag name for "tr:facetRef" - */ - public static final String TAG_FACETREF = "facetRef"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:facetRef" - */ - public static final TagIdentifier TAG_IDENTIFIER_FACETREF = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_FACETREF); - - /** - * Tag name for "tr:breadCrumbs" - */ - public static final String TAG_BREADCRUMBS = "breadCrumbs"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:breadCrumbs" - */ - public static final TagIdentifier TAG_IDENTIFIER_BREADCRUMBS = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_BREADCRUMBS); - - /** - * Tag name for "tr:chart" - */ - public static final String TAG_CHART = "chart"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:chart" - */ - public static final TagIdentifier TAG_IDENTIFIER_CHART = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_CHART); - - /** - * Tag name for "tr:chooseColor" - */ - public static final String TAG_CHOOSECOLOR = "chooseColor"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:chooseColor" - */ - public static final TagIdentifier TAG_IDENTIFIER_CHOOSECOLOR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_CHOOSECOLOR); - - /** - * Tag name for "tr:chooseDate" - */ - public static final String TAG_CHOOSEDATE = "chooseDate"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:chooseDate" - */ - public static final TagIdentifier TAG_IDENTIFIER_CHOOSEDATE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_CHOOSEDATE); - - /** - * Tag name for "tr:column" - */ - public static final String TAG_COLUMN = "column"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:column" - */ - public static final TagIdentifier TAG_IDENTIFIER_COLUMN = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_COLUMN); - - /** - * Tag name for "tr:commandButton" - */ - public static final String TAG_COMMANDBUTTON = "commandButton"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:commandButton" - */ - public static final TagIdentifier TAG_IDENTIFIER_COMMANDBUTTON = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_COMMANDBUTTON); - - /** - * Tag name for "tr:commandLink" - */ - public static final String TAG_COMMANDLINK = "commandLink"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:commandLink" - */ - public static final TagIdentifier TAG_IDENTIFIER_COMMANDLINK = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_COMMANDLINK); - - /** - * Tag name for "tr:commandNavigationItem" - */ - public static final String TAG_COMMANDNAVIGATIONITEM = "commandNavigationItem"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:commandNavigationItem" - */ - public static final TagIdentifier TAG_IDENTIFIER_COMMANDNAVIGATIONITEM = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_COMMANDNAVIGATIONITEM); - - /** - * Tag name for "tr:document" - */ - public static final String TAG_DOCUMENT = "document"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:document" - */ - public static final TagIdentifier TAG_IDENTIFIER_DOCUMENT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_DOCUMENT); - - /** - * Tag name for "tr:form" - */ - public static final String TAG_FORM = "form"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:form" - */ - public static final TagIdentifier TAG_IDENTIFIER_FORM = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_FORM); - - /** - * Tag name for "tr:goButton" - */ - public static final String TAG_GOBUTTON = "goButton"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:goButton" - */ - public static final TagIdentifier TAG_IDENTIFIER_GOBUTTON = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_GOBUTTON); - - /** - * Tag name for "tr:goLink" - */ - public static final String TAG_GOLINK = "goLink"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:goLink" - */ - public static final TagIdentifier TAG_IDENTIFIER_GOLINK = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_GOLINK); - - /** - * Tag name for "tr:icon" - */ - public static final String TAG_ICON = "icon"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:icon" - */ - public static final TagIdentifier TAG_IDENTIFIER_ICON = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_ICON); - - /** - * Tag name for "tr:image" - */ - public static final String TAG_IMAGE = "image"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:image" - */ - public static final TagIdentifier TAG_IDENTIFIER_IMAGE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_IMAGE); - - /** - * Tag name for "tr:importScript" - */ - public static final String TAG_IMPORTSCRIPT = "importScript"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:importScript" - */ - public static final TagIdentifier TAG_IDENTIFIER_IMPORTSCRIPT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_IMPORTSCRIPT); - - /** - * Tag name for "tr:inputColor" - */ - public static final String TAG_INPUTCOLOR = "inputColor"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:inputColor" - */ - public static final TagIdentifier TAG_IDENTIFIER_INPUTCOLOR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_INPUTCOLOR); - - /** - * Tag name for "tr:inputDate" - */ - public static final String TAG_INPUTDATE = "inputDate"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:inputDate" - */ - public static final TagIdentifier TAG_IDENTIFIER_INPUTDATE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_INPUTDATE); - - /** - * Tag name for "tr:inputFile" - */ - public static final String TAG_INPUTFILE = "inputFile"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:inputFile" - */ - public static final TagIdentifier TAG_IDENTIFIER_INPUTFILE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_INPUTFILE); - - /** - * Tag name for "tr:inputHidden" - */ - public static final String TAG_INPUTHIDDEN = "inputHidden"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:inputHidden" - */ - public static final TagIdentifier TAG_IDENTIFIER_INPUTHIDDEN = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_INPUTHIDDEN); - - /** - * Tag name for "tr:inputListOfValues" - */ - public static final String TAG_INPUTLISTOFVALUES = "inputListOfValues"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:inputListOfValues" - */ - public static final TagIdentifier TAG_IDENTIFIER_INPUTLISTOFVALUES = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_INPUTLISTOFVALUES); - - /** - * Tag name for "tr:inputNumberSpinbox" - */ - public static final String TAG_INPUTNUMBERSPINBOX = "inputNumberSpinbox"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:inputNumberSpinbox" - */ - public static final TagIdentifier TAG_IDENTIFIER_INPUTNUMBERSPINBOX = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_INPUTNUMBERSPINBOX); - - /** - * Tag name for "tr:inputText" - */ - public static final String TAG_INPUTTEXT = "inputText"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:inputText" - */ - public static final TagIdentifier TAG_IDENTIFIER_INPUTTEXT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_INPUTTEXT); - - /** - * Tag name for "tr:legend" - */ - public static final String TAG_LEGEND = "legend"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:legend" - */ - public static final TagIdentifier TAG_IDENTIFIER_LEGEND = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_LEGEND); - - /** - * Tag name for "tr:media" - */ - public static final String TAG_MEDIA = "media"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:media" - */ - public static final TagIdentifier TAG_IDENTIFIER_MEDIA = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_MEDIA); - - /** - * Tag name for "tr:message" - */ - public static final String TAG_MESSAGE = "message"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:message" - */ - public static final TagIdentifier TAG_IDENTIFIER_MESSAGE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_MESSAGE); - - /** - * Tag name for "tr:messages" - */ - public static final String TAG_MESSAGES = "messages"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:messages" - */ - public static final TagIdentifier TAG_IDENTIFIER_MESSAGES = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_MESSAGES); - - /** - * Tag name for "tr:navigationPane" - */ - public static final String TAG_NAVIGATIONPANE = "navigationPane"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:navigationPane" - */ - public static final TagIdentifier TAG_IDENTIFIER_NAVIGATIONPANE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_NAVIGATIONPANE); - - /** - * Tag name for "tr:navigationTree" - */ - public static final String TAG_NAVIGATIONTREE = "navigationTree"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:navigationTree" - */ - public static final TagIdentifier TAG_IDENTIFIER_NAVIGATIONTREE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_NAVIGATIONTREE); - - /** - * Tag name for "tr:outputDocument" - */ - public static final String TAG_OUTPUTDOCUMENT = "outputDocument"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:outputDocument" - */ - public static final TagIdentifier TAG_IDENTIFIER_OUTPUTDOCUMENT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_OUTPUTDOCUMENT); - - /** - * Tag name for "tr:outputFormatted" - */ - public static final String TAG_OUTPUTFORMATTED = "outputFormatted"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:outputFormatted" - */ - public static final TagIdentifier TAG_IDENTIFIER_OUTPUTFORMATTED = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_OUTPUTFORMATTED); - - /** - * Tag name for "tr:outputLabel" - */ - public static final String TAG_OUTPUTLABEL = "outputLabel"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:outputLabel" - */ - public static final TagIdentifier TAG_IDENTIFIER_OUTPUTLABEL = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_OUTPUTLABEL); - - /** - * Tag name for "tr:outputText" - */ - public static final String TAG_OUTPUTTEXT = "outputText"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:outputText" - */ - public static final TagIdentifier TAG_IDENTIFIER_OUTPUTTEXT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_OUTPUTTEXT); - - /** - * Tag name for "tr:page" - */ - public static final String TAG_PAGE = "page"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:page" - */ - public static final TagIdentifier TAG_IDENTIFIER_PAGE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PAGE); - - /** - * Tag name for "tr:panelAccordion" - */ - public static final String TAG_PANELACCORDION = "panelAccordion"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelAccordion" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELACCORDION = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELACCORDION); - - /** - * Tag name for "tr:panelBorderLayout" - */ - public static final String TAG_PANELBORDERLAYOUT = "panelBorderLayout"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelBorderLayout" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELBORDERLAYOUT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELBORDERLAYOUT); - - /** - * Tag name for "tr:panelBox" - */ - public static final String TAG_PANELBOX = "panelBox"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelBox" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELBOX = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELBOX); - - /** - * Tag name for "tr:panelButtonBar" - */ - public static final String TAG_PANELBUTTONBAR = "panelButtonBar"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelButtonBar" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELBUTTONBAR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELBUTTONBAR); - - /** - * Tag name for "tr:panelCaptionGroup" - */ - public static final String TAG_PANELCAPTIONGROUP = "panelCaptionGroup"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelCaptionGroup" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELCAPTIONGROUP = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELCAPTIONGROUP); - - /** - * Tag name for "tr:panelChoice" - */ - public static final String TAG_PANELCHOICE = "panelChoice"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelChoice" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELCHOICE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELCHOICE); - - /** - * Tag name for "tr:panelFormLayout" - */ - public static final String TAG_PANELFORMLAYOUT = "panelFormLayout"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelFormLayout" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELFORMLAYOUT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELFORMLAYOUT); - - /** - * Tag name for "tr:panelGroupLayout" - */ - public static final String TAG_PANELGROUPLAYOUT = "panelGroupLayout"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelGroupLayout" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELGROUPLAYOUT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELGROUPLAYOUT); - - /** - * Tag name for "tr:panelHeader" - */ - public static final String TAG_PANELHEADER = "panelHeader"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelHeader" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELHEADER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELHEADER); - - /** - * Tag name for "tr:panelHorizontalLayout" - */ - public static final String TAG_PANELHORIZONTALLAYOUT = "panelHorizontalLayout"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelHorizontalLayout" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELHORIZONTALLAYOUT = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELHORIZONTALLAYOUT); - - /** - * Tag name for "tr:panelLabelAndMessage" - */ - public static final String TAG_PANELLABELANDMESSAGE = "panelLabelAndMessage"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelLabelAndMessage" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELLABELANDMESSAGE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELLABELANDMESSAGE); - - /** - * Tag name for "tr:panelList" - */ - public static final String TAG_PANELLIST = "panelList"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelList" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELLIST = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELLIST); - - /** - * Tag name for "tr:panelPage" - */ - public static final String TAG_PANELPAGE = "panelPage"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelPage" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELPAGE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELPAGE); - - /** - * Tag name for "tr:panelPageHeader" - */ - public static final String TAG_PANELPAGEHEADER = "panelPageHeader"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelPageHeader" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELPAGEHEADER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELPAGEHEADER); - - /** - * Tag name for "tr:panelPopup" - */ - public static final String TAG_PANELPOPUP = "panelPopup"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelPopup" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELPOPUP = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELPOPUP); - - /** - * Tag name for "tr:panelRadio" - */ - public static final String TAG_PANELRADIO = "panelRadio"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelRadio" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELRADIO = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELRADIO); - - /** - * Tag name for "tr:panelSideBar" - */ - public static final String TAG_PANELSIDEBAR = "panelSideBar"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelSideBar" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELSIDEBAR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELSIDEBAR); - - /** - * Tag name for "tr:panelTabbed" - */ - public static final String TAG_PANELTABBED = "panelTabbed"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelTabbed" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELTABBED = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELTABBED); - - /** - * Tag name for "tr:panelTip" - */ - public static final String TAG_PANELTIP = "panelTip"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:panelTip" - */ - public static final TagIdentifier TAG_IDENTIFIER_PANELTIP = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PANELTIP); - - /** - * Tag name for "tr:poll" - */ - public static final String TAG_POLL = "poll"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:poll" - */ - public static final TagIdentifier TAG_IDENTIFIER_POLL = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_POLL); - - /** - * Tag name for "tr:processChoiceBar" - */ - public static final String TAG_PROCESSCHOICEBAR = "processChoiceBar"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:processChoiceBar" - */ - public static final TagIdentifier TAG_IDENTIFIER_PROCESSCHOICEBAR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PROCESSCHOICEBAR); - - /** - * Tag name for "tr:progressIndicator" - */ - public static final String TAG_PROGRESSINDICATOR = "progressIndicator"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:progressIndicator" - */ - public static final TagIdentifier TAG_IDENTIFIER_PROGRESSINDICATOR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_PROGRESSINDICATOR); - - /** - * Tag name for "tr:resetButton" - */ - public static final String TAG_RESETBUTTON = "resetButton"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:resetButton" - */ - public static final TagIdentifier TAG_IDENTIFIER_RESETBUTTON = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_RESETBUTTON); - - /** - * Tag name for "tr:selectBooleanCheckbox" - */ - public static final String TAG_SELECTBOOLEANCHECKBOX = "selectBooleanCheckbox"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectBooleanCheckbox" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTBOOLEANCHECKBOX = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTBOOLEANCHECKBOX); - - /** - * Tag name for "tr:selectBooleanRadio" - */ - public static final String TAG_SELECTBOOLEANRADIO = "selectBooleanRadio"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectBooleanRadio" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTBOOLEANRADIO = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTBOOLEANRADIO); - - /** - * Tag name for "tr:selectItem" - */ - public static final String TAG_SELECTITEM = "selectItem"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectItem" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTITEM = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTITEM); - - /** - * Tag name for "tr:selectManyCheckbox" - */ - public static final String TAG_SELECTMANYCHECKBOX = "selectManyCheckbox"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectManyCheckbox" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTMANYCHECKBOX = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTMANYCHECKBOX); - - /** - * Tag name for "tr:selectManyListbox" - */ - public static final String TAG_SELECTMANYLISTBOX = "selectManyListbox"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectManyListbox" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTMANYLISTBOX = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTMANYLISTBOX); - - /** - * Tag name for "tr:selectManyShuttle" - */ - public static final String TAG_SELECTMANYSHUTTLE = "selectManyShuttle"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectManyShuttle" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTMANYSHUTTLE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTMANYSHUTTLE); - - /** - * Tag name for "tr:selectOneChoice" - */ - public static final String TAG_SELECTONECHOICE = "selectOneChoice"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectOneChoice" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTONECHOICE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTONECHOICE); - - /** - * Tag name for "tr:selectOneListbox" - */ - public static final String TAG_SELECTONELISTBOX = "selectOneListbox"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectOneListbox" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTONELISTBOX = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTONELISTBOX); - - /** - * Tag name for "tr:selectOneRadio" - */ - public static final String TAG_SELECTONERADIO = "selectOneRadio"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectOneRadio" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTONERADIO = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTONERADIO); - - /** - * Tag name for "tr:selectOrderShuttle" - */ - public static final String TAG_SELECTORDERSHUTTLE = "selectOrderShuttle"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectOrderShuttle" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTORDERSHUTTLE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTORDERSHUTTLE); - - /** - * Tag name for "tr:selectRangeChoiceBar" - */ - public static final String TAG_SELECTRANGECHOICEBAR = "selectRangeChoiceBar"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:selectRangeChoiceBar" - */ - public static final TagIdentifier TAG_IDENTIFIER_SELECTRANGECHOICEBAR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SELECTRANGECHOICEBAR); - - /** - * Tag name for "tr:separator" - */ - public static final String TAG_SEPARATOR = "separator"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:separator" - */ - public static final TagIdentifier TAG_IDENTIFIER_SEPARATOR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SEPARATOR); - - /** - * Tag name for "tr:showDetail" - */ - public static final String TAG_SHOWDETAIL = "showDetail"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:showDetail" - */ - public static final TagIdentifier TAG_IDENTIFIER_SHOWDETAIL = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SHOWDETAIL); - - /** - * Tag name for "tr:showDetailHeader" - */ - public static final String TAG_SHOWDETAILHEADER = "showDetailHeader"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:showDetailHeader" - */ - public static final TagIdentifier TAG_IDENTIFIER_SHOWDETAILHEADER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SHOWDETAILHEADER); - - /** - * Tag name for "tr:showDetailItem" - */ - public static final String TAG_SHOWDETAILITEM = "showDetailItem"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:showDetailItem" - */ - public static final TagIdentifier TAG_IDENTIFIER_SHOWDETAILITEM = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SHOWDETAILITEM); - - /** - * Tag name for "tr:singleStepButtonBar" - */ - public static final String TAG_SINGLESTEPBUTTONBAR = "singleStepButtonBar"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:singleStepButtonBar" - */ - public static final TagIdentifier TAG_IDENTIFIER_SINGLESTEPBUTTONBAR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SINGLESTEPBUTTONBAR); - - /** - * Tag name for "tr:spacer" - */ - public static final String TAG_SPACER = "spacer"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:spacer" - */ - public static final TagIdentifier TAG_IDENTIFIER_SPACER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SPACER); - - /** - * Tag name for "tr:statusIndicator" - */ - public static final String TAG_STATUSINDICATOR = "statusIndicator"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:statusIndicator" - */ - public static final TagIdentifier TAG_IDENTIFIER_STATUSINDICATOR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_STATUSINDICATOR); - - /** - * Tag name for "tr:subform" - */ - public static final String TAG_SUBFORM = "subform"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:subform" - */ - public static final TagIdentifier TAG_IDENTIFIER_SUBFORM = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SUBFORM); - - /** - * Tag name for "tr:table" - */ - public static final String TAG_TABLE = "table"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:table" - */ - public static final TagIdentifier TAG_IDENTIFIER_TABLE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_TABLE); - - /** - * Tag name for "tr:train" - */ - public static final String TAG_TRAIN = "train"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:train" - */ - public static final TagIdentifier TAG_IDENTIFIER_TRAIN = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_TRAIN); - - /** - * Tag name for "tr:tree" - */ - public static final String TAG_TREE = "tree"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:tree" - */ - public static final TagIdentifier TAG_IDENTIFIER_TREE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_TREE); - - /** - * Tag name for "tr:treeTable" - */ - public static final String TAG_TREETABLE = "treeTable"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:treeTable" - */ - public static final TagIdentifier TAG_IDENTIFIER_TREETABLE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_TREETABLE); - - /** - * Tag name for "tr:group" - */ - public static final String TAG_GROUP = "group"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:group" - */ - public static final TagIdentifier TAG_IDENTIFIER_GROUP = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_GROUP); - - /** - * Tag name for "tr:iterator" - */ - public static final String TAG_ITERATOR = "iterator"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:iterator" - */ - public static final TagIdentifier TAG_IDENTIFIER_ITERATOR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_ITERATOR); - - /** - * Tag name for "tr:switcher" - */ - public static final String TAG_SWITCHER = "switcher"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:switcher" - */ - public static final TagIdentifier TAG_IDENTIFIER_SWITCHER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_SWITCHER); - - /** - * Tag name for "tr:convertColor" - */ - public static final String TAG_CONVERTCOLOR = "convertColor"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:convertColor" - */ - public static final TagIdentifier TAG_IDENTIFIER_CONVERTCOLOR = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_CONVERTCOLOR); - - /** - * Tag name for "tr:convertDateTime" - */ - public static final String TAG_CONVERTDATETIME = "convertDateTime"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:convertDateTime" - */ - public static final TagIdentifier TAG_IDENTIFIER_CONVERTDATETIME = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_CONVERTDATETIME); - - /** - * Tag name for "tr:convertNumber" - */ - public static final String TAG_CONVERTNUMBER = "convertNumber"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:convertNumber" - */ - public static final TagIdentifier TAG_IDENTIFIER_CONVERTNUMBER = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_CONVERTNUMBER); - - /** - * Tag name for "tr:validateByteLength" - */ - public static final String TAG_VALIDATEBYTELENGTH = "validateByteLength"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:validateByteLength" - */ - public static final TagIdentifier TAG_IDENTIFIER_VALIDATEBYTELENGTH = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_VALIDATEBYTELENGTH); - - /** - * Tag name for "tr:validateDateRestriction" - */ - public static final String TAG_VALIDATEDATERESTRICTION = "validateDateRestriction"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:validateDateRestriction" - */ - public static final TagIdentifier TAG_IDENTIFIER_VALIDATEDATERESTRICTION = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_VALIDATEDATERESTRICTION); - - /** - * Tag name for "tr:validateDateTimeRange" - */ - public static final String TAG_VALIDATEDATETIMERANGE = "validateDateTimeRange"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:validateDateTimeRange" - */ - public static final TagIdentifier TAG_IDENTIFIER_VALIDATEDATETIMERANGE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_VALIDATEDATETIMERANGE); - - /** - * Tag name for "tr:validateDoubleRange" - */ - public static final String TAG_VALIDATEDOUBLERANGE = "validateDoubleRange"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:validateDoubleRange" - */ - public static final TagIdentifier TAG_IDENTIFIER_VALIDATEDOUBLERANGE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_VALIDATEDOUBLERANGE); - - /** - * Tag name for "tr:validateLength" - */ - public static final String TAG_VALIDATELENGTH = "validateLength"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:validateLength" - */ - public static final TagIdentifier TAG_IDENTIFIER_VALIDATELENGTH = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_VALIDATELENGTH); - - /** - * Tag name for "tr:validateLongRange" - */ - public static final String TAG_VALIDATELONGRANGE = "validateLongRange"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:validateLongRange" - */ - public static final TagIdentifier TAG_IDENTIFIER_VALIDATELONGRANGE = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_VALIDATELONGRANGE); - - /** - * Tag name for "tr:validateRegExp" - */ - public static final String TAG_VALIDATEREGEXP = "validateRegExp"; //$NON-NLS-1$ - - /** - * TagIdentifier for "tr:validateRegExp" - */ - public static final TagIdentifier TAG_IDENTIFIER_VALIDATEREGEXP = TagIdentifierFactory - .createJSPTagWrapper(URI_CORE, TAG_VALIDATEREGEXP); - - // "HTML" tags - /** - * Tag name for "trh:styleSheet" - */ - public static final String TAG_STYLESHEET = "styleSheet"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:styleSheet" - */ - public static final TagIdentifier TAG_IDENTIFIER_STYLESHEET = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_STYLESHEET); - - /** - * Tag name for "trh:body" - */ - public static final String TAG_BODY = "body"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:body" - */ - public static final TagIdentifier TAG_IDENTIFIER_BODY = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_BODY); - - /** - * Tag name for "trh:cellFormat" - */ - public static final String TAG_CELLFORMAT = "cellFormat"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:cellFormat" - */ - public static final TagIdentifier TAG_IDENTIFIER_CELLFORMAT = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_CELLFORMAT); - - /** - * Tag name for "trh:frame" - */ - public static final String TAG_FRAME = "frame"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:frame" - */ - public static final TagIdentifier TAG_IDENTIFIER_FRAME = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_FRAME); - - /** - * Tag name for "trh:frameBorderLayout" - */ - public static final String TAG_FRAMEBORDERLAYOUT = "frameBorderLayout"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:frameBorderLayout" - */ - public static final TagIdentifier TAG_IDENTIFIER_FRAMEBORDERLAYOUT = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_FRAMEBORDERLAYOUT); - - /** - * Tag name for "trh:head" - */ - public static final String TAG_HEAD = "head"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:head" - */ - public static final TagIdentifier TAG_IDENTIFIER_HEAD = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_HEAD); - - /** - * Tag name for "trh:html" - */ - public static final String TAG_HTML = "html"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:html" - */ - public static final TagIdentifier TAG_IDENTIFIER_HTML = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_HTML); - - /** - * Tag name for "trh:rowLayout" - */ - public static final String TAG_ROWLAYOUT = "rowLayout"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:rowLayout" - */ - public static final TagIdentifier TAG_IDENTIFIER_ROWLAYOUT = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_ROWLAYOUT); - - /** - * Tag name for "trh:script" - */ - public static final String TAG_SCRIPT = "script"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:script" - */ - public static final TagIdentifier TAG_IDENTIFIER_SCRIPT = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_SCRIPT); - - /** - * Tag name for "trh:tableLayout" - */ - public static final String TAG_TABLELAYOUT = "tableLayout"; //$NON-NLS-1$ - - /** - * TagIdentifier for "trh:tableLayout" - */ - public static final TagIdentifier TAG_IDENTIFIER_TABLELAYOUT = TagIdentifierFactory - .createJSPTagWrapper(URI_HTML, TAG_TABLELAYOUT); - -//Attributes - /** - * "summary" tag attribute name - */ - public static final String ATTR_SUMMARY = "summary"; //$NON-NLS-1$ - - /** - * "initialFocusId" tag attribute name - */ - public static final String ATTR_INITIALFOCUSID = "initialFocusId"; //$NON-NLS-1$ - - /** - * "accessKey" tag attribute name - */ - public static final String ATTR_ACCESSKEY = "accessKey"; //$NON-NLS-1$ - - /** - * "colorData" tag attribute name - */ - public static final String ATTR_COLORDATA = "colorData"; //$NON-NLS-1$ - - /** - * "messageDetailConvertBoth" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILCONVERTBOTH = "messageDetailConvertBoth"; //$NON-NLS-1$ - - /** - * "defaultSortOrder" tag attribute name - */ - public static final String ATTR_DEFAULTSORTORDER = "defaultSortOrder"; //$NON-NLS-1$ - - /** - * "columns" tag attribute name - */ - public static final String ATTR_COLUMNS = "columns"; //$NON-NLS-1$ - - /** - * "chromeType" tag attribute name - */ - public static final String ATTR_CHROMETYPE = "chromeType"; //$NON-NLS-1$ - - /** - * "rowHeader" tag attribute name - */ - public static final String ATTR_ROWHEADER = "rowHeader"; //$NON-NLS-1$ - - /** - * "transparentAllowed" tag attribute name - */ - public static final String ATTR_TRANSPARENTALLOWED = "transparentAllowed"; //$NON-NLS-1$ - - /** - * "rootNodeRendered" tag attribute name - */ - public static final String ATTR_ROOTNODERENDERED = "rootNodeRendered"; //$NON-NLS-1$ - - /** - * "rangeChangeListener" tag attribute name - */ - public static final String ATTR_RANGECHANGELISTENER = "rangeChangeListener"; //$NON-NLS-1$ - - /** - * "messageDetailConvertCurrency" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILCONVERTCURRENCY = "messageDetailConvertCurrency"; //$NON-NLS-1$ - - /** - * "patterns" tag attribute name - */ - public static final String ATTR_PATTERNS = "patterns"; //$NON-NLS-1$ - - /** - * "disclosedRowKeys" tag attribute name - */ - public static final String ATTR_DISCLOSEDROWKEYS = "disclosedRowKeys"; //$NON-NLS-1$ - - /** - * "ondblclick" tag attribute name - */ - public static final String ATTR_ONDBLCLICK = "ondblclick"; //$NON-NLS-1$ - - /** - * "windowWidth" tag attribute name - */ - public static final String ATTR_WINDOWWIDTH = "windowWidth"; //$NON-NLS-1$ - - /** - * "rendered" tag attribute name - */ - public static final String ATTR_RENDERED = "rendered"; //$NON-NLS-1$ - - /** - * "invalidDays" tag attribute name - */ - public static final String ATTR_INVALIDDAYS = "invalidDays"; //$NON-NLS-1$ - - /** - * "styleUsage" tag attribute name - */ - public static final String ATTR_STYLEUSAGE = "styleUsage"; //$NON-NLS-1$ - - /** - * "blocking" tag attribute name - */ - public static final String ATTR_BLOCKING = "blocking"; //$NON-NLS-1$ - - /** - * "gradientsUsed" tag attribute name - */ - public static final String ATTR_GRADIENTSUSED = "gradientsUsed"; //$NON-NLS-1$ - - /** - * "legendPosition" tag attribute name - */ - public static final String ATTR_LEGENDPOSITION = "legendPosition"; //$NON-NLS-1$ - - /** - * "rowDisclosureListener" tag attribute name - */ - public static final String ATTR_ROWDISCLOSURELISTENER = "rowDisclosureListener"; //$NON-NLS-1$ - - /** - * "binding" tag attribute name - */ - public static final String ATTR_BINDING = "binding"; //$NON-NLS-1$ - - /** - * "disclosureListener" tag attribute name - */ - public static final String ATTR_DISCLOSURELISTENER = "disclosureListener"; //$NON-NLS-1$ - - /** - * "separatorClass" tag attribute name - */ - public static final String ATTR_SEPARATORCLASS = "separatorClass"; //$NON-NLS-1$ - - /** - * "showRequired" tag attribute name - */ - public static final String ATTR_SHOWREQUIRED = "showRequired"; //$NON-NLS-1$ - - /** - * "messageDetailInvalidDaysOfWeek" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILINVALIDDAYSOFWEEK = "messageDetailInvalidDaysOfWeek"; //$NON-NLS-1$ - - /** - * "minimum" tag attribute name - */ - public static final String ATTR_MINIMUM = "minimum"; //$NON-NLS-1$ - - /** - * "simple" tag attribute name - */ - public static final String ATTR_SIMPLE = "simple"; //$NON-NLS-1$ - - /** - * "sortable" tag attribute name - */ - public static final String ATTR_SORTABLE = "sortable"; //$NON-NLS-1$ - - /** - * "discloseMany" tag attribute name - */ - public static final String ATTR_DISCLOSEMANY = "discloseMany"; //$NON-NLS-1$ - - /** - * "maximumLength" tag attribute name - */ - public static final String ATTR_MAXIMUMLENGTH = "maximumLength"; //$NON-NLS-1$ - - /** - * "visited" tag attribute name - */ - public static final String ATTR_VISITED = "visited"; //$NON-NLS-1$ - - /** - * "truncateAt" tag attribute name - */ - public static final String ATTR_TRUNCATEAT = "truncateAt"; //$NON-NLS-1$ - - /** - * "auxiliary1Size" tag attribute name - */ - public static final String ATTR_AUXILIARY1SIZE = "auxiliary1Size"; //$NON-NLS-1$ - - /** - * "converter" tag attribute name - */ - public static final String ATTR_CONVERTER = "converter"; //$NON-NLS-1$ - - /** - * "reorderOnly" tag attribute name - */ - public static final String ATTR_REORDERONLY = "reorderOnly"; //$NON-NLS-1$ - - /** - * "maxValue" tag attribute name - */ - public static final String ATTR_MAXVALUE = "maxValue"; //$NON-NLS-1$ - - /** - * "rowSelection" tag attribute name - */ - public static final String ATTR_ROWSELECTION = "rowSelection"; //$NON-NLS-1$ - - /** - * "tooltipsVisible" tag attribute name - */ - public static final String ATTR_TOOLTIPSVISIBLE = "tooltipsVisible"; //$NON-NLS-1$ - - /** - * "sortProperty" tag attribute name - */ - public static final String ATTR_SORTPROPERTY = "sortProperty"; //$NON-NLS-1$ - - /** - * "YMajorGridLineCount" tag attribute name - */ - public static final String ATTR_YMAJORGRIDLINECOUNT = "YMajorGridLineCount"; //$NON-NLS-1$ - - /** - * "yoffset" tag attribute name - */ - public static final String ATTR_YOFFSET = "yoffset"; //$NON-NLS-1$ - - /** - * "shortDesc" tag attribute name - */ - public static final String ATTR_SHORTDESC = "shortDesc"; //$NON-NLS-1$ - - /** - * "messageDetailConvertNumber" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILCONVERTNUMBER = "messageDetailConvertNumber"; //$NON-NLS-1$ - - /** - * "listStyle" tag attribute name - */ - public static final String ATTR_LISTSTYLE = "listStyle"; //$NON-NLS-1$ - - /** - * "readOnly" tag attribute name - */ - public static final String ATTR_READONLY = "readOnly"; //$NON-NLS-1$ - - /** - * "pattern" tag attribute name - */ - public static final String ATTR_PATTERN = "pattern"; //$NON-NLS-1$ - - /** - * "background" tag attribute name - */ - public static final String ATTR_BACKGROUND = "background"; //$NON-NLS-1$ - - /** - * "animationDuration" tag attribute name - */ - public static final String ATTR_ANIMATIONDURATION = "animationDuration"; //$NON-NLS-1$ - - /** - * "labelAndAccessKey" tag attribute name - */ - public static final String ATTR_LABELANDACCESSKEY = "labelAndAccessKey"; //$NON-NLS-1$ - - /** - * "titleClass" tag attribute name - */ - public static final String ATTR_TITLECLASS = "titleClass"; //$NON-NLS-1$ - - /** - * "minFractionDigits" tag attribute name - */ - public static final String ATTR_MINFRACTIONDIGITS = "minFractionDigits"; //$NON-NLS-1$ - - /** - * "to" tag attribute name - */ - public static final String ATTR_TO = "to"; //$NON-NLS-1$ - - /** - * "player" tag attribute name - */ - public static final String ATTR_PLAYER = "player"; //$NON-NLS-1$ - - /** - * "globalOnly" tag attribute name - */ - public static final String ATTR_GLOBALONLY = "globalOnly"; //$NON-NLS-1$ - - /** - * "messageDetailInvalidMonths" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILINVALIDMONTHS = "messageDetailInvalidMonths"; //$NON-NLS-1$ - - /** - * "secondaryPattern" tag attribute name - */ - public static final String ATTR_SECONDARYPATTERN = "secondaryPattern"; //$NON-NLS-1$ - - /** - * "previousAction" tag attribute name - */ - public static final String ATTR_PREVIOUSACTION = "previousAction"; //$NON-NLS-1$ - - /** - * "columnBandingInterval" tag attribute name - */ - public static final String ATTR_COLUMNBANDINGINTERVAL = "columnBandingInterval"; //$NON-NLS-1$ - - /** - * "noWrap" tag attribute name - */ - public static final String ATTR_NOWRAP = "noWrap"; //$NON-NLS-1$ - - /** - * "startLevel" tag attribute name - */ - public static final String ATTR_STARTLEVEL = "startLevel"; //$NON-NLS-1$ - - /** - * "valueChangeListener" tag attribute name - */ - public static final String ATTR_VALUECHANGELISTENER = "valueChangeListener"; //$NON-NLS-1$ - - /** - * "compact" tag attribute name - */ - public static final String ATTR_COMPACT = "compact"; //$NON-NLS-1$ - - /** - * "autoSubmit" tag attribute name - */ - public static final String ATTR_AUTOSUBMIT = "autoSubmit"; //$NON-NLS-1$ - - /** - * "height" tag attribute name - */ - public static final String ATTR_HEIGHT = "height"; //$NON-NLS-1$ - - /** - * "horizontalGridVisible" tag attribute name - */ - public static final String ATTR_HORIZONTALGRIDVISIBLE = "horizontalGridVisible"; //$NON-NLS-1$ - - /** - * "YMinorGridLineCount" tag attribute name - */ - public static final String ATTR_YMINORGRIDLINECOUNT = "YMinorGridLineCount"; //$NON-NLS-1$ - - /** - * "description" tag attribute name - */ - public static final String ATTR_DESCRIPTION = "description"; //$NON-NLS-1$ - - /** - * "onblur" tag attribute name - */ - public static final String ATTR_ONBLUR = "onblur"; //$NON-NLS-1$ - - /** - * "longDesc" tag attribute name - */ - public static final String ATTR_LONGDESC = "longDesc"; //$NON-NLS-1$ - - /** - * "perspective" tag attribute name - */ - public static final String ATTR_PERSPECTIVE = "perspective"; //$NON-NLS-1$ - - /** - * "trailingHeader" tag attribute name - */ - public static final String ATTR_TRAILINGHEADER = "trailingHeader"; //$NON-NLS-1$ - - /** - * "text" tag attribute name - */ - public static final String ATTR_TEXT = "text"; //$NON-NLS-1$ - - /** - * "messageDetailConvert" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILCONVERT = "messageDetailConvert"; //$NON-NLS-1$ - - /** - * "onmouseout" tag attribute name - */ - public static final String ATTR_ONMOUSEOUT = "onmouseout"; //$NON-NLS-1$ - - /** - * "partialSubmit" tag attribute name - */ - public static final String ATTR_PARTIALSUBMIT = "partialSubmit"; //$NON-NLS-1$ - - /** - * "align" tag attribute name - */ - public static final String ATTR_ALIGN = "align"; //$NON-NLS-1$ - - /** - * "width" tag attribute name - */ - public static final String ATTR_WIDTH = "width"; //$NON-NLS-1$ - - /** - * "onkeyup" tag attribute name - */ - public static final String ATTR_ONKEYUP = "onkeyup"; //$NON-NLS-1$ - - /** - * "onfocus" tag attribute name - */ - public static final String ATTR_ONFOCUS = "onfocus"; //$NON-NLS-1$ - - /** - * "label" tag attribute name - */ - public static final String ATTR_LABEL = "label"; //$NON-NLS-1$ - - /** - * "componentType" tag attribute name - */ - public static final String ATTR_COMPONENTTYPE = "componentType"; //$NON-NLS-1$ - - /** - * "autostart" tag attribute name - */ - public static final String ATTR_AUTOSTART = "autostart"; //$NON-NLS-1$ - - /** - * "discloseNone" tag attribute name - */ - public static final String ATTR_DISCLOSENONE = "discloseNone"; //$NON-NLS-1$ - - /** - * "size" tag attribute name - */ - public static final String ATTR_SIZE = "size"; //$NON-NLS-1$ - - /** - * "standbyText" tag attribute name - */ - public static final String ATTR_STANDBYTEXT = "standbyText"; //$NON-NLS-1$ - - /** - * "onselect" tag attribute name - */ - public static final String ATTR_ONSELECT = "onselect"; //$NON-NLS-1$ - - /** - * "items" tag attribute name - */ - public static final String ATTR_ITEMS = "items"; //$NON-NLS-1$ - - /** - * "names" tag attribute name - */ - public static final String ATTR_NAMES = "names"; //$NON-NLS-1$ - - /** - * "maximum" tag attribute name - */ - public static final String ATTR_MAXIMUM = "maximum"; //$NON-NLS-1$ - - /** - * "disclosed" tag attribute name - */ - public static final String ATTR_DISCLOSED = "disclosed"; //$NON-NLS-1$ - - /** - * "rowsByDepth" tag attribute name - */ - public static final String ATTR_ROWSBYDEPTH = "rowsByDepth"; //$NON-NLS-1$ - - /** - * "maxStep" tag attribute name - */ - public static final String ATTR_MAXSTEP = "maxStep"; //$NON-NLS-1$ - - /** - * "var" tag attribute name - */ - public static final String ATTR_VAR = "var"; //$NON-NLS-1$ - - /** - * "focusRowKey" tag attribute name - */ - public static final String ATTR_FOCUSROWKEY = "focusRowKey"; //$NON-NLS-1$ - - /** - * "unselectedLabel" tag attribute name - */ - public static final String ATTR_UNSELECTEDLABEL = "unselectedLabel"; //$NON-NLS-1$ - - /** - * "searchDesc" tag attribute name - */ - public static final String ATTR_SEARCHDESC = "searchDesc"; //$NON-NLS-1$ - - /** - * "pollListener" tag attribute name - */ - public static final String ATTR_POLLLISTENER = "pollListener"; //$NON-NLS-1$ - - /** - * "name" tag attribute name - */ - public static final String ATTR_NAME = "name"; //$NON-NLS-1$ - - /** - * "valueAndAccessKey" tag attribute name - */ - public static final String ATTR_VALUEANDACCESSKEY = "valueAndAccessKey"; //$NON-NLS-1$ - - /** - * "XMajorGridLineCount" tag attribute name - */ - public static final String ATTR_XMAJORGRIDLINECOUNT = "XMajorGridLineCount"; //$NON-NLS-1$ - - /** - * "nextActionListener" tag attribute name - */ - public static final String ATTR_NEXTACTIONLISTENER = "nextActionListener"; //$NON-NLS-1$ - - /** - * "maxIntegerDigits" tag attribute name - */ - public static final String ATTR_MAXINTEGERDIGITS = "maxIntegerDigits"; //$NON-NLS-1$ - - /** - * "messageDetailConvertTime" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILCONVERTTIME = "messageDetailConvertTime"; //$NON-NLS-1$ - - /** - * "icon" tag attribute name - */ - public static final String ATTR_ICON = "icon"; //$NON-NLS-1$ - - /** - * "undisclosedText" tag attribute name - */ - public static final String ATTR_UNDISCLOSEDTEXT = "undisclosedText"; //$NON-NLS-1$ - - /** - * "disclosedText" tag attribute name - */ - public static final String ATTR_DISCLOSEDTEXT = "disclosedText"; //$NON-NLS-1$ - - /** - * "onmouseover" tag attribute name - */ - public static final String ATTR_ONMOUSEOVER = "onmouseover"; //$NON-NLS-1$ - - /** - * "messageDetailConvertPattern" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILCONVERTPATTERN = "messageDetailConvertPattern"; //$NON-NLS-1$ - - /** - * "message" tag attribute name - */ - public static final String ATTR_MESSAGE = "message"; //$NON-NLS-1$ - - /** - * "immediate" tag attribute name - */ - public static final String ATTR_IMMEDIATE = "immediate"; //$NON-NLS-1$ - - /** - * "messageDetailNoMatch" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILNOMATCH = "messageDetailNoMatch"; //$NON-NLS-1$ - - /** - * "source" tag attribute name - */ - public static final String ATTR_SOURCE = "source"; //$NON-NLS-1$ - - /** - * "usesUpload" tag attribute name - */ - public static final String ATTR_USESUPLOAD = "usesUpload"; //$NON-NLS-1$ - - /** - * "onclick" tag attribute name - */ - public static final String ATTR_ONCLICK = "onclick"; //$NON-NLS-1$ - - /** - * "valign" tag attribute name - */ - public static final String ATTR_VALIGN = "valign"; //$NON-NLS-1$ - - /** - * "disabled" tag attribute name - */ - public static final String ATTR_DISABLED = "disabled"; //$NON-NLS-1$ - - /** - * "nextAction" tag attribute name - */ - public static final String ATTR_NEXTACTION = "nextAction"; //$NON-NLS-1$ - - /** - * "facetName" tag attribute name - */ - public static final String ATTR_FACETNAME = "facetName"; //$NON-NLS-1$ - - /** - * "for" tag attribute name - */ - public static final String ATTR_FOR = "for"; //$NON-NLS-1$ - - /** - * "defaultFacet" tag attribute name - */ - public static final String ATTR_DEFAULTFACET = "defaultFacet"; //$NON-NLS-1$ - - /** - * "defaultCommand" tag attribute name - */ - public static final String ATTR_DEFAULTCOMMAND = "defaultCommand"; //$NON-NLS-1$ - - /** - * "minValue" tag attribute name - */ - public static final String ATTR_MINVALUE = "minValue"; //$NON-NLS-1$ - - /** - * "labelStyle" tag attribute name - */ - public static final String ATTR_LABELSTYLE = "labelStyle"; //$NON-NLS-1$ - - /** - * "textAndAccessKey" tag attribute name - */ - public static final String ATTR_TEXTANDACCESSKEY = "textAndAccessKey"; //$NON-NLS-1$ - - /** - * "messageDetailConvertPercent" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILCONVERTPERCENT = "messageDetailConvertPercent"; //$NON-NLS-1$ - - /** - * "valuePassThru" tag attribute name - */ - public static final String ATTR_VALUEPASSTHRU = "valuePassThru"; //$NON-NLS-1$ - - /** - * "imageMapType" tag attribute name - */ - public static final String ATTR_IMAGEMAPTYPE = "imageMapType"; //$NON-NLS-1$ - - /** - * "chartDrillDownListener" tag attribute name - */ - public static final String ATTR_CHARTDRILLDOWNLISTENER = "chartDrillDownListener"; //$NON-NLS-1$ - - /** - * "fieldWidth" tag attribute name - */ - public static final String ATTR_FIELDWIDTH = "fieldWidth"; //$NON-NLS-1$ - - /** - * "auxiliaryGlobalSize" tag attribute name - */ - public static final String ATTR_AUXILIARYGLOBALSIZE = "auxiliaryGlobalSize"; //$NON-NLS-1$ - - /** - * "triggerType" tag attribute name - */ - public static final String ATTR_TRIGGERTYPE = "triggerType"; //$NON-NLS-1$ - - /** - * "orientation" tag attribute name - */ - public static final String ATTR_ORIENTATION = "orientation"; //$NON-NLS-1$ - - /** - * "inlineStyle" tag attribute name - */ - public static final String ATTR_INLINESTYLE = "inlineStyle"; //$NON-NLS-1$ - - /** - * "timeStyle" tag attribute name - */ - public static final String ATTR_TIMESTYLE = "timeStyle"; //$NON-NLS-1$ - - /** - * "flex" tag attribute name - */ - public static final String ATTR_FLEX = "flex"; //$NON-NLS-1$ - - /** - * "destination" tag attribute name - */ - public static final String ATTR_DESTINATION = "destination"; //$NON-NLS-1$ - - /** - * "innerWidth" tag attribute name - */ - public static final String ATTR_INNERWIDTH = "innerWidth"; //$NON-NLS-1$ - - /** - * "useWindow" tag attribute name - */ - public static final String ATTR_USEWINDOW = "useWindow"; //$NON-NLS-1$ - - /** - * "verticalGridVisible" tag attribute name - */ - public static final String ATTR_VERTICALGRIDVISIBLE = "verticalGridVisible"; //$NON-NLS-1$ - - /** - * "onmousedown" tag attribute name - */ - public static final String ATTR_ONMOUSEDOWN = "onmousedown"; //$NON-NLS-1$ - - /** - * "invalidDaysOfWeek" tag attribute name - */ - public static final String ATTR_INVALIDDAYSOFWEEK = "invalidDaysOfWeek"; //$NON-NLS-1$ - - /** - * "headerNoWrap" tag attribute name - */ - public static final String ATTR_HEADERNOWRAP = "headerNoWrap"; //$NON-NLS-1$ - - /** - * "invalidMonths" tag attribute name - */ - public static final String ATTR_INVALIDMONTHS = "invalidMonths"; //$NON-NLS-1$ - - /** - * "headerText" tag attribute name - */ - public static final String ATTR_HEADERTEXT = "headerText"; //$NON-NLS-1$ - - /** - * "actionListener" tag attribute name - */ - public static final String ATTR_ACTIONLISTENER = "actionListener"; //$NON-NLS-1$ - - /** - * "attributeChangeListener" tag attribute name - */ - public static final String ATTR_ATTRIBUTECHANGELISTENER = "attributeChangeListener"; //$NON-NLS-1$ - - /** - * "position" tag attribute name - */ - public static final String ATTR_POSITION = "position"; //$NON-NLS-1$ - - /** - * "previousActionListener" tag attribute name - */ - public static final String ATTR_PREVIOUSACTIONLISTENER = "previousActionListener"; //$NON-NLS-1$ - - /** - * "interval" tag attribute name - */ - public static final String ATTR_INTERVAL = "interval"; //$NON-NLS-1$ - - /** - * "allDetailsEnabled" tag attribute name - */ - public static final String ATTR_ALLDETAILSENABLED = "allDetailsEnabled"; //$NON-NLS-1$ - - /** - * "validator" tag attribute name - */ - public static final String ATTR_VALIDATOR = "validator"; //$NON-NLS-1$ - - /** - * "onunload" tag attribute name - */ - public static final String ATTR_ONUNLOAD = "onunload"; //$NON-NLS-1$ - - /** - * "maxFractionDigits" tag attribute name - */ - public static final String ATTR_MAXFRACTIONDIGITS = "maxFractionDigits"; //$NON-NLS-1$ - - /** - * "leadingDescShown" tag attribute name - */ - public static final String ATTR_LEADINGDESCSHOWN = "leadingDescShown"; //$NON-NLS-1$ - - /** - * "emptyText" tag attribute name - */ - public static final String ATTR_EMPTYTEXT = "emptyText"; //$NON-NLS-1$ - - /** - * "trailingDescShown" tag attribute name - */ - public static final String ATTR_TRAILINGDESCSHOWN = "trailingDescShown"; //$NON-NLS-1$ - - /** - * "escape" tag attribute name - */ - public static final String ATTR_ESCAPE = "escape"; //$NON-NLS-1$ - - /** - * "mode" tag attribute name - */ - public static final String ATTR_MODE = "mode"; //$NON-NLS-1$ - - /** - * "messageDetailInvalidDays" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILINVALIDDAYS = "messageDetailInvalidDays"; //$NON-NLS-1$ - - /** - * "title" tag attribute name - */ - public static final String ATTR_TITLE = "title"; //$NON-NLS-1$ - - /** - * "captionText" tag attribute name - */ - public static final String ATTR_CAPTIONTEXT = "captionText"; //$NON-NLS-1$ - - /** - * "stepSize" tag attribute name - */ - public static final String ATTR_STEPSIZE = "stepSize"; //$NON-NLS-1$ - - /** - * "encoding" tag attribute name - */ - public static final String ATTR_ENCODING = "encoding"; //$NON-NLS-1$ - - /** - * "modal" tag attribute name - */ - public static final String ATTR_MODAL = "modal"; //$NON-NLS-1$ - - /** - * "end" tag attribute name - */ - public static final String ATTR_END = "end"; //$NON-NLS-1$ - - /** - * "onkeypress" tag attribute name - */ - public static final String ATTR_ONKEYPRESS = "onkeypress"; //$NON-NLS-1$ - - /** - * "onkeydown" tag attribute name - */ - public static final String ATTR_ONKEYDOWN = "onkeydown"; //$NON-NLS-1$ - - /** - * "innerHeight" tag attribute name - */ - public static final String ATTR_INNERHEIGHT = "innerHeight"; //$NON-NLS-1$ - - /** - * "messageType" tag attribute name - */ - public static final String ATTR_MESSAGETYPE = "messageType"; //$NON-NLS-1$ - - /** - * "onsubmit" tag attribute name - */ - public static final String ATTR_ONSUBMIT = "onsubmit"; //$NON-NLS-1$ - - /** - * "selectedStep" tag attribute name - */ - public static final String ATTR_SELECTEDSTEP = "selectedStep"; //$NON-NLS-1$ - - /** - * "rowBandingInterval" tag attribute name - */ - public static final String ATTR_ROWBANDINGINTERVAL = "rowBandingInterval"; //$NON-NLS-1$ - - /** - * "varStatus" tag attribute name - */ - public static final String ATTR_VARSTATUS = "varStatus"; //$NON-NLS-1$ - - /** - * "xoffset" tag attribute name - */ - public static final String ATTR_XOFFSET = "xoffset"; //$NON-NLS-1$ - - /** - * "currencySymbol" tag attribute name - */ - public static final String ATTR_CURRENCYSYMBOL = "currencySymbol"; //$NON-NLS-1$ - - /** - * "selectedRowKeys" tag attribute name - */ - public static final String ATTR_SELECTEDROWKEYS = "selectedRowKeys"; //$NON-NLS-1$ - - /** - * "method" tag attribute name - */ - public static final String ATTR_METHOD = "method"; //$NON-NLS-1$ - - /** - * "messageDetailExact" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILEXACT = "messageDetailExact"; //$NON-NLS-1$ - - /** - * "messageDetailNotInRange" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILNOTINRANGE = "messageDetailNotInRange"; //$NON-NLS-1$ - - /** - * "launchListener" tag attribute name - */ - public static final String ATTR_LAUNCHLISTENER = "launchListener"; //$NON-NLS-1$ - - /** - * "templateSource" tag attribute name - */ - public static final String ATTR_TEMPLATESOURCE = "templateSource"; //$NON-NLS-1$ - - /** - * "maxPrecision" tag attribute name - */ - public static final String ATTR_MAXPRECISION = "maxPrecision"; //$NON-NLS-1$ - - /** - * "targetFrame" tag attribute name - */ - public static final String ATTR_TARGETFRAME = "targetFrame"; //$NON-NLS-1$ - - /** - * "messageDetailConvertDate" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILCONVERTDATE = "messageDetailConvertDate"; //$NON-NLS-1$ - - /** - * "focusListener" tag attribute name - */ - public static final String ATTR_FOCUSLISTENER = "focusListener"; //$NON-NLS-1$ - - /** - * "contentType" tag attribute name - */ - public static final String ATTR_CONTENTTYPE = "contentType"; //$NON-NLS-1$ - - /** - * "type" tag attribute name - */ - public static final String ATTR_TYPE = "type"; //$NON-NLS-1$ - - /** - * "initiallyExpanded" tag attribute name - */ - public static final String ATTR_INITIALLYEXPANDED = "initiallyExpanded"; //$NON-NLS-1$ - - /** - * "selectionListener" tag attribute name - */ - public static final String ATTR_SELECTIONLISTENER = "selectionListener"; //$NON-NLS-1$ - - /** - * "level" tag attribute name - */ - public static final String ATTR_LEVEL = "level"; //$NON-NLS-1$ - - /** - * "action" tag attribute name - */ - public static final String ATTR_ACTION = "action"; //$NON-NLS-1$ - - /** - * "value" tag attribute name - */ - public static final String ATTR_VALUE = "value"; //$NON-NLS-1$ - - /** - * "auxiliary2Size" tag attribute name - */ - public static final String ATTR_AUXILIARY2SIZE = "auxiliary2Size"; //$NON-NLS-1$ - - /** - * "required" tag attribute name - */ - public static final String ATTR_REQUIRED = "required"; //$NON-NLS-1$ - - /** - * "integerOnly" tag attribute name - */ - public static final String ATTR_INTEGERONLY = "integerOnly"; //$NON-NLS-1$ - - /** - * "wrap" tag attribute name - */ - public static final String ATTR_WRAP = "wrap"; //$NON-NLS-1$ - - /** - * "chooseId" tag attribute name - */ - public static final String ATTR_CHOOSEID = "chooseId"; //$NON-NLS-1$ - - /** - * "requiredMessageDetail" tag attribute name - */ - public static final String ATTR_REQUIREDMESSAGEDETAIL = "requiredMessageDetail"; //$NON-NLS-1$ - - /** - * "styleClass" tag attribute name - */ - public static final String ATTR_STYLECLASS = "styleClass"; //$NON-NLS-1$ - - /** - * "customColorData" tag attribute name - */ - public static final String ATTR_CUSTOMCOLORDATA = "customColorData"; //$NON-NLS-1$ - - /** - * "rows" tag attribute name - */ - public static final String ATTR_ROWS = "rows"; //$NON-NLS-1$ - - /** - * "groupingUsed" tag attribute name - */ - public static final String ATTR_GROUPINGUSED = "groupingUsed"; //$NON-NLS-1$ - - /** - * "playCount" tag attribute name - */ - public static final String ATTR_PLAYCOUNT = "playCount"; //$NON-NLS-1$ - - /** - * "default" tag attribute name - */ - public static final String ATTR_DEFAULT = "default"; //$NON-NLS-1$ - - /** - * "contentStyle" tag attribute name - */ - public static final String ATTR_CONTENTSTYLE = "contentStyle"; //$NON-NLS-1$ - - /** - * "maxColumns" tag attribute name - */ - public static final String ATTR_MAXCOLUMNS = "maxColumns"; //$NON-NLS-1$ - - /** - * "alignment" tag attribute name - */ - public static final String ATTR_ALIGNMENT = "alignment"; //$NON-NLS-1$ - - /** - * "leadingHeader" tag attribute name - */ - public static final String ATTR_LEADINGHEADER = "leadingHeader"; //$NON-NLS-1$ - - /** - * "locale" tag attribute name - */ - public static final String ATTR_LOCALE = "locale"; //$NON-NLS-1$ - - /** - * "messageDetailMaximum" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILMAXIMUM = "messageDetailMaximum"; //$NON-NLS-1$ - - /** - * "windowHeight" tag attribute name - */ - public static final String ATTR_WINDOWHEIGHT = "windowHeight"; //$NON-NLS-1$ - - /** - * "timeZone" tag attribute name - */ - public static final String ATTR_TIMEZONE = "timeZone"; //$NON-NLS-1$ - - /** - * "from" tag attribute name - */ - public static final String ATTR_FROM = "from"; //$NON-NLS-1$ - - /** - * "messageDetailMinimum" tag attribute name - */ - public static final String ATTR_MESSAGEDETAILMINIMUM = "messageDetailMinimum"; //$NON-NLS-1$ - - /** - * "id" tag attribute name - */ - public static final String ATTR_ID = "id"; //$NON-NLS-1$ - - /** - * "returnListener" tag attribute name - */ - public static final String ATTR_RETURNLISTENER = "returnListener"; //$NON-NLS-1$ - - /** - * "controls" tag attribute name - */ - public static final String ATTR_CONTROLS = "controls"; //$NON-NLS-1$ - - /** - * "disclosedTransient" tag attribute name - */ - public static final String ATTR_DISCLOSEDTRANSIENT = "disclosedTransient"; //$NON-NLS-1$ - - /** - * "selected" tag attribute name - */ - public static final String ATTR_SELECTED = "selected"; //$NON-NLS-1$ - - /** - * "dateStyle" tag attribute name - */ - public static final String ATTR_DATESTYLE = "dateStyle"; //$NON-NLS-1$ - - /** - * "minIntegerDigits" tag attribute name - */ - public static final String ATTR_MININTEGERDIGITS = "minIntegerDigits"; //$NON-NLS-1$ - - /** - * "onmouseup" tag attribute name - */ - public static final String ATTR_ONMOUSEUP = "onmouseup"; //$NON-NLS-1$ - - /** - * "layout" tag attribute name - */ - public static final String ATTR_LAYOUT = "layout"; //$NON-NLS-1$ - - /** - * "expandAllEnabled" tag attribute name - */ - public static final String ATTR_EXPANDALLENABLED = "expandAllEnabled"; //$NON-NLS-1$ - - /** - * "onmousemove" tag attribute name - */ - public static final String ATTR_ONMOUSEMOVE = "onmousemove"; //$NON-NLS-1$ - - /** - * "halign" tag attribute name - */ - public static final String ATTR_HALIGN = "halign"; //$NON-NLS-1$ - - /** - * "labelWidth" tag attribute name - */ - public static final String ATTR_LABELWIDTH = "labelWidth"; //$NON-NLS-1$ - - /** - * "currencyCode" tag attribute name - */ - public static final String ATTR_CURRENCYCODE = "currencyCode"; //$NON-NLS-1$ - - /** - * "partialTriggers" tag attribute name - */ - public static final String ATTR_PARTIALTRIGGERS = "partialTriggers"; //$NON-NLS-1$ - - /** - * "separateRows" tag attribute name - */ - public static final String ATTR_SEPARATEROWS = "separateRows"; //$NON-NLS-1$ - - /** - * "hint" tag attribute name - */ - public static final String ATTR_HINT = "hint"; //$NON-NLS-1$ - - /** - * "onchange" tag attribute name - */ - public static final String ATTR_ONCHANGE = "onchange"; //$NON-NLS-1$ - - /** - * "begin" tag attribute name - */ - public static final String ATTR_BEGIN = "begin"; //$NON-NLS-1$ - - /** - * "longDescURL" tag attribute name - */ - public static final String ATTR_LONGDESCURL = "longDescURL"; //$NON-NLS-1$ - - /** - * "onload" tag attribute name - */ - public static final String ATTR_ONLOAD = "onload"; //$NON-NLS-1$ - - /** - * "sortListener" tag attribute name - */ - public static final String ATTR_SORTLISTENER = "sortListener"; //$NON-NLS-1$ - - /** - * "filename" tag attribute name - */ - public static final String ATTR_FILENAME = "filename"; //$NON-NLS-1$ - - /** - * "secret" tag attribute name - */ - public static final String ATTR_SECRET = "secret"; //$NON-NLS-1$ - - /** - * "group" tag attribute name - */ - public static final String ATTR_GROUP = "group"; //$NON-NLS-1$ - - /** - * "first" tag attribute name - */ - public static final String ATTR_FIRST = "first"; //$NON-NLS-1$ - - /** - * "step" tag attribute name - */ - public static final String ATTR_STEP = "step"; //$NON-NLS-1$ - - /** - * "headers" tag attribute name - */ - public static final String ATTR_HEADERS = "headers"; //$NON-NLS-1$ - - /** - * "generatesContent" tag attribute name - */ - public static final String ATTR_GENERATESCONTENT = "generatesContent"; //$NON-NLS-1$ - - /** - * "marginHeight" tag attribute name - */ - public static final String ATTR_MARGINHEIGHT = "marginHeight"; //$NON-NLS-1$ - - /** - * "cellPadding" tag attribute name - */ - public static final String ATTR_CELLPADDING = "cellPadding"; //$NON-NLS-1$ - - /** - * "wrappingDisabled" tag attribute name - */ - public static final String ATTR_WRAPPINGDISABLED = "wrappingDisabled"; //$NON-NLS-1$ - - /** - * "rowSpan" tag attribute name - */ - public static final String ATTR_ROWSPAN = "rowSpan"; //$NON-NLS-1$ - - /** - * "columnSpan" tag attribute name - */ - public static final String ATTR_COLUMNSPAN = "columnSpan"; //$NON-NLS-1$ - - /** - * "frameSpacing" tag attribute name - */ - public static final String ATTR_FRAMESPACING = "frameSpacing"; //$NON-NLS-1$ - - /** - * "cellSpacing" tag attribute name - */ - public static final String ATTR_CELLSPACING = "cellSpacing"; //$NON-NLS-1$ - - /** - * "header" tag attribute name - */ - public static final String ATTR_HEADER = "header"; //$NON-NLS-1$ - - /** - * "scrolling" tag attribute name - */ - public static final String ATTR_SCROLLING = "scrolling"; //$NON-NLS-1$ - - /** - * "borderWidth" tag attribute name - */ - public static final String ATTR_BORDERWIDTH = "borderWidth"; //$NON-NLS-1$ - - /** - * "frameBorderWidth" tag attribute name - */ - public static final String ATTR_FRAMEBORDERWIDTH = "frameBorderWidth"; //$NON-NLS-1$ - - /** - * "shortText" tag attribute name - */ - public static final String ATTR_SHORTTEXT = "shortText"; //$NON-NLS-1$ - - /** - * "marginWidth" tag attribute name - */ - public static final String ATTR_MARGINWIDTH = "marginWidth"; //$NON-NLS-1$ - - /** - * "firstClickPassed" tag attribute name - */ - public static final String ATTR_FIRSTCLICKPASSED = "firstClickPassed"; //$NON-NLS-1$ - - /** - * Value for "style" attribute on elements used to indicate an empty source - * element. - */ - public static final String STYLE_EMPTYELEMENT = "color:silver;font-family:Arial,Helvetica,Geneva,sans-serif;font-size:8pt;"; //$NON-NLS-1$ - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/Messages.java deleted file mode 100644 index 75e5d7519..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/Messages.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport; - -import org.eclipse.osgi.util.NLS; - -/** - * String resource handler. - * - * @author Ian Trimble - Oracle - */ -public class Messages extends NLS { - - private static final String BUNDLE_NAME = - "org.eclipse.jst.jsf.apache.trinidad.tagsupport.messages"; //$NON-NLS-1$ - - static { - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - /** - * See messages.properties. - */ - public static String BreadCrumbsOperation_EmptyBreadCrumbsTag; - - /** - * See messages.properties. - */ - public static String NavigationPaneOperation_EmptyNavigationPaneTag; - - /** - * See messages.properties. - */ - public static String PanelTabbedOperation_EmptyPanelTabbedTag; - - /** - * See messages.properties. - */ - public static String ShowDetailItemOperation_EmptyShowDetailItemTag; - - /** - * See messages.properties. - */ - public static String SelectItemModel_SampleItem1Label; - - /** - * See messages.properties. - */ - public static String SelectItemModel_SampleItem1Value; - - /** - * See messages.properties. - */ - public static String SelectItemModel_SampleItem2Label; - - /** - * See messages.properties. - */ - public static String SelectItemModel_SampleItem2Value; - - /** - * See messages.properties. - */ - public static String SelectItemModel_SampleItem3Label; - - /** - * See messages.properties. - */ - public static String SelectItemModel_SampleItem3Value; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_Description; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_LinkMove; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_LinkMoveAll; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_LinkRemove; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_LinkRemoveAll; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_LinkTop; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_LinkUp; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_LinkDown; - - /** - * See messages.properties. - */ - public static String SelectShuttleOperation_LinkBottom; - - /** - * See messages.properties. - */ - public static String TrinidadDTResourceProvider_StyleSheetNotLocated; - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/TrinidadTagSupportActivator.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/TrinidadTagSupportActivator.java deleted file mode 100644 index 35aa53387..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/TrinidadTagSupportActivator.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport; - -import org.eclipse.core.runtime.ILog; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.dtresourceprovider.TrinidadDTResourceProvider; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class TrinidadTagSupportActivator extends AbstractUIPlugin { - - /** - * the plugin id - */ - public static final String PLUGIN_ID = "org.eclipse.jst.jsf.apache.trinidad.tagsupport"; //$NON-NLS-1$ - - // The shared instance - private static TrinidadTagSupportActivator plugin; - - /** - * The constructor - */ - public TrinidadTagSupportActivator() { - // do nothing - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - TrinidadDTResourceProvider.init(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static TrinidadTagSupportActivator getDefault() { - return plugin; - } - - /** - * Writes an informational message to this plug-in's log. - * - * @param message Informational message to be written. - */ - public static void logInfo(String message) { - ILog log = getDefault().getLog(); - log.log(new Status(IStatus.INFO, PLUGIN_ID, message)); - } - - /** - * Writes an error message to this plug-in's log. - * - * @param message Error message to be written. - * @param ex Throwable instance. - */ - public static void logError(String message, Throwable ex) { - ILog log = getDefault().getLog(); - IStatus status; - if (ex != null) { - status = new Status(IStatus.ERROR, PLUGIN_ID, message, ex); - } else { - status = new Status(IStatus.ERROR, PLUGIN_ID, message); - } - log.log(status); - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/TrinidadUtils.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/TrinidadUtils.java deleted file mode 100644 index 97991e448..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/TrinidadUtils.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport; - -import org.w3c.dom.Node; - -/** - * Utility class for the Trinidad Tag Support plug-in. - * - * @author Ian Trimble - Oracle - */ -public class TrinidadUtils { - - private static final String KEY_CURRENT_CHILD_INDEX = - "KEY_CURRENT_CHILD_INDEX"; //$NON-NLS-1$ - - /** - * Sets the index of the Node instance's "current" child as user data on - * the Node instance. - * - * @param node Node instance on which to set index. - * @param index Index of node's "current" child. - * @return true if index has changed, else false. - */ - public static boolean setCurrentChildIndex(Node node, int index) { - boolean indexChanged = false; - if (node != null) { - int currentIndex = getCurrentChildIndex(node); - if (currentIndex != index) { - node.setUserData( - KEY_CURRENT_CHILD_INDEX, - new Integer(index), - null); - indexChanged = true; - } - } - return indexChanged; - } - - /** - * Gets the index of the Node instance's "current" child from user data on - * the Node instance. - * - * @param node Node instance from which to get index. - * @return Index of node's "current" child. A value of -1 indicates - * inability to get index from node. - */ - public static int getCurrentChildIndex(Node node) { - int index = -1; - if (node != null) { - Object obj = node.getUserData(KEY_CURRENT_CHILD_INDEX); - if (obj instanceof Integer) { - index = ((Integer)obj).intValue(); - } - } - return index; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/AbstractLabelAndHelpOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/AbstractLabelAndHelpOperation.java deleted file mode 100644 index d9f2113f4..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/AbstractLabelAndHelpOperation.java +++ /dev/null @@ -1,268 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; -import org.eclipse.jst.pagedesigner.converter.ConvertPosition; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.Text; - -/** - * Abstract ITransformOperation implementation for tags which may be preceded by - * a label and may have a "help" facet. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public abstract class AbstractLabelAndHelpOperation extends AbstractTrinidadTransformOperation { - - private static final String STYLECLASS_OUTERELEMENT = "af_inputText p_AFRequired"; //$NON-NLS-1$ - private static final String STYLECLASS_LABELTD = "af_inputText_label"; //$NON-NLS-1$ - private static final String STYLECLASS_REQUIREDSPAN = "AFRequiredIconStyle"; //$NON-NLS-1$ - private static final String STYLECLASS_CONTROLTD = "AFContentCell"; //$NON-NLS-1$ - protected static final String STYLECLASS_CONTROLELEMENT = "af_inputText_content"; //$NON-NLS-1$ - private static final String STYLECLASS_HELPTD = "AFComponentMessageCell"; //$NON-NLS-1$ - private static final String STYLECLASS_HELPSPAN = "OraInlineInfoText"; //$NON-NLS-1$ - - /** - * Subclasses must implement this method to append the desired DOM structure - * that represents the HTML control(s) to parentElement. - * - * @param srcElement Source Element representing source document tag. - * @param parentElement Parent Element to which structure is appended. - */ - protected abstract void appendControl(Element srcElement, Element parentElement); - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - Element outerElement; - - //create outer Element - String simple = srcElement.getAttribute("simple"); //$NON-NLS-1$ - if (Boolean.valueOf(simple)) { - outerElement = createElement("span"); //$NON-NLS-1$ - } else { - outerElement = createElement("table"); //$NON-NLS-1$ - //append table-specific attributes - appendAttribute(outerElement, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(outerElement, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(outerElement, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - //append common attributes - appendAttribute(outerElement, "class", //$NON-NLS-1$ - calculateStyleClass(STYLECLASS_OUTERELEMENT, srcElement, "styleClass")); //$NON-NLS-1$ - String inlineStyle = calculateStyle(null, srcElement, "inlineStyle"); //$NON-NLS-1$ - if (inlineStyle != null) { - appendAttribute(outerElement, "style", inlineStyle); //$NON-NLS-1$ - } - - if (Boolean.valueOf(simple)) { - //continue building simple variant - appendControl(srcElement, outerElement); - } else { - //continue building non-simple variant - Element trElement = appendChildElement("tr", outerElement); //$NON-NLS-1$ - - if (isRequired(srcElement) || getLabel(srcElement) != null) { - //if either required or has label, build top-left table cell - Element tdElement = appendChildElement("td", trElement); //$NON-NLS-1$ - appendAttribute(tdElement, "class", STYLECLASS_LABELTD); //$NON-NLS-1$ - appendAttribute(tdElement, "valign", "top"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - - if (isRequired(srcElement)) { - Element spanElement = appendChildElement("span", tdElement); //$NON-NLS-1$ - appendAttribute(spanElement, "title", "Required"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(spanElement, "class", STYLECLASS_REQUIREDSPAN); //$NON-NLS-1$ - appendChildText("* ", spanElement); //$NON-NLS-1$ - } - - if (getLabel(srcElement) != null) { - Element labelElement = appendChildElement("label", tdElement); //$NON-NLS-1$ - appendChildText(getLabel(srcElement), labelElement); - } - } - - //build content table cell - Element tdElement = appendChildElement("td", trElement); //$NON-NLS-1$ - appendAttribute(tdElement, "class", STYLECLASS_CONTROLTD); //$NON-NLS-1$ - appendAttribute(tdElement, "valign", "top"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - appendControl(srcElement, tdElement); - - List<Node> helpFacetChildNodes = getHelpFacetChildNodes(srcElement); - if (helpFacetChildNodes.size() > 0) { - //build help table row - trElement = appendChildElement("tr", outerElement); //$NON-NLS-1$ - if (isRequired(srcElement) || getLabel(srcElement) != null) { - tdElement = appendChildElement("td", trElement); //$NON-NLS-1$ - } - tdElement = appendChildElement("td", trElement); //$NON-NLS-1$ - appendAttribute(tdElement, "class", STYLECLASS_HELPTD); //$NON-NLS-1$ - Element spanElement = appendChildElement("span", tdElement); //$NON-NLS-1$ - appendAttribute(spanElement, "class", //$NON-NLS-1$ - calculateStyle(STYLECLASS_HELPSPAN, srcElement, "styleClass")); //$NON-NLS-1$ - if (inlineStyle != null) { - appendAttribute(spanElement, "style", inlineStyle); //$NON-NLS-1$ - } - Iterator<Node> itHelpFacetChildNodes = helpFacetChildNodes.iterator(); - int curPos = 0; - while (itHelpFacetChildNodes.hasNext()) { - Node curNode = itHelpFacetChildNodes.next(); - if (curNode instanceof Text) { - if (curNode.getNodeValue() != null && curNode.getNodeValue().length() > 0) { - tagConverterContext.addChild( - curNode, - new ConvertPosition(spanElement, curPos)); - } - } else { - tagConverterContext.addChild( - curNode, - new ConvertPosition(spanElement, curPos)); - } - curPos++; - } - } - } - - return outerElement; - } - - protected String calculateStyle( - String baseStyle, Element srcElement, String styleAttributeName) { - String style = baseStyle; - if (srcElement != null && styleAttributeName != null) { - String srcElementStyle = srcElement.getAttribute(styleAttributeName); - if (srcElementStyle != null && srcElementStyle.length() > 0) { - if (style != null) { - if (!style.endsWith(";")) { //$NON-NLS-1$ - style += ";"; //$NON-NLS-1$ - } - style += srcElementStyle; - } else { - style = srcElementStyle; - } - } - } - return style; - } - - protected String calculateStyleClass( - String baseStyleClass, Element srcElement, String styleClassAttributeName) { - String styleClass = baseStyleClass; - if (srcElement != null && styleClassAttributeName != null) { - String srcElementStyleClass = srcElement.getAttribute(styleClassAttributeName); - if (srcElementStyleClass != null && srcElementStyleClass.length() > 0) { - if (styleClass != null) { - if (!styleClass.endsWith(",")) { //$NON-NLS-1$ - styleClass += ","; //$NON-NLS-1$ - } - styleClass += srcElementStyleClass; - } else { - styleClass = srcElementStyleClass; - } - } - } - return styleClass; - } - - protected boolean isRequired(Element srcElement) { - boolean required = false; - if (!isChildOfPanelFormLayout(srcElement)) { - if (srcElement != null) { - String requiredVal = srcElement.getAttribute("required"); //$NON-NLS-1$ - String showRequiredVal = srcElement.getAttribute("showRequired"); //$NON-NLS-1$ - //if either are true, for the purposes of tag conversion, consider required to be true - required = - Boolean.parseBoolean(requiredVal) || - Boolean.parseBoolean(showRequiredVal); - } - } - return required; - } - - protected String getLabel(Element srcElement) { - String label = null; - if (!isChildOfPanelFormLayout(srcElement)) { - if (srcElement != null) { - String labelAndAccessKeyVal = srcElement.getAttribute("labelAndAccessKey"); //$NON-NLS-1$ - if (labelAndAccessKeyVal != null && labelAndAccessKeyVal.length() > 0) { - label = labelAndAccessKeyVal; - } else { - String labelVal = srcElement.getAttribute("label"); //$NON-NLS-1$ - if (labelVal != null && labelVal.length() > 0) { - label = labelVal; - } - } - } - } - return label; - } - - protected List<Node> getHelpFacetChildNodes(Element srcElement) { - @SuppressWarnings("unchecked") - List<Node> children = Collections.EMPTY_LIST; - Element helpFacet = getChildFacetByName(srcElement, "help"); //$NON-NLS-1$ - if (helpFacet != null) { - children = getCopyChildrenNodes(helpFacet); - } - return children; - } - - protected int getColumns(Element srcElement) { - int columns = 30; - if (srcElement != null) { - String columnsValue = srcElement.getAttribute("columns"); //$NON-NLS-1$ - if (columnsValue != null && columnsValue.length() > 0) { - try { - columns = Integer.parseInt(columnsValue); - } catch(NumberFormatException nfe) { - //ignore; default value will be returned - } - } - } - return columns; - } - - protected boolean isChildOfPanelFormLayout(Element srcElement) { - boolean isChild = false; - if (srcElement != null) { - Node parent = srcElement.getParentNode(); - if (parent instanceof Element) { - TagIdentifier tagID = TagIdentifierFactory.createDocumentTagWrapper((Element)parent); - if (ITrinidadConstants.TAG_IDENTIFIER_PANELFORMLAYOUT.isSameTagType(tagID)) { - isChild = true; - } else if (ITrinidadConstants.TAG_IDENTIFIER_GROUP.isSameTagType(tagID)) { - isChild = isChildOfPanelFormLayout((Element)parent); - } else if (IJSFConstants.TAG_IDENTIFIER_FACET.isSameTagType(tagID)) { - isChild = isChildOfPanelFormLayout((Element)parent); - } - } - } - return isChild; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/AbstractTrinidadTransformOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/AbstractTrinidadTransformOperation.java deleted file mode 100644 index ca8e9eab2..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/AbstractTrinidadTransformOperation.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation; -import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation; -import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.TransformOperationFactory; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Extends AbstractTransformOperation to supply extra convenience methods. - * - * @author Ian Trimble - Oracle - */ -public abstract class AbstractTrinidadTransformOperation extends AbstractTransformOperation { - - /** - * Appends the specified attribute with the specified value to the specified - * Element instance. - * - * @param element Element instance to append attribute to. - * @param attributeName Name of attribute to be appended. - * @param attributeValue Value of attribute to be appended. - */ - protected void appendAttribute( - Element element, String attributeName, String attributeValue) { - ITransformOperation operation = - TransformOperationFactory.getInstance().getTransformOperation( - TransformOperationFactory.OP_CreateAttributeOperation, - new String[]{attributeName, attributeValue}); - operation.transform(null, element); - } - - /** - * Gets a child Element of the specified parent Element that has the node - * name "facet" and the specified value of the "name" attribute. - * - * @param srcElement Parent Element instance. - * @param facetName Name of the facet Element for which to search. - * @return Child Element that is a facet with the specified name. - */ - protected Element getChildFacetByName(Element srcElement, String facetName) { - Element element = null; - @SuppressWarnings("unchecked") - List facets = getChildElements(srcElement, "facet"); //$NON-NLS-1$ - @SuppressWarnings("unchecked") - Iterator itFacets = facets.iterator(); - while (itFacets.hasNext()) { - Element facet = (Element)itFacets.next(); - String facetAttrName = facet.getAttribute("name"); //$NON-NLS-1$ - if (facetAttrName != null && facetAttrName.equals(facetName)) { - element = facet; - break; - } - } - return element; - } - - /** - * Gets a list of child Elements of the specified parent Element, skipping - * any "facet" Elements. - * - * @param srcElement Parent Element instance. - * @return List of child Elements of the specified parent Element that does - * not include any child "facet" Elements. - */ - protected List<Element> getChildElementsSkipFacets(Element srcElement) { - List<Element> childElementsList = new ArrayList<Element>(); - NodeList childNodes = srcElement.getChildNodes(); - for (int i = 0; i < childNodes.getLength(); i++) { - Node childNode = childNodes.item(i); - if (childNode.getNodeType() == Node.ELEMENT_NODE) { - if (!childNode.getLocalName().equals("facet")) { //$NON-NLS-1$ - childElementsList.add((Element)childNode); - } - } - } - return childElementsList; - } - - /** - * Returns a List of child Node instances that will be added by the - * "CopyChildrenOperation" ITransformOperation. This can be useful in - * determining if any Node instances will, in fact, be copied. - * - * @param srcElement Source Element instance to query for child Node - * instances. - * @return A List of child Node instances that will be added by the - * "CopyChildrenOperation" ITransformOperation. - */ - protected List<Node> getCopyChildrenNodes(Element srcElement) { - List<Node> children = new ArrayList<Node>(); - if (srcElement != null) { - NodeList childNodes = srcElement.getChildNodes(); - for (int i = 0; i < childNodes.getLength(); i++) { - Node childNode = childNodes.item(i); - short childNodeType = childNode.getNodeType(); - if (childNodeType == Node.ELEMENT_NODE || - childNodeType == Node.TEXT_NODE || - childNodeType == Node.CDATA_SECTION_NODE) { - children.add(childNode); - } - } - } - return children; - } - - /** - * Calculates required style class value, based on a specified base style - * class and the value of the source Element instance's "styleClass" - * attribute. - * - * @param baseClass Specified base style class (may be null). - * @param srcElement Source Element instance (may be null). - * @return Required style class value, to be set as "class" attribute (may - * be null). - */ - protected String calculateStyleClass(String baseClass, Element srcElement) { - String styleClass = null; - if (baseClass != null) { - styleClass = baseClass; - } - if (srcElement != null) { - String srcStyleClass = srcElement.getAttribute("styleClass"); //$NON-NLS-1$ - if (srcStyleClass != null && srcStyleClass.length() > 0) { - if (styleClass.length() > 0) { - styleClass += "," + srcStyleClass; //$NON-NLS-1$ - } else { - styleClass = srcStyleClass; - } - } - } - return styleClass; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/BreadCrumbsOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/BreadCrumbsOperation.java deleted file mode 100644 index 6d91e145d..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/BreadCrumbsOperation.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright (c) 2009 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.Messages; -import org.eclipse.jst.pagedesigner.converter.ConvertPosition; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -/** - * ITransformOperation implementation specifically for the "breadCrumbs" JSF - * Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class BreadCrumbsOperation extends AbstractTrinidadTransformOperation { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - Element outerSpan = createElement("span"); //$NON-NLS-1$ - String styleClass = calculateStyleClass("af_breadCrumbs", srcElement); //$NON-NLS-1$ - if (styleClass != null) { - appendAttribute(outerSpan, "class", styleClass); //$NON-NLS-1$ - } - String style = srcElement.getAttribute("inlineStyle"); //$NON-NLS-1$ - if (style != null) { - appendAttribute(outerSpan, "style", style); //$NON-NLS-1$ - } - List<Element> childCmdNavItems = getChildCmdNavItems(srcElement); - int currentChildIndex = 0; - int numChildren = childCmdNavItems.size(); - if (numChildren > 0) { - for (Element childCmdNavItem: childCmdNavItems) { - Element nobr; - if (isVertical(srcElement)) { - Element div = appendChildElement("div", outerSpan); //$NON-NLS-1$ - nobr = appendChildElement("nobr", div); //$NON-NLS-1$ - appendChildText(getIndentationString(currentChildIndex), nobr); - } else { - nobr = appendChildElement("nobr", outerSpan); //$NON-NLS-1$ - } - Element innerSpan = appendChildElement("span", nobr); //$NON-NLS-1$ - tagConverterContext.addChild( - childCmdNavItem, new ConvertPosition(innerSpan, 0)); - if (currentChildIndex < numChildren - 1) { - //appendChildText(" > ", nobr); //$NON-NLS-1$ - appendChildText("\u00A0 \u003E \u00A0", nobr); //$NON-NLS-1$ - } - currentChildIndex++; - } - } else { - appendAttribute(outerSpan, "style", ITrinidadConstants.STYLE_EMPTYELEMENT); //$NON-NLS-1$ - appendChildText(Messages.BreadCrumbsOperation_EmptyBreadCrumbsTag, outerSpan); - } - return outerSpan; - } - - private List<Element> getChildCmdNavItems(Element srcElement) { - List<Element> childCmdNavItems = new ArrayList<Element>(); - NodeList childElements = srcElement.getElementsByTagNameNS(ITrinidadConstants.URI_CORE, "commandNavigationItem"); //$NON-NLS-1$$ - if (childElements != null && childElements.getLength() > 0) { - for (int i = 0, len = childElements.getLength(); i < len; i++) { - childCmdNavItems.add((Element)childElements.item(i)); - } - } else { - Element nodeStampFacet = getChildFacetByName(srcElement, "nodeStamp"); //$NON-NLS-1$ - if (nodeStampFacet != null) { - childElements = nodeStampFacet.getElementsByTagNameNS(ITrinidadConstants.URI_CORE, "commandNavigationItem"); //$NON-NLS-1$ - if (childElements != null && childElements.getLength() > 0) { - for (int i = 0, len = childElements.getLength(); i < len; i++) { - childCmdNavItems.add((Element)childElements.item(i)); - } - } - } - } - return childCmdNavItems; - } - - private boolean isVertical(Element srcElement) { - String orientationAttr = srcElement.getAttribute(ITrinidadConstants.ATTR_ORIENTATION); - return "vertical".equalsIgnoreCase(orientationAttr); //$NON-NLS-1$ - } - - private String getIndentationString(int indentationLevel) { - StringBuffer indentation = new StringBuffer(""); //$NON-NLS-1$ - for (int i = 0; i < indentationLevel; i++) { - //indentation.append(" "); //$NON-NLS-1$ - indentation.append(" \u00A0 \u00A0 \u00A0 \u00A0 \u00A0"); //$NON-NLS-1$ - } - return indentation.toString(); - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CommandNavigationItemOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CommandNavigationItemOperation.java deleted file mode 100644 index 7dc403090..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CommandNavigationItemOperation.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * Copyright (c) 2009 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * ITransformOperation implementation specifically for the - * "commandNavigationItem" JSF Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class CommandNavigationItemOperation extends AbstractTrinidadTransformOperation { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - Element topElement = null; - if (isDescendentOf(ITrinidadConstants.TAG_IDENTIFIER_BREADCRUMBS, srcElement)) { - topElement = transformForBreadCrumbs(srcElement); - } else if (isDescendentOf(ITrinidadConstants.TAG_IDENTIFIER_NAVIGATIONPANE, srcElement)) { - Element navPane = getAncestor(ITrinidadConstants.TAG_IDENTIFIER_NAVIGATIONPANE, srcElement); - if (navPane != null) { - String navPaneHint = navPane.getAttribute("hint"); //$NON-NLS-1$ - if ("choice".equalsIgnoreCase(navPaneHint)) { //$NON-NLS-1$ - topElement = transformForNavigationPane_Choice(srcElement); - } else { - topElement = doDefaultTransform(srcElement); - } - } - } else { - topElement = doDefaultTransform(srcElement); - } - return topElement; - } - - private Element transformForBreadCrumbs(Element srcElement) { - Element anchor = createElement("a"); //$NON-NLS-1$ - if (!isDisabledOrLastCmdNavItem(srcElement)) { - appendAttribute(anchor, "href", "#"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(anchor, "class", "af_breadCrumbs_step"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - appendAttribute(anchor, "class", "af_breadCrumbs_selected-step"); //$NON-NLS-1$ //$NON-NLS-2$ - } - appendChildText(getText(srcElement), anchor); - return anchor; - } - - private Element transformForNavigationPane_Choice(Element srcElement) { - Element option = createElement("option"); //$NON-NLS-1$ - if (isSelected(srcElement)) { - appendAttribute(option, "selected", "selected"); //$NON-NLS-1$ //$NON-NLS-2$ - } - appendChildText(getText(srcElement), option); - return option; - } - - private Element doDefaultTransform(Element srcElement) { - Element anchor = createElement("a"); //$NON-NLS-1$ - if (!isDisabled(srcElement)) { - appendAttribute(anchor, "href", "#"); //$NON-NLS-1$ //$NON-NLS-2$ - } - appendChildText(getText(srcElement), anchor); - return anchor; - } - - private boolean isDescendentOf(TagIdentifier tagIdentifier, Element srcElement) { - boolean isDescendent = false; - if (tagIdentifier != null && srcElement != null) { - Node parentNode = srcElement.getParentNode(); - if (parentNode instanceof Element) { - if (tagIdentifier.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper((Element)parentNode))) { - isDescendent = true; - } else if (IJSFConstants.TAG_IDENTIFIER_FACET.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper((Element)parentNode))) { - parentNode = parentNode.getParentNode(); - if (parentNode instanceof Element) { - if (tagIdentifier.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper((Element)parentNode))) { - isDescendent = true; - } - } - } - } - } - return isDescendent; - } - - private Element getAncestor(TagIdentifier tagIdentifier, Element srcElement) { - Element ancestor = null; - if (tagIdentifier != null && srcElement != null) { - Node parentNode = srcElement.getParentNode(); - if (parentNode instanceof Element) { - if (tagIdentifier.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper((Element)parentNode))) { - ancestor = (Element)parentNode; - } else if (IJSFConstants.TAG_IDENTIFIER_FACET.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper((Element)parentNode))) { - parentNode = parentNode.getParentNode(); - if (parentNode instanceof Element) { - if (tagIdentifier.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper((Element)parentNode))) { - ancestor = (Element)parentNode; - } - } - } - } - } - return ancestor; - } - - /** - * Gets display text from a commandNavigationItem Element. - * - * @param srcElement A commmandNavigationItem Element instance. - * @return Display text from a commandNavigationItem Element. - */ - public static String getText(Element srcElement) { - String text = "commandNavigationItem"; //$NON-NLS-1$ - if (srcElement != null) { - String newText = srcElement.getAttribute(ITrinidadConstants.ATTR_TEXTANDACCESSKEY); - if (newText != null && newText.length() > 0) { - text = newText; - } else { - newText = srcElement.getAttribute(ITrinidadConstants.ATTR_TEXT); - if (newText != null && newText.length() > 0) { - text = newText; - } else { - newText = srcElement.getAttribute(ITrinidadConstants.ATTR_ACTION); - if (newText != null && newText.length() > 0) { - text = newText; - } else { - newText = srcElement.getAttribute(ITrinidadConstants.ATTR_DESTINATION); - if (newText != null && newText.length() > 0) { - text = newText; - } - } - } - } - } - return text; - } - - public static boolean isDisabled(Element srcElement) { - String disabledAttr = srcElement.getAttribute(ITrinidadConstants.ATTR_DISABLED); - return Boolean.TRUE.toString().equalsIgnoreCase(disabledAttr); - } - - private boolean isDisabledOrLastCmdNavItem(Element srcElement) { - boolean ret = false; - String disabledAttr = srcElement.getAttribute(ITrinidadConstants.ATTR_DISABLED); - if (Boolean.TRUE.toString().equalsIgnoreCase(disabledAttr)) { - ret = true; - } else { - Node nextSibling = srcElement; - while (nextSibling != null) { - nextSibling = nextSibling.getNextSibling(); - if (nextSibling == null) { - ret = true; - } else { - if (nextSibling instanceof Element) { - if (TagIdentifierFactory.createDocumentTagWrapper((Element)nextSibling).isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_COMMANDNAVIGATIONITEM)) { - break; - } - } - } - } - } - return ret; - } - - public static boolean isSelected(Element srcElement) { - String selectedAttr = srcElement.getAttribute(ITrinidadConstants.ATTR_SELECTED); - return Boolean.TRUE.toString().equalsIgnoreCase(selectedAttr); - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CreateClassAttributeOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CreateClassAttributeOperation.java deleted file mode 100644 index 66f6baad7..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CreateClassAttributeOperation.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2009 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation to handle merging of an Element's optional - * default style class with a specified "styleClass" as the current Element's - * "class" attribute. - * - * @author Ian Trimble - Oracle - */ -public class CreateClassAttributeOperation extends AbstractTrinidadTransformOperation { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - String classValue = null; - if (getParameters().length > 0) { - classValue = getParameters()[0]; - } - String styleClass = srcElement.getAttribute("styleClass"); //$NON-NLS-1$ - if (styleClass != null && styleClass.length() > 0) { - if (classValue == null) { - classValue = styleClass; - } else { - classValue = styleClass + " " + classValue; //$NON-NLS-1$ - } - } - if (classValue != null && curElement != null) { - curElement.setAttribute("class", classValue); //$NON-NLS-1$ - } - return curElement; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CreateStyleAttributeOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CreateStyleAttributeOperation.java deleted file mode 100644 index b0baffaa5..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/CreateStyleAttributeOperation.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation to handle merging of an Element's optional - * default style with a specified "inlineStyle" as the current Element's "style" - * attribute. - * - * @author Ian Trimble - Oracle - */ -public class CreateStyleAttributeOperation extends AbstractTrinidadTransformOperation { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - String styleValue = null; - if (getParameters().length > 0) { - styleValue = getParameters()[0]; - } - String inlineStyle = srcElement.getAttribute("inlineStyle"); //$NON-NLS-1$ - if (inlineStyle != null && inlineStyle.length() > 0) { - if (styleValue == null) { - styleValue = inlineStyle; - } else { - if (styleValue.length() > 0 && !styleValue.endsWith(";")) { //$NON-NLS-1$ - styleValue += ";"; //$NON-NLS-1$ - } - styleValue += inlineStyle; - } - } - if (styleValue != null && curElement != null) { - curElement.setAttribute("style", styleValue); //$NON-NLS-1$ - } - return curElement; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputFileOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputFileOperation.java deleted file mode 100644 index f3e2e97e7..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputFileOperation.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation specifically for the "inputFile" JSF - * Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class InputFileOperation extends AbstractLabelAndHelpOperation { - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#appendControl(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - protected void appendControl(Element srcElement, Element parentElement) { - Element controlElement = appendChildElement("input", parentElement); //$NON-NLS-1$ - appendAttribute(controlElement, "size", //$NON-NLS-1$ - String.valueOf(getColumns(srcElement))); - appendAttribute(controlElement, "type", "file"); //$NON-NLS-1$ //$NON-NLS-2$ - String value = srcElement.getAttribute("value"); //$NON-NLS-1$ - if (value != null) { - appendAttribute(controlElement, "value", value); //$NON-NLS-1$ - } - //append common attributes - appendAttribute(controlElement, "class", STYLECLASS_CONTROLELEMENT); //$NON-NLS-1$ - String contentStyle = calculateStyle(null, srcElement, "contentStyle"); //$NON-NLS-1$ - if (contentStyle != null) { - appendAttribute(controlElement, "style", contentStyle); //$NON-NLS-1$ - } - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputTextOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputTextOperation.java deleted file mode 100644 index 47f7ab46f..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputTextOperation.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation specifically for the "inputText" JSF - * Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class InputTextOperation extends AbstractLabelAndHelpOperation { - - /* - * (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#appendControl(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - protected void appendControl(Element srcElement, Element parentElement) { - int rows = getRows(srcElement); - Element controlElement; - if (rows < 2) { - controlElement = appendChildElement("input", parentElement); //$NON-NLS-1$ - appendAttribute(controlElement, "size", //$NON-NLS-1$ - String.valueOf(getColumns(srcElement))); - appendAttribute(controlElement, "type", getType(srcElement)); //$NON-NLS-1$ - String value = srcElement.getAttribute("value"); //$NON-NLS-1$ - if (value != null) { - appendAttribute(controlElement, "value", value); //$NON-NLS-1$ - } - } else { - controlElement = appendChildElement("textarea", parentElement); //$NON-NLS-1$ - appendAttribute(controlElement, "cols", //$NON-NLS-1$ - String.valueOf(getColumns(srcElement))); - appendAttribute(controlElement, "rows", //$NON-NLS-1$ - String.valueOf(getRows(srcElement))); - appendAttribute(controlElement, "wrap", getWrap(srcElement)); //$NON-NLS-1$ - String value = srcElement.getAttribute("value"); //$NON-NLS-1$ - if (value != null) { - appendChildText(value, controlElement); - } - } - //append common attributes - appendAttribute(controlElement, "class", STYLECLASS_CONTROLELEMENT); //$NON-NLS-1$ - String contentStyle = calculateStyle(null, srcElement, "contentStyle"); //$NON-NLS-1$ - if (contentStyle != null) { - appendAttribute(controlElement, "style", contentStyle); //$NON-NLS-1$ - } - } - - private int getRows(Element srcElement) { - int rows = 1; - if (srcElement != null) { - String rowsValue = srcElement.getAttribute("rows"); //$NON-NLS-1$ - if (rowsValue != null && rowsValue.length() > 0) { - try { - rows = Integer.parseInt(rowsValue); - } catch(NumberFormatException nfe) { - //ignore; default value will be returned - } - } - } - return rows; - } - - private String getWrap(Element srcElement) { - String wrap = "soft"; //$NON-NLS-1$ - if (srcElement != null) { - String wrapValue = srcElement.getAttribute("wrap"); //$NON-NLS-1$ - if (wrapValue != null && wrapValue.length() > 0) { - wrap = wrapValue; - } - } - return wrap; - } - - private String getType(Element srcElement) { - String type = "text"; //$NON-NLS-1$ - if (srcElement != null) { - String secret = srcElement.getAttribute("secret"); //$NON-NLS-1$ - if (Boolean.valueOf(secret)) { - type = "password"; //$NON-NLS-1$ - } - } - return type; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputTextWithIconOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputTextWithIconOperation.java deleted file mode 100644 index d425db04e..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/InputTextWithIconOperation.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation specifically for any "input..." JSF - * Elements that are basically comprised of an inputText followed by an icon. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class InputTextWithIconOperation extends AbstractLabelAndHelpOperation { - - private String imageFilename; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - if (getParameters().length < 1) { - getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$ - return null; - } else { - imageFilename = getParameters()[0]; - } - return super.transform(srcElement, curElement); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#appendControl(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - protected void appendControl(Element srcElement, Element parentElement) { - //append input - Element inputElement = appendChildElement("input", parentElement); //$NON-NLS-1$ - appendAttribute(inputElement, "size", //$NON-NLS-1$ - String.valueOf(getColumns(srcElement))); - appendAttribute(inputElement, "type", "text"); //$NON-NLS-1$ //$NON-NLS-2$ - String value = srcElement.getAttribute("value"); //$NON-NLS-1$ - if (value != null) { - appendAttribute(inputElement, "value", value); //$NON-NLS-1$ - } - //append common attributes - appendAttribute(inputElement, "class", STYLECLASS_CONTROLELEMENT); //$NON-NLS-1$ - String contentStyle = calculateStyle(null, srcElement, "contentStyle"); //$NON-NLS-1$ - if (contentStyle != null) { - appendAttribute(inputElement, "style", contentStyle); //$NON-NLS-1$ - } - - //append anchor with child image - Element aElement = appendChildElement("a", parentElement); //$NON-NLS-1$ - appendAttribute(aElement, "href", "#"); //$NON-NLS-1$ //$NON-NLS-2$ - Element imgElement = appendChildElement("img", aElement); //$NON-NLS-1$ - appendAttribute(imgElement, "align", "absmiddle"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(imgElement, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(imgElement, "src", imageFilename); //$NON-NLS-1$ - appendAttribute(imgElement, "style", "margin-left:4px;"); //$NON-NLS-1$ //$NON-NLS-2$ - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/NavigationPaneOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/NavigationPaneOperation.java deleted file mode 100644 index 8a010ae2a..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/NavigationPaneOperation.java +++ /dev/null @@ -1,430 +0,0 @@ -/** - * Copyright (c) 2009 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.Messages; -import org.eclipse.jst.pagedesigner.converter.ConvertPosition; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -/** - * ITransformOperation implementation specifically for the "navigationPane" - * JSF Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class NavigationPaneOperation extends AbstractTrinidadTransformOperation { - - private static final String STYLECLASS_OUTERDIV = "af_navigationPane"; //$NON-NLS-1$ - - private static final String STYLECLASS_BAR_OUTERDIV = "af_navigationPane_bar"; //$NON-NLS-1$ - private static final String STYLECLASS_BAR_TABLE_INACTIVE_ENABLED = "af_navigationPane_bar-inactive-enabled"; //$NON-NLS-1$ - private static final String STYLECLASS_BAR_TABLE_ACTIVE_ENABLED = "af_navigationPane_bar-active-enabled"; //$NON-NLS-1$ - private static final String STYLECLASS_BAR_TABLE_INACTIVE_DISABLED = "af_navigationPane_bar-inactive-disabled"; //$NON-NLS-1$ - private static final String STYLECLASS_BAR_TABLE_ACTIVE_DISABLED = "af_navigationPane_bar-active-disabled"; //$NON-NLS-1$ - private static final String STYLECLASS_BAR_DIV_CONTENT = "af_navigationPane_bar-content"; //$NON-NLS-1$ - private static final String STYLECLASS_BAR_DIV_SEPARATOR = "af_navigationPane_bar-separator"; //$NON-NLS-1$ - - private static final String STYLECLASS_BUTTONS_TABLE_INACTIVE_ENABLED = "af_navigationPane_buttons-inactive-enabled"; //$NON-NLS-1$ - private static final String STYLECLASS_BUTTONS_TABLE_ACTIVE_ENABLED = "af_navigationPane_buttons-active-enabled"; //$NON-NLS-1$ - private static final String STYLECLASS_BUTTONS_TABLE_INACTIVE_DISABLED = "af_navigationPane_buttons-inactive-disabled"; //$NON-NLS-1$ - private static final String STYLECLASS_BUTTONS_TABLE_ACTIVE_DISABLED = "af_navigationPane_buttons-active-disabled"; //$NON-NLS-1$ - private static final String STYLECLASS_BUTTONS_DIV_CONTENT = "af_navigationPane_buttons-content"; //$NON-NLS-1$ - private static final String STYLECLASS_BUTTONS_DIV_SEPARATOR = "af_navigationPane_buttons-separator"; //$NON-NLS-1$ - - private static final String STYLECLASS_CHOICE_SELECT = "af_navigationPane_choice-options"; //$NON-NLS-1$ - private static final String STYLECLASS_CHOICE_BUTTON = "af_navigationPane_choice-button"; //$NON-NLS-1$ - - private static final String STYLECLASS_LIST_TABLE_INACTIVE_ENABLED = "af_navigationPane_list-inactive-enabled"; //$NON-NLS-1$ - private static final String STYLECLASS_LIST_TABLE_ACTIVE_ENABLED = "af_navigationPane_list-active-enabled"; //$NON-NLS-1$ - private static final String STYLECLASS_LIST_TABLE_INACTIVE_DISABLED = "af_navigationPane_list-inactive-disabled"; //$NON-NLS-1$ - private static final String STYLECLASS_LIST_TABLE_ACTIVE_DISABLED = "af_navigationPane_list-active-disabled"; //$NON-NLS-1$ - private static final String STYLECLASS_LIST_TD_BULLET = "af_navigationPane_list-bullet"; //$NON-NLS-1$ - private static final String STYLECLASS_LIST_DIV_CONTENT = "af_navigationPane_list-content"; //$NON-NLS-1$ - - private static final String STYLECLASS_TABS_TABLE_INACTIVE_ENABLED = "af_navigationPane_tabs-inactive"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TABLE_ACTIVE_ENABLED = "af_navigationPane_tabs-active"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TABLE_INACTIVE_DISABLED = "af_navigationPane_tabs-inactive p_AFDisabled"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TABLE_ACTIVE_DISABLED = "af_navigationPane_tabs-active p_AFDisabled"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_START = "af_navigationPane_tabs-start"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_START_JOIN = "af_navigationPane_tabs-start-join"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_START_JOINFROMACTIVE = "af_navigationPane_tabs-start-join-from-active"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_START_JOINFROMINACTIVE = "af_navigationPane_tabs-start-join-from-inactive"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_BOTTOM_START = "af_navigationPane_tabs-bottom-start"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_MID = "af_navigationPane_tabs-mid"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_BOTTOM_MID = "af_navigationPane_tabs-bottom-mid"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_END = "af_navigationPane_tabs-end"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_END_JOINTOINACTIVE = "af_navigationPane_tabs-end-join-to-inactive"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_BOTTOM_END = "af_navigationPane_tabs-bottom-end"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_TD_BOTTOM_END_JOIN = "af_navigationPane_tabs-bottom-end-join"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_DIV_BOTTOM_START_CONTENT = "af_navigationPane_tabs-bottom-start-content"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_DIV_BOTTOM_MID_CONTENT = "af_navigationPane_tabs-bottom-mid-content"; //$NON-NLS-1$ - private static final String STYLECLASS_TABS_DIV_BOTTOM_END_CONTENT = "af_navigationPane_tabs-bottom-end-content"; //$NON-NLS-1$ - - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - Element div = null; - String hint = getHint(srcElement); - if (hint.equalsIgnoreCase("bar")) { //$NON-NLS-1$ - div = transformAsBar(srcElement); - } else if (hint.equalsIgnoreCase("buttons")) { //$NON-NLS-1$ - div = transformAsButtons(srcElement); - } else if (hint.equalsIgnoreCase("choice")) { //$NON-NLS-1$ - div = transformAsChoice(srcElement); - } else if (hint.equalsIgnoreCase("list")) { //$NON-NLS-1$ - div = transformAsList(srcElement); - } else if (hint.equalsIgnoreCase("tabs")) { //$NON-NLS-1$ - div = transformAsTabs(srcElement); - } else { - div = transformAsBar(srcElement); - } - return div; - } - - private Element transformAsBar(Element srcElement) { - return transformAsBarOrButtons(srcElement, true); - } - - private Element transformAsButtons(Element srcElement) { - return transformAsBarOrButtons(srcElement, false); - } - - private Element transformAsBarOrButtons(Element srcElement, boolean isBar) { - Element div = null; - String styleClass_outerDiv; - String styleClass_tableInactiveEnabled; - String styleClass_tableActiveEnabled; - String styleClass_tableInactiveDisabled; - String styleClass_tableActiveDisabled; - String styleClass_divContent; - String styleClass_divSeparator; - if (isBar) { - styleClass_outerDiv = STYLECLASS_BAR_OUTERDIV; - styleClass_tableInactiveEnabled = STYLECLASS_BAR_TABLE_INACTIVE_ENABLED; - styleClass_tableActiveEnabled = STYLECLASS_BAR_TABLE_ACTIVE_ENABLED; - styleClass_tableInactiveDisabled = STYLECLASS_BAR_TABLE_INACTIVE_DISABLED; - styleClass_tableActiveDisabled = STYLECLASS_BAR_TABLE_ACTIVE_DISABLED; - styleClass_divContent = STYLECLASS_BAR_DIV_CONTENT; - styleClass_divSeparator = STYLECLASS_BAR_DIV_SEPARATOR; - } else { - styleClass_outerDiv = STYLECLASS_OUTERDIV; - styleClass_tableInactiveEnabled = STYLECLASS_BUTTONS_TABLE_INACTIVE_ENABLED; - styleClass_tableActiveEnabled = STYLECLASS_BUTTONS_TABLE_ACTIVE_ENABLED; - styleClass_tableInactiveDisabled = STYLECLASS_BUTTONS_TABLE_INACTIVE_DISABLED; - styleClass_tableActiveDisabled = STYLECLASS_BUTTONS_TABLE_ACTIVE_DISABLED; - styleClass_divContent = STYLECLASS_BUTTONS_DIV_CONTENT; - styleClass_divSeparator = STYLECLASS_BUTTONS_DIV_SEPARATOR; - } - div = createElement("div"); //$NON-NLS-1$ - setClassAndStyleAttributes(srcElement, styleClass_outerDiv, div); - List<Element> childCmdNavItems = getChildCmdNavItems(srcElement); - int index = 0; - int numChildCmdNavItems = childCmdNavItems.size(); - if (numChildCmdNavItems > 0) { - for (Element childCmdNavItem: childCmdNavItems) { - String styleClass = - determineStyleClass( - childCmdNavItem, - styleClass_tableActiveEnabled, - styleClass_tableActiveDisabled, - styleClass_tableInactiveEnabled, - styleClass_tableInactiveDisabled); - Element tbody = appendTableAndTBody(div, true, styleClass); - Element tr = appendChildElement("tr", tbody); //$NON-NLS-1$ - Element contentTD = appendChildElement("td", tr); //$NON-NLS-1$ - Element contentDiv = appendChildElement("div", contentTD); //$NON-NLS-1$ - appendAttribute(contentDiv, "class", styleClass_divContent); //$NON-NLS-1$ - tagConverterContext.addChild( - childCmdNavItem, - new ConvertPosition(contentDiv, 0)); - if (index++ < numChildCmdNavItems - 1) { - Element separatorTD = appendChildElement("td", tr); //$NON-NLS-1$ - Element separatorDiv = appendChildElement("div", separatorTD); //$NON-NLS-1$ - appendAttribute(separatorDiv, "class", styleClass_divSeparator); //$NON-NLS-1$ - appendChildText("|", separatorDiv); //$NON-NLS-1$ - } - } - } else { - setEmptyNavPaneMessage(div); - } - return div; - } - - private Element transformAsChoice(Element srcElement) { - Element div = null; - div = createElement("div"); //$NON-NLS-1$ - setClassAndStyleAttributes(srcElement, STYLECLASS_OUTERDIV, div); - List<Element> childCmdNavItems = getChildCmdNavItems(srcElement); - if (childCmdNavItems.size() > 0) { - Element select = appendChildElement("select", div); //$NON-NLS-1$ - appendAttribute(select, "class", STYLECLASS_CHOICE_SELECT); //$NON-NLS-1$ - for (Element childCmdNavItem: childCmdNavItems) { - if (!CommandNavigationItemOperation.isDisabled(childCmdNavItem)) { - Element option = appendChildElement("option", select); //$NON-NLS-1$ - if (CommandNavigationItemOperation.isSelected(childCmdNavItem)) { - appendAttribute(option, "selected", "selected"); //$NON-NLS-1$ //$NON-NLS-2$ - } - appendChildText(CommandNavigationItemOperation.getText(childCmdNavItem), option); - } - } - Element span = appendChildElement("span", div); //$NON-NLS-1$ - appendAttribute(span, "style", "width: 5px;"); //$NON-NLS-1$ //$NON-NLS-2$ - appendChildText(" ", span); //$NON-NLS-1$ - Element button = appendChildElement("button", div); //$NON-NLS-1$ - appendAttribute(button, "class", STYLECLASS_CHOICE_BUTTON); //$NON-NLS-1$ - appendAttribute(button, "type", "button"); //$NON-NLS-1$ //$NON-NLS-2$ - appendChildText("Go", button); //$NON-NLS-1$ - } else { - setEmptyNavPaneMessage(div); - } - return div; - } - - private Element transformAsList(Element srcElement) { - Element div = null; - div = createElement("div"); //$NON-NLS-1$ - setClassAndStyleAttributes(srcElement, STYLECLASS_OUTERDIV, div); - List<Element> childCmdNavItems = getChildCmdNavItems(srcElement); - if (childCmdNavItems.size() > 0) { - for (Element childCmdNavItem: childCmdNavItems) { - String styleClass = - determineStyleClass( - childCmdNavItem, - STYLECLASS_LIST_TABLE_ACTIVE_ENABLED, - STYLECLASS_LIST_TABLE_ACTIVE_DISABLED, - STYLECLASS_LIST_TABLE_INACTIVE_ENABLED, - STYLECLASS_LIST_TABLE_INACTIVE_DISABLED); - Element tbody = appendTableAndTBody(div, false, styleClass); - Element tr = appendChildElement("tr", tbody); //$NON-NLS-1$ - Element bulletTD = appendChildElement("td", tr); //$NON-NLS-1$ - appendAttribute(bulletTD, "class", STYLECLASS_LIST_TD_BULLET); //$NON-NLS-1$ - Element bulletDiv = appendChildElement("div", bulletTD); //$NON-NLS-1$ - appendChildText(" ", bulletDiv); //$NON-NLS-1$ - Element contentTD = appendChildElement("td", tr); //$NON-NLS-1$ - Element contentDiv = appendChildElement("div", contentTD); //$NON-NLS-1$ - appendAttribute(contentDiv, "class", STYLECLASS_LIST_DIV_CONTENT); //$NON-NLS-1$ - tagConverterContext.addChild( - childCmdNavItem, - new ConvertPosition(contentDiv, 0)); - } - } else { - setEmptyNavPaneMessage(div); - } - return div; - } - - private Element transformAsTabs(Element srcElement) { - Element div = null; - div = createElement("div"); //$NON-NLS-1$ - setClassAndStyleAttributes(srcElement, STYLECLASS_OUTERDIV, div); - List<Element> childCmdNavItems = getChildCmdNavItems(srcElement); - int index = 0; - int numChildCmdNavItems = childCmdNavItems.size(); - int selectedTabIndex = determineSelectedTabIndex(childCmdNavItems); - if (numChildCmdNavItems > 0) { - for (Element childCmdNavItem: childCmdNavItems) { - String tableStyleClass = - determineStyleClass( - childCmdNavItem, - STYLECLASS_TABS_TABLE_ACTIVE_ENABLED, - STYLECLASS_TABS_TABLE_ACTIVE_DISABLED, - STYLECLASS_TABS_TABLE_INACTIVE_ENABLED, - STYLECLASS_TABS_TABLE_INACTIVE_DISABLED); - Element outerTBody = appendTableAndTBody(div, true, ""); //$NON-NLS-1$ - Element outerTR = appendChildElement("tr", outerTBody); //$NON-NLS-1$ - Element outerTD = appendChildElement("td", outerTR); //$NON-NLS-1$ - Element innerTBody = appendTableAndTBody(outerTD, false, tableStyleClass); - appendStartColumn(innerTBody, index, selectedTabIndex); - outerTD = appendChildElement("td", outerTR); //$NON-NLS-1$ - innerTBody = appendTableAndTBody(outerTD, false, tableStyleClass); - appendMidColumn(innerTBody, childCmdNavItem); - if (index + 1 != selectedTabIndex) { - outerTD = appendChildElement("td", outerTR); //$NON-NLS-1$ - innerTBody = appendTableAndTBody(outerTD, false, tableStyleClass); - appendEndColumn(innerTBody, index, numChildCmdNavItems); - } - index++; - } - } else { - setEmptyNavPaneMessage(div); - } - return div; - } - - private List<Element> getChildCmdNavItems(Element srcElement) { - List<Element> childCmdNavItems = new ArrayList<Element>(); - NodeList childElements = srcElement.getElementsByTagNameNS(ITrinidadConstants.URI_CORE, "commandNavigationItem"); //$NON-NLS-1$$ - if (childElements != null && childElements.getLength() > 0) { - for (int i = 0, len = childElements.getLength(); i < len; i++) { - childCmdNavItems.add((Element)childElements.item(i)); - } - } else { - Element nodeStampFacet = getChildFacetByName(srcElement, "nodeStamp"); //$NON-NLS-1$ - if (nodeStampFacet != null) { - childElements = nodeStampFacet.getElementsByTagNameNS(ITrinidadConstants.URI_CORE, "commandNavigationItem"); //$NON-NLS-1$ - if (childElements != null && childElements.getLength() > 0) { - for (int i = 0, len = childElements.getLength(); i < len; i++) { - childCmdNavItems.add((Element)childElements.item(i)); - } - } - } - } - return childCmdNavItems; - } - - private String getHint(Element srcElement) { - String hint = srcElement.getAttribute("hint"); //$NON-NLS-1$ - return hint != null ? hint : "bar"; //$NON-NLS-1$ - } - - private void setClassAndStyleAttributes(Element srcElement, String baseStyleClass, Element curElement) { - String styleClass = calculateStyleClass(baseStyleClass, srcElement); - if (styleClass != null) { - appendAttribute(curElement, "class", styleClass); //$NON-NLS-1$ - } - String style = srcElement.getAttribute("inlineStyle"); //$NON-NLS-1$ - if (style != null) { - appendAttribute(curElement, "style", style); //$NON-NLS-1$ - } - } - - private void setEmptyNavPaneMessage(Element curElement) { - appendAttribute(curElement, "style", ITrinidadConstants.STYLE_EMPTYELEMENT); //$NON-NLS-1$ - appendChildText(Messages.NavigationPaneOperation_EmptyNavigationPaneTag, curElement); - } - - private Element appendTableAndTBody(Element parentElement, boolean isInline, String styleClass) { - Element table = appendChildElement("table", parentElement); //$NON-NLS-1$ - appendAttribute(table, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(table, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(table, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - if (isInline) { - appendAttribute(table, "style", "display: inline;"); //$NON-NLS-1$ //$NON-NLS-2$ - } - appendAttribute(table, "class", styleClass); //$NON-NLS-1$ - Element tbody = appendChildElement("tbody", table); //$NON-NLS-1$ - return tbody; - } - - private String determineStyleClass( - Element cmdNavItem, - String styleClass_ActiveEnabled, - String styleClass_ActiveDisabled, - String styleClass_InactiveEnabled, - String styleClass_InactiveDisabled) { - String styleClass; - if (CommandNavigationItemOperation.isSelected(cmdNavItem)) { - if (!CommandNavigationItemOperation.isDisabled(cmdNavItem)) { - styleClass = styleClass_ActiveEnabled; - } else { - styleClass = styleClass_ActiveDisabled; - } - } else { - if (!CommandNavigationItemOperation.isDisabled(cmdNavItem)) { - styleClass = styleClass_InactiveEnabled; - } else { - styleClass = styleClass_InactiveDisabled; - } - } - return styleClass; - } - - private int determineSelectedTabIndex(List<Element> childCmdNavItems) { - int selectedTabIndex = -2; - int curTabIndex = 0; - for (Element childCmdNavItem: childCmdNavItems) { - if (CommandNavigationItemOperation.isSelected(childCmdNavItem)) { - selectedTabIndex = curTabIndex; - break; - } - curTabIndex++; - } - return selectedTabIndex; - } - - private void appendStartColumn(Element parentTBody, int curTabIndex, int selectedTabIndex) { - String topTDStyleClass; - String bottomTDStyleClass; - String divStyleClass; - if (curTabIndex == 0) { - topTDStyleClass = STYLECLASS_TABS_TD_START; - bottomTDStyleClass = STYLECLASS_TABS_TD_BOTTOM_START; - divStyleClass = STYLECLASS_TABS_DIV_BOTTOM_START_CONTENT; - } else { - if (curTabIndex == selectedTabIndex) { - topTDStyleClass = STYLECLASS_TABS_TD_START_JOIN; - bottomTDStyleClass = STYLECLASS_TABS_TD_BOTTOM_START; - divStyleClass = STYLECLASS_TABS_DIV_BOTTOM_START_CONTENT; - } else { - if (curTabIndex == selectedTabIndex + 1) { - topTDStyleClass = STYLECLASS_TABS_TD_START_JOINFROMACTIVE; - } else { - topTDStyleClass = STYLECLASS_TABS_TD_START_JOINFROMINACTIVE; - } - bottomTDStyleClass = STYLECLASS_TABS_TD_BOTTOM_END; - divStyleClass = STYLECLASS_TABS_DIV_BOTTOM_MID_CONTENT; - } - } - Element topTR = appendChildElement("tr", parentTBody); //$NON-NLS-1$ - Element topTD = appendChildElement("td", topTR); //$NON-NLS-1$ - appendAttribute(topTD, "class", topTDStyleClass); //$NON-NLS-1$ - Element bottomTR = appendChildElement("tr", parentTBody); //$NON-NLS-1$ - Element bottomTD = appendChildElement("td", bottomTR); //$NON-NLS-1$ - appendAttribute(bottomTD, "class", bottomTDStyleClass); //$NON-NLS-1$ - Element div = appendChildElement("div", bottomTD); //$NON-NLS-1$ - appendAttribute(div, "class", divStyleClass); //$NON-NLS-1$ - } - - private void appendMidColumn(Element parentTBody, Element cmdNavItem) { - Element topTR = appendChildElement("tr", parentTBody); //$NON-NLS-1$ - Element topTD = appendChildElement("td", topTR); //$NON-NLS-1$ - appendAttribute(topTD, "class", STYLECLASS_TABS_TD_MID); //$NON-NLS-1$ - tagConverterContext.addChild(cmdNavItem, new ConvertPosition(topTD, 0)); - Element bottomTR = appendChildElement("tr", parentTBody); //$NON-NLS-1$ - Element bottomTD = appendChildElement("td", bottomTR); //$NON-NLS-1$ - appendAttribute(bottomTD, "class", STYLECLASS_TABS_TD_BOTTOM_MID); //$NON-NLS-1$ - Element div = appendChildElement("div", bottomTD); //$NON-NLS-1$ - appendAttribute(div, "class", STYLECLASS_TABS_DIV_BOTTOM_MID_CONTENT); //$NON-NLS-1$ - } - - private void appendEndColumn(Element parentTBody, int curTabIndex, int numTabs) { - String topTDStyleClass; - String bottomTDStyleClass; - if (curTabIndex < numTabs - 1) { - topTDStyleClass = STYLECLASS_TABS_TD_END_JOINTOINACTIVE; - bottomTDStyleClass = STYLECLASS_TABS_TD_BOTTOM_END_JOIN; - } else { - topTDStyleClass = STYLECLASS_TABS_TD_END; - bottomTDStyleClass = STYLECLASS_TABS_TD_BOTTOM_END; - } - Element topTR = appendChildElement("tr", parentTBody); //$NON-NLS-1$ - Element topTD = appendChildElement("td", topTR); //$NON-NLS-1$ - appendAttribute(topTD, "class", topTDStyleClass); //$NON-NLS-1$ - Element bottomTR = appendChildElement("tr", parentTBody); //$NON-NLS-1$ - Element bottomTD = appendChildElement("td", bottomTR); //$NON-NLS-1$ - appendAttribute(bottomTD, "class", bottomTDStyleClass); //$NON-NLS-1$ - Element div = appendChildElement("div", bottomTD); //$NON-NLS-1$ - appendAttribute(div, "class", STYLECLASS_TABS_DIV_BOTTOM_END_CONTENT); //$NON-NLS-1$ - } - -}
\ No newline at end of file diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/OutputFormattedOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/OutputFormattedOperation.java deleted file mode 100644 index d29e92ebf..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/OutputFormattedOperation.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation; -import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.TransformOperationFactory; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -/** - * ITransformOperation implementation specifically for the "outputFormatted" JSF - * Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class OutputFormattedOperation extends AbstractTrinidadTransformOperation { - - /* - * NOTICE (especially if looking for missing whitespace): - * Because this operation can potentially return a mix of child Element - * and Text nodes inside a span Element, it can suffer from bug #221629 - * (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=221629). - * This operation is not the cause of the above-mentioned bug. - */ - - private static final String STYLECLASS_INSTRUCTION = "AFInstructionText"; //$NON-NLS-1$ - private static final String STYLECLASS_PAGESTAMP = "OraPageStampText"; //$NON-NLS-1$ - private static final String STYLECLASS_INCONTEXTBRANDING = "p_InContextBrandingText"; //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - //create outer span element and set class attribute - Element spanElement = createElement("span"); //$NON-NLS-1$ - ITransformOperation operation = - TransformOperationFactory.getInstance().getTransformOperation( - TransformOperationFactory.OP_CopyAttributeWithRenameOperation, - new String[]{"inlineStyle", "style"}); //$NON-NLS-1$ //$NON-NLS-2$ - operation.transform(srcElement, spanElement); - - String styleClass = srcElement.getAttribute("styleClass"); //$NON-NLS-1$ - if (styleClass == null || styleClass.length() < 1) { - String styleUsage = srcElement.getAttribute("styleUsage"); //$NON-NLS-1$ - if (styleUsage != null && styleUsage.length() > 8) { - if (styleUsage.equals("instruction")) { //$NON-NLS-1$ - styleClass = STYLECLASS_INSTRUCTION; - } else if (styleUsage.equals("pageStamp")) { //$NON-NLS-1$ - styleClass = STYLECLASS_PAGESTAMP; - } else if (styleUsage.equals("inContextBranding")) { //$NON-NLS-1$ - styleClass = STYLECLASS_INCONTEXTBRANDING; - } - } - } - if (styleClass != null && styleClass.length() > 0) { - appendAttribute(spanElement, "class", styleClass); //$NON-NLS-1$ - } - - //deal with value - String value = srcElement.getAttribute("value"); //$NON-NLS-1$ - if (value != null && value.length() > 0) { - StringBuffer wrappedValue = new StringBuffer(); - wrappedValue.append("<?xml version=\"1.0\"?><value>"); //$NON-NLS-1$ - wrappedValue.append(value); - wrappedValue.append("</value>"); //$NON-NLS-1$ - InputStream inputStream = new ByteArrayInputStream(wrappedValue.toString().getBytes()); - Element valueElement = getValueDocumentElement(inputStream); - if (valueElement != null) { - if (!appendValueNodes(spanElement, valueElement)) { - //remove any children added before appendValueNodes failed - NodeList childNodes = spanElement.getChildNodes(); - for (int i = 0; i < childNodes.getLength(); i++) { - spanElement.removeChild(childNodes.item(i)); - } - //set as simple text - appendChildText(value, spanElement); - } - } else { - //set as simple text - appendChildText(value, spanElement); - } - } - - return spanElement; - } - - private Element getValueDocumentElement(InputStream inputStream) { - Element element = null; - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - //TODO: entity expansion should be set to false for ".jsp", true for ".jspx" - factory.setExpandEntityReferences(true); - try { - DocumentBuilder builder = factory.newDocumentBuilder(); - Document document = builder.parse(inputStream); - element = document.getDocumentElement(); - } catch(Exception e) { - //fail on any exception - text with markup will be rendered instead - } - return element; - } - - private boolean appendValueNodes(Node parentNode, Node currentNode) { - boolean success = true; - try { - NodeList childNodes = currentNode.getChildNodes(); - for (int i = 0; i < childNodes.getLength(); i++) { - Node childNode = childNodes.item(i); - if (childNode instanceof Element) { - //TODO: elements should be filtered to only create elements specified for this tag - Element newElement = (Element)parentNode.appendChild( - parentNode.getOwnerDocument().createElement( - childNode.getNodeName())); - NamedNodeMap attrMap = childNode.getAttributes(); - if (attrMap != null) { - for (int j = 0; j < attrMap.getLength(); j++) { - Attr attr = (Attr)attrMap.item(j); - //TODO: attributes should be filtered to only create attributes specified for this tag - newElement.setAttribute( - attr.getName(), attr.getValue()); - } - } - success &= appendValueNodes(newElement, childNode); - } else if (childNode instanceof Text) { - parentNode.appendChild( - parentNode.getOwnerDocument().createTextNode( - childNode.getTextContent())); - } - } - } catch(Exception e) { - //fail on any exception - text with markup will be rendered instead - success = false; - } - return success; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelFormLayoutOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelFormLayoutOperation.java deleted file mode 100644 index 761893e43..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelFormLayoutOperation.java +++ /dev/null @@ -1,427 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; -import org.eclipse.jst.pagedesigner.converter.ConvertPosition; -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation specifically for the "panelFormLayout" - * JSF Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class PanelFormLayoutOperation extends AbstractTrinidadTransformOperation { - - private static final String STYLECLASS_REQUIREDSPAN = "AFRequiredIconStyle"; //$NON-NLS-1$ - private static final String STYLECLASS_GROUPSEPARATOR = "af_panelFormLayout_separator"; //$NON-NLS-1$ - private static final String STYLECLASS_LABELCELL = "af_inputText_label af_panelFormLayout_label-cell"; //$NON-NLS-1$ - private static final String STYLECLASS_FIELDCELL = "af_panelFormLayout_content-cell"; //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - //calculate required values - int columnCount = calculateColumnCount(srcElement); - int rowCount = calculateRowCount(srcElement); - String fieldWidth = calculateFieldWidth(srcElement); - String labelWidth = calculateLabelWidth(srcElement); - - //initialize current column/row variables - int currentColumn = 1; - int currentRow = 1; - - //build outer table - Element outerTableElement = createElement("table"); //$NON-NLS-1$ - String styleClass = srcElement.getAttribute("styleClass"); //$NON-NLS-1$ - if (styleClass != null && styleClass.length() > 0) { - appendAttribute(outerTableElement, "class", styleClass); //$NON-NLS-1$ - } - String inlineStyle = srcElement.getAttribute("inlineStyle"); //$NON-NLS-1$ - if (inlineStyle != null && inlineStyle.length() > 0) { - appendAttribute(outerTableElement, "style", inlineStyle + ";width:100%;"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - appendAttribute(outerTableElement, "style", "width:100%;"); //$NON-NLS-1$ //$NON-NLS-2$ - } - appendAttribute(outerTableElement, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(outerTableElement, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(outerTableElement, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - Element outerTBodyElement = appendChildElement("tbody", outerTableElement); //$NON-NLS-1$ - Element outerTopTRElement = appendChildElement("tr", outerTBodyElement); //$NON-NLS-1$ - - //build start of column - Element currentTBodyElement = buildColumnStart(outerTopTRElement, columnCount, currentColumn, labelWidth, fieldWidth); - - //build controls - List<Element> childElements = getChildElementsSkipFacets(srcElement); - Iterator<Element> itChildElements = childElements.iterator(); - while (itChildElements.hasNext()) { - Element childElement = itChildElements.next(); - if (ITrinidadConstants.TAG_IDENTIFIER_GROUP.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper(childElement))) { - if (currentRow > 1) { - buildGroupSeparatorRow(currentTBodyElement); - } - List<Element> groupChildElements = getChildElementsSkipFacets(childElement); - Iterator<Element> itGroupChildElements = groupChildElements.iterator(); - while (itGroupChildElements.hasNext()) { - Element groupChildElement = itGroupChildElements.next(); - buildControlRow(groupChildElement, currentTBodyElement); - } - currentRow += groupChildElements.size(); - if (currentRow <= rowCount) { - buildGroupSeparatorRow(currentTBodyElement); - } - if (currentRow > rowCount && currentColumn < columnCount) { - currentRow = 1; - currentColumn++; - currentTBodyElement = buildColumnStart( - outerTopTRElement, columnCount, currentColumn, labelWidth, fieldWidth); - } - } else { - buildControlRow(childElement, currentTBodyElement); - currentRow++; - if (currentRow > rowCount && currentColumn < columnCount) { - currentRow = 1; - currentColumn++; - currentTBodyElement = buildColumnStart( - outerTopTRElement, columnCount, currentColumn, labelWidth, fieldWidth); - } - } - } - - //handle "footer" facet - Element footerElement = getChildFacetByName(srcElement, "footer"); //$NON-NLS-1$ - if (footerElement != null) { - List<Element> footerChildElements = getChildElementsSkipFacets(footerElement); - if (footerChildElements.size() > 0) { - Element outerBottomTRElement = appendChildElement("tr", outerTBodyElement); //$NON-NLS-1$ - currentTBodyElement = buildFooterStart( - outerBottomTRElement, columnCount, labelWidth); - rowCount = countChildElements(footerElement); - currentRow = 1; - Iterator<Element> itFooterChildElements = footerChildElements.iterator(); - while (itFooterChildElements.hasNext()) { - Element footerChildElement = itFooterChildElements.next(); - if (ITrinidadConstants.TAG_IDENTIFIER_GROUP.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper(footerChildElement))) { - if (currentRow > 1) { - buildGroupSeparatorRow(currentTBodyElement); - } - List<Element> groupFooterChildElements = getChildElementsSkipFacets(footerChildElement); - Iterator<Element> itGroupFooterChildElements = groupFooterChildElements.iterator(); - while (itGroupFooterChildElements.hasNext()) { - Element groupFooterChildElement = itGroupFooterChildElements.next(); - if (ITrinidadConstants.TAG_IDENTIFIER_GROUP.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper(groupFooterChildElement))) { - if (currentRow > 1) { - buildGroupSeparatorRow(currentTBodyElement); - } - List<Element> subGroupFooterChildElements = getChildElementsSkipFacets(groupFooterChildElement); - Iterator<Element> itSubGroupFooterChildElements = subGroupFooterChildElements.iterator(); - while (itSubGroupFooterChildElements.hasNext()) { - Element subGroupFooterChildElement = itSubGroupFooterChildElements.next(); - buildControlRow(subGroupFooterChildElement, currentTBodyElement, true); - currentRow++; - } - if (currentRow <= rowCount) { - buildGroupSeparatorRow(currentTBodyElement); - } - } else { - buildControlRow(groupFooterChildElement, currentTBodyElement, true); - currentRow++; - } - } - if (currentRow <= rowCount) { - buildGroupSeparatorRow(currentTBodyElement); - } - } else { - buildControlRow(footerChildElement, currentTBodyElement, true); - currentRow++; - } - } - } - } - - return outerTableElement; - } - - private int calculateRowCount(Element srcElement) { - int rowCount = Integer.MAX_VALUE; - int specifiedRows = Integer.MAX_VALUE; - String rows = srcElement.getAttribute("rows"); //$NON-NLS-1$ - if (rows != null && rows.length() > 0) { - try { - //not spec'ed, but observed that setting rows < 5 is ignored - specifiedRows = Math.max(5, Integer.parseInt(rows)); - } catch(NumberFormatException nfe) { - //ignore - specifiedRows will default to Integer.MAX_VALUE - } - } - int specifiedMaxColumns = Integer.MAX_VALUE; - String maxColumns = srcElement.getAttribute("maxColumns"); //$NON-NLS-1$ - if (maxColumns != null && maxColumns.length() > 0) { - try { - specifiedMaxColumns = Integer.parseInt(maxColumns); - } catch(NumberFormatException nfe) { - //ignore - specifiedMaxColumns will default to Integer.MAX_VALUE - } - } - int childElementCount = countChildElements(srcElement); - int calculatedColumns = childElementCount / specifiedRows; - if (childElementCount % specifiedRows > 0) { - calculatedColumns++; - } - if (calculatedColumns > specifiedMaxColumns) { - rowCount = childElementCount / specifiedMaxColumns; - } else { - rowCount = specifiedRows; - } - return rowCount; - } - - private int calculateColumnCount(Element srcElement) { - int columnCount = Integer.MAX_VALUE; - int specifiedRows = Integer.MAX_VALUE; - String rows = srcElement.getAttribute("rows"); //$NON-NLS-1$ - if (rows != null && rows.length() > 0) { - try { - //not spec'ed, but observed that setting rows < 5 is ignored - specifiedRows = Math.max(5, Integer.parseInt(rows)); - } catch(NumberFormatException nfe) { - //ignore - specifiedRows will default to Integer.MAX_VALUE - } - } - int specifiedMaxColumns = Integer.MAX_VALUE; - String maxColumns = srcElement.getAttribute("maxColumns"); //$NON-NLS-1$ - if (maxColumns != null && maxColumns.length() > 0) { - try { - specifiedMaxColumns = Integer.parseInt(maxColumns); - } catch(NumberFormatException nfe) { - //ignore - specifiedMaxColumns will default to Integer.MAX_VALUE - } - } - int childElementCount = countChildElements(srcElement); - int calculatedColumns = childElementCount / specifiedRows; - if (childElementCount % specifiedRows > 0) { - calculatedColumns++; - } - columnCount = Math.min(specifiedMaxColumns, calculatedColumns); - return columnCount; - } - - private int countChildElements(Element srcElement) { - int count = 0; - List<Element> childElements = getChildElementsSkipFacets(srcElement); - Iterator<Element> itChildElements = childElements.iterator(); - while (itChildElements.hasNext()) { - Element childElement = itChildElements.next(); - if (ITrinidadConstants.TAG_IDENTIFIER_GROUP.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper(childElement))) { - count += countChildElements(childElement); - } else { - count++; - } - } - return count; - } - - private String calculateFieldWidth(Element srcElement) { - String width = null; - String fieldWidth = srcElement.getAttribute("fieldWidth"); //$NON-NLS-1$ - if (fieldWidth != null && fieldWidth.length() > 0) { - width = fieldWidth; - } else { - String labelWidth = srcElement.getAttribute("labelWidth"); //$NON-NLS-1$ - if (labelWidth != null && labelWidth.length() > 1) { - if (labelWidth.endsWith("%")) { //$NON-NLS-1$ - try { - int iLabelWidth = Integer.parseInt(labelWidth.substring(0, labelWidth.length() - 1)); - if (iLabelWidth <= 100) { - width = String.valueOf(100 - iLabelWidth) + "%"; //$NON-NLS-1$ - } - } catch(NumberFormatException nfe) { - //ignore - cannot calculate and so will return null - } - } - } - } - return width; - } - - private String calculateLabelWidth(Element srcElement) { - String width = null; - String labelWidth = srcElement.getAttribute("labelWidth"); //$NON-NLS-1$ - if (labelWidth != null && labelWidth.length() > 0) { - width = labelWidth; - } else { - String fieldWidth = srcElement.getAttribute("fieldWidth"); //$NON-NLS-1$ - if (fieldWidth != null && fieldWidth.length() > 1) { - if (fieldWidth.endsWith("%")) { //$NON-NLS-1$ - try { - int iFieldWidth = Integer.parseInt(fieldWidth.substring(0, fieldWidth.length() - 1)); - if (iFieldWidth <= 100) { - width = String.valueOf(100 - iFieldWidth) + "%"; //$NON-NLS-1$ - } - } catch(NumberFormatException nfe) { - //ignore - cannot calculate and so will return null - } - } - } - } - return width; - } - - private Element buildColumnStart( - Element parentElement, int columnCount, int currentColumn, - String labelWidth, String fieldWidth) { - Element tdElement = appendChildElement("td", parentElement); //$NON-NLS-1$ - appendAttribute(tdElement, "style", "vertical-align:top;"); //$NON-NLS-1$ //$NON-NLS-2$ - if (currentColumn < columnCount) { - String width = String.valueOf(100 / columnCount) + "%"; //$NON-NLS-1$ - appendAttribute(tdElement, "width", width); //$NON-NLS-1$ - } - Element tableElement = appendChildElement("table", tdElement); //$NON-NLS-1$ - appendAttribute(tableElement, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "width", "100%"); //$NON-NLS-1$ //$NON-NLS-2$ - Element tBodyElement = appendChildElement("tbody", tableElement); //$NON-NLS-1$ - Element trElement = appendChildElement("tr", tBodyElement); //$NON-NLS-1$ - Element tdLabelElement = appendChildElement("td", trElement); //$NON-NLS-1$ - if (labelWidth != null && labelWidth.length() > 0) { - appendAttribute(tdLabelElement, "style", "width:" + labelWidth); //$NON-NLS-1$ //$NON-NLS-2$ - } - Element tdFieldElement = appendChildElement("td", trElement); //$NON-NLS-1$ - if (fieldWidth != null && fieldWidth.length() > 0) { - appendAttribute(tdFieldElement, "style", "width:" + fieldWidth); //$NON-NLS-1$ //$NON-NLS-2$ - } - return tBodyElement; - } - - private void buildControlRow(Element srcElement, Element parentElement, boolean alignLabelsTop) { - Element trElement = appendChildElement("tr", parentElement); //$NON-NLS-1$ - Element tdLabelElement = appendChildElement("td", trElement); //$NON-NLS-1$ - appendAttribute(tdLabelElement, "class", STYLECLASS_LABELCELL); //$NON-NLS-1$ - if (alignLabelsTop) { - appendAttribute(tdLabelElement, "valign", "top"); //$NON-NLS-1$ //$NON-NLS-2$ - } - appendAttribute(tdLabelElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - buildLabel(srcElement, tdLabelElement); - Element tdFieldElement = appendChildElement("td", trElement); //$NON-NLS-1$ - appendAttribute(tdFieldElement, "class", STYLECLASS_FIELDCELL); //$NON-NLS-1$ - appendAttribute(tdFieldElement, "valign", "top"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdFieldElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - tagConverterContext.addChild(srcElement, new ConvertPosition(tdFieldElement, 0)); - } - - private void buildControlRow(Element srcElement, Element parentElement) { - buildControlRow(srcElement, parentElement, false); - } - - private void buildLabel(Element srcElement, Element parentElement) { - TagIdentifier tagID = TagIdentifierFactory.createDocumentTagWrapper(srcElement); - if ( - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_INPUTCOLOR) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_INPUTDATE) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_INPUTFILE) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_INPUTLISTOFVALUES) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_INPUTNUMBERSPINBOX) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_INPUTTEXT) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_SELECTBOOLEANCHECKBOX) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_SELECTBOOLEANRADIO) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_SELECTMANYCHECKBOX) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_SELECTMANYLISTBOX) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_SELECTONECHOICE) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_SELECTONELISTBOX) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_SELECTONERADIO) || - tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_PANELLABELANDMESSAGE)) { - String required = srcElement.getAttribute("required"); //$NON-NLS-1$ - String showRequired = srcElement.getAttribute("showRequired"); //$NON-NLS-1$ - if (Boolean.parseBoolean(required) || Boolean.parseBoolean(showRequired)) { - Element spanElement = appendChildElement("span", parentElement); //$NON-NLS-1$ - appendAttribute(spanElement, "title", "Required"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(spanElement, "class", STYLECLASS_REQUIREDSPAN); //$NON-NLS-1$ - appendChildText("* ", spanElement); //$NON-NLS-1$ - } - String label = srcElement.getAttribute("labelAndAccessKey"); //$NON-NLS-1$ - if (label == null || label.length() < 1) { - label = srcElement.getAttribute("label"); //$NON-NLS-1$ - } - if (label != null && label.length() > 0) { - Element labelElement = appendChildElement("label", parentElement); //$NON-NLS-1$ - appendChildText(label, labelElement); - } - } - } - - private void buildGroupSeparatorRow(Element parentElement) { - Element trElement = appendChildElement("tr", parentElement); //$NON-NLS-1$ - Element tdElement = appendChildElement("td", trElement); //$NON-NLS-1$ - appendAttribute(tdElement, "colspan", "2"); //$NON-NLS-1$ //$NON-NLS-2$ - Element divElement = appendChildElement("div", tdElement); //$NON-NLS-1$ - appendAttribute(divElement, "class", STYLECLASS_GROUPSEPARATOR); //$NON-NLS-1$ - } - - private Element buildFooterStart( - Element parentElement, int columnCount, String labelWidth) { - Element tdElement = appendChildElement("td", parentElement); //$NON-NLS-1$ - appendAttribute(tdElement, "style", "vertical-align:top;"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdElement, "colspan", String.valueOf(columnCount)); //$NON-NLS-1$ - Element tableElement = appendChildElement("table", tdElement); //$NON-NLS-1$ - appendAttribute(tableElement, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "width", "100%"); //$NON-NLS-1$ //$NON-NLS-2$ - Element tBodyElement = appendChildElement("tbody", tableElement); //$NON-NLS-1$ - Element trElement = appendChildElement("tr", tBodyElement); //$NON-NLS-1$ - String footerLabelWidth = null; - String footerFieldWidth = null; - if (labelWidth != null && labelWidth.length() > 0) { - if (labelWidth.endsWith("%")) { //$NON-NLS-1$ - try { - int iLabelWidth = Integer.parseInt(labelWidth.substring(0, labelWidth.length() - 1)); - iLabelWidth = iLabelWidth / columnCount; - footerLabelWidth = String.valueOf(iLabelWidth) + "%"; //$NON-NLS-1$ - footerFieldWidth = String.valueOf(100 - iLabelWidth) + "%"; //$NON-NLS-1$ - } catch(NumberFormatException nfe) { - //ignore - cannot calculate, widths remain null - } - } else { - footerLabelWidth = labelWidth; - } - } - Element tdLabelElement = appendChildElement("td", trElement); //$NON-NLS-1$ - if (footerLabelWidth != null && footerLabelWidth.length() > 0) { - //appendAttribute(tdLabelElement, "style", "width:" + footerLabelWidth); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdLabelElement, "width", footerLabelWidth); //$NON-NLS-1$ - } - Element tdFieldElement = appendChildElement("td", trElement); //$NON-NLS-1$ - if (footerFieldWidth != null && footerFieldWidth.length() > 0) { - //appendAttribute(tdFieldElement, "style", "width:" + footerFieldWidth); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdFieldElement, "width", footerFieldWidth); //$NON-NLS-1$ - } - return tBodyElement; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelGroupLayoutOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelGroupLayoutOperation.java deleted file mode 100644 index cc303c7e1..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelGroupLayoutOperation.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; -import org.eclipse.jst.pagedesigner.converter.ConvertPosition; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -/** - * ITransformOperation implementation specifically for the "panelGroupLayout" - * JSF Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class PanelGroupLayoutOperation extends AbstractTrinidadTransformOperation { - - private static final int LAYOUT_DEFAULT = 0; - private static final int LAYOUT_HORIZONTAL = 1; - private static final int LAYOUT_VERTICAL = 2; - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - Element outerElement; - - //create outer element and set element-specific attributes - final int layout = getLayout(srcElement); - Element containerElement; - switch (layout) { - case LAYOUT_HORIZONTAL: - outerElement = createElement("table"); //$NON-NLS-1$ - outerElement.setAttribute("cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - outerElement.setAttribute("cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - outerElement.setAttribute("border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - containerElement = appendChildElement("tr", outerElement); //$NON-NLS-1$ - break; - case LAYOUT_VERTICAL: - outerElement = createElement("div"); //$NON-NLS-1$ - containerElement = outerElement; - break; - default: - outerElement = createElement("span"); //$NON-NLS-1$ - containerElement = outerElement; - break; - } - - //set common attributes on outer element - final String styleClass = srcElement.getAttribute("styleClass"); //$NON-NLS-1$ - if (styleClass != null && styleClass.length() > 0) { - outerElement.setAttribute("class", styleClass); //$NON-NLS-1$ - } - final String inlineStyle = srcElement.getAttribute("inlineStyle"); //$NON-NLS-1$ - if (inlineStyle != null && inlineStyle.length() > 0) { - outerElement.setAttribute("style", inlineStyle); //$NON-NLS-1$ - } - - //get child nodes, skipping "facet" elements and empty Text nodes - List<Node> childNodes = new ArrayList<Node>(); - Iterator<Node> itCopyChildrenNodes = getCopyChildrenNodes(srcElement).iterator(); - while (itCopyChildrenNodes.hasNext()) { - Node copyChildrenNode = itCopyChildrenNodes.next(); - if (!(copyChildrenNode instanceof Element && TagIdentifierFactory.createDocumentTagWrapper((Element)copyChildrenNode).isSameTagType(IJSFConstants.TAG_IDENTIFIER_FACET))) { - if (!(copyChildrenNode instanceof Text && copyChildrenNode.getNodeValue().trim().length() < 1)) { - childNodes.add(copyChildrenNode); - } - } - } - - //get "separator" facet's first child Element (only one used at runtime) - Element separatorElement = null; - final Element facetElement = getChildFacetByName(srcElement, "separator"); //$NON-NLS-1$ - if (facetElement != null) { - NodeList facetChildNodes = facetElement.getChildNodes(); - for (int i = 0; i < facetChildNodes.getLength(); i++) { - Node curChildNode = facetChildNodes.item(i); - if (curChildNode instanceof Element) { - separatorElement = (Element)curChildNode; - break; - } - } - } - - //iterate over child nodes, interspersing separator(s) as required - int curChildNodeIndex = 0; - int curIndex = 0; - Iterator<Node> itChildNodes = childNodes.iterator(); - switch (layout) { - case LAYOUT_HORIZONTAL: - while (itChildNodes.hasNext()) { - final Element childTDElement = appendChildElement("td", containerElement); //$NON-NLS-1$ - tagConverterContext.addChild(itChildNodes.next(), new ConvertPosition(childTDElement, 0)); - if (++curChildNodeIndex < childNodes.size()) { - if (separatorElement != null) { - final Element sepTDElement = appendChildElement("td", containerElement); //$NON-NLS-1$ - tagConverterContext.addChild(separatorElement, new ConvertPosition(sepTDElement, 0)); - } - } - } - break; - case LAYOUT_VERTICAL: - while (itChildNodes.hasNext()) { - tagConverterContext.addChild(itChildNodes.next(), new ConvertPosition(containerElement, curIndex++)); - if (++curChildNodeIndex < childNodes.size()) { - final Element divElement = appendChildElement("div", containerElement); //$NON-NLS-1$ - curIndex++; - if (separatorElement != null) { - tagConverterContext.addChild(separatorElement, new ConvertPosition(divElement, 0)); - } - } - } - break; - default: - while (itChildNodes.hasNext()) { - tagConverterContext.addChild(itChildNodes.next(), new ConvertPosition(containerElement, curIndex++)); - if (++curChildNodeIndex < childNodes.size()) { - if (separatorElement != null) { - tagConverterContext.addChild(separatorElement, new ConvertPosition(containerElement, curIndex++)); - } - } - } - break; - } - - return outerElement; - } - - private int getLayout(Element srcElement) { - int layout = LAYOUT_DEFAULT; - if (srcElement != null) { - String layoutValue = srcElement.getAttribute("layout"); //$NON-NLS-1$ - if (layoutValue != null) { - if (layoutValue.equals("horizontal")) { //$NON-NLS-1$ - layout = LAYOUT_HORIZONTAL; - } else if (layoutValue.equals("vertical")) { //$NON-NLS-1$ - layout = LAYOUT_VERTICAL; - } - } - } - return layout; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelLabelAndMessageOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelLabelAndMessageOperation.java deleted file mode 100644 index 93d9f7a9d..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelLabelAndMessageOperation.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; -import org.eclipse.jst.pagedesigner.converter.ConvertPosition; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * ITransformOperation implementation specifically for the "panelLabelAndMessage" - * JSF Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class PanelLabelAndMessageOperation extends - AbstractLabelAndHelpOperation { - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#appendControl(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - protected void appendControl(Element srcElement, Element parentElement) { - handleLabelStyle(srcElement, parentElement); - Element tableElement = appendChildElement("table", parentElement); //$NON-NLS-1$ - appendAttribute(tableElement, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - Element trElement = appendChildElement("tr", tableElement); //$NON-NLS-1$ - Element tdElementLeft = appendChildElement("td", trElement); //$NON-NLS-1$ - List<Node> childNodes = getCopyChildrenNodes(srcElement); - Iterator<Node> itChildNodes = childNodes.iterator(); - int curIndex = 0; - while (itChildNodes.hasNext()) { - Node childNode = itChildNodes.next(); - if (!(childNode instanceof Element && - IJSFConstants.TAG_IDENTIFIER_FACET.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper((Element)childNode)))) { - tagConverterContext.addChild( - childNode, new ConvertPosition(tdElementLeft, curIndex++)); - } - } - Element tdElementRight = appendChildElement("td", trElement); //$NON-NLS-1$ - Element endFacetElement = getChildFacetByName(srcElement, "end"); //$NON-NLS-1$ - if (endFacetElement != null) { - tagConverterContext.addChild( - endFacetElement, new ConvertPosition(tdElementRight, 0)); - } - } - - private void handleLabelStyle(Element srcElement, Element parentElement) { - String labelStyle = srcElement.getAttribute("labelStyle"); //$NON-NLS-1$ - if (labelStyle != null && labelStyle.length() > 0) { - if (parentElement.getPreviousSibling() instanceof Element) { - Element labelTDElement = (Element)parentElement.getPreviousSibling(); - labelTDElement.removeAttribute("valign"); //$NON-NLS-1$ - String style = labelTDElement.getAttribute("style"); //$NON-NLS-1$ - if (style != null && style.length() > 0) { - if (!style.endsWith(";")) { //$NON-NLS-1$ - style += ";"; //$NON-NLS-1$ - } - style += labelStyle; - appendAttribute(labelTDElement, "style", style); //$NON-NLS-1$ - } else { - appendAttribute(labelTDElement, "style", labelStyle); //$NON-NLS-1$ - } - } - } - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelTabbedOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelTabbedOperation.java deleted file mode 100644 index d27015323..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/PanelTabbedOperation.java +++ /dev/null @@ -1,297 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.Messages; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.TrinidadUtils; -import org.eclipse.jst.pagedesigner.converter.ConvertPosition; -import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation; -import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.TransformOperationFactory; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * ITransformOperation implementation specifically for the "panelTabbed" JSF - * Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class PanelTabbedOperation extends AbstractTrinidadTransformOperation { - - private static final int SEP_POS_BETWEEN = -1; - private static final int SEP_POS_START = 0; - private static final int SEP_POS_END = 1; - - private static final String STYLECLASS_TABLE_ABOVE = "af_panelTabbed_orientation-top"; //$NON-NLS-1$ - private static final String STYLECLASS_TABLE_BELOW = "af_panelTabbed_orientation-bottom"; //$NON-NLS-1$ - private static final String STYLECLASS_SEPARATOR_START = "af_panelTabbed_cell-start"; //$NON-NLS-1$ - private static final String STYLECLASS_SEPARATOR_END = "af_panelTabbed_cell-end"; //$NON-NLS-1$ - private static final String STYLECLASS_CELL = "af_panelTabbed_tab-selected"; //$NON-NLS-1$ - private static final String STYLECLASS_CELL_NOTDISCLOSED_OR_DISABLED = "af_panelTabbed_tab"; //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - //create outer span element and set style and class attributes - Element spanElement = createElement("span"); //$NON-NLS-1$ - ITransformOperation operation = - TransformOperationFactory.getInstance().getTransformOperation( - TransformOperationFactory.OP_CopyAttributeWithRenameOperation, - new String[]{"styleClass", "class"}); //$NON-NLS-1$ //$NON-NLS-2$ - operation.transform(srcElement, spanElement); - operation = - TransformOperationFactory.getInstance().getTransformOperation( - TransformOperationFactory.OP_CopyAttributeWithRenameOperation, - new String[]{"inlineStyle", "style"}); //$NON-NLS-1$ //$NON-NLS-2$ - operation.transform(srcElement, spanElement); - - //get child showDetailItem elements - @SuppressWarnings("unchecked") - List<Node> showDetailItems = getChildElements( - srcElement, "showDetailItem"); //$NON-NLS-1$ - if (showDetailItems.size() > 0) { - - //determine tabs position ("both", "above", or "below" - default "both") - String tabsPosition = srcElement.getAttribute("position"); //$NON-NLS-1$ - if (tabsPosition == null || - !(tabsPosition.equalsIgnoreCase("above") || //$NON-NLS-1$ - tabsPosition.equalsIgnoreCase("below"))) { //$NON-NLS-1$ - tabsPosition = "both"; //$NON-NLS-1$ - } - - //need to track where showDetailItem is in relation to "tabs" - int showDetailItemConvertPosition = 0; - - //write tabs "above" if specified - if ("above".equalsIgnoreCase(tabsPosition) || //$NON-NLS-1$ - "both".equalsIgnoreCase(tabsPosition)) { //$NON-NLS-1$ - appendTabs(srcElement, showDetailItems, spanElement, true); - showDetailItemConvertPosition++; - } - - //copy current child showDetailItem - int currentEditorItem = - getCurrentShowDetailItem(srcElement, showDetailItems); - int curItem = 0; - Iterator<Node> itItems = showDetailItems.iterator(); - while (itItems.hasNext()) { - Node nodeItem = itItems.next(); - if (currentEditorItem == curItem) { - if (nodeItem instanceof Element) { - Element elemItem = (Element)nodeItem; - tagConverterContext.addChild( - elemItem, - new ConvertPosition( - spanElement, - showDetailItemConvertPosition)); - break; - } - } - curItem++; - } - - //write tabs "below" if specified - if ("below".equalsIgnoreCase(tabsPosition) || //$NON-NLS-1$ - "both".equalsIgnoreCase(tabsPosition)) { //$NON-NLS-1$ - appendTabs(srcElement, showDetailItems, spanElement, false); - } - } else { - appendAttribute( - spanElement, - "style", //$NON-NLS-1$ - ITrinidadConstants.STYLE_EMPTYELEMENT); - appendChildText( - Messages.PanelTabbedOperation_EmptyPanelTabbedTag, - spanElement); - } - - return spanElement; - } - - private void appendTabs(Element srcElement, List<Node> showDetailItems, Element spanElement, boolean above) { - Element tableElement = appendChildElement("table", spanElement); //$NON-NLS-1$ - String tableStyleClass; - if (above) { - tableStyleClass = STYLECLASS_TABLE_ABOVE; - } else { - tableStyleClass = STYLECLASS_TABLE_BELOW; - } - appendAttribute(tableElement, "class", tableStyleClass); //$NON-NLS-1$ - appendAttribute(tableElement, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "width", "100%"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement, "summary", ""); //$NON-NLS-1$ //$NON-NLS-2$ - Element trElement = appendChildElement("tr", tableElement); //$NON-NLS-1$ - - //append first separator - appendSeparatorTD(trElement, SEP_POS_START); - - int currentItem = getCurrentShowDetailItem(srcElement, showDetailItems); - int disclosedItem = calculateDisclosedShowDetailItem(showDetailItems); - int curItem = 0; - - //iterate over showDetailItem elements - Iterator<Node> itItems = showDetailItems.iterator(); - while (itItems.hasNext()) { - Node nodeItem = itItems.next(); - if (nodeItem instanceof Element) { - Element elemItem = (Element)nodeItem; - appendShowDetailItemTD( - trElement, - elemItem, - currentItem == curItem, - disclosedItem == curItem); - if (curItem < showDetailItems.size() - 1) { - appendSeparatorTD(trElement); - } - curItem++; - } - } - - //append last separator - appendSeparatorTD(trElement, SEP_POS_END); - } - - private void appendSeparatorTD(Element trElement, int sepPosition) { - Element tdElement = appendChildElement("td", trElement); //$NON-NLS-1$ - if (sepPosition == SEP_POS_START) { - appendAttribute(tdElement, "class", STYLECLASS_SEPARATOR_START); //$NON-NLS-1$ - } else if (sepPosition == SEP_POS_END) { - appendAttribute(tdElement, "class", STYLECLASS_SEPARATOR_END); //$NON-NLS-1$ - } - Element bElement = appendChildElement("b", tdElement); //$NON-NLS-1$ - appendAttribute(bElement, "style", "margin-left:0px;"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - private void appendSeparatorTD(Element trElement) { - appendSeparatorTD(trElement, SEP_POS_BETWEEN); - } - - private void appendShowDetailItemTD(Element trElement, Element showDetailItem, boolean isCurrent, boolean isDisclosed) { - boolean isDisabled = false; - String attrShowDetailItemDisabled = showDetailItem.getAttribute("disabled"); //$NON-NLS-1$ - if (Boolean.TRUE.toString().equalsIgnoreCase(attrShowDetailItemDisabled)) { - isDisabled = true; - } - Element tdElement = appendChildElement("td", trElement); //$NON-NLS-1$ - appendAttribute(tdElement, "height", "1"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdElement, "nowrap", "nowrap"); //$NON-NLS-1$ //$NON-NLS-2$ - String tdStyleClass; - if (isDisclosed && !isDisabled) { - tdStyleClass = STYLECLASS_CELL; - } else { - tdStyleClass = STYLECLASS_CELL_NOTDISCLOSED_OR_DISABLED; - } - appendAttribute(tdElement, "class", tdStyleClass); //$NON-NLS-1$ - Element aElement = appendChildElement("a", tdElement); //$NON-NLS-1$ - String aStyle; - if (isDisabled) { - appendAttribute(aElement, "name", "name"); //$NON-NLS-1$ //$NON-NLS-2$ - aStyle = "color:#999999;"; //$NON-NLS-1$ - } else { - appendAttribute(aElement, "href", "#"); //$NON-NLS-1$ //$NON-NLS-2$ - if (isDisclosed) { - aStyle = "color:#669966;text-decoration:none;"; //$NON-NLS-1$ - } else { - aStyle = "color:#003333;"; //$NON-NLS-1$ - } - } - if (isCurrent) { - aStyle += "border:1px solid #99cc99;padding:2px;"; //$NON-NLS-1$ - } - String attrShowDetailItemInlineStyle = showDetailItem.getAttribute("inlineStyle"); //$NON-NLS-1$ - if (attrShowDetailItemInlineStyle != null && - attrShowDetailItemInlineStyle.length() > 0) { - aStyle += attrShowDetailItemInlineStyle; - } - if (aStyle.length() > 0) { - appendAttribute(aElement, "style", aStyle); //$NON-NLS-1$ - } - ITransformOperation operation = - TransformOperationFactory.getInstance().getTransformOperation( - TransformOperationFactory.OP_CopyAttributeWithRenameOperation, - new String[]{"styleClass", "class"}); //$NON-NLS-1$ //$NON-NLS-2$ - operation.transform(showDetailItem, aElement); - String attrShowDetailItemTextAndAccessKey = showDetailItem.getAttribute("textAndAccessKey"); //$NON-NLS-1$ - if (attrShowDetailItemTextAndAccessKey != null && - attrShowDetailItemTextAndAccessKey.length() > 0) { - appendChildText(attrShowDetailItemTextAndAccessKey, aElement); - } else { - String attrShowDetailItemText = showDetailItem.getAttribute("text"); //$NON-NLS-1$ - if (attrShowDetailItemText != null && attrShowDetailItemText.length() > 0) { - appendChildText(attrShowDetailItemText, aElement); - } - } - } - - private int getCurrentShowDetailItem( - Element srcElement, List<Node> showDetailItems) { - int disclosedItem = TrinidadUtils.getCurrentChildIndex(srcElement); - if (disclosedItem == -1) { - disclosedItem = calculateDisclosedShowDetailItem(showDetailItems); - TrinidadUtils.setCurrentChildIndex(srcElement, disclosedItem); - } - return disclosedItem; - } - - private int calculateDisclosedShowDetailItem(List<Node> showDetailItems) { - int disclosedItem = -1; - int curItem = 0; - Iterator<Node> itItems = showDetailItems.iterator(); - while (itItems.hasNext()) { - Node item = itItems.next(); - if (item instanceof Element) { - Element elemItem = (Element)item; - String attrDisclosedVal = elemItem.getAttribute("disclosed"); //$NON-NLS-1$ - if (Boolean.TRUE.toString().equalsIgnoreCase( - attrDisclosedVal)) { - disclosedItem = curItem; - break; - } - } - curItem++; - } - //if none explicitly disclosed, consider first non-disabled tab disclosed - if (disclosedItem == -1) { - curItem = 0; - itItems = showDetailItems.iterator(); - while (itItems.hasNext()) { - Node item = itItems.next(); - if (item instanceof Element) { - Element elemItem = (Element)item; - String attrDisabledVal = elemItem.getAttribute("disabled"); //$NON-NLS-1$ - if (!(Boolean.TRUE.toString().equalsIgnoreCase(attrDisabledVal))) { - disclosedItem = curItem; - break; - } - } - curItem++; - } - } - //if none explicitly disclosed and all disabled, consider first tab disclosed - if (disclosedItem == -1) { - disclosedItem = 0; - } - return disclosedItem; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectBooleanOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectBooleanOperation.java deleted file mode 100644 index 55ee08ee8..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectBooleanOperation.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation specifically for any "selectBoolean..." - * JSF Elements. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class SelectBooleanOperation extends AbstractLabelAndHelpOperation { - - private String inputType; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - if (getParameters().length < 1) { - getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$ - return null; - } else { - inputType = getParameters()[0]; - } - return super.transform(srcElement, curElement); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#appendControl(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - protected void appendControl(Element srcElement, Element parentElement) { - Element spanElement = appendChildElement("span", parentElement); //$NON-NLS-1$ - Element inputElement = appendChildElement("input", spanElement); //$NON-NLS-1$ - appendAttribute(inputElement, "type", inputType); //$NON-NLS-1$ - Element labelElement = appendChildElement("label", spanElement); //$NON-NLS-1$ - String textAndAccessKey = srcElement.getAttribute("textAndAccessKey"); //$NON-NLS-1$ - if (textAndAccessKey != null && textAndAccessKey.length() > 0) { - appendChildText(textAndAccessKey, labelElement); - } else { - String text = srcElement.getAttribute("text"); //$NON-NLS-1$ - if (text != null) { - appendChildText(text, labelElement); - } - } - //append common attributes - appendAttribute(inputElement, "class", STYLECLASS_CONTROLELEMENT); //$NON-NLS-1$ - String contentStyle = calculateStyle(null, srcElement, "contentStyle"); //$NON-NLS-1$ - if (contentStyle != null) { - appendAttribute(inputElement, "style", contentStyle); //$NON-NLS-1$ - } - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectListboxChoiceOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectListboxChoiceOperation.java deleted file mode 100644 index 1e507698a..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectListboxChoiceOperation.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.model.SelectItem; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.model.SelectItemModel; -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation specifically for "selectManyListbox", - * "selectOneListbox", and "selectOneChoice" JSF Elements. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class SelectListboxChoiceOperation extends AbstractLabelAndHelpOperation { - - private boolean isMultiple; - private boolean showSize; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - if (getParameters().length < 2) { - getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$ - return null; - } else { - isMultiple = Boolean.parseBoolean(getParameters()[0]); - showSize = Boolean.parseBoolean(getParameters()[1]); - } - return super.transform(srcElement, curElement); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#appendControl(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - protected void appendControl(Element srcElement, Element parentElement) { - Element selectElement = appendChildElement("select", parentElement); //$NON-NLS-1$ - if (isMultiple) { - appendAttribute(selectElement, "multiple", ""); //$NON-NLS-1$ //$NON-NLS-2$ - } - List<SelectItem> selectItems = SelectItemModel.getModel(srcElement); - if (showSize) { - int size; - String attrSize = srcElement.getAttribute("size"); //$NON-NLS-1$ - if (attrSize != null && attrSize.length() > 0) { - try { - size = Integer.parseInt(attrSize); - } catch(NumberFormatException nfe) { - size = 1; - } - } else { - size = 1; - } - size = Math.max(size, selectItems.size()); - appendAttribute(selectElement, "size", String.valueOf(size)); //$NON-NLS-1$ - } - boolean isFirstSelectItem = !isMultiple; - Iterator<SelectItem> itSelectItems = selectItems.iterator(); - while (itSelectItems.hasNext()) { - SelectItem selectItem = itSelectItems.next(); - Element optionElement = appendChildElement("option", selectElement); //$NON-NLS-1$ - if (isFirstSelectItem) { - appendAttribute(optionElement, "selected", ""); //$NON-NLS-1$ //$NON-NLS-2$ - isFirstSelectItem = false; - } - appendChildText(selectItem.getLabel(), optionElement); - } - //append common attributes - appendAttribute(selectElement, "class", STYLECLASS_CONTROLELEMENT); //$NON-NLS-1$ - String contentStyle = calculateStyle(null, srcElement, "contentStyle"); //$NON-NLS-1$ - if (contentStyle != null) { - appendAttribute(selectElement, "style", contentStyle); //$NON-NLS-1$ - } - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectManyCheckboxOneRadioOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectManyCheckboxOneRadioOperation.java deleted file mode 100644 index a06a48cb8..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectManyCheckboxOneRadioOperation.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.model.SelectItem; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.model.SelectItemModel; -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation specifically for "selectManyCheckbox" and - * "selectOneRadio" JSF Elements. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class SelectManyCheckboxOneRadioOperation extends AbstractLabelAndHelpOperation { - - private String inputType; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - if (getParameters().length < 1) { - getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$ - return null; - } else { - inputType = getParameters()[0]; - } - return super.transform(srcElement, curElement); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations.AbstractLabelAndHelpOperation#appendControl(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - protected void appendControl(Element srcElement, Element parentElement) { - Element spanElement = appendChildElement("span", parentElement); //$NON-NLS-1$ - String layout = srcElement.getAttribute("layout"); //$NON-NLS-1$ - List<SelectItem> selectItems = SelectItemModel.getModel(srcElement); - Iterator<SelectItem> itSelectItems = selectItems.iterator(); - while (itSelectItems.hasNext()) { - SelectItem selectItem = itSelectItems.next(); - Element inputElement = appendChildElement("input", spanElement); //$NON-NLS-1$ - appendAttribute(inputElement, "type", inputType); //$NON-NLS-1$ - Element labelElement = appendChildElement("label", spanElement); //$NON-NLS-1$ - appendChildText(selectItem.getLabel(), labelElement); - if (layout == null || !layout.equals("horizontal")) { //$NON-NLS-1$ - if (itSelectItems.hasNext()) { - appendChildElement("br", spanElement); //$NON-NLS-1$ - } - } - } - //append common attributes - appendAttribute(spanElement, "class", STYLECLASS_CONTROLELEMENT); //$NON-NLS-1$ - String contentStyle = calculateStyle(null, srcElement, "contentStyle"); //$NON-NLS-1$ - if (contentStyle != null) { - appendAttribute(spanElement, "style", contentStyle); //$NON-NLS-1$ - } - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectShuttleOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectShuttleOperation.java deleted file mode 100644 index aa7183351..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/SelectShuttleOperation.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.Messages; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.model.SelectItem; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.model.SelectItemModel; -import org.eclipse.jst.pagedesigner.converter.ConvertPosition; -import org.w3c.dom.Element; - -/** - * ITransformOperation implementation specifically for "selectManyShuttle" and - * "selectOrderShuttle" JSF Elements. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class SelectShuttleOperation extends AbstractTrinidadTransformOperation { - - private static final String STYLECLASS_OUTERTABLE = "af_selectManyShuttle p_AFRequired"; //$NON-NLS-1$ - private static final String STYLECLASS_HEADER = "OraShuttleHeader"; //$NON-NLS-1$ - private static final String STYLECLASS_REQUIRED = "AFRequiredIconStyle"; //$NON-NLS-1$ - private static final String STYLECLASS_LISTCOLUMN = "af_selectManyShuttle_box-content"; //$NON-NLS-1$ - private static final String STYLECLASS_SELECT = "af_selectManyListbox_content"; //$NON-NLS-1$ - private static final String STYLECLASS_DESCRIPTION = "AFInstructionText"; //$NON-NLS-1$ - private static final String STYLECLASS_LINK = "OraLinkText"; //$NON-NLS-1$ - private static final String DEFAULT_SIZE = "10"; //$NON-NLS-1$ - - private static final String[] LINKS_MOVE = new String[]{ - Messages.SelectShuttleOperation_LinkMove, - Messages.SelectShuttleOperation_LinkMoveAll, - Messages.SelectShuttleOperation_LinkRemove, - Messages.SelectShuttleOperation_LinkRemoveAll - }; - private static final String[] LINKS_ORDER = new String[]{ - Messages.SelectShuttleOperation_LinkTop, - Messages.SelectShuttleOperation_LinkUp, - Messages.SelectShuttleOperation_LinkDown, - Messages.SelectShuttleOperation_LinkBottom - }; - - private boolean showOrderLinks; - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - //get parameter - if (getParameters().length < 1) { - getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$ - return null; - } else { - showOrderLinks = Boolean.parseBoolean(getParameters()[0]); - } - - //build outer table element - Element outerTableElement = createElement("table"); //$NON-NLS-1$ - appendAttribute(outerTableElement, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(outerTableElement, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(outerTableElement, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(outerTableElement, "width", "10%"); //$NON-NLS-1$ //$NON-NLS-2$ - String inlineStyle = srcElement.getAttribute("inlineStyle"); //$NON-NLS-1$ - if (inlineStyle != null && inlineStyle.length() > 0) { - appendAttribute(outerTableElement, "style", inlineStyle); //$NON-NLS-1$ - } - String styleClass = srcElement.getAttribute("styleClass"); //$NON-NLS-1$ - if (styleClass != null && styleClass.length() > 0) { - appendAttribute(outerTableElement, "class", styleClass + " " + STYLECLASS_OUTERTABLE); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - appendAttribute(outerTableElement, "class", STYLECLASS_OUTERTABLE); //$NON-NLS-1$ - } - - //build header row - Element trHeaderElement = appendChildElement("tr", outerTableElement); //$NON-NLS-1$ - Element tdLeadingHeaderElement = appendChildElement("td", trHeaderElement); //$NON-NLS-1$ - String leadingHeader = srcElement.getAttribute("leadingHeader"); //$NON-NLS-1$ - if (leadingHeader != null && leadingHeader.length() > 0) { - appendAttribute(tdLeadingHeaderElement, "class", STYLECLASS_HEADER); //$NON-NLS-1$ - appendAttribute(tdLeadingHeaderElement, "valign", "bottom"); //$NON-NLS-1$ //$NON-NLS-2$ - appendChildText(leadingHeader, tdLeadingHeaderElement); - } - appendChildElement("td", trHeaderElement); //$NON-NLS-1$ - Element tdTrailingHeaderElement = appendChildElement("td", trHeaderElement); //$NON-NLS-1$ - String required = srcElement.getAttribute("required"); //$NON-NLS-1$ - String trailingHeader = srcElement.getAttribute("trailingHeader"); //$NON-NLS-1$ - if ((required != null && Boolean.parseBoolean(required)) || (trailingHeader != null && trailingHeader.length() > 0)) { - appendAttribute(tdTrailingHeaderElement, "class", STYLECLASS_HEADER); //$NON-NLS-1$ - appendAttribute(tdTrailingHeaderElement, "valign", "bottom"); //$NON-NLS-1$ //$NON-NLS-2$ - if (required != null && Boolean.parseBoolean(required)) { - Element spanRequiredElement = appendChildElement("span", tdTrailingHeaderElement); //$NON-NLS-1$ - appendAttribute(spanRequiredElement, "class", STYLECLASS_REQUIRED); //$NON-NLS-1$ - appendChildText("*", spanRequiredElement); //$NON-NLS-1$ - } - if (trailingHeader != null && trailingHeader.length() > 0) { - appendChildText(trailingHeader, tdTrailingHeaderElement); - } - } - - //build content row - Element trContentElement = appendChildElement("tr", outerTableElement); //$NON-NLS-1$ - buildListColumn(srcElement, trContentElement, true); - buildLinkColumn(trContentElement, LINKS_MOVE); - buildListColumn(srcElement, trContentElement, false); - - return outerTableElement; - } - - private void buildListColumn(Element srcElement, Element parentElement, boolean isLeadingColumn) { - //build outer structure - Element tdElement0 = appendChildElement("td", parentElement); //$NON-NLS-1$ - Element tableElement0 = appendChildElement("table", tdElement0); //$NON-NLS-1$ - appendAttribute(tableElement0, "style", "width:100%;"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement0, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement0, "cellspacing", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement0, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - Element tbodyElement0 = appendChildElement("tbody", tableElement0); //$NON-NLS-1$ - Element trElement0 = appendChildElement("tr", tbodyElement0); //$NON-NLS-1$ - Element tdElement1 = appendChildElement("td", trElement0); //$NON-NLS-1$ - Element divElement0 = appendChildElement("div", tdElement1); //$NON-NLS-1$ - appendAttribute(divElement0, "class", STYLECLASS_LISTCOLUMN); //$NON-NLS-1$ - Element tableElement1 = appendChildElement("table", divElement0); //$NON-NLS-1$ - appendAttribute(tableElement1, "cellpadding", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tableElement1, "border", "0"); //$NON-NLS-1$ //$NON-NLS-2$ - - //build filter structure - if (isLeadingColumn) { - Element filterFacet = getChildFacetByName(srcElement, "filter"); //$NON-NLS-1$ - if (filterFacet != null) { - Element trFilterElement = appendChildElement("tr", tableElement1); //$NON-NLS-1$ - Element tdFilterElement = appendChildElement("td", trFilterElement); //$NON-NLS-1$ - appendAttribute(tdFilterElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdFilterElement, "valign", "middle"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdFilterElement, "colspan", "3"); //$NON-NLS-1$ //$NON-NLS-2$ - tagConverterContext.addChild(filterFacet, new ConvertPosition(tdFilterElement, 0)); - } - } - - //build select element structure - Element trSelectElement = appendChildElement("tr", tableElement1); //$NON-NLS-1$ - Element tdSelectElement = appendChildElement("td", trSelectElement); //$NON-NLS-1$ - appendAttribute(tdSelectElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdSelectElement, "valign", "middle"); //$NON-NLS-1$ //$NON-NLS-2$ - Element spanSelectElement = appendChildElement("span", tdSelectElement); //$NON-NLS-1$ - Element selectElement = appendChildElement("select", spanSelectElement); //$NON-NLS-1$ - appendAttribute(selectElement, "multiple", ""); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(selectElement, "class", STYLECLASS_SELECT); //$NON-NLS-1$ - appendAttribute(selectElement, "size", getSizeString(srcElement)); //$NON-NLS-1$ - - if (isLeadingColumn) { - List<SelectItem> selectItems = SelectItemModel.getModel(srcElement); - Iterator<SelectItem> itSelectItems = selectItems.iterator(); - while (itSelectItems.hasNext()) { - SelectItem selectItem = itSelectItems.next(); - Element optionElement = appendChildElement("option", selectElement); //$NON-NLS-1$ - appendChildText(selectItem.getLabel(), optionElement); - } - } - Element optionElement = appendChildElement("option", selectElement); //$NON-NLS-1$ - appendChildText("_______________", optionElement); //$NON-NLS-1$ - - //build order links - if (!isLeadingColumn && showOrderLinks) { - buildLinkColumn(trSelectElement, LINKS_ORDER); - } - - //build description structure - boolean showDesc = false; - String showDescAttrName; - if (isLeadingColumn) { - showDescAttrName = "leadingDescShown"; //$NON-NLS-1$ - } else { - showDescAttrName = "trailingDescShown"; //$NON-NLS-1$ - } - String showDescAttr = srcElement.getAttribute(showDescAttrName); - if (showDescAttr != null && showDescAttr.length() > 0) { - showDesc = Boolean.parseBoolean(showDescAttr); - } - if (showDesc) { - Element trDescElement = appendChildElement("tr", tableElement1); //$NON-NLS-1$ - Element tdDescElement = appendChildElement("td", trDescElement); //$NON-NLS-1$ - appendAttribute(tdDescElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdDescElement, "valign", "middle"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdDescElement, "colspan", "3"); //$NON-NLS-1$ //$NON-NLS-2$ - Element spanDescElement = appendChildElement("span", tdDescElement); //$NON-NLS-1$ - appendAttribute(spanDescElement, "class", STYLECLASS_DESCRIPTION); //$NON-NLS-1$ - appendChildText(Messages.SelectShuttleOperation_Description, spanDescElement); - appendChildElement("div", tdDescElement); //$NON-NLS-1$ - Element textareaElement = appendChildElement("textarea", tdDescElement); //$NON-NLS-1$ - appendAttribute(textareaElement, "rows", "2"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(textareaElement, "cols", "18"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(textareaElement, "readonly", ""); //$NON-NLS-1$ //$NON-NLS-2$ - } - - //build footer structure - String footerFacetName; - if (isLeadingColumn) { - footerFacetName = "leadingFooter"; //$NON-NLS-1$ - } else { - footerFacetName = "trailingFooter"; //$NON-NLS-1$ - } - Element footerFacet = getChildFacetByName(srcElement, footerFacetName); - if (footerFacet != null) { - Element trFooterElement = appendChildElement("tr", tableElement1); //$NON-NLS-1$ - Element tdFooterElement = appendChildElement("td", trFooterElement); //$NON-NLS-1$ - appendAttribute(tdFooterElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdFooterElement, "valign", "middle"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdFooterElement, "colspan", "3"); //$NON-NLS-1$ //$NON-NLS-2$ - tagConverterContext.addChild(footerFacet, new ConvertPosition(tdFooterElement, 0)); - } - } - - private void buildLinkColumn(Element parentElement, String[] linkText) { - Element tdElement = appendChildElement("td", parentElement); //$NON-NLS-1$ - appendAttribute(tdElement, "align", "center"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdElement, "valign", "middle"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdElement, "nowrap", ""); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(tdElement, "style", "padding:5px;"); //$NON-NLS-1$ //$NON-NLS-2$ - for (int i = 0; i < linkText.length; i++) { - Element aElement = appendChildElement("a", tdElement); //$NON-NLS-1$ - appendAttribute(aElement, "href", "#"); //$NON-NLS-1$ //$NON-NLS-2$ - appendAttribute(aElement, "class", STYLECLASS_LINK); //$NON-NLS-1$ - appendChildText(linkText[i], aElement); - if (i < linkText.length - 1) { - appendChildElement("br", tdElement); //$NON-NLS-1$ - } - } - } - - private String getSizeString(Element srcElement) { - String size = DEFAULT_SIZE; - String sizeAttr = srcElement.getAttribute("size"); //$NON-NLS-1$ - if (sizeAttr != null && sizeAttr.length() > 0) { - try { - int iSize = Integer.parseInt(sizeAttr); - iSize = Math.max(iSize, 10); - iSize = Math.min(iSize, 20); - size = String.valueOf(iSize); - } catch(NumberFormatException nfe) { - //ignore - default of "10" will be returned - } - } - return size; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/ShowDetailItemOperation.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/ShowDetailItemOperation.java deleted file mode 100644 index 4cc395290..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/converter/operations/ShowDetailItemOperation.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.converter.operations; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.Messages; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * ITransformOperation implementation specifically for the "showDetailItem" JSF - * Element. - * - * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to - * have been called to provide a valid ITagConverterContext instance prior to - * a call to the transform(...) method. - * - * @author Ian Trimble - Oracle - */ -public class ShowDetailItemOperation extends AbstractTrinidadTransformOperation { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element) - */ - @Override - public Element transform(Element srcElement, Element curElement) { - - /* - * We need to represent showDetailItem as a container on the design - * canvas, so we need to return a top-level element to contain converted - * child elements. However, at runtime, it is the parent that renders - * the container element for showDetailItem's children. Therefore, we - * need to determine the parent element in order to know what top-level - * element it will render at runtime. There's no obvious way to do this - * using generic operations alone; hence, we need this specialization. - */ - - Element topElement = null; - - /* - * create top-level element type, which may differ depending on parent - * element - */ - Element parentSrcElement = getParentElement(srcElement); - if (ITrinidadConstants.TAG_IDENTIFIER_PANELTABBED.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper(parentSrcElement))) { - topElement = createElement("div"); //$NON-NLS-1$ - } else { - //default to div element - topElement = createElement("div"); //$NON-NLS-1$ - } - - if (getCopyChildrenNodes(srcElement).size() > 0) { - //copy all children - tagConverterContext.copyChildren(srcElement, topElement); - } else { - appendAttribute( - topElement, - "style", //$NON-NLS-1$ - ITrinidadConstants.STYLE_EMPTYELEMENT); - appendChildText( - Messages.ShowDetailItemOperation_EmptyShowDetailItemTag, - topElement); - } - return topElement; - } - - private Element getParentElement(Node node) { - Element parentElement = null; - Node curNode = node; - while (curNode != null) { - curNode = curNode.getParentNode(); - if (curNode instanceof Element) { - parentElement = (Element)curNode; - break; - } - } - return parentElement; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/dtresourceprovider/TrinidadDTResourceProvider.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/dtresourceprovider/TrinidadDTResourceProvider.java deleted file mode 100644 index 5664642c8..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/dtresourceprovider/TrinidadDTResourceProvider.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Copyright (c) 2009 Oracle Corporation 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: - * Ian Trimble - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.dtresourceprovider; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URL; -import java.util.Collections; -import java.util.jar.JarEntry; -import java.util.jar.JarInputStream; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.Messages; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.TrinidadTagSupportActivator; -import org.eclipse.jst.pagedesigner.dtresourceprovider.DefaultDTResourceProvider; -import org.eclipse.jst.pagedesigner.dtresourceprovider.DefaultDTSkin; - -public class TrinidadDTResourceProvider extends DefaultDTResourceProvider { - - private static final String ID = "http://myfaces.apache.org/trinidad"; //$NON-NLS-1$ - - private static final String SKIN_MINIMAL = "minimal"; //$NON-NLS-1$ - private static final String SKIN_SIMPLE = "simple"; //$NON-NLS-1$ - - private static final String STYLESHEET_MINIMAL = "/skinning/minimal.css"; //$NON-NLS-1$ - private static final String STYLESHEET_SIMPLE = "/skinning/simple.css"; //$NON-NLS-1$ - - /** - * Constructs an instance. - */ - public TrinidadDTResourceProvider() { - super(ID); - addSkin(createSkin(SKIN_MINIMAL, STYLESHEET_MINIMAL_URL, true)); - addSkin(createSkin(SKIN_SIMPLE, STYLESHEET_SIMPLE_URL, false)); - } - - private DefaultDTSkin createSkin(String name, URL stylesheetURL, boolean isDefault) { - DefaultDTSkin skin = null; - if (stylesheetURL != null) { - skin = new DefaultDTSkin(name, Collections.singletonList(stylesheetURL)); - skin.setDefault(isDefault); - } else { - TrinidadTagSupportActivator.logError( - Messages.TrinidadDTResourceProvider_StyleSheetNotLocated, - null); - } - return skin; - } - - //here we try to ensure we can access stylesheets and referenced resources even when JARed - private static URL STYLESHEET_MINIMAL_URL; - private static URL STYLESHEET_SIMPLE_URL; - private static final String DTREZPROV_CACHE_DIRNAME = "dtRezProvCache"; //$NON-NLS-1$ - private static final String URI_DIRNAME = "myfaces.apache.org_trinidad"; //$NON-NLS-1$ - private static final String DIR_TO_COPY = "skinning/"; //$NON-NLS-1$ - /** - * Initializes the class. - */ - public static void init() { - //worst case - we get the stylesheets but no referenced resources (if plug-in is JARed) - try { - STYLESHEET_MINIMAL_URL = FileLocator.toFileURL( - TrinidadDTResourceProvider.class.getResource(STYLESHEET_MINIMAL)); - STYLESHEET_SIMPLE_URL = FileLocator.toFileURL( - TrinidadDTResourceProvider.class.getResource(STYLESHEET_SIMPLE)); - } catch(IOException ioe) { - //nothing to be done - } - try { - File bundleFile = FileLocator.getBundleFile(TrinidadTagSupportActivator.getDefault().getBundle()); - if (bundleFile.isFile()) { - //plug-in is JARed - try { - File stateLocation = TrinidadTagSupportActivator.getDefault().getStateLocation().toFile(); - File dtRezProvCacheDir = new File(stateLocation, DTREZPROV_CACHE_DIRNAME); - File targetDir = new File(dtRezProvCacheDir, URI_DIRNAME); - wipeDir(targetDir); - if (targetDir.mkdirs()) { - FileInputStream fis = null; - JarInputStream jis = null; - FileOutputStream fos = null; - try { - fis = new FileInputStream(bundleFile); - jis = new JarInputStream(fis, false); - JarEntry jarEntry = jis.getNextJarEntry(); - while (jarEntry != null) { - String name = jarEntry.getName(); - if (name != null && name.startsWith(DIR_TO_COPY)) { - File targetFile = new File(targetDir, name); - if (!jarEntry.isDirectory()) { - File parentDir = targetFile.getParentFile(); - if (parentDir != null && !parentDir.exists()) { - parentDir.mkdirs(); - } - if (targetFile.createNewFile()) { - fos = new FileOutputStream(targetFile); - byte[] buf = new byte[1024]; - int bytesRead = jis.read(buf, 0, 1024); - while (bytesRead > 0) { - fos.write(buf, 0, bytesRead); - bytesRead = jis.read(buf, 0, 1024); - } - } - } - } - jarEntry = jis.getNextJarEntry(); - } - } catch(IOException ioe) { - //do nothing, we fall back on stylesheet without referenced resources - } finally { - if (fos != null) { - fos.close(); - } - if (jis != null) { - jis.close(); - } - if (fis != null) { - fis.close(); - } - } - } - File minimalStylesheet = new File(targetDir, STYLESHEET_MINIMAL); - if (minimalStylesheet.exists()) { - STYLESHEET_MINIMAL_URL = minimalStylesheet.toURL(); - } - File simpleStylesheet = new File(targetDir, STYLESHEET_SIMPLE); - if (simpleStylesheet.exists()) { - STYLESHEET_SIMPLE_URL = simpleStylesheet.toURL(); - } - } catch(IllegalStateException ise) { - //do nothing, we fall back on stylesheet without referenced resources - } - } - } catch(IOException ioe) { - //do nothing, we fall back on stylesheet without referenced resources - } - } - - private static void wipeDir(File targetDir) { - if (targetDir != null && targetDir.exists()) { - File[] files = targetDir.listFiles(); - for (File file: files) { - if (file.isFile()) { - file.delete(); - } else { - wipeDir(file); - } - } - targetDir.delete(); - } - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/el/TrinidadDecorativeVariableResolver.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/el/TrinidadDecorativeVariableResolver.java deleted file mode 100644 index d9c6c29d7..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/el/TrinidadDecorativeVariableResolver.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.el; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jst.jsf.context.symbol.ERuntimeSource; -import org.eclipse.jst.jsf.context.symbol.ISymbol; -import org.eclipse.jst.jsf.designtime.context.DTFacesContext; -import org.eclipse.jst.jsf.designtime.el.AbstractDTVariableResolver; -import org.eclipse.jst.jsf.designtime.el.IDecorativeResolver; -import org.eclipse.jst.jsf.designtime.symbols.JSFSymbolFactory; - -/** - * A decorative dt variable resolver that shadows Trinidad's runtime resolver. - * - * @author cbateman - * - */ -public class TrinidadDecorativeVariableResolver extends - AbstractDTVariableResolver implements IDecorativeResolver -{ - private final static JSFSymbolFactory _symbolFactory = new JSFSymbolFactory(); - - public final static String PAGE_FLOW_SCOPE_VARIABLE_NAME = "pageFlowScope"; //$NON-NLS-1$ - public final static String PROCESS_SCOPE_VARIABLE_NAME = "processScope"; //$NON-NLS-1$ - - public final static String REQUEST_CONTEXT_VARIABLE_NAME = "requestContext"; //$NON-NLS-1$ - public final static String REQUEST_CONTEXT_CLASS_NAME = "org.apache.myfaces.trinidad.context.RequestContext"; //$NON-NLS-1$ - - @Override - public ISymbol[] getAllVariables(final DTFacesContext facesContext, - final IAdaptable externalContextKey) - { - final Map<String, ISymbol> symbols = createSymbols(facesContext); - return symbols.values().toArray(ISymbol.EMPTY_SYMBOL_ARRAY); - } - - @Override - public ISymbol resolveVariable(final DTFacesContext context, - final String name, final IAdaptable externalContextKey) - { - return createSymbols(context).get(name); - } - - private Map<String, ISymbol> createSymbols(final DTFacesContext context) - { - final IResource res = context.adaptContextObject(); - - if (res != null) - { - final IProject project = res.getProject(); - if (project != null) - { - final Map<String, ISymbol> symbols = new HashMap<String, ISymbol>(); - - final ISymbol requestContextVar = _symbolFactory - .createBeanOrUnknownInstanceSymbol(project, - REQUEST_CONTEXT_CLASS_NAME, - PAGE_FLOW_SCOPE_VARIABLE_NAME, - ERuntimeSource.OTHER_LITERAL); - symbols.put(REQUEST_CONTEXT_VARIABLE_NAME, requestContextVar); - - // both pageFlowScope and processScope return the same variable - // TODO: we may be able to populate this map - final ISymbol pageFlowVar = _symbolFactory - .createUnknownInstanceSymbol( - PAGE_FLOW_SCOPE_VARIABLE_NAME, - ERuntimeSource.OTHER_LITERAL); - symbols.put(PAGE_FLOW_SCOPE_VARIABLE_NAME, pageFlowVar); - final ISymbol processScopeVar = _symbolFactory - .createUnknownInstanceSymbol( - PROCESS_SCOPE_VARIABLE_NAME, - ERuntimeSource.OTHER_LITERAL); - symbols.put(PROCESS_SCOPE_VARIABLE_NAME, processScopeVar); - return symbols; - } - } - return Collections.emptyMap(); - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/DefaultTrinidadCoreElementEdit.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/DefaultTrinidadCoreElementEdit.java deleted file mode 100644 index a12ea8ebe..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/DefaultTrinidadCoreElementEdit.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.elementedit; - -import org.eclipse.jst.pagedesigner.elementedit.AbstractElementEdit; - -/** - * Default IElementEdit implementation for Trinidad core tag library. - * - * @author Ian Trimble - Oracle - */ -public class DefaultTrinidadCoreElementEdit extends AbstractElementEdit { - - /* - * Currently no default behaviour, but likely we will add some. - * Delete this comment when functionality added. - */ - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/PanelFormLayoutChildElementEdit.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/PanelFormLayoutChildElementEdit.java deleted file mode 100644 index 47b376f6d..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/PanelFormLayoutChildElementEdit.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.elementedit; - -import org.eclipse.gef.EditPart; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants; -import org.eclipse.jst.pagedesigner.parts.ElementEditPart; -import org.w3c.dom.Element; - -/** - * IElementEdit implementation for Trinidad tags that are potentially children - * of the panelFormLayout tag, and therefore may need to refresh panelFormLayout - * on model change. - * - * @author Ian Trimble - Oracle - */ -public class PanelFormLayoutChildElementEdit extends - DefaultTrinidadCoreElementEdit { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.elementedit.AbstractElementEdit#handleModelChange(org.w3c.dom.Element, org.eclipse.jst.pagedesigner.parts.ElementEditPart, boolean) - */ - @Override - public boolean handleModelChange(Element ele, ElementEditPart part, - boolean recursive) { - boolean handled = false; - EditPart parentPart = part.getParent(); - while (parentPart instanceof ElementEditPart) { - ElementEditPart parentElementEditPart = (ElementEditPart)parentPart; - TagIdentifier tagID = parentElementEditPart.getTagIdentifier(); - if (tagID != null) { - if (ITrinidadConstants.TAG_IDENTIFIER_PANELFORMLAYOUT.isSameTagType(tagID)) { - parentElementEditPart.refreshModelChange(recursive); - handled = true; - break; - } else if ( - ITrinidadConstants.TAG_IDENTIFIER_GROUP.isSameTagType(tagID) || - IJSFConstants.TAG_IDENTIFIER_FACET.isSameTagType(tagID)) { - parentPart = parentPart.getParent(); - } else { - break; - } - } - } - return handled; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/PanelTabbedElementEdit.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/PanelTabbedElementEdit.java deleted file mode 100644 index dc086aaac..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/PanelTabbedElementEdit.java +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.elementedit; - -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.gef.DragTracker; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.requests.DropRequest; -import org.eclipse.gef.requests.LocationRequest; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.TrinidadUtils; -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; -import org.eclipse.jst.pagedesigner.editpolicies.DragMoveEditPolicy; -import org.eclipse.jst.pagedesigner.editpolicies.ElementResizableEditPolicy; -import org.eclipse.jst.pagedesigner.itemcreation.ItemCreationEditPolicy; -import org.eclipse.jst.pagedesigner.itemcreation.ItemCreationRequest; -import org.eclipse.jst.pagedesigner.parts.ElementEditPart; -import org.eclipse.jst.pagedesigner.parts.NodeEditPart; -import org.eclipse.jst.pagedesigner.tools.ObjectModeDragTracker; -import org.eclipse.jst.pagedesigner.validation.caret.ActionData; -import org.eclipse.jst.pagedesigner.validation.caret.DefaultPositionRule; -import org.eclipse.jst.pagedesigner.validation.caret.DnDPositionValidator; -import org.eclipse.jst.pagedesigner.validation.caret.DropActionData; -import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator; -import org.eclipse.jst.pagedesigner.validation.caret.Target; -import org.eclipse.jst.pagedesigner.validation.caret.DropActionData.DropData; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * IElementEdit implementation for Trinidad's panelTabbed tag. - * - * @author Ian Trimble - Oracle - */ -public class PanelTabbedElementEdit extends DefaultTrinidadCoreElementEdit { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.elementedit.AbstractElementEdit#createEditPolicies(org.eclipse.jst.pagedesigner.parts.ElementEditPart) - */ - @Override - public void createEditPolicies(ElementEditPart part) { - part.installEditPolicy( - EditPolicy.SELECTION_FEEDBACK_ROLE, - new PanelTabbedElementResizableEditPolicy()); - part.installEditPolicy( - EditPolicy.PRIMARY_DRAG_ROLE, - new PanelTabbedDragMoveEditPolicy()); - part.installEditPolicy( - ItemCreationRequest.REQ_ITEM_CREATION, - new PanelTabbedItemCreationEditPolicy()); - } - - /** - * Extends ElementResizableEditPolicy to determine if tab is clicked and - * respond accordingly. - * - * @author Ian Trimble - Oracle - */ - public static class PanelTabbedElementResizableEditPolicy extends ElementResizableEditPolicy { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.editpolicies.ElementResizableEditPolicy#getSelectionDragTracker(org.eclipse.gef.requests.LocationRequest) - */ - @Override - public DragTracker getSelectionDragTracker(LocationRequest request) { - return getSelectionTracker(request); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.editpolicies.ElementResizableEditPolicy#getSelectionTracker(org.eclipse.gef.requests.LocationRequest) - */ - @Override - protected DragTracker getSelectionTracker(LocationRequest request) { - final GraphicalEditPart part = (GraphicalEditPart)getHost(); - if (part instanceof NodeEditPart) { - final Node node = ((NodeEditPart)part).getDOMNode(); - if (getShowDetailItemCount(node) > 0) { - ObjectModeDragTracker dragTracker = new ObjectModeDragTracker(getHost()) { - protected boolean handleButtonDown(int button) { - if (button == 1) { - final int tabIndex = getTabIndex(getLocation()); - final EditPart editPart = getSourceEditPart(); - if (editPart instanceof ElementEditPart) { - final Node node = ((ElementEditPart)editPart).getDOMNode(); - if (TrinidadUtils.setCurrentChildIndex(node, tabIndex)) { - ((ElementEditPart)editPart).refresh(true); - } - } - } - return super.handleButtonDown(button); - } - }; - return dragTracker; - } - } - return new ObjectModeDragTracker(getHost()); - } - - private int getTabIndex(Point location) { - int tabIndex = -1; - final GraphicalEditPart part = (GraphicalEditPart)getHost(); - if (part instanceof NodeEditPart) { - final Node node = ((NodeEditPart)part).getDOMNode(); - final IFigure figure = part.getFigure(); - Point relLocation = location.getCopy(); - figure.translateToRelative(relLocation); - final int showDetailItemCount = getShowDetailItemCount(node); - if (showDetailItemCount > 0) { - final int tabWidth = figure.getBounds().width / showDetailItemCount; - tabIndex = relLocation.x / tabWidth; - if (tabIndex > showDetailItemCount - 1) { - tabIndex = showDetailItemCount - 1; - } - } - } - return tabIndex; - } - - private int getShowDetailItemCount(Node node) { - int count = 0; - if (node != null) { - NodeList childNodes = node.getChildNodes(); - for (int i = 0; i < childNodes.getLength(); i++) { - Node childNode = childNodes.item(i); - if (childNode instanceof Element) { - if (ITrinidadConstants.TAG_IDENTIFIER_SHOWDETAILITEM.isSameTagType( - TagIdentifierFactory.createDocumentTagWrapper((Element)childNode))) { - count++; - } - } - } - } - return count; - } - - } - - /** - * Extends DragMoveEditPolicy to add OnlyShowDetailItemsRule as a rule. - * - * @author Ian Trimble - Oracle - */ - public static class PanelTabbedDragMoveEditPolicy extends DragMoveEditPolicy { - - /* - * (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.editpolicies.DropEditPolicy#createDropChildValidator(org.eclipse.gef.requests.DropRequest) - */ - @Override - protected IPositionMediator createDropChildValidator(DropRequest r) { - DropData dropData = createDropData(r); - if (dropData != null) { - DnDPositionValidator validator = - new DnDPositionValidator(new DropActionData( - ActionData.COMPONENT_MOVE, dropData)); - validator.addRule(new OnlyShowDetailItemsRule(validator.getActionData())); - return validator; - } - return null; - } - - } - - /** - * Extends ItemCreationEditPolicy to add OnlyShowDetailItemsRule as a rule. - * - * @author Ian Trimble - Oracle - */ - public static class PanelTabbedItemCreationEditPolicy extends ItemCreationEditPolicy { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.editpolicies.DropEditPolicy#createDropChildValidator(org.eclipse.gef.requests.DropRequest) - */ - @Override - protected IPositionMediator createDropChildValidator(DropRequest r) { - DropData dropData = createDropData(r); - if (dropData != null) { - DnDPositionValidator validator = - new DnDPositionValidator(new DropActionData( - ActionData.PALETTE_DND, dropData)); - validator.addRule(new OnlyShowDetailItemsRule(validator.getActionData())); - return validator; - } - return null; - } - - } - - /** - * Extends DefaultPositionRule to only allow showDetailItem tags to be - * dropped on panelTabbed tag. - * - * @author Ian Trimble - Oracle - */ - private static class OnlyShowDetailItemsRule extends DefaultPositionRule { - - /** - * Instantiates an instance. - * - * @param actionData ActionData instance. - */ - public OnlyShowDetailItemsRule(ActionData actionData) { - super(actionData); - } - - /* - * (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.validation.caret.DefaultPositionRule#isEditable(org.eclipse.jst.pagedesigner.validation.caret.Target) - */ - @Override - public boolean isEditable(Target target) { - if (ITrinidadConstants.TAG_IDENTIFIER_PANELTABBED.isSameTagType( - target.getTagWrapper())) { - return isDataDroppable(); - } - return true; - } - - private boolean isDataDroppable() { - ActionData actionData = getActionData(); - if (actionData instanceof DropActionData) { - DropActionData dropActionData = (DropActionData)actionData; - TagIdentifier tagIdentifier = - (TagIdentifier)dropActionData.getDropData().getTagIdentifiers().get(0); - if (ITrinidadConstants.TAG_IDENTIFIER_SHOWDETAILITEM.isSameTagType( - tagIdentifier)) { - return true; - } - } - return false; - } - - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/ShowDetailItemElementEdit.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/ShowDetailItemElementEdit.java deleted file mode 100644 index f0ba5bde8..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/ShowDetailItemElementEdit.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.elementedit; - -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPartViewer; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.pagedesigner.parts.ElementEditPart; -import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator; -import org.eclipse.jst.pagedesigner.validation.caret.Target; -import org.eclipse.jst.pagedesigner.viewer.DefaultDropLocationStrategy; -import org.eclipse.jst.pagedesigner.viewer.DesignPosition; -import org.eclipse.jst.pagedesigner.viewer.IDropLocationStrategy; -import org.w3c.dom.Element; - -/** - * IElementEdit implementation for Trinidad's showDetailItem tag. - * - * @author Ian Trimble - Oracle - */ -public class ShowDetailItemElementEdit extends DefaultTrinidadCoreElementEdit { - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.elementedit.AbstractElementEdit#handleModelChange(org.w3c.dom.Element, org.eclipse.jst.pagedesigner.parts.ElementEditPart, boolean) - */ - @Override - public boolean handleModelChange( - Element ele, ElementEditPart part, boolean recursive) { - boolean handled = false; - EditPart parentPart = part.getParent(); - if (parentPart instanceof ElementEditPart) { - ((ElementEditPart)parentPart).refreshModelChange(recursive); - handled = true; - } - return handled; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.elementedit.AbstractElementEdit#getDropRequestorLocationStrategy(org.eclipse.jst.jsf.common.dom.TagIdentifier, org.eclipse.gef.EditPartViewer) - */ - @Override - public IDropLocationStrategy getDropRequestorLocationStrategy( - TagIdentifier tag, EditPartViewer viewer) { - return new ShowDetailItemDropLocationStrategy(viewer); - } - - /** - * Extends DefaultDropLocationStrategy. - * - * @author Ian Trimble - Oracle - */ - private static class ShowDetailItemDropLocationStrategy extends DefaultDropLocationStrategy { - - /** - * Instantiates an instance. - * - * @param viewer EditPartViewer instance. - */ - public ShowDetailItemDropLocationStrategy(EditPartViewer viewer) { - super(viewer); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.viewer.DefaultDropLocationStrategy#calculateDesignPosition(org.eclipse.gef.EditPart, org.eclipse.draw2d.geometry.Point, org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator) - */ - @Override - public DesignPosition calculateDesignPosition( - EditPart host, Point p, IPositionMediator validator) { - DesignPosition position = null; - //check if host is editable or get nearest editable ancestor - host = validator.getEditableContainer(new Target(host)); - if (host instanceof ElementEditPart) { - final TagIdentifier hostTagId = - ((ElementEditPart)host).getTagIdentifier(); - if (ITrinidadConstants.TAG_IDENTIFIER_PANELTABBED.isSameTagType(hostTagId)) { - final int showDetailItemCount = host.getChildren().size(); - position = new DesignPosition(host, showDetailItemCount); - if (!validator.isValidPosition(position)) { - position = null; - } - } - } - return position; - } - - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/TrinidadCoreElementEditFactory.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/TrinidadCoreElementEditFactory.java deleted file mode 100644 index 3a1d3c688..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/elementedit/TrinidadCoreElementEditFactory.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.elementedit; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.pagedesigner.elementedit.AbstractElementEditFactory; -import org.eclipse.jst.pagedesigner.elementedit.IElementEdit; - -/** - * AbstractElementEditFactory extension for Trinidad core tag library. - * - * @author Ian Trimble - Oracle - */ -public class TrinidadCoreElementEditFactory extends AbstractElementEditFactory { - - /** - * Instantiates an instance, with ITrinidadConstants.URI_CORE as the - * supported URI. - */ - public TrinidadCoreElementEditFactory() { - super(ITrinidadConstants.URI_CORE); - } - - /* - * (non-Javadoc) - * @see org.eclipse.jst.pagedesigner.elementedit.AbstractElementEditFactory#createElementEdit(org.eclipse.jst.jsf.common.dom.TagIdentifier) - */ - public IElementEdit createElementEdit(final TagIdentifier tagIdentifier) { - if (ITrinidadConstants.TAG_IDENTIFIER_PANELTABBED.isSameTagType(tagIdentifier)) { - return new PanelTabbedElementEdit(); - } else if (ITrinidadConstants.TAG_IDENTIFIER_SHOWDETAILITEM.isSameTagType(tagIdentifier)) { - return new ShowDetailItemElementEdit(); - } else if ( - ITrinidadConstants.TAG_IDENTIFIER_INPUTCOLOR.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_INPUTDATE.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_INPUTFILE.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_INPUTLISTOFVALUES.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_INPUTNUMBERSPINBOX.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_INPUTTEXT.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_SELECTBOOLEANCHECKBOX.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_SELECTBOOLEANRADIO.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_SELECTMANYCHECKBOX.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_SELECTMANYLISTBOX.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_SELECTONECHOICE.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_SELECTONELISTBOX.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_SELECTONERADIO.isSameTagType(tagIdentifier) || - ITrinidadConstants.TAG_IDENTIFIER_PANELLABELANDMESSAGE.isSameTagType(tagIdentifier) - ) { - return new PanelFormLayoutChildElementEdit(); - } else { - return new DefaultTrinidadCoreElementEdit(); - } - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/messages.properties deleted file mode 100644 index 28fafc3a3..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/messages.properties +++ /dev/null @@ -1,31 +0,0 @@ -############################################################################### -# Copyright (c) 2001, 2008 Oracle Corporation 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: -# Oracle Corporation - initial API and implementation -# -############################################################################### -BreadCrumbsOperation_EmptyBreadCrumbsTag=Empty breadCrumbs tag - add child commandNavigationItem tags or set nodeStamp facet -NavigationPaneOperation_EmptyNavigationPaneTag=Empty navigationPane tag - add child commandNavigationItem tags or set nodeStamp facet -PanelTabbedOperation_EmptyPanelTabbedTag=Empty panelTabbed tag - add child showDetailItem tags -ShowDetailItemOperation_EmptyShowDetailItemTag=Empty showDetailItem tag - add children -SelectItemModel_SampleItem1Label=Sample Label 1 -SelectItemModel_SampleItem1Value=Sample Value 1 -SelectItemModel_SampleItem2Label=Sample Label 2 -SelectItemModel_SampleItem2Value=Sample Value 2 -SelectItemModel_SampleItem3Label=Sample Label 3 -SelectItemModel_SampleItem3Value=Sample Value 3 -SelectShuttleOperation_Description=Description -SelectShuttleOperation_LinkMove=Move -SelectShuttleOperation_LinkMoveAll=Move All -SelectShuttleOperation_LinkRemove=Remove -SelectShuttleOperation_LinkRemoveAll=Remove All -SelectShuttleOperation_LinkTop=Top -SelectShuttleOperation_LinkUp=Up -SelectShuttleOperation_LinkDown=Down -SelectShuttleOperation_LinkBottom=Bottom -TrinidadDTResourceProvider_StyleSheetNotLocated=StyleSheet could not be located
\ No newline at end of file diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/model/SelectItem.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/model/SelectItem.java deleted file mode 100644 index f6a06bb31..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/model/SelectItem.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.model; - -/** - * A simplified representation of a "selectItem" tag's most useful properties. - * - * @author Ian Trimble - Oracle - */ -public class SelectItem { - - private String label; - private String value; - - /** - * Creates an instance. - * - * @param label The label. - * @param value The value. - */ - public SelectItem(String label, String value) { - setLabel(label); - setValue(value); - } - - /** - * Sets the label of this instance. - * - * @param label The new label. - */ - public void setLabel(String label) { - if (label != null) { - this.label = label; - } else { - this.label = ""; //$NON-NLS-1$ - } - } - - /** - * Gets the label of this instance. - * - * @return The current label. - */ - public String getLabel() { - return label; - } - - /** - * Sets the value of this instance. - * - * @param value The new value. - */ - public void setValue(String value) { - if (value != null) { - this.value = value; - } else { - this.value = ""; //$NON-NLS-1$ - } - } - - /** - * Gets the value of this instance. - * - * @return The current value. - */ - public String getValue() { - return value; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/model/SelectItemModel.java b/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/model/SelectItemModel.java deleted file mode 100644 index 74d802e64..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.apache.trinidad.tagsupport/src/org/eclipse/jst/jsf/apache/trinidad/tagsupport/model/SelectItemModel.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) 2008 Oracle Corporation 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: - * Oracle Corporation - initial API and implementation - */ -package org.eclipse.jst.jsf.apache.trinidad.tagsupport.model; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.ITrinidadConstants; -import org.eclipse.jst.jsf.apache.trinidad.tagsupport.Messages; -import org.eclipse.jst.jsf.common.dom.TagIdentifier; -import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants; -import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -/** - * Provides a simple "selectItem"-like model to facilitate handling of both - * standard JSF core selectItem tags and Trinidad selectItem tags, or a sample - * model in the absence of either. - * - * @author Ian Trimble - Oracle - */ -public class SelectItemModel { - - private static final List<SelectItem> SAMPLE_MODEL = new ArrayList<SelectItem>(); - static { - SAMPLE_MODEL.add(new SelectItem( - Messages.SelectItemModel_SampleItem1Label, - Messages.SelectItemModel_SampleItem1Value)); - SAMPLE_MODEL.add(new SelectItem( - Messages.SelectItemModel_SampleItem2Label, - Messages.SelectItemModel_SampleItem2Value)); - SAMPLE_MODEL.add(new SelectItem( - Messages.SelectItemModel_SampleItem3Label, - Messages.SelectItemModel_SampleItem3Value)); - } - - /** - * Gets a model as a List of SelectItem instances, derived from child - * selectItem Elements, or a sample model if no suitable child Elements are - * found. - * - * @param parentElement Parent Element instance to scan for child selectItem - * Elements. - * @return List of SelectItem instances. - */ - public static final List<SelectItem> getModel(Element parentElement) { - return getModel(parentElement, true); - } - - /** - * Gets a model as a List of SelectItem instances, derived from child - * selectItem Elements, or (optionally) a sample model if no suitable - * child Elements are found. - * - * @param parentElement Parent Element instance to scan for child selectItem - * Elements. - * @param fallbackOnSampleModel If true and no suitable child Elements are - * found, return sample model. - * @return List of SelectItem instances (may be empty, but not null). - */ - public static final List<SelectItem> getModel( - Element parentElement, boolean fallbackOnSampleModel) { - List<SelectItem> selectItems = new ArrayList<SelectItem>(); - if (parentElement != null) { - NodeList childNodes = parentElement.getChildNodes(); - for (int i = 0; i < childNodes.getLength(); i++) { - if (childNodes.item(i) instanceof Element) { - Element childElement = (Element)childNodes.item(i); - TagIdentifier tagID = - TagIdentifierFactory.createDocumentTagWrapper(childElement); - if (tagID.isSameTagType(ITrinidadConstants.TAG_IDENTIFIER_SELECTITEM)) { - String label = childElement.getAttribute("label"); //$NON-NLS-1$ - if (label == null || label.length() < 1) { - label = childElement.getAttribute("value"); //$NON-NLS-1$ - } - selectItems.add(new SelectItem( - label, childElement.getAttribute("value"))); //$NON-NLS-1$ - } else if (tagID.isSameTagType(IJSFConstants.TAG_IDENTIFIER_SELECTITEM)) { - String value = childElement.getAttribute("value"); //$NON-NLS-1$ - if (value == null || value.length() < 1) { - value = childElement.getAttribute("itemValue"); //$NON-NLS-1$ - } - String label = childElement.getAttribute("itemLabel"); //$NON-NLS-1$ - if (label == null || label.length() < 1) { - label = value; - } - selectItems.add(new SelectItem(label, value)); - } - } - } - } - if (selectItems.size() > 0 || !fallbackOnSampleModel) { - return selectItems; - } else { - return getSampleModel(); - } - } - - /** - * Gets a sample model as a List of SelectItem instances. - * - * @return Sample model as a List of SelectItem instances. - */ - public static final List<SelectItem> getSampleModel() { - return SAMPLE_MODEL; - } - -} |