コード例 #1
0
 @Test
 public void testResolution() throws Exception {
   boolean localRequiresRuntime =
       ServerProfileModel.getDefault().profileRequiresRuntime(serverType, "local");
   assertTrue(localRequiresRuntime);
   boolean rseRequiresRuntime =
       ServerProfileModel.getDefault().profileRequiresRuntime(serverType, "rse");
   assertFalse(rseRequiresRuntime);
 }
コード例 #2
0
  public void serverChanged(ServerEvent event) {
    final IServer server = event.getServer();
    JBossServer jbs =
        (JBossServer) server.loadAdapter(JBossServer.class, new NullProgressMonitor());
    if (jbs != null && serverSwitchesToState(event, IServer.STATE_STARTING)) {
      // do not launch console for remotes, for now
      String type = ServerProfileModel.getProfile(server);
      if (!ServerProfileModel.DEFAULT_SERVER_PROFILE.equals(type)) return;

      new Thread() {
        public void run() {
          try {
            // delay to insure the server gets a chance to actually launch
            Thread.sleep(3000);
          } catch (InterruptedException ie) {
          }
          Display.getDefault()
              .asyncExec(
                  new Runnable() {
                    public void run() {
                      ILaunch launch = server.getLaunch();
                      if (launch != null && launch.getProcesses().length > 0)
                        new ShowInConsoleAction(getNullSelectionProvider()).perform(server);
                    }
                  });
        }
      }.start();
    }
  }