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

x33g5p2x  于2022-01-31 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(126)

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

UI.push介绍

[英]Pushes the pending changes and client RPC invocations of this UI to the client-side.

If push is enabled, but the push connection is not currently open, the push will be done when the connection is established.

As with all UI methods, the session must be locked when calling this method. It is also recommended that UI#getCurrent() is set up to return this UI since writing the response may invoke logic in any attached component or extension. The recommended way of fulfilling these conditions is to use #access(Runnable).
[中]将此UI的挂起更改和客户端RPC调用推送到客户端。
如果已启用推送,但推送连接当前未打开,则推送将在连接建立后完成。
与所有UI方法一样,调用此方法时必须锁定会话。还建议将UI#getCurrent()设置为返回此UI,因为编写响应可能会调用任何附加组件或扩展中的逻辑。满足这些条件的推荐方法是使用#访问(Runnable)。

代码示例

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

.setCurrent(ui);
try {
  ui.push();
} finally {
  CurrentInstance.restoreInstances(oldCurrent);

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run()
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try
    {
      ConcurrentHashMap<String, String> states = event.getFlowStateMap();
      for(String flowKey: states.keySet())
      {
        flowStates.put(flowKey, states.get(flowKey));
      }
      moduleTree.markAsDirty();
    }
    finally
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    UI.getCurrent().push();
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run() 
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try 
    {
      container.removeItem(exclusionEvent);
    } 
    finally 
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    
    UI.getCurrent().push();	
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run() 
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try 
    {
      container.removeItem(exclusionEvent);
    } 
    finally 
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    
    UI.getCurrent().push();	
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run() 
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try 
    {
      populate(event.getFlowStateMap());
    } 
    finally 
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    
    UI.getCurrent().push();	
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run() 
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try 
    {
      flowStates = event.getFlowStateMap();
      moduleTree.markAsDirty();
    } 
    finally 
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    
    UI.getCurrent().push();	
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run()
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try
    {
      // module.getName() + "-" + flow.getName()
      ConcurrentHashMap<String, String> states = event.getFlowStateMap();
      for(String flowKey: states.keySet())
      {
        logger.debug("Updating state! Flow[" + flowKey + "] State [" + states.get(flowKey) + "]");
        flowStates.put(flowKey, states.get(flowKey));
      }
      for(Flow flow: (List<Flow>)container.getItemIds())
      {
        Item item = container.getItem(flow);
        String key = flow.getModule().getName() + "-" + flow.getName();
        item.getItemProperty("Status").setValue(flowStates.get(key));
      }
      moduleTable.markAsDirty();
    }
    finally
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    UI.getCurrent().push();
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run() 
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try 
    {
      Item item = tableContainer.getItem(exclusionEvent);
      item.getItemProperty("").setValue(new Label(VaadinIcons.CHECK.getHtml(), ContentMode.HTML));
      
      float current = count / exclusionEvents.size();
      
      bar.setValue(current);
      
    } 
    finally 
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    
    UI.getCurrent().push();	
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run() 
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try 
    {
      stateMap = event.getFlowStateMap();
      setStatusLabel();
      populate(event.getFlowStateMap());
    } 
    finally 
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    
    UI.getCurrent().push();	
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

@Override
  public void run() 
  {
    VaadinSession.getCurrent().getLockInstance().lock();
    try 
    {
      Item item = tableContainer.getItem(exclusionEvent);
      item.getItemProperty("").setValue(new Label(VaadinIcons.CHECK.getHtml(), ContentMode.HTML));
      
      exclusionEventsTable.setCurrentPageFirstItemId(item);
      
      
      float current = count / exclusionEvents.size();
      
      bar.setValue(current);                      
    } 
    finally 
    {
      VaadinSession.getCurrent().getLockInstance().unlock();
    }
    
    UI.getCurrent().push();	
  }
});

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

.setCurrent(ui);
try {
  ui.push();
} finally {
  CurrentInstance.restoreInstances(oldCurrent);

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

UI.getCurrent().push();

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

UI.getCurrent().push();

相关文章