org.zkoss.zk.ui.Desktop.getPages()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(157)

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

Desktop.getPages介绍

[英]Returns a readonly collection of all Page in this desktop.
[中]返回此桌面中所有页面的只读集合。

代码示例

代码示例来源:origin: org.zkoss.zk/zk

private static Boolean getAutomaticTimeout(Desktop desktop) {
  if (desktop != null)
    for (Page page : desktop.getPages()) {
      Boolean b = ((PageCtrl) page).getAutomaticTimeout();
      if (b != null)
        return b;
    }
  return null;
}

代码示例来源:origin: org.zkoss.zk/zk

/** Returns the main page of the desktop.
 * It assumes there is at most one main page (that is, a page without owner)
 */
/*package*/ static Page getMainPage(Desktop desktop) {
  for (Iterator it = desktop.getPages().iterator(); it.hasNext();) {
    final Page page = (Page) it.next();
    if (((PageCtrl) page).getOwner() == null)
      return page;
  }
  return null;
}

代码示例来源:origin: org.zkoss.zk/zk

public void setId(String id) {
  if (_desktop != null && _desktop.getPages().contains(this))
    throw new UiException("ID cannot be changed after initialized");
  _id = id != null ? id : "";
  //No need to update client since it is allowed only before init(...)
}

代码示例来源:origin: org.zkoss.zats/zats-mimic

public List<PageAgent> getPages() {
  List<PageAgent> agents = new ArrayList<PageAgent>();
  Iterator<?> iter = desktop.getPages().iterator();
  while (iter.hasNext())
    agents.add(new DefaultPageAgent(this, (Page) iter.next()));
  return agents;
}

代码示例来源:origin: org.zkoss.zk/zk

private static final boolean isGroupingAllowed(Desktop desktop) {
  final String name = "org.zkoss.zk.ui.input.grouping.allowed";
  if (desktop != null) {
    final Collection<Page> pages = desktop.getPages();
    if (!pages.isEmpty()) {
      final Page page = pages.iterator().next();
      Object o = page.getAttribute(name);
      if (o != null)
        return (o instanceof Boolean && ((Boolean) o).booleanValue()) || !"false".equals(o);
    }
  }
  if (_groupingAllowed == null) {
    final String s = Library.getProperty(name);
    _groupingAllowed = Boolean.valueOf(s == null || !"false".equals(s));
  }
  return _groupingAllowed.booleanValue();
}

代码示例来源:origin: org.zkoss.zats/zats-mimic

Collection<Page> pages = ((Desktop)base).getPages();
foundComponents = new ArrayList<Component>();
for(Page p : pages){

代码示例来源:origin: org.zkoss.zk/zk

for (Page page : desktop.getPages()) {
  final Component owner = ((PageCtrl) page).getOwner();
  if (owner != null) { //included

代码示例来源:origin: org.zkoss.zk/zk

/** Processing the event and stores result into UiVisualizer. */
private void process(Desktop desktop, Event event) {
  //		if (log.finable()) log.finer("Processing event: "+event);
  final Component comp;
  if (event instanceof ProxyEvent) {
    final ProxyEvent pe = (ProxyEvent) event;
    comp = pe.getRealTarget();
    event = pe.getProxiedEvent();
  } else {
    comp = event.getTarget();
  }
  if (comp != null) {
    processEvent(desktop, comp, event);
  } else {
    //since an event might change the page/desktop/component relation,
    //we copy roots first
    final List<Component> roots = new LinkedList<Component>();
    for (Page page : desktop.getPages()) {
      roots.addAll(page.getRoots());
    }
    for (Component c : roots) {
      if (c.getPage() != null) //might be removed, so check first
        processEvent(desktop, c, event);
    }
  }
}

相关文章