Skip to content

How to get LanguageElements from Canvas

Jinyoung Jang edited this page Mar 1, 2016 · 1 revision

The canvas which contains all elements can be obtain by @AutowiredFromClient. The code below shows how to implement it:

    public class EssenciaProcessVariableTypeSelectorPopup extends SelectBox{
    
        public EssenciaProcessVariableTypeSelectorPopup(){
            for(ElementView elementView : methodCanvas.getElementViewList()){
                if(elementView.getElement() instanceof Alpha){
                    Alpha alpha = (Alpha) elementView.getElement();
                    
                    getOptionValues().add(alpha.getName());
                }
            }
            
            setOptionNames(getOptionValues());
        }
    
        @AutowiredFromClient
        public MethodCanvas methodCanvas;
    
    
        @ServiceMethod
        public void select(){
            
        }
    }