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 2017/06/22 14:23:51 UTC
svn commit: r1799587 - in
/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago:
component/ internal/component/ internal/taglib/component/
internal/taglib/declaration/ internal/util/
Author: lofwyr
Date: Thu Jun 22 14:23:50 2017
New Revision: 1799587
URL: http://svn.apache.org/viewvc?rev=1799587&view=rev
Log:
TOBAGO-1760: New attributes "outcome" and "fragment" for <tc:link> and other commands for internal links
Added:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasFragment.java
- copied, changed from r1799494, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasOutcome.java
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommandBase.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/EventTagDeclaration.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeCommandTagDeclaration.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java?rev=1799587&r1=1799586&r2=1799587&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java Thu Jun 22 14:23:50 2017
@@ -89,6 +89,7 @@ public enum Attributes {
filter,
first,
fixed,
+ fragment,
frequency,
focus,
focusId,
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommandBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommandBase.java?rev=1799587&r1=1799586&r2=1799587&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommandBase.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommandBase.java Thu Jun 22 14:23:50 2017
@@ -143,4 +143,6 @@ public abstract class AbstractUICommandB
public abstract String getLink();
public abstract String getOutcome();
+
+ public abstract String getFragment();
}
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java?rev=1799587&r1=1799586&r2=1799587&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java Thu Jun 22 14:23:50 2017
@@ -31,6 +31,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.taglib.declaration.HasAction;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasActionListener;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasConfirmation;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasFragment;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasImage;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
@@ -84,7 +85,7 @@ import javax.faces.component.UICommand;
})
public interface ButtonTagDeclaration
extends HasIdBindingAndRendered, HasAction, HasActionListener, IsImmediateCommand, HasConfirmation,
- HasLink, HasOutcome, IsTransition, HasTarget, IsDisabledBySecurity,
+ HasLink, HasOutcome, HasFragment, IsTransition, HasTarget, IsDisabledBySecurity,
IsOmit, IsVisual, HasLabel, HasAccessKey, HasTip, HasImage,
IsDefaultCommand, HasTabIndex {
}
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/EventTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/EventTagDeclaration.java?rev=1799587&r1=1799586&r2=1799587&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/EventTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/EventTagDeclaration.java Thu Jun 22 14:23:50 2017
@@ -27,6 +27,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.internal.taglib.declaration.HasAction;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasActionListener;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasConfirmation;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasFragment;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasLink;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasOutcome;
@@ -55,7 +56,7 @@ import javax.faces.component.UICommand;
faceletHandler = "org.apache.myfaces.tobago.facelets.EventHandler")
public interface EventTagDeclaration
extends HasIdBindingAndRendered, HasAction, HasActionListener, IsImmediateCommand, HasConfirmation,
- HasLink, HasOutcome, IsTransition, HasTarget, IsDisabledBySecurity, IsOmit {
+ HasLink, HasOutcome, HasFragment, IsTransition, HasTarget, IsDisabledBySecurity, IsOmit {
/**
* The name of the event as an instance of {@link org.apache.myfaces.tobago.component.ClientBehaviors}
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java?rev=1799587&r1=1799586&r2=1799587&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java Thu Jun 22 14:23:50 2017
@@ -31,6 +31,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.taglib.declaration.HasAction;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasActionListener;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasConfirmation;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasFragment;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasImage;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
@@ -79,6 +80,6 @@ import javax.faces.component.UICommand;
})
public interface LinkTagDeclaration
extends HasIdBindingAndRendered, HasAction, HasActionListener, IsImmediateCommand, HasConfirmation,
- HasLink, HasOutcome, IsTransition, HasTarget, IsDisabledBySecurity,
+ HasLink, HasOutcome, HasFragment, IsTransition, HasTarget, IsDisabledBySecurity,
IsOmit, HasImage, HasTabIndex, IsVisual, HasLabel, HasAccessKey, HasTip {
}
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeCommandTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeCommandTagDeclaration.java?rev=1799587&r1=1799586&r2=1799587&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeCommandTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TreeCommandTagDeclaration.java Thu Jun 22 14:23:50 2017
@@ -31,6 +31,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.taglib.declaration.HasAction;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasActionListener;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasConfirmation;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasFragment;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasLink;
@@ -76,6 +77,6 @@ import javax.faces.component.UICommand;
rendererType = RendererTypes.TREE_COMMAND)
public interface TreeCommandTagDeclaration
extends HasIdBindingAndRendered, HasAction, HasActionListener, IsImmediateCommand, HasConfirmation,
- HasLink, HasOutcome, IsTransition, HasTarget, IsDisabledBySecurity,
+ HasLink, HasOutcome, HasFragment, IsTransition, HasTarget, IsDisabledBySecurity,
IsOmit, HasLabel, HasAccessKey, HasTip, HasTabIndex, IsVisual {
}
Copied: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasFragment.java (from r1799494, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasOutcome.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasFragment.java?p2=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasFragment.java&p1=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasOutcome.java&r1=1799494&r2=1799587&rev=1799587&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasOutcome.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasFragment.java Thu Jun 22 14:23:50 2017
@@ -22,15 +22,15 @@ package org.apache.myfaces.tobago.intern
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
-public interface HasOutcome {
+public interface HasFragment {
/**
- * Link to an internal facelet page, like the outcome of an action.
- * The context path will be added.
- * A session id will be added, if needed.
- *
- * @param outcome internal link
+ * The identifier of the page fragment which should
+ * be brought into focus when the target page is
+ * rendered. The value of this attribute is appended
+ * to the end of target URL following a hash (#) mark.
+ * This notation is part of the standard URL syntax.
*/
@TagAttribute
@UIComponentTagAttribute()
- void setOutcome(String outcome);
+ void setFragment(String fragment);
}
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java?rev=1799587&r1=1799586&r2=1799587&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java Thu Jun 22 14:23:50 2017
@@ -252,6 +252,12 @@ public final class RenderUtils {
}
}
}
+
+ final String fragment = component.getFragment();
+ if (StringUtils.isNotBlank(fragment)) {
+ builder.append("#").append(fragment.trim());
+ }
+
url = builder.toString();
}