|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| ScriptUtils.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* Joey and its relative products are published under the terms
|
|
| 3 |
* of the Apache Software License.
|
|
| 4 |
*/
|
|
| 5 |
/*
|
|
| 6 |
* Created on 2004/01/03
|
|
| 7 |
*/
|
|
| 8 |
package org.asyrinx.brownie.tapestry.script;
|
|
| 9 |
|
|
| 10 |
import org.apache.tapestry.IComponent;
|
|
| 11 |
import org.apache.tapestry.IEngine;
|
|
| 12 |
import org.apache.tapestry.IPage;
|
|
| 13 |
import org.apache.tapestry.IResourceLocation;
|
|
| 14 |
import org.apache.tapestry.IScript;
|
|
| 15 |
import org.apache.tapestry.engine.IScriptSource;
|
|
| 16 |
import org.apache.tapestry.spec.IComponentSpecification;
|
|
| 17 |
|
|
| 18 |
/**
|
|
| 19 |
* @author akima
|
|
| 20 |
*/
|
|
| 21 |
public class ScriptUtils { |
|
| 22 |
|
|
| 23 |
/**
|
|
| 24 |
*
|
|
| 25 |
*/
|
|
| 26 | 0 |
private ScriptUtils() {
|
| 27 | 0 |
super();
|
| 28 |
} |
|
| 29 |
|
|
| 30 | 0 |
public static IScript loadScript(IComponent component, String scriptName) { |
| 31 | 0 |
final IPage page = component.getPage(); |
| 32 | 0 |
final IComponentSpecification specification = component |
| 33 |
.getSpecification(); |
|
| 34 | 0 |
final IEngine engine = page.getEngine(); |
| 35 | 0 |
final IScriptSource source = engine.getScriptSource(); |
| 36 | 0 |
final IResourceLocation location = specification |
| 37 |
.getSpecificationLocation().getRelativeLocation(scriptName); |
|
| 38 | 0 |
return source.getScript(location);
|
| 39 |
} |
|
| 40 |
|
|
| 41 |
} |
|
||||||||||