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

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


  protected Server getServerFromWizard() {
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
        .getShell();
    NullProgressMonitor monitor = new NullProgressMonitor();
    Server theServer = null;

    ServerWizard wizard = new ServerWizard();
    ClosableWizardDialog dialog = new ClosableWizardDialog(shell, wizard);
    if (dialog.open() == Window.CANCEL) {
      monitor.setCanceled(true);
View Full Code Here


    if (server == null) {
      return;
    }

    ServersManager manager = getInstance();
    Server oldValue = ServersManager.getServer(server);
    if (server != oldValue) {
      manager.servers.remove(oldValue.getName());
      oldValue.removePropertyChangeListener(manager);
      ServerManagerEvent event = new ServerManagerEvent(
          ServerManagerEvent.MANAGER_EVENT_REMOVED, oldValue);
      manager.fireEvent(event);
    }
    oldValue = (Server) manager.servers.put(server.getName(), server);
    if (oldValue != null) {
      oldValue.removePropertyChangeListener(manager);
      ServerManagerEvent event = new ServerManagerEvent(
          ServerManagerEvent.MANAGER_EVENT_REMOVED, oldValue);
      manager.fireEvent(event);
    } else {
View Full Code Here

    // Do it the long way...
    // Check if the removed server is the workspace default, and if so,
    // replace the default to the
    // first in the list.
    ServersManager manager = ServersManager.getInstance();
    Server removedServer = (Server) manager.servers.remove(serverName);
    Server workspaceDefault = getDefaultServer(null);
    // if (workspaceDefault == null) {
    // // Should not happen
    // Logger.log(IStatus.ERROR,
    // "There is no defined default server for the workspace.");
    // return null;
View Full Code Here

  public static Server getServer(Server oldServer) {
    ServersManager manager = getInstance();
    for (Iterator iterator = manager.servers.values().iterator(); iterator
        .hasNext();) {
      Server server = (Server) iterator.next();
      if (server.getBaseURL().equals(oldServer.getBaseURL())) {
        return server;
      }
    }
    return oldServer;
  }
View Full Code Here

   * @return
   */
  public static Server getDefaultServer(IProject project) {
    ServersManager manager = getInstance();
    // First, try to get it from the memory.
    Server server = (Server) manager.defaultServersMap.get(project);
    if (project != null) {
      // In case that the project is not null, check that we have
      // project-specific settings for it.
      // Otherwise, map it to the workspace default server.
      IScopeContext[] preferenceScopes = createPreferenceScopes(project);
View Full Code Here

  public static void setDefaultServer(IProject project, Server server) {
    ServersManager manager = getInstance();
    // Get the default server for the given project.
    // In case that we need to set a new server for the project, make sure
    // we save it as well.
    Server defaultProjectServer = (Server) manager.defaultServersMap
        .get(project);
    if (server != defaultProjectServer) {
      manager.defaultServersMap.put(project, server);
      manager.innerSaveDefaultServer(project, server);
    }
View Full Code Here

   * @param serverName
   *            A default server name for the given project.
   */
  public static void setDefaultServer(IProject project, String serverName) {
    ServersManager manager = getInstance();
    Server server = (Server) manager.servers.get(serverName);
    setDefaultServer(project, server);
  }
View Full Code Here

   * @return
   * @throws MalformedURLException
   */
  public static Server createServer(String name, String baseURL)
      throws MalformedURLException {
    Server server = new Server(name, "localhost", baseURL, ""); //$NON-NLS-1$ //$NON-NLS-2$
    server = ServersManager.getServer(server);
    addServer(server);
    return server;
  }
View Full Code Here

    // servers hash (map name to Server instance).
    HashMap[] serversConfigs = XMLPreferencesReader.read(Activator
        .getDefault().getPluginPreferences(), SERVERS_PREFERENCES_KEY);
    // Then we create the servers from their configurations...
    for (HashMap serverMap : serversConfigs) {
      Server server = new Server();
      server.restoreFromMap(serverMap);
      String serverName = server.getName();
      servers.put(serverName, server);
      // Register the manager as a Server lister to get nofitications
      // about attribute changes.
      server.addPropertyChangeListener(this);
    }
  }
View Full Code Here

   * @seejava.beans.PropertyChangeListener#propertyChange(java.beans.
   * PropertyChangeEvent)
   */
  public void propertyChange(PropertyChangeEvent evt) {
    // Listen to any attribute change in the Servers
    Server server = (Server) evt.getSource();
    String oldValue = (String) evt.getOldValue();
    String newValue = (String) evt.getNewValue();
    ServerManagerEvent event = new ServerManagerEvent(
        ServerManagerEvent.MANAGER_EVENT_MODIFIED, server,
        evt.getPropertyName(), oldValue, newValue);
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.