You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2018/04/25 15:45:17 UTC
[myfaces-tobago] branch master updated: TOBAGO-1893: Mark
as deprecated
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/master by this push:
new 1631d4e TOBAGO-1893: Mark <tc:treeMenu> as deprecated
1631d4e is described below
commit 1631d4ef1bddafee9efca35fc5624e6aec5d4754
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Wed Apr 25 17:41:43 2018 +0200
TOBAGO-1893: Mark <tc:treeMenu> as deprecated
---
.../myfaces/tobago/component/RendererTypes.java | 16 ++++++++
.../renderkit/renderer/TreeMenuRenderer.java | 4 ++
.../component/TreeListboxTagDeclaration.java | 5 +--
.../taglib/component/TreeMenuTagDeclaration.java | 8 ++--
.../taglib/component/TreeNodeTagDeclaration.java | 3 +-
.../taglib/component/TreeTagDeclaration.java | 5 +--
.../20-component/090-tree/03-menu/tree-menu.xhtml | 30 ++++++++-------
.../90000-attic/tree/tree-simple-with-data.xhtml | 43 ----------------------
.../90000-attic/treeMenu/treeMenu-command.xhtml | 40 --------------------
.../90000-attic/treeMenu/treeMenu-simple.xhtml | 40 --------------------
.../src/main/webapp/navigation.xhtml | 7 ++--
11 files changed, 50 insertions(+), 151 deletions(-)
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java
index 6c8293c..0c3cb11 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java
@@ -95,12 +95,20 @@ public enum RendererTypes {
TabGroup,
ToolBar,
Tree,
+ /**
+ * @deprecated since 2.0.0
+ */
+ @Deprecated
TreeData,
TreeCommand,
TreeIcon,
TreeIndent,
TreeLabel,
TreeListbox,
+ /**
+ * @deprecated since 4.2.1
+ */
+ @Deprecated
TreeMenu,
TreeNode,
TreeSelect;
@@ -176,12 +184,20 @@ public enum RendererTypes {
public static final String TAB_GROUP = "TabGroup";
public static final String TOOL_BAR = "ToolBar";
public static final String TREE = "Tree";
+ /**
+ * @deprecated since 2.0.0
+ */
+ @Deprecated
public static final String TREE_DATA = "TreeData";
public static final String TREE_COMMAND = "TreeCommand";
public static final String TREE_ICON = "TreeIcon";
public static final String TREE_INDENT = "TreeIndent";
public static final String TREE_LABEL = "TreeLabel";
public static final String TREE_LISTBOX = "TreeListbox";
+ /**
+ * @deprecated since 4.2.1
+ */
+ @Deprecated
public static final String TREE_MENU = "TreeMenu";
public static final String TREE_NODE = "TreeNode";
public static final String TREE_SELECT = "TreeSelect";
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeMenuRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeMenuRenderer.java
index 7935831..c40d214 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeMenuRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeMenuRenderer.java
@@ -19,5 +19,9 @@
package org.apache.myfaces.tobago.internal.renderkit.renderer;
+/**
+ * @deprecated since 4.2.1, please user {@link TreeRenderer} instead.
+ */
+@Deprecated
public class TreeMenuRenderer extends TreeRenderer {
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeListboxTagDeclaration.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeListboxTagDeclaration.java
index b0aef20..062a1be 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeListboxTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeListboxTagDeclaration.java
@@ -40,7 +40,7 @@ import javax.faces.component.UIData;
* A tree data structure displayed as a set of list boxes.
*/
@Tag(name = "treeListbox")
-@BodyContentDescription(anyTagOf = "<tc:treeNode>|<tc:treeData>")
+@BodyContentDescription(anyTagOf = "<tc:treeNode>")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UITreeListbox",
uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUITreeListbox",
@@ -52,8 +52,7 @@ import javax.faces.component.UIData;
"javax.faces.component.behavior.ClientBehaviorHolder"
},
allowedChildComponenents = {
- "org.apache.myfaces.tobago.TreeNode",
- "org.apache.myfaces.tobago.TreeData"
+ "org.apache.myfaces.tobago.TreeNode"
})
public interface TreeListboxTagDeclaration
extends HasIdBindingAndRendered, HasValue, HasVar, IsVisual, IsRequired, HasSize {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeMenuTagDeclaration.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeMenuTagDeclaration.java
index 173ce75..35e7941 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeMenuTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeMenuTagDeclaration.java
@@ -37,9 +37,12 @@ import javax.faces.component.UIData;
/**
* A tree which will be displayed like a flat menu.
* This menu is often used for navigation on the left side of an application.
+ *
+ * @deprecated since 4.2.1. Please use {@link TreeTagDeclaration} or <tc:tree> instead.
*/
+@Deprecated
@Tag(name = "treeMenu")
-@BodyContentDescription(anyTagOf = "<tc:treeData>")
+@BodyContentDescription(anyTagOf = "<tc:treeNode>")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UITreeMenu",
uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUITreeMenu",
@@ -51,8 +54,7 @@ import javax.faces.component.UIData;
"javax.faces.component.behavior.ClientBehaviorHolder"
},
allowedChildComponenents = {
- "org.apache.myfaces.tobago.TreeNode",
- "org.apache.myfaces.tobago.TreeData"
+ "org.apache.myfaces.tobago.TreeNode"
})
public interface TreeMenuTagDeclaration
extends HasIdBindingAndRendered, HasValue, HasVar, IsVisual,
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeNodeTagDeclaration.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeNodeTagDeclaration.java
index 69d4524..bac3b49 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeNodeTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeNodeTagDeclaration.java
@@ -46,8 +46,7 @@ import javax.faces.component.UIColumn;
componentFamily = UIColumn.COMPONENT_FAMILY,
rendererType = RendererTypes.TREE_NODE,
allowedChildComponenents = {
- "org.apache.myfaces.tobago.TreeNode",
- "org.apache.myfaces.tobago.TreeData"
+ "org.apache.myfaces.tobago.TreeNode"
})
public interface TreeNodeTagDeclaration
extends HasIdBindingAndRendered, HasTip, IsDisabled, IsVisual {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeTagDeclaration.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeTagDeclaration.java
index ef6ddbb..78ba8b8 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeTagDeclaration.java
@@ -41,7 +41,7 @@ import javax.faces.component.UIData;
* Usually used with icons and junction lines to open folder, etc.
*/
@Tag(name = "tree")
-@BodyContentDescription(anyTagOf = "<tc:treeData>")
+@BodyContentDescription(anyTagOf = "<tc:treeNode>")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UITree",
uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUITree",
@@ -53,8 +53,7 @@ import javax.faces.component.UIData;
"javax.faces.component.behavior.ClientBehaviorHolder"
},
allowedChildComponenents = {
- "org.apache.myfaces.tobago.TreeNode",
- "org.apache.myfaces.tobago.TreeData"
+ "org.apache.myfaces.tobago.TreeNode"
})
public interface TreeTagDeclaration
extends HasIdBindingAndRendered, HasValue, HasVar, IsVisual,
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/03-menu/tree-menu.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/03-menu/tree-menu.xhtml
index 98fdd2e..12d4e8a 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/03-menu/tree-menu.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/03-menu/tree-menu.xhtml
@@ -22,24 +22,28 @@
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:param name="title" value="#{demoBundle.tree_menu} <tc:treeMenu>"/>
- <p>The <code class="language-markup"><tc:treeMenu/></code> tag can be used for menus
- like the one on the left side of this site.
- The nodes have to be <code class="language-markup"><tc:treeCommand/></code> tags,
- otherwise <code class="language-markup"><tc:treeMenu/></code> behaves the same way as
- <code class="language-markup"><tc:tree/></code>.
- <code class="language-markup"><tc:treeMenu/></code> set indents automatically for
- <code class="language-markup"><tc:treeCommand/></code>.
- So the <code class="language-markup"><tc:treeIndent/></code> tag is not needed.</p>
- <tc:link label="Tag Library Documentation:" image="#{request.contextPath}/image/feather-leaf.png"
- link="#{demoBundle.tagDocUrl}/#{info.stableVersion}/tld/tc/treeMenu.html"/>
+
+ <p>The <code class="language-markup"><tc:treeMenu/></code> tag is deprecated, because it's easy to
+ build a tree menu with the <code class="language-markup"><tc:tree/></code> tag.
+ You find an example as the navigation bar on the left side of this site.
+ </p>
+ <p>
+ The menu nodes can be build inside of <code class="language-markup"><tc:treeNode/></code> with
+ <code class="language-markup"><tc:treeCommand/></code>,
+ <code class="language-markup"><tc:treeLabel/></code>,
+ <code class="language-markup"><tc:treeIcon/></code> and
+ <code class="language-markup"><tc:treeIndent/></code> tags.
+ It might be helpful to use cumstom classes here.
+ </p>
<tc:section label="Example">
<p>In this example, a click on a node has no effect.</p>
- <pre><code class="language-markup"><tc:treeMenu value="\#{treeController.sample}" ...></code></pre>
- <tc:treeMenu value="#{treeController.sample}" var="node">
+ <pre><code class="language-markup"><tc:tree value="\#{treeController.sample}" ...></code></pre>
+ <tc:tree value="#{treeController.sample}" var="node">
<tc:treeNode>
<tc:treeCommand label="#{node.userObject.name}"/>
+ <tc:treeIndent/>
</tc:treeNode>
- </tc:treeMenu>
+ </tc:tree>
</tc:section>
</ui:composition>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/tree/tree-simple-with-data.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/tree/tree-simple-with-data.xhtml
deleted file mode 100644
index 4c1f418..0000000
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/tree/tree-simple-with-data.xhtml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-
-<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
-<f:view
- xmlns:tc="http://myfaces.apache.org/tobago/component"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core">
-
- <tc:page>
- <!-- <tc:gridLayoutConstraint width="600px" height="300px" /> -->
- <f:facet name="layout">
- <tc:gridLayout rows="auto 1fr"/>
- </f:facet>
-
- <tc:out value="Simple tree with deprecated <tc:treeData> tag:"/>
-
- <tc:tree id="tree" selectable="single" showRoot="true" showRootJunction="true">
- <tc:treeData value="#{tree.tree}" var="node" id="data">
- <tc:treeNode id="template">
- <tc:treeIndent/>
- <tc:treeLabel value="#{node.userObject.name}"/>
- </tc:treeNode>
- </tc:treeData>
- </tc:tree>
-
- </tc:page>
-</f:view>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/treeMenu/treeMenu-command.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/treeMenu/treeMenu-command.xhtml
deleted file mode 100644
index a103270..0000000
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/treeMenu/treeMenu-command.xhtml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-
-<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
-<f:view
- xmlns:tc="http://myfaces.apache.org/tobago/component"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core">
-
- <tc:page id="page">
- <!-- <tc:gridLayoutConstraint width="600px" height="300px"/> -->
- <f:facet name="layout">
- <tc:gridLayout rows="auto 1fr"/>
- </f:facet>
-
- <tc:out value="Tree Menu with commands as nodes:"/>
-
- <tc:treeMenu id="tree" value="#{tree.tree}" var="node" showRoot="true">
- <tc:treeNode id="node">
- <tc:treeCommand label="#{node.userObject.name}" action="#{node.userObject.action}"/>
- </tc:treeNode>
- </tc:treeMenu>
-
- </tc:page>
-</f:view>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/treeMenu/treeMenu-simple.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/treeMenu/treeMenu-simple.xhtml
deleted file mode 100644
index d1250e7..0000000
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/treeMenu/treeMenu-simple.xhtml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-
-<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
-<f:view
- xmlns:tc="http://myfaces.apache.org/tobago/component"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core">
-
- <tc:page id="page">
- <!-- <tc:gridLayoutConstraint width="600px" height="300px"/> -->
- <f:facet name="layout">
- <tc:gridLayout rows="auto 1fr"/>
- </f:facet>
-
- <tc:out value="Simple Tree Menu:"/>
-
- <tc:treeMenu id="tree" showRoot="true" value="#{tree.tree}" var="node">
- <tc:treeNode id="template">
- <tc:treeLabel value="#{node.userObject.name}"/>
- </tc:treeNode>
- </tc:treeMenu>
-
- </tc:page>
-</f:view>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/navigation.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/navigation.xhtml
index ad5d81d..9be9b33 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/navigation.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/navigation.xhtml
@@ -20,13 +20,12 @@
<f:subview id="navigator"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:tc="http://myfaces.apache.org/tobago/component">
- <tc:treeMenu id="nav" value="#{navigationTree.tree}" var="node" state="#{navigationState.state}">
+ <tc:tree id="nav" value="#{navigationTree.tree}" var="node" state="#{navigationState.state}">
<tc:treeNode id="node">
<tc:treeCommand
id="cmd"
label="» #{node.title}"
- outcome="#{node.outcome}"
- omit="true"/>
+ outcome="#{node.outcome}"/>
</tc:treeNode>
- </tc:treeMenu>
+ </tc:tree>
</f:subview>
--
To stop receiving notification emails like this one, please contact
lofwyr@apache.org.