com.ibm.portal.theme.plugin.impl
Class DefaultThemeItem

java.lang.Object
  extended by com.ibm.portal.theme.plugin.impl.DefaultThemeContent
      extended by com.ibm.portal.theme.plugin.impl.DefaultThemeItem
All Implemented Interfaces:
ActiveFlag, Localized, ThemeContentDescriptorConstants, ThemeItemDescriptorConstants, ThemeContent, ThemeItem, org.eclipse.core.runtime.IExecutableExtension
Direct Known Subclasses:
DefaultThemeLinkItem

public class DefaultThemeItem
extends DefaultThemeContent
implements ThemeItem

This class will retrieve the icon path for an extension.

Since:
6.0
Note:
This interface is designed to be implemented by clients.

Field Summary
static java.lang.String ICON_NAME_ATTRIBUTE
          The ICON_NAME_ATTRIBUTE indicates the icon files name that we want to generate a URL to.
 java.lang.String iconName
           
 java.lang.String state
           
 
Fields inherited from class com.ibm.portal.theme.plugin.impl.DefaultThemeContent
context, description, ordinal, title
 
Fields inherited from interface com.ibm.portal.theme.plugin.impl.ThemeItemDescriptorConstants
ELEMENT_NAME, TOOLTIP_ATTRIBUTE
 
Fields inherited from interface com.ibm.portal.theme.plugin.impl.ThemeContentDescriptorConstants
CLASS_ATTRIBUTE, DESCR_ATTRIBUTE, ID_ATTRIBUTE, ORDINAL_ATTRIBUTE, TITLE_ATTRIBUTE
 
Constructor Summary
DefaultThemeItem()
           
 
Method Summary
 java.lang.String createIconFilename(java.lang.String icon, PortalResources.State s)
          This method is called to process the concatenation of the state to the icon filename
 java.lang.String getIconDirectoryPath(java.lang.String path)
          This method will parse the full icon's path and return only the directory path
 java.lang.String getIconFileName(java.lang.String path)
          This method will parse the full icon's path and return only the filename
 java.lang.String getIconStateValue(PortalResources.State iconState, java.lang.String iconValue)
          This method concatenates the state onto the front of the icon's filename
 PortalResources.State getStateValue(java.lang.String s)
          This method retrieves the state that should be sent into newIconURL
 DisposableURL newIconURL(PortalResources.State s)
          Returns the URL for the associated icon.
 EngineURL newURL()
           
 boolean requiresPOST()
           
 void setInitializationData(org.eclipse.core.runtime.IConfigurationElement element, java.lang.String arg1, java.lang.Object arg2)
           
 
Methods inherited from class com.ibm.portal.theme.plugin.impl.DefaultThemeContent
getDescription, getLocales, getOrdinal, getRequest, getResponse, getTitle, getTooltip, init, isActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.portal.theme.plugin.ThemeItem
getTooltip
 
Methods inherited from interface com.ibm.portal.theme.plugin.ThemeContent
getOrdinal, init
 
Methods inherited from interface com.ibm.portal.ActiveFlag
isActive
 
Methods inherited from interface com.ibm.portal.Localized
getDescription, getLocales, getTitle
 

Field Detail

state

public java.lang.String state

iconName

public java.lang.String iconName

ICON_NAME_ATTRIBUTE

public static final java.lang.String ICON_NAME_ATTRIBUTE
The ICON_NAME_ATTRIBUTE indicates the icon files name that we want to generate a URL to.

See Also:
Constant Field Values
Constructor Detail

DefaultThemeItem

public DefaultThemeItem()
Method Detail

setInitializationData

public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement element,
                                  java.lang.String arg1,
                                  java.lang.Object arg2)
                           throws org.eclipse.core.runtime.CoreException
Specified by:
setInitializationData in interface org.eclipse.core.runtime.IExecutableExtension
Overrides:
setInitializationData in class DefaultThemeContent
Throws:
org.eclipse.core.runtime.CoreException

newIconURL

public DisposableURL newIconURL(PortalResources.State s)
Description copied from interface: ThemeItem
Returns the URL for the associated icon. If the URL cannot be created or does not exist, a null value is returned.

Specified by:
newIconURL in interface ThemeItem
Overrides:
newIconURL in class DefaultThemeContent
Parameters:
s - the icon state
Returns:
the URL or null if the URL cannot be created

requiresPOST

public boolean requiresPOST()

newURL

public EngineURL newURL()
                 throws StateException
Throws:
StateException

getStateValue

public PortalResources.State getStateValue(java.lang.String s)
This method retrieves the state that should be sent into newIconURL

Parameters:
s - the string retrieved from the state attribute on the tag
Returns:
PortalIcons.State

createIconFilename

public java.lang.String createIconFilename(java.lang.String icon,
                                           PortalResources.State s)
This method is called to process the concatenation of the state to the icon filename

Parameters:
icon - the icons file path
Returns:
fileValue

getIconFileName

public java.lang.String getIconFileName(java.lang.String path)
This method will parse the full icon's path and return only the filename

Parameters:
path - complete icon path
Returns:
filenameValue

getIconDirectoryPath

public java.lang.String getIconDirectoryPath(java.lang.String path)
This method will parse the full icon's path and return only the directory path

Parameters:
path - full icon's path
Returns:
dirPath

getIconStateValue

public java.lang.String getIconStateValue(PortalResources.State iconState,
                                          java.lang.String iconValue)
This method concatenates the state onto the front of the icon's filename

Parameters:
iconState - the string retrieved from the state attribute on the tag
iconValue - the filename of the icon
Returns:
iconValue