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

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

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

Window.setClosable介绍

[英]Sets the closable status for the window. If a window is closable it typically shows an X in the upper right corner. Clicking on the X sends a close event to the server. Setting closable to false will remove the X from the window and prevent the user from closing the window.
[中]设置窗口的可关闭状态。如果一个窗口是可关闭的,它通常会在右上角显示一个X。点击X向服务器发送关闭事件。将closable设置为false将从窗口中删除X,并阻止用户关闭窗口。

代码示例

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

/**
 * Sets whether the Popover is automatically closed when the user clicks
 * (taps) outside of it. Note that no close button is displayed by default,
 * so some other way to close the window must be arranged if set to
 * <code>false</code>.
 * 
 * @param closable
 *            true to allow the user to close the Popover by tapping outside
 *            of it
 */
@Override
public void setClosable(boolean closable) {
  super.setClosable(closable);
}

代码示例来源:origin: com.holon-platform.vaadin7/holon-vaadin-navigator

@Override
public ViewWindowConfigurator closable(boolean closable) {
  getInstance().setClosable(closable);
  return this;
}

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

private void decorateWindow(final Window window) {
  if (id != null) {
    window.setId(id);
  }
  if (SPUIDefinitions.CONFIRMATION_WINDOW.equals(type)) {
    window.setDraggable(false);
    window.setClosable(true);
    window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
  } else if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) {
    window.setDraggable(true);
    window.setClosable(true);
  }
}

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

private void decorateWindow(final Window window) {
  if (id != null) {
    window.setId(id);
  }
  if (SPUIDefinitions.CONFIRMATION_WINDOW.equals(type)) {
    window.setDraggable(false);
    window.setClosable(true);
    window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
  } else if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) {
    window.setDraggable(true);
    window.setClosable(true);
  }
}

代码示例来源:origin: org.aperteworkflow/gui-commons

public static Window modalWindow(String title, ComponentContainer content) {
  Window window = new Window(title, content);
  window.setClosable(false);
  window.setModal(true);
  window.setSizeUndefined();
  return window;
}

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

/**
   * Build window based on type.
   *
   * @return Window
   */
  public Window buildWindow() {
    final Window window = new Window(caption);
    window.setContent(content);
    window.setSizeUndefined();
    window.setModal(true);
    window.setResizable(false);

    decorateWindow(window);

    if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) {
      window.setClosable(false);
    }

    return window;
  }
}

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

/**
   * Build window based on type.
   *
   * @return Window
   */
  public Window buildWindow() {
    final Window window = new Window(caption);
    window.setContent(content);
    window.setSizeUndefined();
    window.setModal(true);
    window.setResizable(false);

    decorateWindow(window);

    if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) {
      window.setClosable(false);
    }

    return window;
  }
}

代码示例来源:origin: org.opencms/opencms-core

/**
 * @see org.opencms.ui.actions.I_CmsWorkplaceAction#executeAction(org.opencms.ui.I_CmsDialogContext)
 */
public void executeAction(final I_CmsDialogContext context) {
  CmsUserInfo dialog = new CmsUserInfo(new I_UploadListener() {
    public void onUploadFinished(List<String> uploadedFiles) {
      handleUpload(uploadedFiles, context);
    }
  }, context);
  Multimap<String, String> params = A_CmsUI.get().getParameters();
  int top = 55;
  int left = 0;
  if (params.containsKey("left")) {
    String buttonLeft = params.get("left").iterator().next();
    left = Integer.parseInt(buttonLeft) - 290;
  }
  final Window window = new Window();
  window.setModal(false);
  window.setClosable(true);
  window.setResizable(false);
  window.setContent(dialog);
  context.setWindow(window);
  window.addStyleName(OpenCmsTheme.DROPDOWN);
  UI.getCurrent().addWindow(window);
  window.setPosition(left, top);
}

代码示例来源:origin: org.opencms/opencms-core

/**
 * Replaces the ui content with a single dialog.<p>
 *
 * @param caption the caption
 * @param dialog the dialog content
 */
public void setContentToDialog(String caption, CmsBasicDialog dialog) {
  setContent(new Label());
  Window window = CmsBasicDialog.prepareWindow(DialogWidth.narrow);
  window.setContent(dialog);
  window.setCaption(caption);
  window.setClosable(false);
  addWindow(window);
  window.center();
}

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

