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

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


  /**
   * Default constructor for a collection component object.
   */
  public CollectionComponentProvider() {
                
    componentTypeInfo = new ComponentTypeInfo(
      bundle.getString("display_name"),
      bundle.getString("description"),
      CollectionComponent.class, true);
  }
View Full Code Here


    private ImageIcon DROPBOX_ICON = new ImageIcon(getClass().getResource("/icons/mct_icon_dropbox.png"));
   
    @Override
    public Collection<ComponentTypeInfo> getComponentTypes() {
        List<ComponentTypeInfo> compInfos = new ArrayList<ComponentTypeInfo>();
        ComponentTypeInfo typeInfo = new ComponentTypeInfo(resource.getString("discipline_component_display_name"), resource
                .getString("discipline_component_description"), TelemetryDisciplineComponent.class, false);
        compInfos.add(typeInfo);
        typeInfo = new ComponentTypeInfo(resource.getString("user_dropbox_component_display_name"), resource
                .getString("user_dropbox_component_description"), TelemetryUserDropBoxComponent.class, false);
        compInfos.add(typeInfo);
        typeInfo = new ComponentTypeInfo(resource.getString("mine_component_display_name"), resource
                .getString("mine_component_description"), MineTaxonomyComponent.class, false);
        compInfos.add(typeInfo);
        typeInfo = new ComponentTypeInfo(resource.getString("broken_component_display_name"), resource
                .getString("broken_component_description"), BrokenComponent.class, false);
        compInfos.add(typeInfo);
        typeInfo = new ComponentTypeInfo(resource.getString("data_taxonomy_component_type_display_name"), resource.getString("data_taxonomy_component_type_description"), TelemetryDataTaxonomyComponent.class, false);
        compInfos.add(typeInfo);

       
        return compInfos;
    }
View Full Code Here

    List<Object[]> cases = new ArrayList<Object[]>();
    // Consider all view types
    for (ViewType type : ViewType.values()) {
      ViewInfo info = new ViewInfo(InfoViewManifestation.class, InfoViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), type);
      ViewInfo expr = new ViewInfo(ExpressionsViewManifestation.class, ExpressionsViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), type);
      TypeInfo<?> eval = new ComponentTypeInfo("","",EvaluatorComponent.class);
      TypeInfo<?> mult = new ComponentTypeInfo("","",MultiComponent.class);
      for (TypeInfo<?> vi : new TypeInfo<?>[]{info,expr,eval,mult}) {
        // Expressions view should have an image icon
        cases.add(new Object[] { new EvaluatorComponentProvider(), vi, ImageIcon.class, vi.getTypeClass().equals(ExpressionsViewManifestation.class)});
        // Verify assignable check also recognizes icon
        cases.add(new Object[] { new EvaluatorComponentProvider(), vi, Icon.class, vi.getTypeClass().equals(ExpressionsViewManifestation.class)});
View Full Code Here

     *
     * @param componentTypeId the type ID for which we want the component class
     * @return the component class, or null if no such component type
     */
    Class<? extends AbstractComponent> getComponentType(String componentTypeId) {
        ComponentTypeInfo info = availableComponents.get(componentTypeId);
        Class<? extends AbstractComponent> componentClass = null;
        if (info != null) {
            componentClass = info.getComponentClass();
        }
        return componentClass;
    }
View Full Code Here

     * @param clazz the class to check if it is creatable.
     * @return true if clazz is creatable, false otherwise
     */
    @Override
    public boolean isCreatable(Class<?> clazz) {
        ComponentTypeInfo info = availableComponents.get(clazz.getName());
        return info != null && info.isCreatable();
    }
View Full Code Here

                        typeInfo = info;
                        break;
                    }
                }
                if (typeInfo == null) {
                    typeInfo = new ComponentTypeInfo(getClass().getSimpleName(), getClass().getSimpleName(), getClass());
                }
            }
            return capability.cast(typeInfo);
        }
      
View Full Code Here

 
    public ExecutableButtonComponentProvider() {
    executableButtonComponentType.set(createTypeInfo());
    }
  private ComponentTypeInfo createTypeInfo() {
    return new ComponentTypeInfo(
        bundle.getString("display_name")
        bundle.getString("description"),
        ExecutableButtonComponent.class
        );
  }
View Full Code Here

      Assert.assertNull(provider.getAsset(compInfo, UnknownType.class));
    }
    // Verify that unknown types consistently return null
    TypeInfo<?>[] unknowns = {
        new TypeInfo<Object>(UnknownType.class){},
        new ComponentTypeInfo("","",UnknownComponent.class),
        new ViewInfo(UnknownView.class, "", "", ViewType.OBJECT)
    };
    for (TypeInfo<?> unknown : unknowns) {
      Assert.assertNull(provider.getAsset(unknown, ImageIcon.class));
      Assert.assertNull(provider.getAsset(unknown, CreateWizardUI.class));
View Full Code Here

 
  public ExampleComponentProvider() {
    // this is the component type we are providing. The display name and description are used
    // by the MCT menu system for creating new instances and thus should be human readable
    // and descriptive
    exampleComponentType = new ComponentTypeInfo(
        bundle.getString("display_name")
        bundle.getString("description"),
        ExampleComponent.class);
    telemetryComponentType = new ComponentTypeInfo(
        bundle.getString("telemetry_display_name")
        bundle.getString("telemetry_description"),
        TelemetryComponent.class,
        true);
  }
View Full Code Here

  private final Collection<ComponentTypeInfo> infos;
  private final Collection<PolicyInfo> policies = new ArrayList<PolicyInfo>();
   
 
  public MultiComponentProvider() {
    infos = Arrays.asList(new ComponentTypeInfo(
        bundle.getString("display_name")
        bundle.getString("description"),
        MultiComponent.class));
    policies.add(new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), EvaluatorViewPolicy.class));
    policies.add(new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), EnumeratorViewPolicy.class));
View Full Code Here

TOP

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

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.