ilog.views.sdm.util
Class IlvCSSJViews

java.lang.Object
  extended by ilog.views.util.css.IlvCSS
      extended by ilog.views.util.cssbeans.IlvCSSBeans
          extended by ilog.views.sdm.util.IlvCSSJViews
All Implemented Interfaces:
ilog.views.util.css.event.RuleSetListener, ilog.views.util.css.IlvCSSEngine.ApplicableRuleListFactory, ilog.views.util.css.IlvCSSEngine.AttributeHandler, ilog.views.util.css.IlvCSSRuleSet.DeclarationValueHandler, IlvAcceptFunctions, IlvStylable, EventListener

public class IlvCSSJViews
extends ilog.views.util.cssbeans.IlvCSSBeans

This subclass of IlvCSSBeans provides access to JViews objects. In addition to the beans processing coming from the superclass, it can create and customize IlvGraphic objects like BGO and links.

Note that createBean() cannot create a link by itself. The user should call createLink(ilog.views.IlvGraphic, ilog.views.IlvGraphic, ilog.views.util.css.IlvApplicableDeclarationCollection) directly.

Since:
JViews 6.0
Internal method or field: do not use!

Nested Class Summary
static class IlvCSSJViews.ConvertWithBGO
          Converter is improved with BGO specific processing
 
Nested classes/interfaces inherited from class ilog.views.util.cssbeans.IlvCSSBeans
ilog.views.util.cssbeans.IlvCSSBeans.AppliedDeclarationHook, ilog.views.util.cssbeans.IlvCSSBeans.AttributeRuntimeAccess, ilog.views.util.cssbeans.IlvCSSBeans.SingletonModel
 
Field Summary
static int ACTUAL_LOCATION_MASK
          Debug mask: shows node actual location (bbox centered).
 
Fields inherited from class ilog.views.util.cssbeans.IlvCSSBeans
__IdRefersToCSSModel, __TypeRefersToCSSModel, _convert, BEAN_PARAMETER, CANCEL, CANCEL_PROP, CLASS_PARAMETER, CSS_ID, CSS_TYPE, ENGINE_PARAMETER, EXCEPTION_PARAMETER, EXPR, MODEL, MODEL_PROPERTY_PARAMETER, NEW, NO_AT, NO_VALUE, OBJECT_PARAMETER, OBJECT_TYPE_PARAMETER, PROPERTY_PARAMETER, RESULT_PARAMETER, REUSE, RULE_PARAMETER, RULE_SELECTOR_PARAMETER, SHARE, SUBOBJECT_TYPE, SYMBOL_RESOURCE_PREFIX, VALUE_PARAMETER, VARIABLES_RULE_NAME
 
Fields inherited from class ilog.views.util.css.IlvCSS
_debug, _engineInitialized, _error, _lastPseudos, _matchCache, _recursive
 
Fields inherited from interface ilog.views.util.css.IlvCSSEngine.AttributeHandler
MATCHING_DEFERRED, MATCHING_FAILED, MATCHING_OK
 
Fields inherited from interface ilog.views.util.styling.IlvStylable
APPLIED_RULE_MASK, BAD_CLASS_MASK, BAD_PROP_MASK, BAD_PROP_WITH_STACK_MASK, CREATED_MASK, DECL_MASK, DECL_VALUE_MASK, FAILED_CONVERSIONS_MASK, TIME_REPORT_MASK, WARNING_PROP_MASK
 
Constructor Summary
IlvCSSJViews()
           
IlvCSSJViews(ilog.views.util.css.IlvCSSEngine engine)
           
IlvCSSJViews(Reader css, URL baseURL)
           
IlvCSSJViews(Reader css, URL baseURL, URL[] urlPath)
           
 
Method Summary
protected  boolean applyDeclarationsImpl(ilog.views.util.css.IlvCSSModel model, Object node, Object g, ilog.views.util.css.IlvApplicableDeclarationCollection decls, String[] pseudos, ilog.views.util.cssbeans.IlvApplicableDeclarationsStatus status, Collection<String> used)
          Overrides applyDeclarations to customize BGO as well.
