public boolean isComplete() {
    runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);

    if (runtime != null) {
      GenericServerRuntime gRuntime =
          (GenericServerRuntime)
              runtime.loadAdapter(GenericServerRuntime.class, new NullProgressMonitor());

      Map properties = gRuntime.getServerInstanceProperties();
      String serverName = (String) properties.get("server.name");
      if (serverName != null) {
        runtime.setName(serverName);
      }
    }
    return super.isComplete();
  }
示例#2
0
  public static IRuntimeWorkingCopy getRuntime(String runtimeTypeId, IPath location) {
    IRuntimeType runtimeType = ServerCore.findRuntimeType(runtimeTypeId);

    try {
      IRuntime runtime = runtimeType.createRuntime("runtime", null);

      IRuntimeWorkingCopy runtimeWC = runtime.createWorkingCopy();
      runtimeWC.setName("Runtime");
      runtimeWC.setLocation(location);

      return runtimeWC;
    } catch (CoreException e) {
      e.printStackTrace();
    }

    return null;
  }