예제 #1
0
 private ConfirmationModel getImportCertificateConfirmationModel(CertificateInfo certInfo) {
   ConfirmationModel confirmationModel = new ConfirmationModel();
   if (certInfo.getSelfSigned()) {
     confirmationModel.setMessage(
         ConstantsManager.getInstance()
             .getMessages()
             .approveRootCertificateTrust(certInfo.getSubject(), certInfo.getSHA1Fingerprint()));
   } else {
     confirmationModel.setMessage(
         ConstantsManager.getInstance()
             .getMessages()
             .approveCertificateTrust(
                 certInfo.getSubject(), certInfo.getIssuer(), certInfo.getSHA1Fingerprint()));
   }
   confirmationModel.setTitle(
       ConstantsManager.getInstance().getConstants().importProviderCertificateTitle());
   confirmationModel.setHelpTag(HelpTag.import_provider_certificate);
   confirmationModel.setHashName("import_provider_certificate"); // $NON-NLS-1$
   UICommand importCertificateCommand = new UICommand(CMD_IMPORT_CERTIFICATE, this);
   importCertificateCommand.setTitle(ConstantsManager.getInstance().getConstants().yes());
   importCertificateCommand.setIsDefault(false);
   confirmationModel.getCommands().add(importCertificateCommand);
   UICommand cancelImport = new UICommand(CMD_CANCEL_IMPORT, this);
   cancelImport.setTitle(ConstantsManager.getInstance().getConstants().no());
   cancelImport.setIsCancel(true);
   cancelImport.setIsDefault(true);
   confirmationModel.getCommands().add(cancelImport);
   return confirmationModel;
 }
  private void resetParameter() {
    if (getWindow() != null) {
      return;
    }

    if (getSelectedItem() == null) {
      return;
    }
    GlusterVolumeOptionEntity selectedOption = getSelectedItem();

    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().resetOptionVolumeTitle());
    model.setHelpTag(HelpTag.reset_option);
    model.setHashName("reset_option"); // $NON-NLS-1$
    model.setMessage(ConstantsManager.getInstance().getConstants().resetOptionVolumeMsg());

    ArrayList<String> list = new ArrayList<String>();
    list.add(selectedOption.getKey());
    model.setItems(list);

    UICommand okCommand =
        UICommand.createDefaultOkUiCommand("OnResetParameter", this); // $NON-NLS-1$
    model.getCommands().add(okCommand);
    UICommand cancelCommand = UICommand.createCancelUiCommand("OnCancel", this); // $NON-NLS-1$
    model.getCommands().add(cancelCommand);
  }
  private void disableHook() {
    if (getWindow() != null) {
      return;
    }

    if (getSelectedItems() == null || getSelectedItems().size() == 0) {
      return;
    }

    ConfirmationModel model = new ConfirmationModel();
    setConfirmWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks());
    model.setHelpTag(HelpTag.disable_hooks);
    model.setHashName("disable_hooks"); // $NON-NLS-1$
    model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage());

    ArrayList<String> list = new ArrayList<String>();
    for (GlusterHookEntity hook : getSelectedItems()) {
      list.add(hook.getName());
    }
    model.setItems(list);

    UICommand okCommand = UICommand.createDefaultOkUiCommand("OnDisableHook", this); // $NON-NLS-1$
    model.getCommands().add(okCommand);
    UICommand cancelCommand =
        UICommand.createCancelUiCommand("OnCancelConfirmation", this); // $NON-NLS-1$
    model.getCommands().add(cancelCommand);
  }
예제 #4
0
  public void remove() {
    if (getWindow() != null) {
      return;
    }

    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removeUsersTitle());
    model.setHelpTag(HelpTag.remove_user);
    model.setHashName("remove_user"); // $NON-NLS-1$

    ArrayList<String> list = new ArrayList<String>();
    for (DbUser item : Linq.<DbUser>cast(getSelectedItems())) {
      list.add(item.getFirstName());
    }
    model.setItems(list);

    UICommand tempVar = new UICommand("OnRemove", this); // $NON-NLS-1$
    tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
    tempVar.setIsDefault(true);
    model.getCommands().add(tempVar);
    UICommand tempVar2 = new UICommand("Cancel", this); // $NON-NLS-1$
    tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel());
    tempVar2.setIsCancel(true);
    model.getCommands().add(tempVar2);
  }
  private void remove() {
    if (getWindow() != null) {
      return;
    }

    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removeSystemPermissionsTitle());
    model.setHelpTag(HelpTag.remove_system_permission);
    model.setHashName("remove_system_permission"); // $NON-NLS-1$
    model.setItems(getSelectedItems());

    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this); // $NON-NLS-1$
    model.getCommands().add(tempVar);
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); // $NON-NLS-1$
    model.getCommands().add(tempVar2);
  }
  private void resetAllParameters() {
    if (getWindow() != null) {
      return;
    }

    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().resetAllOptionsTitle());
    model.setHelpTag(HelpTag.reset_all_options);
    model.setHashName("reset_all_options"); // $NON-NLS-1$
    model.setMessage(ConstantsManager.getInstance().getConstants().resetAllOptionsMsg());

    UICommand okCommand =
        UICommand.createDefaultOkUiCommand("OnResetAllParameters", this); // $NON-NLS-1$
    model.getCommands().add(okCommand);
    UICommand cancelCommand = UICommand.createCancelUiCommand("OnCancel", this); // $NON-NLS-1$
    model.getCommands().add(cancelCommand);
  }
  protected void forceCreationWarning(ArrayList<String> usedLunsMessages) {
    ConfirmationModel confirmationModel = new ConfirmationModel();
    setConfirmWindow(confirmationModel);

    confirmationModel.setTitle(constants.forceStorageDomainCreation());
    confirmationModel.setMessage(constants.lunsAlreadyPartOfSD());
    confirmationModel.setHelpTag(HelpTag.force_lun_disk_creation);
    confirmationModel.setHashName("force_lun_disk_creation"); // $NON-NLS-1$
    confirmationModel.setItems(usedLunsMessages);

    UICommand forceSaveCommand = new UICommand("OnForceSave", this); // $NON-NLS-1$
    forceSaveCommand.setTitle(constants.ok());
    forceSaveCommand.setIsDefault(true);
    confirmationModel.getCommands().add(forceSaveCommand);

    UICommand cancelconfirmCommand = new UICommand("CancelConfirm", this); // $NON-NLS-1$
    cancelconfirmCommand.setTitle(constants.cancel());
    cancelconfirmCommand.setIsCancel(true);
    confirmationModel.getCommands().add(cancelconfirmCommand);
  }
예제 #8
0
  private void remove() {
    if (getWindow() != null) {
      return;
    }

    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removePermissionTitle());
    model.setHelpTag(HelpTag.remove_permission);
    model.setHashName("remove_permission"); // $NON-NLS-1$
    model.setItems(getSelectedItems());

    UICommand tempVar = new UICommand("OnRemove", this); // $NON-NLS-1$
    tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
    tempVar.setIsDefault(true);
    model.getCommands().add(tempVar);
    UICommand tempVar2 = new UICommand("Cancel", this); // $NON-NLS-1$
    tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel());
    tempVar2.setIsCancel(true);
    model.getCommands().add(tempVar2);
  }