com.xpn.xwiki.wysiwyg.client.plugin.link
Class LinkConfig

java.lang.Object
  extended by com.xpn.xwiki.wysiwyg.client.plugin.link.LinkConfig
All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable

public class LinkConfig
extends java.lang.Object
implements com.google.gwt.user.client.rpc.IsSerializable

Stores the data about a link: information about the link: reference (wiki, space, page), URL and also about its representation in a document (parameters, etc).

Version:
$Id: LinkConfig.java 20040 2009-05-16 12:06:29Z sdumitriu $

Nested Class Summary
static class LinkConfig.LinkType
          Enumeration type to store the type of link: wiki external link, link to an existing page, link to a new page, etc.
 
Constructor Summary
LinkConfig()
           
 
Method Summary
 void fromJSON(java.lang.String json)
          Fills this object with data from the passed JSON representation.
 java.lang.String getLabel()
           
 java.lang.String getLabelText()
           
 java.lang.String getPage()
           
 java.lang.String getParameter(java.lang.String name)
           
 java.lang.String getReference()
           
 java.lang.String getSpace()
           
 java.lang.String getTooltip()
           
 LinkConfig.LinkType getType()
           
 java.lang.String getUrl()
           
 java.lang.String getWiki()
           
 boolean isOpenInNewWindow()
           
 boolean isReadOnlyLabel()
           
 java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> listParameters()
          Returns an iterable type over the list of parameters for this LinkConfig.
 java.lang.String removeParameter(java.lang.String name)
           
 void setLabel(java.lang.String label)
           
 void setLabelText(java.lang.String labelText)
           
 void setOpenInNewWindow(boolean openInNewWindow)
           
 void setPage(java.lang.String page)
           
 java.lang.String setParameter(java.lang.String name, java.lang.String value)
          Sets the value of the specified parameter to the specified value and returns the old value, if any, or null otherwise.
 void setReadOnlyLabel(boolean readOnlyLabel)
           
 void setReference(java.lang.String reference)
           
 void setSpace(java.lang.String space)
           
 void setTooltip(java.lang.String tooltip)
           
 void setType(LinkConfig.LinkType type)
           
 void setUrl(java.lang.String url)
           
 void setWiki(java.lang.String wiki)
           
 java.lang.String toJSON()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkConfig

public LinkConfig()
Method Detail

getUrl

public java.lang.String getUrl()
Returns:
the url

setUrl

public void setUrl(java.lang.String url)
Parameters:
url - the url to set

getWiki

public java.lang.String getWiki()
Returns:
the wiki

setWiki

public void setWiki(java.lang.String wiki)
Parameters:
wiki - the wiki to set

getSpace

public java.lang.String getSpace()
Returns:
the space

setSpace

public void setSpace(java.lang.String space)
Parameters:
space - the space to set

getPage

public java.lang.String getPage()
Returns:
the page

setPage

public void setPage(java.lang.String page)
Parameters:
page - the page to set

getLabel

public java.lang.String getLabel()
Returns:
the label

setLabel

public void setLabel(java.lang.String label)
Parameters:
label - the label to set

getType

public LinkConfig.LinkType getType()
Returns:
the type

setType

public void setType(LinkConfig.LinkType type)
Parameters:
type - the type to set

getLabelText

public java.lang.String getLabelText()
Returns:
the labelText

setLabelText

public void setLabelText(java.lang.String labelText)
Parameters:
labelText - the labelText to set

isReadOnlyLabel

public boolean isReadOnlyLabel()
Returns:
the readOnlyLabel

setReadOnlyLabel

public void setReadOnlyLabel(boolean readOnlyLabel)
Parameters:
readOnlyLabel - the readOnlyLabel to set

getReference

public java.lang.String getReference()
Returns:
the reference

setReference

public void setReference(java.lang.String reference)
Parameters:
reference - the reference to set

isOpenInNewWindow

public boolean isOpenInNewWindow()
Returns:
true if this link is configured to open in a new window, false otherwise

setOpenInNewWindow

public void setOpenInNewWindow(boolean openInNewWindow)
Parameters:
openInNewWindow - whether this link should be opened in a new window or not

getTooltip

public java.lang.String getTooltip()
Returns:
the tooltip of this link

setTooltip

public void setTooltip(java.lang.String tooltip)
Parameters:
tooltip - the tooltip to set for this link

getParameter

public java.lang.String getParameter(java.lang.String name)
Parameters:
name - the name of the parameter to get
Returns:
the value of the parameter

setParameter

public java.lang.String setParameter(java.lang.String name,
                                     java.lang.String value)
Sets the value of the specified parameter to the specified value and returns the old value, if any, or null otherwise.

Parameters:
name - the name of the parameter to set
value - the value of the parameter to set
Returns:
the old value of the set parameter, if any

removeParameter

public java.lang.String removeParameter(java.lang.String name)
Parameters:
name - the name of the parameter to unset
Returns:
the old value of the parameter to unset, if any, or null otherwise

toJSON

public java.lang.String toJSON()
Returns:
the JSON representation of this ImageConfig

fromJSON

public void fromJSON(java.lang.String json)
Fills this object with data from the passed JSON representation.

Parameters:
json - the JSON representation of this image config object.

listParameters

public java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> listParameters()
Returns an iterable type over the list of parameters for this LinkConfig. Implemented through this function to hide the actual parameters map and return only a read-only iterator.

Returns:
an iterable type over the this LinkConfig's parameters collection


Copyright © 2004-2010 XWiki. All Rights Reserved.