protected  void cacheParamValuesAtExternalBean(Object bean, Map params, String symbolPath, String symbolName, String palette, String symbol, ClassLoader loader, boolean created)
          This method allows to cache the current values of the parameters of an external bean at the bean.
protected  Object copyExternalBean(Object prototype, boolean in)
          Returns a copy of the given symbol prototype.
protected  Object createBeanImpl(ilog.views.util.css.IlvCSSModel model, Object node, boolean required, ilog.views.util.css.IlvApplicableDeclarationCollection decls, ilog.views.util.cssbeans.IlvApplicableDeclarationsStatus status, Collection<String> consumed)
          Creates a bean, according to the model and the style sheet declarations.
 IlvGraphic createLink(IlvGraphic from, IlvGraphic to, ilog.views.util.css.IlvApplicableDeclarationCollection decls)
          Creates a link instance according to the given declarations.
protected  boolean doCreate(ilog.views.util.css.IlvApplicableDeclarationCollection decls, Object bean)
          Returns true if the bean class name is different from the class requested in the CSS declaration.
protected  boolean isExternalBean(Object bean, String classDecl)
          Returns true iff the class declaration refers to a bean defined in external CSS and resources (aka "symbol").
protected  void prepareExternalBean(Object symbol, String symbolPath)
          Called just before external bean is customized (not when created).
protected static Class queryFactoryType(String factoryName)
          Queries the class generated by the IlvRectangularObjectFactory.
protected static void storeFactoryType(String factoryName, Class created)
          Records which class of IlvGraphic the IlvRectangularObjectFactory has generated.
 
Methods inherited from class ilog.views.util.cssbeans.IlvCSSBeans
addExternalBeanClassLoader, addInit, applyDeclarations, applyDeclarations, callExpression, clear, clearShared, clearShared, collectSubobjectIds, computeAttributeNameValue, computeValue, convertDeclarationsForEvaluation, convertDeclarationsForPublic, createBean, createBean, createBean, createBeanAndApplyDeclarations, createBeanAndApplyDeclarations, createBeanAndApplyDeclarations, createBeanAndApplyDeclarationsImpl, createDOMImplementation, createSingletonCSSModel, evaluateAttributeSelector, getAllFunctions, getAppliedDeclarationHook, getBeanClass, getBeanState, getClassLoader, getCssClassPropertyName, getCurrentCSSElement, getCurrentCSSModel, getDebugMask, getDeclarationValue, getDOMImplementationDuringConstructor, getExternalBeanClassLoaders, getFunction, getFunctionClosure, getFunctionList, getInitPseudoClass, getInstance, getModelValue, getPropertyClass, getSymbolDeclarations, handleMissingSymbol, instantiate, isClearExternalContext, isLoggingEnabled, isProcessingSymbol, isUsingBeanState, migrateTo81, refreshVariables, registerBeanClass, registerFunction, removeExternalBeanClassLoader, rulesChanged, setAppliedDeclarationHook, setBeanInfoFlags, setClassLoader, setClearExternalContext, setCssClassPropertyName, setDebugMask, setFunctionClosure, setFunctionList, setInitPseudoClass, setLoggingEnabled, setStyleSheetsImpl, setterInvoke, setUsingBeanState, unregisterAllFunction, unregisterFunction, unsetBeanInfoFlags, usesModelAttributes, usesModelAttributes, usesModelAttributes, usesModelAttributes, valueCode
 
Methods inherited from class ilog.views.util.css.IlvCSS
addPropertyChangeListener, clear, createApplicableRuleList, debug, getBaseURL, getBaseURLPath, getCSSengine, getDebugDeclarations, getDebugRules, getDeclarations, getDeclarations, getDOMImplementation, getMatchedRules, getStyleSheet, getStyleSheetDebugMask, getStyleSheets, getStyleSheets, hasHierarchicalSelectors, printCSS, printCSS, removePropertyChangeListener, setBaseURLPath, setEmptyStyleSheet, setStyleSheet, setStyleSheetDebugMask, setStyleSheets, setStyleSheets, traceException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTUAL_LOCATION_MASK

