Пример #1
0
  @Override
  public void executeCommand(UICommand command) {
    super.executeCommand(command);

    if (command == getNewCommand()) {
      newEntity();
    } else if (command == getAttachCommand()) {
      attach();
    } else if (command == getEditCommand()) {
      edit();
    } else if (command == getRemoveCommand()) {
      remove();
    } else if (command == getMoveCommand()) {
      move();
    } else if (command == getScanAlignmentCommand()) {
      scanAlignment();
    } else if ("Cancel".equals(command.getName())) { // $NON-NLS-1$
      cancel();
    } else if (RemoveDiskModel.CANCEL_REMOVE.equals(command.getName())) {
      cancel();
    } else if (RemoveDiskModel.ON_REMOVE.equals(command.getName())) {
      onRemove();
    } else if (command == getPlugCommand()) {
      plug();
    } else if (command == getUnPlugCommand()) {
      confirmUnplug();
    } else if ("OnUnplug".equals(command.getName())) { // $NON-NLS-1$
      unplug();
    } else if (command == getChangeQuotaCommand()) {
      changeQuota();
    } else if (command.getName().equals("onChangeQuota")) { // $NON-NLS-1$
      onChangeQuota();
    }
  }
Пример #2
0
  @Override
  protected void entityPropertyChanged(Object sender, PropertyChangedEventArgs e) {
    super.entityPropertyChanged(sender, e);

    if (e.propertyName.equals("status")) { // $NON-NLS-1$
      updateActionAvailability();
    }
  }
Пример #3
0
  @Override
  public void setItems(Collection value) {
    ArrayList<Disk> disks = value != null ? Linq.<Disk>cast(value) : new ArrayList<Disk>();

    Collections.sort(disks, new DiskByAliasComparer());
    super.setItems(disks);

    updateActionAvailability();
  }
Пример #4
0
  @Override
  protected void syncSearch() {
    if (getEntity() == null) {
      return;
    }
    VM vm = getEntity();

    super.syncSearch(VdcQueryType.GetAllDisksByVmId, new IdQueryParameters(vm.getId()));
  }
Пример #5
0
  @Override
  protected void onEntityChanged() {
    super.onEntityChanged();

    if (getEntity() != null) {
      updateDataCenterVersion();
      getSearchCommand().execute();
      updateIsDiskHotPlugAvailable();
      updateLiveStorageMigrationEnabled();
    }

    updateActionAvailability();
  }
Пример #6
0
 @Override
 protected void selectedItemsChanged() {
   super.selectedItemsChanged();
   updateActionAvailability();
 }