private void createNotificationWindow() {
  notificationsWindow = new Window();
  notificationsWindow.setWidth(300.0F, Unit.PIXELS);
  notificationsWindow.addStyleName(STYLE_POPUP);
  notificationsWindow.addStyleName(STYLE_NO_CLOSEBOX);
  notificationsWindow.setClosable(true);
  notificationsWindow.setResizable(false);
  notificationsWindow.setDraggable(false);
  notificationsWindow.setId(UIComponentIdProvider.NOTIFICATION_UNREAD_POPUP_ID);
  notificationsWindow.addCloseListener(event -> refreshCaption());
  notificationsWindow.addBlurListener(this::closeWindow);
}

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

private void createNotificationWindow() {
  notificationsWindow = new Window();
  notificationsWindow.setWidth(300.0F, Unit.PIXELS);
  notificationsWindow.addStyleName(STYLE_POPUP);
  notificationsWindow.addStyleName(STYLE_NO_CLOSEBOX);
  notificationsWindow.setClosable(true);
  notificationsWindow.setResizable(false);
  notificationsWindow.setDraggable(false);
  notificationsWindow.setId(UIComponentIdProvider.NOTIFICATION_UNREAD_POPUP_ID);
  notificationsWindow.addCloseListener(event -> refreshCaption());
  notificationsWindow.addBlurListener(this::closeWindow);
}

代码示例来源:origin: OpenNMS/opennms

window.setClosable(true);
window.setResizable(false);

代码示例来源:origin: org.opennms.features/vaadin-surveillance-views

window.setClosable(true);
window.setResizable(false);

代码示例来源:origin: org.opencms/opencms-core

/**
 * Replaces the ui content with a single dialog.<p>
 *
 * TODO: In the future this should only handle window creation, refactor dialog contents to CmsBasicDialog
 *
 * @param caption the caption
 * @param component the dialog content
 */
public void setContentToDialog(String caption, Component component) {
  setContent(new Label());
  Window window = CmsBasicDialog.prepareWindow(DialogWidth.narrow);
  CmsBasicDialog dialog = new CmsBasicDialog();
  VerticalLayout result = new VerticalLayout();
  dialog.setContent(result);
  window.setContent(dialog);
  window.setCaption(caption);
  window.setClosable(false);
  addWindow(window);
  window.center();
  if (component instanceof I_CmsHasButtons) {
    I_CmsHasButtons hasButtons = (I_CmsHasButtons)component;
    for (Button button : hasButtons.getButtons()) {
      dialog.addButton(button);
    }
  }
  result.addComponent(component);
}

代码示例来源:origin: KrailOrg/krail

window.setClosable(false);
window.setModal(true);
window.setResizable(false);

代码示例来源:origin: org.opencms/opencms-core

/**
 * Shows the password reset dialog.<p>
 */
public void showPasswordResetDialog() {
  String caption = CmsVaadinUtils.getMessageText(Messages.GUI_PWCHANGE_FORGOT_PASSWORD_0);
  A_CmsUI r = A_CmsUI.get();
  r.setContent(new Label());
  Window window = CmsBasicDialog.prepareWindow(DialogWidth.narrow);
  CmsBasicDialog dialog = new CmsBasicDialog();
  VerticalLayout result = new VerticalLayout();
  dialog.setContent(result);
  window.setContent(dialog);
  window.setCaption(caption);
  window.setClosable(true);
  final CmsForgotPasswordDialog forgotPassword = new CmsForgotPasswordDialog();
  window.addCloseListener(new CloseListener() {
    /** Serial version id. */
    private static final long serialVersionUID = 1L;
    public void windowClose(CloseEvent e) {
      forgotPassword.cancel();
    }
  });
  for (Button button : forgotPassword.getButtons()) {
    dialog.addButton(button);
  }
  r.addWindow(window);
  window.center();
  VerticalLayout vl = result;
  vl.addComponent(forgotPassword);
}

代码示例来源:origin: OpenNMS/opennms

window.setClosable(false);
window.setResizable(false);

代码示例来源:origin: org.opencms/opencms-core

org.opencms.workplace.Messages.GUI_DIALOG_BUTTON_OK_0));
window.setContent(panel);
window.setClosable(false);
window.setResizable(false);
A_CmsUI.get().addWindow(window);

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

.getArtifactoryDetailsLabelId(softwareModule.getName() + "." + softwareModule.getVersion(), getI18n()));
artifactDtlsWindow.setCaptionAsHtml(true);
artifactDtlsWindow.setClosable(true);
artifactDtlsWindow.setResizable(true);
artifactDtlsWindow.setImmediate(true);

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

.getArtifactoryDetailsLabelId(softwareModule.getName() + "." + softwareModule.getVersion(), getI18n()));
artifactDtlsWindow.setCaptionAsHtml(true);
artifactDtlsWindow.setClosable(true);
artifactDtlsWindow.setResizable(true);
artifactDtlsWindow.setImmediate(true);

相关文章