org.fujion.component.Window类的使用及代码示例

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

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

Window介绍

[英]A window component with a title bar and maximize/minimize/close buttons. May be used in modal, popup, or inline modes.
[中]带有标题栏和最大化/最小化/关闭按钮的窗口组件。可用于模式、弹出或内联模式。

代码示例

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

Window parent = new Window(); // Temporary parent in case materialize fails, so can cleanup.
Page currentPage = ExecutionContext.getPage();
parent.setParent(currentPage);
Window window = null;
  window = parent.getChild(Window.class);
    window.setParent(null);
    BaseComponent child;
    while ((child = parent.getFirstChild()) != null) {
      child.setParent(window);
    parent.destroy();
    window.setParent(currentPage);
  } else { // Otherwise, use the temp parent as the window
    window = parent;
  window.setClosable(closable);
  window.setSizable(sizable);
    window.modal(closeListener);
    window.destroy();
    window = null;
    parent.destroy();

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

@Override
public void afterInitialized(BaseComponent comp) {
  this.root = (Window) comp;
  root.setAttribute("controller", this);
  root.setTitle(root.getAttribute("title", ""));
  root.addClass("flavor:" + root.getAttribute("panelClass", "panel-primary"));
  prompt.setLabel(root.getAttribute("prompt", ""));
  textbox.setValue(root.getAttribute("oldValue", null));
  textbox.selectAll();
  updateState();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

/**
 * Displays the dialog.
 *
 * @param text The text or HTML content. HTML content is indicated by prefixing with the html
 *            tag.
 * @param title Dialog title.
 * @param allowPrint If true, a print button is provided.
 * @param asModal If true, open as modal; otherwise, as popup.
 * @param callback Callback when dialog is closed.
 * @return The created dialog.
 */
public static Window show(String text, String title, boolean allowPrint, boolean asModal, IEventListener callback) {
  Map<String, Object> args = new HashMap<>();
  args.put("text", text);
  args.put("title", title);
  args.put("allowPrint", allowPrint);
  Window dialog = PopupDialog.show(DialogConstants.RESOURCE_PREFIX + "reportDialog.fsp", args, true, true, false,
    null);
  if (asModal) {
    dialog.modal(callback);
  } else {
    dialog.popup(callback);
  }
  return dialog;
}

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

public Window() {
  super();
  setMode(Mode.INLINE);
  addClass("flavor:panel-default");
}

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

private void close(LayoutIdentifier layoutId) {
  window.setAttribute("layoutId", layoutId);
  LayoutManager.defaultIsShared(layoutId.shared);
  window.close();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.help.core

boolean proxied = proxyId != null;
mode = proxied ? HelpViewerMode.POPUP : HelpViewerMode.EMBEDDED;
root.setWidth(proxied ? "100%" : lastWidth + "px");
root.setHeight(proxied ? "100%" : lastHeight + "px");
root.setSizable(!proxied);
root.setClosable(!proxied);
root.setMaximizable(!proxied);
root.setMinimizable(!proxied);
root.setTitle(proxied ? null : "Help");
root.setVisible(proxied);
findView(HelpViewType.HISTORY, true, false);
history.addTopicListener(this);
  root.setCloseAction(CloseAction.DESTROY);
  page.setTitle("Help");
  InvocationRequestQueue proxyQueue = InvocationRequestQueueRegistry.getInstance().get("help" + proxyId);
  root.setCloseAction(CloseAction.HIDE);

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

@Override
public void afterInitialized(BaseComponent comp) {
  this.root = (Window) comp;
  root.setAttribute("controller", this);
  control = (DialogControl<?>) root.getAttribute("control");
  root.setTitle(control.getTitle());
  icon.addClass(control.getIconClass());
  message.addClass(control.getTextClass());
  message.setLabel(control.getMessage());
  root.addClass(control.getPanelClass());
  chkRemember.setVisible(root.hasAttribute("remember"));
  root.setOnCanClose(() -> {
    control.callback(response);
    return true;
  });
  
  if (control.getFormat() == ChoiceFormat.BUTTONS) {
    processButtonResponses();
  } else {
    processListResponses();
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

/**
 * Creates a property grid for the given target UI element.
 *
 * @param target UI element whose properties are to be edited.
 * @param parent Parent component for property grid (may be null).
 * @param embedded If true, the property grid is embedded within another component.
 * @return Newly created PropertyGrid instance.
 */
public static PropertyGrid create(ElementBase target, BaseComponent parent, boolean embedded) {
  Map<String, Object> args = new HashMap<>();
  args.put("target", target);
  args.put("embedded", embedded);
  Window window = (Window) PageUtil.createPage(DesignConstants.RESOURCE_PREFIX + "propertyGrid.fsp", parent, args)
      .get(0);
  
  if (parent == null) {
    window.modal(null);
  }
  
  return window.getAttribute("controller", PropertyGrid.class);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

/**
 * Initializes the property grid.
 *
 * @param comp The root component.
 */
@Override
public void afterInitialized(BaseComponent comp) {
  window = (Window) comp;
  changeEvent = new ChangeEvent(window, null);
  @SuppressWarnings("rawtypes")
  IModelAndView<Row, PropertyEditorBase> mv = gridProperties.getRows().getModelAndView(PropertyEditorBase.class);
  mv.setRenderer(rowRenderer);
  mv.setModel(model);
  comp.setAttribute("controller", this);
  this.embedded = comp.getAttribute("embedded", false);
  setTarget(comp.getAttribute("target", ElementBase.class));
  
  if (window.getParent() != null) {
    window.setClosable(false);
    window.setWidth("100%");
    window.setHeight("100%");
    window.setSizable(false);
    window.addClass("cwf-propertygrid-embedded");
    toolbar.setVisible(embedded);
  }
  
  btnOK.setVisible(!embedded);
  btnCancel.setVisible(!embedded);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.popupsupport

window.setTitle(popupData.getTitle());
  window.setParent(currentPage);
  String pos = getPosition();
  window.addStyle("left", pos);
  window.addStyle("top", pos);
  window.addEventListener("close", this);
  Label label = window.findByName("messagetext", Label.class);
  label.setLabel(popupData.getMessage());
  window.setMode(Mode.POPUP);
} catch (Exception e) {}

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

/**
 * Handles close events from the client.
 */
@EventHandler(value = "close", syncToClient = false, mode = "init")
private void _close() {
  close();
}

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

/**
 * Opens the window modally.
 */
public void modal() {
  modal(null);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.sharedforms

/**
 * Set the current caption.
 *
 * @param caption Current caption.
 */
public void setCaption(String caption) {
  panel.setTitle(caption);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

root.setTitle(root.getTitle() + " - " + manifestItem.implModule);

代码示例来源:origin: org.carewebframework/org.carewebframework.help.core

/**
 * @see org.carewebframework.help.IHelpViewer#show()
 */
@Override
public void show() {
  lblLoading.setVisible(false);
  tvNavigator.setVisible(true);
  
  if (mode == HelpViewerMode.EMBEDDED) {
    root.setHeight(lastHeight + "px");
    root.setWidth(lastWidth + "px");
    root.setSize(Size.NORMAL);
    root.popup(null);
  } else {
    ClientUtil.invoke("window.focus");
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

.createPage(DialogConstants.RESOURCE_PREFIX + "promptDialog.fsp", ExecutionContext.getPage(), args)
      .get(0);
  root.modal(null);
} catch (Exception e) {
  log.error("Error Displaying Dialog", e);
    root.destroy();

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

/**
 * Display the Layout Manager dialog
 *
 * @param rootElement The root UI element.
 */
public static void execute(ElementBase rootElement) {
  Window dlg = getInstance(true);
  dlg.getAttribute("controller", LayoutDesigner.class).init(rootElement);
  dlg.popup(null);
}

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

if (canClose()) {
  switch (closeAction) {
    case DESTROY:
      destroy();
      break;
      detach();
      break;
      setVisible(false);
      break;

代码示例来源:origin: org.hspconsortium.carewebframework/cwf-plugin-scenario

/**
 * Display view resources dialog.
 *
 * @param scenario Scenario whose resources are to be viewed.
 * @param callback Callback upon dialog closure.
 */
public static void show(Scenario scenario, IResponseCallback<Boolean> callback) {
  Map<String, Object> args = new HashMap<>();
  args.put("scenario", scenario);
  Window dlg = (Window) PageUtil.createPage("web/org/hspconsortium/cwf/ui/scenario/viewResources.fsp", null, args)
      .get(0);
  dlg.modal((event) -> {
    if (callback != null) {
      callback.onComplete(dlg.hasAttribute("modified"));
    }
  });
}

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

window.setTitle(
  StrUtil.formatMessage("@cwf.shell.designer.add.component.title", parentElement.getDefinition().getName()));
window.setOnCanClose(() -> {
  if (favoritesChanged) {
    PropertyUtil.saveValues(DesignConstants.DESIGN_FAVORITES_PROPERTY, null, false, favorites);

相关文章