Exemplo n.º 1
0
  public PingLayout() {
    panel.setSizeFull();
    panel.addStyleName("panel-centered-title");
    // Le listener pour si on lance le scan d'ici
    ping.addScanEndListener(
        new ScanEndListener() {
          @Override
          public void onScanTerminated() {
            try {
              scan = neo.getScanOfSite(site, Ping.NAME);
            } catch (ScanNotFoundException e) {
              e.printStackTrace();
            }
            panel.setContent(resultLayout());
          }
        });

    try {
      this.scan = neo.getScanOfSite(site, Ping.NAME);
    } catch (ScanNotFoundException e) {
    }
    if (scan != null) {
      if (scan.isFinished()) {
        panel.setContent(resultLayout());
      } else if (scan.isRunning()) {
        panel.setContent(runningLayout());
      }
    } else {
      panel.setContent(startLayout());
    }

    layout.addComponent(panel);
  }
Exemplo n.º 2
0
 @Override
 public void resetScan() {
   neo.deleteScan(scan);
   ping.start(site);
   panel.setContent(runningLayout());
 }