Package gov.nasa.arc.mct.registry

Examples of gov.nasa.arc.mct.registry.ExternalComponentRegistryImpl


    @Override
    public boolean canHandle(ActionContext context) {
        actionContext = (ActionContextImpl) context;
        AbstractComponent targetComponent = actionContext.getTargetComponent();
        ExternalComponentRegistryImpl extCompRegistry = ExternalComponentRegistryImpl.getInstance();
        Collection<ExtendedComponentTypeInfo> componentInfos = extCompRegistry.getComponentInfos();

        List<Action> subActions = new ArrayList<Action>(componentInfos.size());
        for (ExtendedComponentTypeInfo info : componentInfos) {
            if (info.isCreatable()) {
                PolicyContext policyContext = new PolicyContext();
                policyContext.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), targetComponent);
                policyContext.setProperty(PolicyContext.PropertyName.ACTION.getName(), 'w');
                String compositionKey = PolicyInfo.CategoryType.COMPOSITION_POLICY_CATEGORY.getKey();
                AbstractComponent tempComponent =  extCompRegistry.newInstance(info);
                policyContext.setProperty(PolicyContext.PropertyName.SOURCE_COMPONENTS.getName(), Collections.singleton(tempComponent));
                if (PolicyManagerImpl.getInstance().execute(compositionKey, policyContext).getStatus()) {
                    subActions.add(new NewTypeAction(info, targetComponent));
                }
            }
View Full Code Here


    @Override
    public boolean canHandle(ActionContext context) {
        ActionContextImpl actionContext = (ActionContextImpl) context;
        // For now, this New submenu should only appear when there are external bundles
        ExternalComponentRegistryImpl extCompRegistry = ExternalComponentRegistryImpl.getInstance();
        Collection<ExtendedComponentTypeInfo> componentInfos = extCompRegistry.getComponentInfos();
        if (componentInfos.isEmpty())
            return false;

        AbstractComponent targetComponent = actionContext.getTargetComponent();
        PolicyContext policyContext = new PolicyContext();
View Full Code Here

        }

    }

    protected boolean isComponentCreatable(AbstractComponent ac) {
        ExternalComponentRegistryImpl extCompRegistry = ExternalComponentRegistryImpl.getInstance();
        return extCompRegistry.isCreatable(ac.getClass());
    }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.registry.ExternalComponentRegistryImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.