Package gov.nasa.arc.mct.table.model

Examples of gov.nasa.arc.mct.table.model.ComponentTableModel


  public DateFormatItem getDateFormat() {
    if (isSelectionContainsEmptyCells()) {
      return null;
    }
    DateFormatItem df = null;
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        DateFormatItem cellDateFormat = settings.getDateFormat();
     
        df = cellDateFormat;
      }     
    } 
View Full Code Here


    return df;
  }

  @Override
  public void setDateFormat(ComboBoxModel comboBoxModel) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);

    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        DateFormatItem df = (DateFormatItem)comboBoxModel.getSelectedItem();
        settings.setDateFormat(df);
      }
    }
    manifestation.saveCellSettings();//persistDate
View Full Code Here

    manifestation.saveCellSettings();//persistDate
  }


  private TableCellSettings getTableCellSettings(int rowIndex, int columnIndex) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
    AbstractComponent component = (AbstractComponent) model.getStoredValueAt(rowIndex, columnIndex);
    String id = tableModel.getKey(component);
    TableCellSettings settings = tableModel.getCellSettings(id);
    return settings;
  }
View Full Code Here

  @Override
  public AbbreviationSettings getRowLabelAbbreviationSettings() {
    if (!isSingleCellSelection()) {
      return null;
    } else {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      String fullLabel = tableModel.getFullRowName(table.getSelectedRows()[0]);
      LabelAbbreviations currentAbbrevs = tableModel.getRowLabelAbbreviations(table.getSelectedRows()[0]);
      Abbreviations availableAbbrevs = ServiceAccess.getService(AbbreviationService.class).getAbbreviations(fullLabel);
      return new AbbreviationSettings(fullLabel, availableAbbrevs, currentAbbrevs);
    }
  }
View Full Code Here

  }

  @Override
  public void setRowLabelAbbreviations(AbbreviationSettings settings) {
    if (isSingleCellSelection()) {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      tableModel.setRowLabelAbbreviations(table.getSelectedRows()[0], settings.getAbbreviations());
      manifestation.saveCellSettings();
    }
   
  }
View Full Code Here

  @Override
  public AbbreviationSettings getColumnLabelAbbreviationSettings() {
    if (!isSingleCellSelection()) {
      return null;
    } else {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      String fullLabel = tableModel.getFullColumnName(table.getSelectedColumns()[0]);
      LabelAbbreviations currentAbbrevs = tableModel.getColumnLabelAbbreviations(table.getSelectedColumns()[0]);
      Abbreviations availableAbbrevs = ServiceAccess.getService(AbbreviationService.class).getAbbreviations(fullLabel);
      return new AbbreviationSettings(fullLabel, availableAbbrevs, currentAbbrevs);
    }
  }
View Full Code Here

  }

  @Override
  public void setColumnLabelAbbreviations(AbbreviationSettings settings) {
    if (isSingleCellSelection()) {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      tableModel.setColumnLabelAbbreviations(table.getSelectedColumns()[0], settings.getAbbreviations());
      table.updateColumnsHeaderValuesOnly();

      manifestation.saveCellSettings();
    }
  }
View Full Code Here

  @Override
  public AbbreviationSettings getCellLabelAbbreviationSettings() {
    if (!isSingleCellSelection()) {
      return null;
    } else {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      AbstractComponent component = (AbstractComponent) model.getStoredValueAt(table.getSelectedRows()[0], table.getSelectedColumns()[0]);
      String fullLabel = tableModel.getFullCellName(table.getSelectedRows()[0], table.getSelectedColumns()[0]);
      LabelAbbreviations currentAbbrevs = tableModel.getCellLabelAbbreviations(tableModel.getKey(component));
      Abbreviations availableAbbrevs = ServiceAccess.getService(AbbreviationService.class).getAbbreviations(fullLabel);
      return new AbbreviationSettings(fullLabel, availableAbbrevs, currentAbbrevs);
    }
  }
View Full Code Here

  }

  @Override
  public void setCellLabelAbbreviations(AbbreviationSettings settings) {
    if (isSingleCellSelection()) {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      AbstractComponent component = (AbstractComponent) model.getStoredValueAt(table.getSelectedRows()[0], table.getSelectedColumns()[0]);
      tableModel.setCellLabelAbbreviations(tableModel.getKey(component), settings.getAbbreviations());
      manifestation.saveCellSettings();
    }
  }
View Full Code Here

    if (isSelectionContainsEmptyCells()) {
      return null;
    }
   
    ContentAlignment alignment = null;
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        TableCellSettings settings = tableModel.getCellSettings(tableModel.getKey(component));
        ContentAlignment cellAlignment = settings.getAlignment();
       
        if (alignment!=null && cellAlignment!=alignment) {
          return null;
        }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.table.model.ComponentTableModel

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.