com.cc.framework.ui.painter.def
Class DefPainterFactory

java.lang.Object
  extended bycom.cc.framework.ui.painter.PainterFactory
      extended bycom.cc.framework.ui.painter.def.DefPainterFactory
All Implemented Interfaces:
Factory, java.io.Serializable
Direct Known Subclasses:
Def2PainterFactory

public class DefPainterFactory
extends PainterFactory

Factory Class for creating the Default-Painters.

Important:
The default painter must be registered in your application at startup. The best place to do this is in your FrontControllerServlet init() method.

 public void init() throws ServletException {
 
 	super.init();
 
 	// Register all PainterFactories
 	PainterFactory.registerApplicationPainter(getServletContext(), DefPainterFactory.instance());
 	PainterFactory.registerApplicationPainter(getServletContext(), HtmlPainterFactory.instance());
 	// other painters go here ...
 
 	// Log the information about the system-environment.
 	if (log.isInfoEnabled()) {
 		log.info(createApplicationInfo());
 		log.info(HttpUtil.createEnvironmentInfo());
 		log.info(HttpUtil.createContextInfo(getServletContext()));
 	}
 }
 

Since:
1.0
Version:
$Revision: 1.50 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          Serial Version UID
 
Fields inherited from class com.cc.framework.ui.painter.PainterFactory
 
Constructor Summary
DefPainterFactory()
          Constructor
 
Method Summary
protected  ResourceMap createResourceMap()
          Creates the Painters Resource Map
protected  FramePainter doCreateFramePainter(PainterContext painterContext, Control ctrl)
          Creates a frame painter for the control specified in the argument.
protected  void doCreateHeaderIncludes(javax.servlet.jsp.JspWriter writer)
          Creates all Include-Tags in the HTML-Pages which are necessary for the Framework to work well (css, javascripts, ...).
protected  ControlPainter doCreatePainter(PainterContext painterContext, Control ctrl)
          Creates a painter for the control specified in the argument.
 java.lang.String getFactoryId()
          Returns the unique Id for this painter factory
static PainterFactory instance()
          Deprecated. use constructor to create a new instance
 
Methods inherited from class com.cc.framework.ui.painter.PainterFactory
createActionPainter, createFramePainter, createHeaderIncludes, createPainter, createPainterContext, doCreateActionPainter, doCreatePainterContext, equals, getColorResource, getFactoyStack, getImageResource, getImageResource, getResources, getStringResource, getStringResource, getStringResource, hashCode, isFactorySelected, isRegisteredInScopeList, iterator, lookupFactory, registerApplicationPainter, registerApplicationPainters, registerRequestPainter, registerSessionPainter, resetApplicationPainter, resetSessionPainter, resetSessionPainter, toString, unregisterApplicationPainter, unregisterRequestPainter, unregisterSessionPainter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values
Constructor Detail

DefPainterFactory

public DefPainterFactory()
Constructor

Method Detail

createResourceMap

protected ResourceMap createResourceMap()
Description copied from class: PainterFactory
Creates the Painters Resource Map

Specified by:
createResourceMap in class PainterFactory
Returns:
The Resource Map
See Also:
PainterFactory.createResourceMap()

getFactoryId

public java.lang.String getFactoryId()
Returns the unique Id for this painter factory

Specified by:
getFactoryId in class PainterFactory
Returns:
The unique Id for this painter factory which is def

instance

public static PainterFactory instance()
Deprecated. use constructor to create a new instance

Returns the single instance of the class (singleton)

Returns:
The single instance of the DefPainterFactory

doCreatePainter

protected ControlPainter doCreatePainter(PainterContext painterContext,
                                         Control ctrl)
Description copied from class: PainterFactory
Creates a painter for the control specified in the argument. This method must be implemented by a concrete sub class.

Note: This method will be called from the PainterFactory!

Specified by:
doCreatePainter in class PainterFactory
Parameters:
painterContext - The context of the JSP page where the control is defined. So it is possible for the painter to get the ActionMappings if required. The ActionMappings are necessary for the generation of hyperlinks.
ctrl - The instance of the control for which a painter should be created
Returns:
The painter for the specified control
See Also:
PainterFactory.doCreatePainter(com.cc.framework.ui.painter.PainterContext, com.cc.framework.ui.control.Control)

doCreateFramePainter

protected FramePainter doCreateFramePainter(PainterContext painterContext,
                                            Control ctrl)
Description copied from class: PainterFactory
Creates a frame painter for the control specified in the argument. This method must be implemented by a concrete sub class.

Note: This method will be called from the PainterFactory!

Overrides:
doCreateFramePainter in class PainterFactory
Parameters:
painterContext - The context of the JSP page where the control is defined. So it is possible for the painter to get the ActionMappings if required. The ActionMappings are necessary for the generation of hyperlinks.
ctrl - The instance of the control for which a frame painter should be created
Returns:
The frame painter for the specified control
See Also:
PainterFactory.doCreateFramePainter(com.cc.framework.ui.painter.PainterContext, com.cc.framework.ui.control.Control)

doCreateHeaderIncludes

protected void doCreateHeaderIncludes(javax.servlet.jsp.JspWriter writer)
                               throws java.io.IOException
Description copied from class: PainterFactory
Creates all Include-Tags in the HTML-Pages which are necessary for the Framework to work well (css, javascripts, ...). This Method must be overridden by a concrete Painter Class.

Specified by:
doCreateHeaderIncludes in class PainterFactory
Parameters:
writer - The JspWriter
Throws:
java.io.IOException - If an input or output exception occurred
See Also:
PainterFactory.doCreateHeaderIncludes(javax.servlet.jsp.JspWriter)


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.