Package gov.nasa.arc.mct.services.component

Examples of gov.nasa.arc.mct.services.component.ComponentRegistry


                existingPanel.update(canvasContent);
                changeOrder(existingPanel, zorder);
            }
        } else {
            String viewType = canvasContent.getManifestedViewType();
            ComponentRegistry cr = ComponentRegistryAccess.getComponentRegistry();
            AbstractComponent comp = cr.getComponent(componentId);

            View viewManifestation = getManifestation(comp, viewType, canvasContent);
            if (viewManifestation == null) { return; }
           
            Panel panel = createPanel(viewManifestation, index, this);
View Full Code Here


   * has already been checked in the isEnable method.
   */
  private void createChildInstance(AbstractComponent component) {
    // acquire the ComponentRegistry through the access object. The ComponentRegistry
    // will be injected through the OSGi declarative services model
    ComponentRegistry registry = ComponentRegistryAccess.getComponentRegistry();
   
    if (registry != null) {
      // use the ComponentRegistry service to create a new instance of a component
      ExampleComponent ec = registry.newInstance(ExampleComponent.class, component);
   
      // additional information can be collected here to populate a model. This simply
      // sets a unique name
      ec.setDisplayName("newComponentFromMenu"+newCount.incrementAndGet());
     
View Full Code Here

  }
 
  @Override
  public AbstractComponent createEvaluator(String languageType, String code,
                                           AbstractComponent parent) {
    ComponentRegistry registry = EvaluatorCreationServiceImpl.registry.get();
    EvaluatorComponent evaluator =
                              registry.newInstance(EvaluatorComponent.class, parent);
    evaluator.getData().setLanguage(languageType);
    evaluator.getData().setCode(code);
    evaluator.save();
   
    return evaluator;
View Full Code Here

  @BeforeTest
  public void setup() {
    MockitoAnnotations.initMocks(this);
    new PlatformAccess().setPlatform(mockPlatform);
    Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockProvider);
    mockRegistry = new ComponentRegistry() {

      @SuppressWarnings("unchecked")
      @Override
      public <T extends AbstractComponent> T newInstance(
          Class<T> componentClass, AbstractComponent parent) {
View Full Code Here

    MultiCreationServiceImpl.registry.set(null);
  }
 
  @Override
  public AbstractComponent createMulti(String languageType, String code) {
    ComponentRegistry registry = MultiCreationServiceImpl.registry.get();
    MultiComponent evaluator = registry.newInstance(MultiComponent.class, null);
    evaluator.getData().setLanguage(languageType);
    evaluator.getData().setCode(code);
    evaluator.save();
   
    return evaluator;
View Full Code Here

   * @param component
   * @return
   */
  public static boolean isCreateable(AbstractComponent component) {
    //get the registry
    ComponentRegistry registry = (new ComponentRegistryAccess()).getComponentRegistry();
    return registry.isCreatable(component.getClass());
  }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.services.component.ComponentRegistry

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.