com.vaadin.ui.Window.bringToFront()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(14.3k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中com.vaadin.ui.Window.bringToFront()方法的一些代码示例,展示了Window.bringToFront()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.bringToFront()方法的具体详情如下:
包路径:com.vaadin.ui.Window
类名称:Window
方法名:bringToFront

Window.bringToFront介绍

[英]Used to keep the right order of windows if multiple windows are brought to front in a single changeset. If this is not used, the order is quite random (depends on the order getting to dirty list. e.g. which window got variable changes).
[中]用于在单个变更集中出现多个窗口时保持窗口的正确顺序。如果不使用此选项,则顺序相当随机(取决于进入脏列表的顺序。例如,哪个窗口发生了变量更改)。

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * {@inheritDoc}
 *
 * Cause the window to be brought on top of other windows and gain keyboard
 * focus.
 */
@Override
public void focus() {
  /*
   * When focusing a window it basically means it should be brought to the
   * front. Instead of just moving the keyboard focus we focus the window
   * and bring it top-most.
   */
  super.focus();
  bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void openConfirmationWindowForAssignment(final String distributionNameToAssign,
    final List<Target> targetDetailsList) {
  final String confirmQuestion = createConfirmationQuestionForAssignment(distributionNameToAssign,
      targetDetailsList);
  createConfirmationWindowForAssignment(confirmQuestion);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

private void openConfirmationWindowForAssignment(final String distributionNameToAssign,
    final List<Target> targetDetailsList) {
  final String confirmQuestion = createConfirmationQuestionForAssignment(distributionNameToAssign,
      targetDetailsList);
  createConfirmationWindowForAssignment(confirmQuestion);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

private void openConfirmationWindowForAssignment(final String distributionNameToAssign,
    final SoftwareModuleIdName[] softwareModules) {
  final String confirmQuestion = createConfirmationMessageForAssignment(distributionNameToAssign,
      softwareModules);
  final ConfirmationDialog confirmDialog = createConfirmationWindowForAssignment(confirmQuestion);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void openConfirmationWindowForAssignment(final String distributionNameToAssign,
    final SoftwareModuleIdName[] softwareModules) {
  final String confirmQuestion = createConfirmationMessageForAssignment(distributionNameToAssign,
      softwareModules);
  final ConfirmationDialog confirmDialog = createConfirmationWindowForAssignment(confirmQuestion);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

private void openConfirmationWindowDeleteAction(final ClickEvent event) {
  final List<Long> entitiesToBeDeleted = getEntitiesForDeletion(event);
  final String confirmationQuestion = createConfirmationQuestionForDeletion(entitiesToBeDeleted);
  final ConfirmationDialog confirmDialog = createConfirmationWindowForDeletion(entitiesToBeDeleted,
      confirmationQuestion);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void openConfirmationWindowDeleteAction(final ClickEvent event) {
  final List<Long> entitiesToBeDeleted = getEntitiesForDeletion(event);
  final String confirmationQuestion = createConfirmationQuestionForDeletion(entitiesToBeDeleted);
  final ConfirmationDialog confirmDialog = createConfirmationWindowForDeletion(entitiesToBeDeleted,
      confirmationQuestion);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

protected void openConfirmationWindowForDeletion(final String entityToDelete, final String entityName,
    final FilterHeaderEvent event) {
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.entity.delete.action.confirmbox"),
      i18n.getMessage("message.confirm.delete.entity", entityName.toLowerCase(),
          entityToDelete.substring(entityToDelete.indexOf('.') + 1), ""),
      i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
      ok -> {
        if (ok) {
          deleteEntity(entityToDelete);
        } else {
          removeUpdateAndDeleteColumn();
          getEventBus().publish(this, event);
        }
      });
  confirmDialog.getWindow().addCloseListener(getCloseListenerForEditAndDeleteTag(event));
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

protected void openConfirmationWindowForDeletion(final String entityToDelete, final String entityName,
    final FilterHeaderEvent event) {
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.entity.delete.action.confirmbox"),
      i18n.getMessage("message.confirm.delete.entity", entityName.toLowerCase(),
          entityToDelete.substring(entityToDelete.indexOf('.') + 1), ""),
      i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
      ok -> {
        if (ok) {
          deleteEntity(entityToDelete);
        } else {
          removeUpdateAndDeleteColumn();
          getEventBus().publish(this, event);
        }
      });
  confirmDialog.getWindow().addCloseListener(getCloseListenerForEditAndDeleteTag(event));
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

private void confirmAndDeleteArtifact(final Long id, final String fileName) {
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.delete.artifact.confirmbox"),
      i18n.getMessage("message.delete.artifact", fileName), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
      i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
        if (ok) {
          artifactManagement.delete(id);
          uINotification.displaySuccess(i18n.getMessage("message.artifact.deleted", fileName));
          final Optional<SoftwareModule> softwareModule = findSelectedSoftwareModule();
          populateArtifactDetails(softwareModule.orElse(null));
        }
      });
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void deleteRollout(final Long rolloutId) {
  final Optional<Rollout> rollout = rolloutManagement.getWithDetailedStatus(rolloutId);
  if (!rollout.isPresent()) {
    return;
  }
  final String formattedConfirmationQuestion = getConfirmationQuestion(rollout.get());
  final ConfirmationDialog confirmationDialog = new ConfirmationDialog(
      i18n.getMessage("caption.entity.delete.action.confirmbox"), formattedConfirmationQuestion,
      i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
      ok -> {
        if (!ok) {
          return;
        }
        final Item row = getContainerDataSource().getItem(rolloutId);
        final String rolloutName = (String) row.getItemProperty(SPUILabelDefinitions.VAR_NAME).getValue();
        rolloutManagement.delete(rolloutId);
        uiNotification.displaySuccess(i18n.getMessage("message.rollout.deleted", rolloutName));
      }, UIComponentIdProvider.ROLLOUT_DELETE_CONFIRMATION_DIALOG);
  UI.getCurrent().addWindow(confirmationDialog.getWindow());
  confirmationDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void confirmAndDeleteArtifact(final Long id, final String fileName) {
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.delete.artifact.confirmbox"),
      i18n.getMessage("message.delete.artifact", new Object[] { fileName }),
      i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
      ok -> {
        if (ok) {
          artifactManagement.delete(id);
          uINotification.displaySuccess(i18n.getMessage("message.artifact.deleted", fileName));
          final Optional<SoftwareModule> softwareModule = findSelectedSoftwareModule();
          populateArtifactDetails(softwareModule.orElse(null));
        }
      });
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

private void deleteRollout(final Long rolloutId) {
  final Optional<Rollout> rollout = rolloutManagement.getWithDetailedStatus(rolloutId);
  if (!rollout.isPresent()) {
    return;
  }
  final String formattedConfirmationQuestion = getConfirmationQuestion(rollout.get());
  final ConfirmationDialog confirmationDialog = new ConfirmationDialog(
      i18n.getMessage("caption.entity.delete.action.confirmbox"), formattedConfirmationQuestion,
      i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
      ok -> {
        if (!ok) {
          return;
        }
        final Item row = getContainerDataSource().getItem(rolloutId);
        final String rolloutName = (String) row.getItemProperty(SPUILabelDefinitions.VAR_NAME).getValue();
        rolloutManagement.delete(rolloutId);
        uiNotification.displaySuccess(i18n.getMessage("message.rollout.deleted", rolloutName));
      }, UIComponentIdProvider.ROLLOUT_DELETE_CONFIRMATION_DIALOG);
  UI.getCurrent().addWindow(confirmationDialog.getWindow());
  confirmationDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

private void openConfirmationWindowForAssignment(final String distributionNameToAssign, final String targetName) {
  confirmDialog = new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX),
      getI18n().getMessage(MESSAGE_CONFIRM_ASSIGN_ENTITY, distributionNameToAssign, "target", targetName),
      getI18n().getMessage(UIMessageIdProvider.BUTTON_OK),
      getI18n().getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
        if (ok && isMaintenanceWindowValid()) {
          saveAllAssignments();
        } else {
          managementUIState.getAssignedList().clear();
        }
      }, createAssignmentTab(), UIComponentIdProvider.DIST_SET_TO_TARGET_ASSIGNMENT_CONFIRM_ID);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void openConfirmationWindowForAssignment(final String distributionNameToAssign, final String targetName) {
  confirmDialog = new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX),
      getI18n().getMessage(MESSAGE_CONFIRM_ASSIGN_ENTITY, distributionNameToAssign, "target", targetName),
      getI18n().getMessage(UIMessageIdProvider.BUTTON_OK),
      getI18n().getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
        if (ok && isMaintenanceWindowValid()) {
          saveAllAssignments();
        } else {
          managementUIState.getAssignedList().clear();
        }
      }, createAssignmentTab(), UIComponentIdProvider.DIST_SET_TO_TARGET_ASSIGNMENT_CONFIRM_ID);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

/**
 * Show confirmation window and if ok then only, force the action.
 *
 * @param actionId
 *            as Id if the action needs to be forced.
 */
private void confirmAndForceAction(final Long actionId) {
  /* Display the confirmation */
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.force.action.confirmbox"), i18n.getMessage("message.force.action.confirm"),
      i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
      ok -> {
        if (!ok) {
          return;
        }
        deploymentManagement.forceTargetAction(actionId);
        populateAndUpdateTargetDetails(selectedTarget);
        notification.displaySuccess(i18n.getMessage("message.force.action.success"));
      }, UIComponentIdProvider.CONFIRMATION_POPUP_ID);
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

/**
 * Show confirmation window and if ok then only, force the action.
 *
 * @param actionId
 *            as Id if the action needs to be forced.
 */
private void confirmAndForceAction(final Long actionId) {
  /* Display the confirmation */
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.force.action.confirmbox"), i18n.getMessage("message.force.action.confirm"),
      i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
      ok -> {
        if (!ok) {
          return;
        }
        deploymentManagement.forceTargetAction(actionId);
        populateAndUpdateTargetDetails(selectedTarget);
        notification.displaySuccess(i18n.getMessage("message.force.action.success"));
      });
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void onDelete(final RendererClickEvent event) {
  final Item item = metaDataGrid.getContainerDataSource().getItem(event.getItemId());
  final String key = (String) item.getItemProperty(KEY).getValue();
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.entity.delete.action.confirmbox"),
      i18n.getMessage("message.confirm.delete.metadata", key), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
      i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
        if (ok) {
          handleOkDeleteMetadata(event, key);
        }
      });
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: eclipse/hawkbit

private void onDelete(final RendererClickEvent event) {
  final Item item = metaDataGrid.getContainerDataSource().getItem(event.getItemId());
  final String key = (String) item.getItemProperty(KEY).getValue();
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.entity.delete.action.confirmbox"),
      i18n.getMessage("message.confirm.delete.metadata", key), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
      i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
        if (ok) {
          handleOkDeleteMetadata(event, key);
        }
      });
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

/**
 * Show confirmation window and if ok then only, cancel the action.
 *
 * @param actionId
 *            as Id if the action needs to be cancelled.
 */
private void confirmAndCancelAction(final Long actionId) {
  if (actionId == null) {
    return;
  }
  final ConfirmationDialog confirmDialog = new ConfirmationDialog(
      i18n.getMessage("caption.cancel.action.confirmbox"), i18n.getMessage("message.cancel.action.confirm"),
      i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
      ok -> {
        if (!ok) {
          return;
        }
        final boolean cancelResult = cancelActiveAction(actionId);
        if (cancelResult) {
          populateAndUpdateTargetDetails(selectedTarget);
          notification.displaySuccess(i18n.getMessage("message.cancel.action.success"));
        } else {
          notification.displayValidationError(i18n.getMessage("message.cancel.action.failed"));
        }
      });
  UI.getCurrent().addWindow(confirmDialog.getWindow());
  confirmDialog.getWindow().bringToFront();
}

相关文章