Java Doc for Link.java in  » J2EE » wicket » org » apache » wicket » markup » html » link » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » wicket » org.apache.wicket.markup.html.link 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.wicket.markup.html.link.AbstractLink
   org.apache.wicket.markup.html.link.Link

All known Subclasses:   org.apache.wicket.extensions.breadcrumb.BreadCrumbLink,  org.apache.wicket.markup.html.ScopedLink,  org.apache.wicket.markup.html.navigation.paging.PagingNavigationIncrementLink,  org.apache.wicket.ajax.markup.html.AjaxFallbackLink,  org.apache.wicket.markup.html.link.PageLink,  org.apache.wicket.markup.html.link.DownloadLink,  org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByLink,  org.apache.wicket.markup.html.navigation.paging.PagingNavigationLink,  org.apache.wicket.markup.html.link.ResourceLink,  org.apache.wicket.markup.html.link.PopupCloseLink,  org.apache.wicket.markup.html.link.StatelessLink,  org.apache.wicket.markup.html.link.BookmarkablePageLink,
Link
abstract public class Link extends AbstractLink implements ILinkListener(Code)
Implementation of a hyperlink component. A link can be used with an anchor (<a href...) element or any element that supports the onclick javascript event handler (such as buttons, td elements, etc). When used with an anchor, a href attribute will be generated. When used with any other element, an onclick javascript event handler attribute will be generated.