public static final int ACTUAL_LOCATION_MASK
Debug mask: shows node actual location (bbox centered).

See Also:
Constant Field Values
Constructor Detail

IlvCSSJViews

public IlvCSSJViews()

IlvCSSJViews

public IlvCSSJViews(Reader css,
                    URL baseURL)
             throws IlvStylingException
Parameters:
css -
baseURL -
Throws:
IlvStylingException

IlvCSSJViews

public IlvCSSJViews(Reader css,
                    URL baseURL,
                    URL[] urlPath)
             throws IlvStylingException
Parameters:
css -
baseURL -
urlPath -
Throws:
IlvStylingException

IlvCSSJViews

public IlvCSSJViews(ilog.views.util.css.IlvCSSEngine engine)
Parameters:
engine -
Method Detail

createBeanImpl

protected Object createBeanImpl(ilog.views.util.css.IlvCSSModel model,
                                Object node,
                                boolean required,
                                ilog.views.util.css.IlvApplicableDeclarationCollection decls,
                                ilog.views.util.cssbeans.IlvApplicableDeclarationsStatus status,
                                Collection<String> consumed)
                         throws ClassNotFoundException,
                                InstantiationException,
                                IllegalAccessException,
                                IOException,
                                InvocationTargetException
Creates a bean, according to the model and the style sheet declarations. The default behavior retrieves the class attribute from the CSS, loads the class from this name with the system class loader, and returns a new instance of this class using the constructor with an empty argument list.

If the class name contains '#', the remainder of the name is a prototype URL. This method will then load the prototype and return an IlvGraphicGroup instance.

If the class implements IlvRectangularObjectFactory, a declaration IlvRect is searched for to provide the factory's createObject() method with the initial rectangle.

The exceptions that may be thrown are explained in Class.forName(java.lang.String) and Class.newInstance().

Overrides:
createBeanImpl in class ilog.views.util.cssbeans.IlvCSSBeans
Parameters:
model - The CSS model.
node - The model node against which the declarations were matched.
required - Whether the caller expects a non-null return value. If true, the method warns when a new bean cannot be created due to missing declarations.
decls - The declaration collection.
status - An object telling which declarations among decls have been applied so far.
consumed - If non-null, will contain all the declarations used to create the bean (that is, constructor parameters, if any).
Returns:
The new instance, or null if it could not be created.
Throws:
ClassNotFoundException - The class name specified by the class declaration cannot be found.
InstantiationException - The bean cannot be instantiated.
IllegalAccessException - The bean cannot be instantiated.
IOException - The bean cannot be instantiated.
InvocationTargetException - An error occurred during the invocation of the constructor.
IllegalArgumentException - The class declaration is not correct.

storeFactoryType

protected static void storeFactoryType(String factoryName,
                                       Class created)
Records which class of IlvGraphic the IlvRectangularObjectFactory has generated. Obviously this assumes the factory always generates the same class of IlvGraphic.

Parameters:
factoryName - The name of the factory.
created - The generated class.
See Also:
queryFactoryType(java.lang.String)

queryFactoryType

protected static Class queryFactoryType(String factoryName)
Queries the class generated by the IlvRectangularObjectFactory.

Parameters:
factoryName - The name of the factory.
Returns:
factory type
See Also:
storeFactoryType(java.lang.String, java.lang.Class)

doCreate

protected boolean doCreate(ilog.views.util.css.IlvApplicableDeclarationCollection decls,
                           Object bean)
Returns true if the bean class name is different from the class requested in the CSS declaration. This method is called to resolve the '@+' construct. If the bean was created by a factory, the factory class is taken instead of the bean class.

Overrides:
doCreate in class ilog.views.util.cssbeans.IlvCSSBeans
Parameters:
decls - The CSS declarations.
bean - The existing bean (cannot be null).
Returns:
true if the bean class name or its factory name is different from the "class" value.

applyDeclarationsImpl

protected boolean applyDeclarationsImpl(ilog.views.util.css.IlvCSSModel model,
                                        Object node,
                                        Object g,
                                        ilog.views.util.css.IlvApplicableDeclarationCollection decls,
                                        String[] pseudos,
                                        ilog.views.util.cssbeans.IlvApplicableDeclarationsStatus status,
                                        Collection<String> used)
