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

extensions.XMAStatusFlag.ext Maven / Gradle / Ivy

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

extension extensions::XMAPage;
extension extensions::XMAComponent;
extension extensions::Expression;


/**
 * Get the owner of a StatusFlag (Component, Page or Entity)
 */
emf::EObject getOwnerOfStatusFlag(StatusFlag statusFlag):
JAVA org.openxma.dsl.generator.helper.ExpressionExtension.getOwnerOfStatusFlag(org.openxma.dsl.core.model.StatusFlag);	

/**
 * Computes the name for the corresponding XMAStatusFlag.
 */
String getXMAStateFlagName(StatusFlag statusFlag, DataObjectVariable dov):
JAVA org.openxma.dsl.generator.helper.ExpressionExtension.getXMAStateFlagName(org.openxma.dsl.core.model.StatusFlag,org.openxma.dsl.pom.model.DataObjectVariable);	 

flex::XMAStateFlag findXMAStateFlagInList(List[flex::XMAStateFlag] xmaStateFlagList, StatusFlag statusFlag, DataObjectVariable dov):
JAVA org.openxma.dsl.generator.helper.ExpressionExtension.findXMAStateFlagInList(java.util.List, org.openxma.dsl.core.model.StatusFlag,org.openxma.dsl.pom.model.DataObjectVariable);

/**
 * Find statusflag in a XMAPage.
 */	
flex::XMAStateFlag findXMAStateFlagForPage(XMAPage xmaPage, StatusFlag statusFlag, XMAComponent xmaComponent, DataObjectVariable dov):

	//let xmaPage = xmaComponent.findXMAPage(page):	
	let existingStateFlag = xmaPage.stateFlags.findXMAStateFlagInList(statusFlag,dov):
	
	(existingStateFlag == null)
		? xmaPage.stateFlags.createAndAppendXMAStateFlagInList(xmaComponent,xmaPage,dov,statusFlag)	
		: existingStateFlag;
			
/**
 * Find statusflag in a XMAComponent.
 */	
flex::XMAStateFlag findXMAStateFlagForComponent(XMAComponent xmaComponent, StatusFlag statusFlag, DataObjectVariable dov):

	let existingStateFlag = xmaComponent.stateFlags.findXMAStateFlagInList(statusFlag,dov):
	
	(existingStateFlag == null)
		? xmaComponent.stateFlags.createAndAppendXMAStateFlagInList(xmaComponent,null,dov,statusFlag)	
		: existingStateFlag;
		
/**
 * Find statusflag in a Application.
 */	
flex::XMAStateFlag findXMAStateFlagForApplication(XMAComponent xmaComponent, StatusFlag statusFlag, DataObjectVariable dov):

	let application = xmaComponent.getXMAApplicationContext():
	
	let existingStateFlag = application.stateFlags.findXMAStateFlagInList(statusFlag,dov):
	
	(existingStateFlag == null)
		? application.stateFlags.createAndAppendXMAStateFlagInList(xmaComponent,null,dov,statusFlag)	
		: existingStateFlag;		
			
/**
 * Find a statusflag for a statusflag defined in a datatype of a dataobjectvariable
 */ 
flex::XMAStateFlag findXMAStateFlagForDataObjectVariable(DataObjectVariable dov, StatusFlag statusFlag, XMAComponent xmaComp, XMAPage currPage):

	let variableContainer = dov.eContainer:
	
	(Component.isInstance(variableContainer))
		? xmaComp.findXMAStateFlagForDataObjectVariableOfComponent(currPage,dov,statusFlag)
		: xmaComp.findXMAPage((Page)variableContainer).findXMAStateFlagForDataObjectVariableOfPage(xmaComp,dov,statusFlag);

/**
 * Find a statusflag for a statusflag defined in a datatype of a dataobjectvariable contained of a component
 */
flex::XMAStateFlag findXMAStateFlagForDataObjectVariableOfComponent(XMAComponent xmaComp, XMAPage currPage, DataObjectVariable dov, StatusFlag statusFlag):

	let existingStateFlag = xmaComp.stateFlags.findXMAStateFlagInList(statusFlag,dov):
	
	(existingStateFlag == null)
		? xmaComp.stateFlags.createAndAppendXMAStateFlagInList(xmaComp,currPage,dov,statusFlag)
		: existingStateFlag;	

/**
 * Find a statusflag for a statusflag defined in a datatype of a dataobjectvariable contained of a page
 */	
flex::XMAStateFlag findXMAStateFlagForDataObjectVariableOfPage(XMAPage xmaPage, XMAComponent xmaComponent, DataObjectVariable dov, StatusFlag statusFlag):

	let existingStateFlag = xmaPage.stateFlags.findXMAStateFlagInList(statusFlag,dov):
	
	(existingStateFlag == null)
		? xmaPage.stateFlags.createAndAppendXMAStateFlagInList(xmaComponent,xmaPage,dov,statusFlag)
		: existingStateFlag;		
	
flex::XMAStateFlag createAndAppendXMAStateFlagInList(List[flex::XMAStateFlag] xmaStateFlagList, XMAComponent xmaComponent, XMAPage currPage, DataObjectVariable dov, StatusFlag statusFlag):

	let xmaStateFlag = statusFlag.createXmaStatusFlag(xmaComponent,currPage,dov):
	 
	xmaStateFlagList.add(xmaStateFlag)->	
	xmaStateFlag;		
	
/**
 * Create a xma-statusflag from a xmadsl-statusflag
 */	
flex::XMAStateFlag createXmaStatusFlag(StatusFlag statusFlag, XMAComponent xmaComp, XMAPage currPage, DataObjectVariable dov):

	let xmaStatusFlag = new guidesign::flex::XMAStateFlag:
	let xmaExpression = statusFlag.expression.createXMAExpression(xmaComp,currPage,dov):
	let namXMAStateFlag = statusFlag.getXMAStateFlagName(dov):		
		
	xmaStatusFlag.setNamState(namXMAStateFlag)->
	xmaStatusFlag.setCondition(xmaExpression)->			
	
	//xmaComp.stateFlags.add(xmaStatusFlag)->
	xmaStatusFlag;	




© 2015 - 2024 Weber Informatics LLC | Privacy Policy