コード例 #1
0
  @Override
  public void eventRaised(Event ev, Object sender, EventArgs args) {
    super.eventRaised(ev, sender, args);

    if (ev.equals(ListModel.SelectedItemChangedEventDefinition)
        && sender == getDataCenter().getVersion()) {
      DataCenterVersion_SelectedItemChanged();
    }
  }
コード例 #2
0
  @Override
  public void UpdateItemsAvailability() {
    super.UpdateItemsAvailability();

    storage_pool dataCenter = (storage_pool) getModel().getDataCenter().getSelectedItem();

    for (IStorageModel item : Linq.<IStorageModel>Cast(getModel().getItems())) {
      Model model = (Model) item;

      storage_domains isoStorage = DataProvider.GetIsoDomainByDataCenterId(dataCenter.getId());
      storage_domains exportStorage =
          DataProvider.GetExportDomainByDataCenterId(dataCenter.getId());

      // available type/function items are:
      // all in case of Unassigned DC.
      // ISO in case the specified DC doesn't have an attached ISO domain.
      // Export in case the specified DC doesn't have an attached export domain.
      model.setIsSelectable(
          (dataCenter.getId().equals(StorageModel.UnassignedDataCenterId)
              || (item.getRole() == StorageDomainType.ISO && isoStorage == null)
              || (item.getRole() == StorageDomainType.ImportExport && exportStorage == null)));
    }
  }