You can use a link like:

 add(new Link("myLink")
 {
 public void onClick(RequestCycle cycle)
 {
 // do something here...  
 }
 );
 
and in your HTML file:
 <a href="#" wicket:id="myLink">click here</a>
 
or:
 <td wicket:id="myLink">my clickable column</td>
 

The following snippet shows how to pass a parameter from the Page creating the Page to the Page responded by the Link.
 add(new Link("link", listItem.getModel()) 
 {
 public void onClick() 
 {
 MyObject obj = (MyObject)getModelObject();
 setResponsePage(new MyPage(obj.getId(), ... ));
 }
 

author:
   Jonathan Locke
author:
   Eelco Hillenius



Constructor Summary
public  Link(String id)
    
public  Link(String id, IModel object)
    

Method Summary
protected  CharSequenceappendAnchor(ComponentTag tag, CharSequence url)
     Appends any anchor to the url if the url is not null and the url does not already contain an anchor (url.indexOf('#') != -1).
public  ComponentgetAnchor()
     Gets any anchor component.
final public  booleangetAutoEnable()
     Gets whether link should automatically enable/disable based on current page.
protected  CharSequencegetOnClickScript(CharSequence url)
    
protected  StringgetOnClickScript(String url)
    
public  PopupSettingsgetPopupSettings()
     Gets the popup specification.
protected  booleangetStatelessHint()
    
protected  CharSequencegetURL()
     Gets the url to use for this link.
public  booleanisEnabled()
    
protected  booleanlinksTo(Page page)
     Whether this link refers to the given page.
abstract public  voidonClick()
     Called when a link is clicked.
protected  voidonComponentTag(ComponentTag tag)
     Handles this link's tag.
final public  voidonLinkClicked()
     THIS METHOD IS NOT PART OF THE WICKET API.
public  LinksetAnchor(Component anchor)
     Sets an anchor component.
final public  LinksetAutoEnable(boolean autoEnable)
     Sets whether this link should automatically enable/disable based on current page.
Parameters:
  autoEnable - whether this link should automatically enable/disable based oncurrent page.
final public  LinksetPopupSettings(PopupSettings popupSettings)
     Sets the popup specification.


Constructor Detail
Link
public Link(String id)(Code)

See Also:   org.apache.wicket.Component.Component(String)



Link
public Link(String id, IModel object)(Code)

See Also:   org.apache.wicket.Component.Component(StringIModel)




Method Detail
appendAnchor
protected CharSequence appendAnchor(ComponentTag tag, CharSequence url)(Code)
Appends any anchor to the url if the url is not null and the url does not already contain an anchor (url.indexOf('#') != -1). This implementation looks whether an anchor component was set, and if so, it will append the markup id of that component. That markup id is gotten by either calling Component.getMarkupId if Component.getOutputMarkupId returns true, or if the anchor component does not output it's id, this method will try to retrieve the id from the markup directly. If neither is found, an WicketRuntimeException excpeption is thrown. If no anchor component was set, but the link component is attached to a <a element, this method will append what is in the href attribute if there is one, starts with a '#' and has more than one character.

You can override this method, but it means that you have to take care of whatever is done with any set anchor component yourself. You also have to manually append the '#' at the right place.


Parameters:
  tag - The component tag
Parameters:
  url - The url to start with The url, possibly with an anchor appended



getAnchor
public Component getAnchor()(Code)
Gets any anchor component. Any anchor component to jump to, might be null



getAutoEnable
final public boolean getAutoEnable()(Code)
Gets whether link should automatically enable/disable based on current page. Whether this link should automatically enable/disable based oncurrent page.



getOnClickScript
protected CharSequence getOnClickScript(CharSequence url)(Code)

Parameters:
  url - The url for the link Any onClick JavaScript that should be used



getOnClickScript
protected String getOnClickScript(String url)(Code)

Parameters:
  url - The url for the link Any onClick JavaScript that should be usedLink.getOnClickScript(CharSequence)



getPopupSettings
public PopupSettings getPopupSettings()(Code)
Gets the popup specification. If not-null, a javascript on-click event handler will be generated that opens a new window using the popup properties. the popup specification.



getStatelessHint
protected boolean getStatelessHint()(Code)



getURL
protected CharSequence getURL()(Code)
Gets the url to use for this link. The URL that this link links to



isEnabled
public boolean isEnabled()(Code)

See Also:   org.apache.wicket.Component.isEnabled



linksTo
protected boolean linksTo(Page page)(Code)
Whether this link refers to the given page.
Parameters:
  page - A page True if this link goes to the given page



onClick
abstract public void onClick()(Code)
Called when a link is clicked.



onComponentTag
protected void onComponentTag(ComponentTag tag)(Code)
Handles this link's tag. OVERRIDES MUST CALL SUPER.
Parameters:
  tag - the component tag
See Also:   org.apache.wicket.Component.onComponentTag(ComponentTag)



onLinkClicked
final public void onLinkClicked()(Code)
THIS METHOD IS NOT PART OF THE WICKET API. DO NOT ATTEMPT TO OVERRIDE OR CALL IT. Called when a link is clicked. The implementation of this method is currently to simply call onClick(), but this may be augmented in the future.
See Also:   ILinkListener



setAnchor
public Link setAnchor(Component anchor)(Code)
Sets an anchor component. An anchor (form 'http://server/app/etc#someAnchor') will be appended to the link so that after this link executes, it will jump to the provided anchor component's position. The provided anchor must either have the Component.getOutputMarkupId flag true, or it must be attached to a <a tag with a href attribute of more than one character starting with '#' ('<a href="#someAnchor" ... ').
Parameters:
  anchor - The anchor this



setAutoEnable
final public Link setAutoEnable(boolean autoEnable)(Code)
Sets whether this link should automatically enable/disable based on current page.
Parameters:
  autoEnable - whether this link should automatically enable/disable based oncurrent page. This



setPopupSettings
final public Link setPopupSettings(PopupSettings popupSettings)(Code)
Sets the popup specification. If not-null, a javascript on-click event handler will be generated that opens a new window using the popup properties.
Parameters:
  popupSettings - the popup specification. This



Methods inherited from org.apache.wicket.markup.html.link.AbstractLink
protected void disableLink(ComponentTag tag)(Code)(Java Doc)
public String getAfterDisabledLink()(Code)(Java Doc)
public String getBeforeDisabledLink()(Code)(Java Doc)
final protected boolean isLinkEnabled()(Code)(Java Doc)
protected void onBeforeRender()(Code)(Java Doc)
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)(Code)(Java Doc)
public void setAfterDisabledLink(String afterDisabledLink)(Code)(Java Doc)
public void setBeforeDisabledLink(String beforeDisabledLink)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.