Package gov.nasa.arc.mct.gui

Examples of gov.nasa.arc.mct.gui.View


 
  @Test
  public void testIsEnabled() {
    // Setup mocks (need to invoke canHandle for Action lifecycle)
    ActionContext mockContext = Mockito.mock(ActionContext.class);
    View mockView = Mockito.mock(View.class);
    AbstractComponent mockComponent = Mockito.mock(AbstractComponent.class);
    Mockito.when(mockView.getManifestedComponent()).thenReturn(mockComponent);

    // Call canHandle (for lifecycle)
    Mockito.when(mockContext.getWindowManifestation()).thenReturn(mockView);
    Assert.assertTrue(importThisAction.canHandle(mockContext));
    Mockito.when(mockContext.getSelectedManifestations())
View Full Code Here


        ComponentTableModel model = ComponentTableModel.class.cast(table.getTable().getModel());
        for (int rowIndex : table.getSelectedRows()) {
          for (int columnIndex : table.getSelectedColumns()) {
            AbstractComponent component = (AbstractComponent) model.getStoredValueAt(rowIndex, columnIndex);
            if (component != null) {
              View view = component.getViewInfos(ViewType.NODE).iterator().next().createView(component);
              if (view != null) {
                views.add(view);
              }
            }
          }
View Full Code Here

  private void addComponents(int components, List<AbstractComponent> childList, List<AbstractComponent> createdComponents) {
    for (int i = 0; i < components; i++) {
      AbstractComponent ac = Mockito.mock(AbstractComponent.class);
      Mockito.when(ac.getComponents()).thenReturn(Collections.<AbstractComponent>emptyList());
      Mockito.when(ac.isLeaf()).thenReturn(true);
      final View mvm = Mockito.mock(View.class);
      ViewInfo vi = new ViewInfo(TableViewManifestation.class, "", ViewType.EMBEDDED) {
        @Override
        public View createView(AbstractComponent component) {
          return mvm;
        }
      };
      Mockito.when(ac.getViewInfos(ViewType.NODE)).thenReturn(Collections.singleton(vi));
      Mockito.when(ac.getViewInfos(ViewType.EMBEDDED)).thenReturn(Collections.singleton(vi));
      Mockito.when(ac.getComponentTypeID()).thenReturn("MockComponent");
      Mockito.when(mvm.getManifestedComponent()).thenReturn(ac);
      Mockito.when(mvm.getInfo()).thenReturn(vi);
      childList.add(ac);
      createdComponents.add(ac);
    }
  }
View Full Code Here

      if (files != null) {
        if (files.isEmpty()) {
          dialogMgr.showMessageDialog("No XML files found in specified directory");
        }
        else {
          View manifestation = currentContext.getSelectedManifestations()
                           .iterator().next();
          assert manifestation != null;
          AbstractComponent selectedComponent =
                             manifestation.getManifestedComponent();
          buildProgressBar();  
          Importer importReaderTask = new Importer(files, owner, selectedComponent,
                                               bar, jd);
          // ImportAction on EDT listens to Task's bound property progress
          importReaderTask.addPropertyChangeListener(this);
View Full Code Here

  public boolean isEnabled() {
    Collection<View> views = currentContext.getSelectedManifestations();
    // Check to see if something is selected
    // if nothing selected assume This menu -so check if window is creatable
    if(views.size() == 0){
      View view = currentContext.getWindowManifestation();
      if (view == null) { // Nothing is selected, or in window
        return false;
      }       
      views = Collections.<View>singleton(view);
    }
View Full Code Here

      if (files != null) {
        if (files.isEmpty()) {
          dialogMgr.showMessageDialog("No XML files found in specified directory");
        }
        else {
          View manifestation = currentContext.getWindowManifestation();
          assert manifestation != null;
          AbstractComponent selectedComponent =
                             manifestation.getManifestedComponent();
          buildProgressBar();  
          Importer importReaderTask = new Importer(files, owner, selectedComponent,
                                               bar, jd);
          // ImportAction on EDT listens to Task's bound property progress
          importReaderTask.addPropertyChangeListener(this);
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.gui.View

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.