All Downloads are FREE. Search and download functionalities are using the official Maven repository.

extensions.XMAFunction.ext Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
import guidesign;
import pom;

extension extensions::XMAPage;
extension extensions::XMAComponent;
extension extensions::Widgets;

// Extend Function	
cached flex::XMAFunction extendFunction(Command f, XMAComponent c):

	(Component.isInstance(f.eContainer))
		? c.addXMAFunction(f)	
		: c.findXMAPage(((Page)f.eContainer)).addXMAFunction(f)
	;

// Add XMAFunction to XMAComponent
flex::XMAFunction addXMAFunction(XMAComponent c, Command f):

	let xmaFunction = createXMAFunction(f):
		
	c.functions.add(xmaFunction)->
	xmaFunction;


// Add XMAFunction to XMAPage
flex::XMAFunction addXMAFunction(XMAPage p, Command f):

	let xmaFunction = createXMAFunction(f):
			
	setCommandProperty(xmaFunction,f)->
	p.functions.add(xmaFunction)->
	xmaFunction;
		
Void setCommandProperty(flex::XMAFunction xmaFunction, Command f):
JAVA org.openxma.dsl.generator.helper.EventExtension.setCommandProperty(at.spardat.xma.guidesign.flex.XMAFunction,org.openxma.dsl.pom.model.Command);

// Create XMAFunction
create flex::XMAFunction createXMAFunction(Command f):		

	this.setNamFunction(f.name)->
	this.setYnServerSide(!f.clientOnly)->
	this.setTxtDescription(f.doc)->	
	this.setSourceModelElementProperty(f)->
	this;

	
// Search for existing XMAFunction: First try to find it in the page
// and if not found there then try to find it in the component
flex::XMAFunction getXMAFunctionForName(XMAComponent c, XMAPage p, String functionName):
JAVA org.openxma.dsl.generator.helper.Util.getXMAFunctionForName(at.spardat.xma.guidesign.XMAComponent,at.spardat.xma.guidesign.XMAPage,java.lang.String);				
		
		
// Try to cast the XMAWidget to ISelectFunctionCaller and set the selectFunction.
XMAWidget castAndSetSelectFunction(XMAWidget widget, flex::XMAFunction xmaFunction):
JAVA org.openxma.dsl.generator.helper.Util.castAndSetSelectFunction(at.spardat.xma.guidesign.XMAWidget,at.spardat.xma.guidesign.flex.XMAFunction);				


// Try to cast the XMAWidget to IDefSelectFunctionCaller and set the defaultSelectFunction.
XMAWidget castAndSetDefSelectFunction(XMAWidget widget, flex::XMAFunction xmaFunction):
JAVA org.openxma.dsl.generator.helper.Util.castAndSetDefSelectFunction(at.spardat.xma.guidesign.XMAWidget,at.spardat.xma.guidesign.flex.XMAFunction);	
	




© 2015 - 2024 Weber Informatics LLC | Privacy Policy