コード例 #1
0
  private void OnRemove() {
    ConfirmationModel model = (ConfirmationModel) getWindow();

    if (model.getProgress() != null) {
      return;
    }

    java.util.ArrayList<VdcActionParametersBase> list =
        new java.util.ArrayList<VdcActionParametersBase>();
    for (Object item : getSelectedItems()) {
      VmNetworkInterface a = (VmNetworkInterface) item;
      list.add(
          new RemoveVmTemplateInterfaceParameters(getEntityStronglyTyped().getId(), a.getId()));
    }

    model.StartProgress(null);

    Frontend.RunMultipleAction(
        VdcActionType.RemoveVmTemplateInterface,
        list,
        new IFrontendMultipleActionAsyncCallback() {
          @Override
          public void Executed(FrontendMultipleActionAsyncResult result) {

            ConfirmationModel localModel = (ConfirmationModel) result.getState();
            localModel.StopProgress();
            Cancel();
          }
        },
        model);
  }
コード例 #2
0
  private void remove() {
    if (getWindow() != null) {
      return;
    }

    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle("Remove Network Interface(s)");
    model.setMessage("Network Interface(s)");

    java.util.ArrayList<String> items = new java.util.ArrayList<String>();
    for (Object item : getSelectedItems()) {
      VmNetworkInterface a = (VmNetworkInterface) item;
      items.add(a.getName());
    }
    model.setItems(items);

    UICommand tempVar = new UICommand("OnRemove", this);
    tempVar.setTitle("OK");
    tempVar.setIsDefault(true);
    model.getCommands().add(tempVar);
    UICommand tempVar2 = new UICommand("Cancel", this);
    tempVar2.setTitle("Cancel");
    tempVar2.setIsCancel(true);
    model.getCommands().add(tempVar2);
  }