private void maybeClearSelectionAndSelectNextAvailable(
      LaunchConfiguration removedLaunchConfiguration) {
    IModelNode currentSelection = getFirstElementInSelection();

    if (currentSelection == null) {
      return;
    }

    if (currentSelection == removedLaunchConfiguration
        || isParentOf(currentSelection, removedLaunchConfiguration)) {

      /*
       * Technically, a launch configuration could have been added to the model
       * (but not the view) at the point that we perform this query. In reality,
       * this is very unlikely to happen. Even it it does, there will be no harm
       * - this call will force a refresh of the data, and the new one that
       * "sneaked" in will be selected. The notification event for the new
       * launch will follow shortly afterwards.
       */
      LaunchConfiguration latestActiveLaunchConfiguration =
          WebAppDebugModel.getInstance().getLatestActiveLaunchConfiguration();
      if (latestActiveLaunchConfiguration != null) {
        setSelection(new StructuredSelection(latestActiveLaunchConfiguration));
      } else {
        setSelection(new StructuredSelection(WebAppDebugModel.getInstance()));
      }
    }
  }
  public void setInput(WebAppDebugModel newModel) {
    if (model != null) {
      model.removeWebAppDebugModelListener(this);
    }

    this.model = newModel;
    setSelection(new StructuredSelection(WebAppDebugModel.getInstance()));

    if (model != null) {
      model.addWebAppDebugModelListener(this);
    }
  }
  private void displayCodeServerUrlInDevMode(final ILaunch launch, String text) {
    if (!text.contains("http")) {
      return;
    }

    // Extract URL http://localhost:9876/
    String url = text.replaceAll(".*(http.*).*?", "$1").trim();
    if (url.matches(".*/")) {
      url = url.substring(0, url.length() - 1);
      launchUrls.add(url);
    }

    // Dev Mode View, add url
    LaunchConfiguration lc =
        WebAppDebugModel.getInstance().addOrReturnExistingLaunchConfiguration(launch, "", null);
    lc.setLaunchUrls(launchUrls);
  }