Package org.eclipse.php.internal.server.core

Examples of org.eclipse.php.internal.server.core.Server


  public boolean performCancel() {
    // Since the performOk might be triggered if this composite is inside a
    // wizard fragment, we have to
    // implement the perform cancel to revert any changes made.
    try {
      Server server = getServer();
      if (server != null) {
        server.setPort(String.valueOf(originalValuesCache.port));
        server.setBaseURL(originalValuesCache.url);
      }
      server.setHost(originalValuesCache.host);
      server.setName(originalValuesCache.serverName);
    } catch (Throwable e) {
      Logger.logException("Error while reverting the server settings", e); //$NON-NLS-1$
      return false;
    }
    return super.performCancel();
View Full Code Here


      }
      return null;
    }

    public String getColumnText(Object element, int columnIndex) {
      Server server = null;
      if (element instanceof Server) {
        server = (Server) element;
      } else {
        return super.getText(element);
      }
      if (columnIndex == 0) {
        String serverName = server.getName();
        if (isDefault((Server) element)) {
          serverName += PHPServerUIMessages
              .getString("PHPServersConfigurationBlock.workspaceDefault"); //$NON-NLS-1$
        }
        return serverName;
      } else if (columnIndex == 1) {
        return server.getBaseURL();
      }
      return element.toString();
    }
View Full Code Here

   */
  public void enter() {
    if (comp != null) {
      try {

        Server server = (Server) getWizardModel().getObject(
            WizardModel.SERVER);
        if (server == null) {
          server = new Server();
          comp.setData(server);
        }
      } catch (Exception e) {
        Logger.logException(e);
      }
View Full Code Here

  protected void init() {
    if (pathMapperComposite == null || pathMapperComposite.isDisposed()) {
      return;
    }
    Server server = getServer();
    if (server != null) {
      PathMapper pathMapper = PathMapperRegistry.getByServer(server);
      if (pathMapper != null) {
        pathMapperComposite.setData(pathMapper.getMapping());
      }
View Full Code Here

    setComplete(type != IMessageProvider.ERROR);
    controlHandler.update();
  }

  public boolean performOk() {
    Server server = getServer();
    if (server != null) {
      PathMapper pathMapper = PathMapperRegistry.getByServer(server);
      pathMapper.setMapping(pathMapperComposite.getMappings());
      PathMapperRegistry.storeToPreferences();
    }
View Full Code Here

    populateServerList(servers);

    // initialize the servers list
    if (!servers.isEmpty()) {
      for (int i = 0; i < servers.size(); i++) {
        Server svr = servers.get(i);
        serverCombo.add(svr.getName());
      }
    }

    // select first item in list
    if (serverCombo.getItemCount() > 0) {
View Full Code Here

  public String[] getRequiredNatures() {
    return null;
  }

  protected void handleServerButtonSelected() {
    final Server newServer = getServerFromWizard();
    if (newServer != null) {
      Display.getDefault().asyncExec(new Runnable() {
        public void run() {
          servers.add(newServer);
          serverCombo.add(newServer.getName());
          serverCombo.select(serverCombo.indexOf(newServer.getName()));
          handleServerSelection();
        }
      });
    }
  }
View Full Code Here

    }
  }

  protected void handleConfigureButtonSelected() {
    int selectionIndex = serverCombo.getSelectionIndex();
    Server server = servers.get(selectionIndex);
    String serverName = server.getName();
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
        .getShell();
    NullProgressMonitor monitor = new NullProgressMonitor();
    ServerEditDialog dialog = new ServerEditDialog(shell, server);
    if (dialog.open() == Window.CANCEL) {
      monitor.setCanceled(true);
      return;
    }
    ServersManager.save();
    String newName = server.getName();
    if (!newName.equals(serverName)) {
      serverCombo.remove(selectionIndex);
      serverCombo.add(newName, selectionIndex);
      serverCombo.select(selectionIndex);
    }
View Full Code Here

      IProject project = null;
      if (projectName != null) {
        project = ResourcesPlugin.getWorkspace().getRoot()
            .getProject(projectName);
      }
      Server defaultServer = ServersManager.getDefaultServer(project);
      int nameIndex = serverCombo.indexOf(defaultServer.getName());
      if (nameIndex > -1) {
        serverCombo.select(nameIndex);
      } else {
        serverCombo.select(0);
      }
View Full Code Here

    // checks when removing or renaming a server from
    // the PHP Servers preferences page.
    try {
      String serverName = launchConfig.getAttribute(Server.NAME, ""); //$NON-NLS-1$
      if (!serverName.equals("")) { //$NON-NLS-1$
        Server server = ServersManager.getServer(serverName);
        if (server == null) {
          deleteLaunchConfiguration(launchConfig);
          ILaunchConfiguration[] allConfigurations = DebugPlugin
              .getDefault().getLaunchManager()
              .getLaunchConfigurations();
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.server.core.Server

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.