Class 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
    • Constructor Detail

      • GraphicElementFactory

        public GraphicElementFactory​(String look)
        Constructor declaration
        Parameters:
        look -
    • 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:
      • setLook

        public final String setLook​(String lookName)
        Method declaration
        Parameters:
        lookName -
      • getCurrentLookName

        public String getCurrentLookName()
      • getCSSOfLook

        public static String getCSSOfLook​(String lookName)
      • 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:
      • getIcon

        public String getIcon​(String iconKey)
        Method declaration
        Returns:
      • getAvailableLooks

        public List<String> getAvailableLooks()
        Method declaration
        Returns:
      • getAvailableLooksForUser

        public List<String> getAvailableLooksForUser()
      • getFormButton

        public Button getFormButton​(String label,
                                    String action,
                                    boolean disabled)
        Construct a new button.
        Parameters:
        label - The new button label
        action - 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 label
        action - 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=12
        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.
      • 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()
      • setComponentIdForCurrentRequest

        public void setComponentIdForCurrentRequest​(String componentId)
      • getComponentIdOfCurrentRequest

        public String getComponentIdOfCurrentRequest()
      • 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