Overrides applyDeclarations to customize BGO as well.

Overrides:
applyDeclarationsImpl in class ilog.views.util.cssbeans.IlvCSSBeans
Parameters:
model - The model.
node - The model object.
g - The bean to customize.
decls - The declarations to apply on the given bean, as returned by IlvCSS.getDeclarations(IlvCSSModel, Object, Object, String[]). Some of them may be marked "consumed"; this allows to avoid setting properties that have already been specified as constructor arguments.
pseudos - The pseudos class currently defined (used for @# constructs).
status - An object telling which declarations among decls have been applied so far.
used - if non null, the customization won't touch the properties whose names are present in the collection. When the method completes, the collection will be augmented with the property names that were used to customize the bean. This parameter is used to avoid replacing values that have been set through the API in the jviews-table module.
Returns:
true if something has changed.

copyExternalBean

protected Object copyExternalBean(Object prototype,
                                  boolean in)
Description copied from class: ilog.views.util.cssbeans.IlvCSSBeans
Returns a copy of the given symbol prototype. This methods returns null, but subclasses are supposed to be smarter, e.g. IlvCSSJViews invokes IlvGraphic.copy().

This methods is called also to make the prototype from the first instance created.

Overrides:
copyExternalBean in class ilog.views.util.cssbeans.IlvCSSBeans
Parameters:
prototype - the symbol
in - true if storing the prototype into the cache
Returns:
a copy of the prototype, or null if the object needs to be created.

prepareExternalBean

protected void prepareExternalBean(Object symbol,
                                   String symbolPath)
Description copied from class: ilog.views.util.cssbeans.IlvCSSBeans
Called just before external bean is customized (not when created). Does nothing in this class.

Overrides:
prepareExternalBean in class ilog.views.util.cssbeans.IlvCSSBeans

createLink

public IlvGraphic createLink(IlvGraphic from,
                             IlvGraphic to,
                             ilog.views.util.css.IlvApplicableDeclarationCollection decls)
                      throws ClassNotFoundException,
                             InstantiationException,
                             IllegalAccessException,
                             NoSuchMethodException,
                             InvocationTargetException
Creates a link instance according to the given declarations. The "class" attribute from the CSS should refer to a subclass of IlvLinkImage. The constructor with two IlvGraphics and a boolean (oriented property, false) as arguments will be used to create the link.

The exceptions that may be thrown are explained in Class, methods forName(), getDeclaredConstructor(), and newInstance()

.

Parameters:
from - The source graphic.
to - The destination graphic.
decls - the applicable declarations from the CSS.
Returns:
the created link
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NoSuchMethodException
InvocationTargetException

cacheParamValuesAtExternalBean

protected void cacheParamValuesAtExternalBean(Object bean,
                                              Map params,
                                              String symbolPath,
                                              String symbolName,
                                              String palette,
                                              String symbol,
                                              ClassLoader loader,
                                              boolean created)
This method allows to cache the current values of the parameters of an external bean at the bean. You should not call this method.

Overrides:
cacheParamValuesAtExternalBean in class ilog.views.util.cssbeans.IlvCSSBeans
Parameters:
bean - The bean.
params - The parameters. The parameter name are the keys.
symbolPath - The path the the css file of the symbol.
symbolName - The name of the CSS file of the symbol.
palette - An identifier for the palette. Can be null.
symbol - An identifier for the symbol. Can be null.
loader - The class loader the found the definition of the symbol. Can be null.
created - true if the bean is just created. Otherwise, it is customized only.
Since:
JViews 7.5

isExternalBean

protected boolean isExternalBean(Object bean,
                                 String classDecl)
Returns true iff the class declaration refers to a bean defined in external CSS and resources (aka "symbol").

Overrides:
isExternalBean in class ilog.views.util.cssbeans.IlvCSSBeans
Parameters:
bean - the bean if it exists already.
classDecl - the class declaration
Returns:
true iff the bean is external
Since:
JViews 7.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.