Class GraphicElementFactory
- java.lang.Object
-
- org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory
-
- All Implemented Interfaces:
Serializable
public class GraphicElementFactory extends Object implements Serializable
The GraphicElementFactory is the only class to instanciate in this package. You should have one factory for each client (for future evolution). The GraphicElementFactory is responsible from graphic component instanciation. You should never directly instanciate a component without using this factory ! This class uses the "factory design pattern".- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_LOOK_NAME
static String
GE_FACTORY_SESSION_ATT
static String
RESOURCES_KEY
The key with which is associated the resources wrapper used by a Silverpeas component instance and that is carried in each request.static String
STANDARD_CSS
-
Constructor Summary
Constructors Constructor Description GraphicElementFactory(String look)
Constructor declarationGraphicElementFactory(MainSessionController mainSessionController)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ArrayPane
getArrayPane(String name, String url, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
Build a new ArrayPane.ArrayPane
getArrayPane(String name, javax.servlet.jsp.PageContext pageContext)
Deprecated, for removal: This API element is subject to removal in a future version.ArrayPane
getArrayPane(String name, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
Deprecated, for removal: This API element is subject to removal in a future version.List<String>
getAvailableLooks()
Method declarationList<String>
getAvailableLooksForUser()
Board
getBoard()
Construct a new board.BrowseBar
getBrowseBar()
Build a new BrowseBar.ButtonPane
getButtonPane()
Build a new ButtonPane.Calendar
getCalendar(String context, String language, Date date)
Build a new SilverpeasCalendar.String
getComponentIdOfCurrentRequest()
static String
getCSSOfLook(String lookName)
String
getCurrentLookName()
String
getDefaultLookName()
Retrieve default look nameString
getExternalStylesheet()
org.silverpeas.kernel.bundle.SettingBundle
getFavoriteLookSettings()
Method declarationButton
getFormButton(String label, String action, boolean disabled)
Construct a new button.Button
getFormButton(String label, String action, boolean disabled, String imagePath)
Deprecated, for removal: This API element is subject to removal in a future version.Frame
getFrame()
Construct a new frame.String
getIcon(String iconKey)
Method declarationIconPane
getIconPane()
Build a new IconPane.static String
getIconsPath()
String
getLookFrame()
Method declarationorg.silverpeas.kernel.bundle.SettingBundle
getLookSettings()
Method declarationstatic org.silverpeas.kernel.bundle.SettingBundle
getLookSettings(String lookName)
String
getLookStyleSheet(HttpRequest request)
Deprecated, for removal: This API element is subject to removal in a future version.MainSessionController
getMainSessionController()
org.silverpeas.kernel.bundle.LocalizationBundle
getMultilang()
NavigationList
getNavigationList()
Construct a new navigation list.OperationPane
getOperationPane()
Build a new OperationPane.Pagination
getPagination()
Pagination
getPagination(int nbItems, int nbItemsPerPage, int firstItemIndex)
ProgressMessage
getProgressMessage(List<String> messages)
static org.silverpeas.kernel.bundle.SettingBundle
getSettings()
Get the settings for the factory.String
getSpaceIdOfCurrentRequest()
TabbedPane
getTabbedPane()
Build a new TabbedPane.Window
getWindow()
Build a new main Window using the object specified in the properties.boolean
hasExternalStylesheet()
boolean
isComponentMainPage()
boolean
isCurrentRequestFromSpaceHomepage()
boolean
isPortletMainPage()
void
setComponentIdForCurrentRequest(String componentId)
void
setExternalStylesheet(String externalStylesheet)
void
setHttpRequest(HttpRequest request)
String
setLook(String lookName)
Method declarationvoid
setSpaceIdForCurrentRequest(String spaceId)
-
-
-
Field Detail
-
RESOURCES_KEY
public static final String RESOURCES_KEY
The key with which is associated the resources wrapper used by a Silverpeas component instance and that is carried in each request.- See Also:
- Constant Field Values
-
GE_FACTORY_SESSION_ATT
public static final String GE_FACTORY_SESSION_ATT
- See Also:
- Constant Field Values
-
DEFAULT_LOOK_NAME
public static final String DEFAULT_LOOK_NAME
- See Also:
- Constant Field Values
-
STANDARD_CSS
public static final String STANDARD_CSS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GraphicElementFactory
public GraphicElementFactory(String look)
Constructor declaration- Parameters:
look
-
-
GraphicElementFactory
public GraphicElementFactory(MainSessionController mainSessionController)
-
-
Method Detail
-
getIconsPath
public static String getIconsPath()
-
getMultilang
public org.silverpeas.kernel.bundle.LocalizationBundle getMultilang()
-
getSettings
public static org.silverpeas.kernel.bundle.SettingBundle getSettings()
Get the settings for the factory.- Returns:
- The ResourceLocator returned contains all default environment settings necessary to know wich component to instanciate, but also to know how to generate html code.
-
getLookSettings
public org.silverpeas.kernel.bundle.SettingBundle getLookSettings()
Method declaration- Returns:
- Customer specific look settings if defined, default look settings otherwise
-
getFavoriteLookSettings
public org.silverpeas.kernel.bundle.SettingBundle getFavoriteLookSettings()
Method declaration- Returns:
-
getCurrentLookName
public String getCurrentLookName()
-
getLookSettings
public static org.silverpeas.kernel.bundle.SettingBundle getLookSettings(String lookName)
-
setExternalStylesheet
public void setExternalStylesheet(String externalStylesheet)
-
getExternalStylesheet
public String getExternalStylesheet()
-
hasExternalStylesheet
public boolean hasExternalStylesheet()
-
getLookFrame
public String getLookFrame()
Method declaration- Returns:
-
getLookStyleSheet
@Deprecated(forRemoval=true) public String getLookStyleSheet(HttpRequest request)
Deprecated, for removal: This API element is subject to removal in a future version.UseLookAndStyleTag
instead- Returns:
- HTML header fragment
-
getFormButton
public Button getFormButton(String label, String action, boolean disabled)
Construct a new button.- Parameters:
label
- The new button labelaction
- The action associated exemple : "javascript:onClick=history.back()", or "http://www.stratelia.com/"disabled
- Specify if the button is disabled or not. If disabled, no action will be possible.- Returns:
- returns an object implementing the FormButton interface. That's the new button to use.
-
getFrame
public Frame getFrame()
Construct a new frame.- Returns:
- returns an object implementing the Frame interface. That's the new frame to use.
-
getBoard
public Board getBoard()
Construct a new board.- Returns:
- returns an object implementing the Board interface. That's the new board to use.
-
getNavigationList
public NavigationList getNavigationList()
Construct a new navigation list.- Returns:
- returns an object implementing the NavigationList interface.
-
getFormButton
@Deprecated(forRemoval=true) public Button getFormButton(String label, String action, boolean disabled, String imagePath)
Deprecated, for removal: This API element is subject to removal in a future version.Construct a new button.- Parameters:
label
- The new button labelaction
- The action associated exemple : "javascript:history.back()", or "http://www.stratelia.com/"disabled
- Specify if the button is disabled or not. If disabled, no action will be possible.imagePath
- The path where the images needed to display buttons will be found.- Returns:
- returns an object implementing the FormButton interface. That's the new button to use.
-
getTabbedPane
public TabbedPane getTabbedPane()
Build a new TabbedPane.- Returns:
- An object implementing the TabbedPane interface.
-
getArrayPane
@Deprecated(forRemoval=true) public ArrayPane getArrayPane(String name, javax.servlet.jsp.PageContext pageContext)
Deprecated, for removal: This API element is subject to removal in a future version.Build a new ArrayPane.- Parameters:
name
- The name from your array. This name has to be unique in the session. It will be used to put some information (including the sorted column), in the session. exemple : "MyToDoArrayPane"pageContext
- The page context computed by the servlet or JSP. The PageContext is used to both get new request (sort on a new column), and keep the current state (via the session).- Returns:
- An object implementing the ArrayPane interface.
-
getArrayPane
@Deprecated(forRemoval=true) public ArrayPane getArrayPane(String name, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
Deprecated, for removal: This API element is subject to removal in a future version.Build a new ArrayPane.- Parameters:
name
- The name from your array. This name has to be unique in the session. It will be used to put some information (including the sorted column), in the session. exemple : "MyToDoArrayPane"request
- The http request (to get entering action, like sort operation)session
- The client session (to get the old status, like on which column we are sorted)- Returns:
- An object implementing the ArrayPane interface.
-
getArrayPane
public ArrayPane getArrayPane(String name, String url, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
Build a new ArrayPane.- Parameters:
name
- The name from your array. This name has to be unique in the session. It will be used to put some information (including the sorted column), in the session. exemple : "MyToDoArrayPane"url
- The url to root sorting action. This url can contain parameters. exemple : http://localhost/webactiv/Rkmelia/topicManager?topicId=12request
- The http request (to get entering action, like sort operation)session
- The client session (to get the old status, like on which column we are sorted)- Returns:
- An object implementing the ArrayPane interface.
-
getWindow
public Window getWindow()
Build a new main Window using the object specified in the properties.- Returns:
- An object implementing Window interface
-
getButtonPane
public ButtonPane getButtonPane()
Build a new ButtonPane.- Returns:
- An object implementing the ButtonPane interface
-
getIconPane
public IconPane getIconPane()
Build a new IconPane.- Returns:
- An object implementing the IconPane interface.
-
getOperationPane
public OperationPane getOperationPane()
Build a new OperationPane.- Returns:
- An object implementing the OperationPane interface.
-
getBrowseBar
public BrowseBar getBrowseBar()
Build a new BrowseBar.- Returns:
- An object implementing the BrowseBar interface.
-
getCalendar
public Calendar getCalendar(String context, String language, Date date)
Build a new SilverpeasCalendar.- Parameters:
language
- : the language to use by the monthCalendar- Returns:
- an object implementing the monthCalendar interface
-
getPagination
public Pagination getPagination(int nbItems, int nbItemsPerPage, int firstItemIndex)
-
getPagination
public Pagination getPagination()
-
getProgressMessage
public ProgressMessage getProgressMessage(List<String> messages)
-
setComponentIdForCurrentRequest
public void setComponentIdForCurrentRequest(String componentId)
-
getComponentIdOfCurrentRequest
public String getComponentIdOfCurrentRequest()
-
getMainSessionController
public MainSessionController getMainSessionController()
-
setHttpRequest
public void setHttpRequest(HttpRequest request)
-
isCurrentRequestFromSpaceHomepage
public boolean isCurrentRequestFromSpaceHomepage()
-
isComponentMainPage
public boolean isComponentMainPage()
-
isPortletMainPage
public boolean isPortletMainPage()
-
getSpaceIdOfCurrentRequest
public String getSpaceIdOfCurrentRequest()
- Returns:
- the space identifier
-
setSpaceIdForCurrentRequest
public void setSpaceIdForCurrentRequest(String spaceId)
- Parameters:
spaceId
- the space identifier to set (full identifier with WA + number)
-
getDefaultLookName
public String getDefaultLookName()
Retrieve default look name- Returns:
- user personal look settings if defined, default look settings otherwise
-
-