org.eclipse.wst.server.ui_1.3.0.v20120210_1439

16:49:24.598 INFO  jd.cli.Main - Decompiling org.eclipse.wst.server.ui_1.3.0.v20120210_1439.jar
package org.eclipse.wst.server.ui;

import java.util.Map;

public abstract interface AbstractUIControl$IUIControlListener
{
  public abstract void handleUIControlMapChanged(Map<String, AbstractUIControl.UIControlEntry> paramMap);
  
  public abstract String getControlStringValue(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.AbstractUIControl.IUIControlListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

public class AbstractUIControl$UIControlEntry
{
  private boolean isEnabled;
  private String newTextValue;
  
  public AbstractUIControl$UIControlEntry(AbstractUIControl paramAbstractUIControl, boolean curIsEnabled, String curNewTextValue)
  {
    isEnabled = curIsEnabled;
    newTextValue = curNewTextValue;
  }
  
  public String getNewTextValue()
  {
    return newTextValue;
  }
  
  public boolean isEnabled()
  {
    return isEnabled;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.AbstractUIControl.UIControlEntry
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

import java.beans.PropertyChangeEvent;
import java.util.HashMap;
import java.util.Map;

public abstract class AbstractUIControl
{
  public Map<String, UIControlEntry> controlMap = new HashMap();
  public IUIControlListener controlListener;
  public static final String PROP_HOSTNAME = "PROP_HOSTNAME";
  public static final String PROP_SERVER_TYPE = "PROP_SERVERTYPE";
  
  public static abstract interface IUIControlListener
  {
    public abstract void handleUIControlMapChanged(Map<String, AbstractUIControl.UIControlEntry> paramMap);
    
    public abstract String getControlStringValue(String paramString);
  }
  
  public class UIControlEntry
  {
    private boolean isEnabled;
    private String newTextValue;
    
    public UIControlEntry(boolean curIsEnabled, String curNewTextValue)
    {
      isEnabled = curIsEnabled;
      newTextValue = curNewTextValue;
    }
    
    public String getNewTextValue()
    {
      return newTextValue;
    }
    
    public boolean isEnabled()
    {
      return isEnabled;
    }
  }
  
  protected void fireUIControlChangedEvent()
  {
    if (controlListener != null) {
      controlListener.handleUIControlMapChanged(controlMap);
    }
  }
  
  public abstract void handlePropertyChanged(PropertyChangeEvent paramPropertyChangeEvent);
  
  public void setUIControlListener(IUIControlListener curControlListener)
  {
    controlListener = curControlListener;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.AbstractUIControl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
import org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider;

public final class FacetRuntimeComponentLabelProvider$RuntimeLabelProvider
  implements IRuntimeComponentLabelProvider
{
  private final IRuntimeComponent rc;
  
  public FacetRuntimeComponentLabelProvider$RuntimeLabelProvider(FacetRuntimeComponentLabelProvider paramFacetRuntimeComponentLabelProvider, IRuntimeComponent rc)
  {
    this.rc = rc;
  }
  
  public String getLabel()
  {
    return rc.getProperty("type");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.FacetRuntimeComponentLabelProvider.RuntimeLabelProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
import org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider;

public class FacetRuntimeComponentLabelProvider
  implements IAdapterFactory
{
  private static final Class[] ADAPTER_TYPES = { IRuntimeComponentLabelProvider.class };
  
  public final class RuntimeLabelProvider
    implements IRuntimeComponentLabelProvider
  {
    private final IRuntimeComponent rc;
    
    public RuntimeLabelProvider(IRuntimeComponent rc)
    {
      this.rc = rc;
    }
    
    public String getLabel()
    {
      return rc.getProperty("type");
    }
  }
  
  public Object getAdapter(Object adaptable, Class adapterType)
  {
    IRuntimeComponent rc = (IRuntimeComponent)adaptable;
    return new RuntimeLabelProvider(rc);
  }
  
  public Class[] getAdapterList()
  {
    return ADAPTER_TYPES;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.FacetRuntimeComponentLabelProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;

public abstract interface IServerModule
{
  public abstract IServer getServer();
  
  public abstract IModule[] getModule();
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.IServerModule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;

class ServerLaunchConfigurationTab$1
  implements SelectionListener
{
  ServerLaunchConfigurationTab$1(ServerLaunchConfigurationTab paramServerLaunchConfigurationTab) {}
  
  public void widgetDefaultSelected(SelectionEvent e)
  {
    widgetSelected(e);
  }
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.handleServerSelection();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.ServerLaunchConfigurationTab.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;

public class ServerLaunchConfigurationTab
  extends AbstractLaunchConfigurationTab
{
  private static final String READ_ONLY = "read-only";
  private String[] serverTypeIds;
  private Combo serverCombo;
  private Label runtimeLabel;
  private Label hostname;
  private IServer server;
  private List<IServer> servers;
  private ILaunchConfigurationWorkingCopy wc;
  
  public ServerLaunchConfigurationTab()
  {
    this(new String[] { "*" });
  }
  
  public ServerLaunchConfigurationTab(String[] serverTypeIds)
  {
    this.serverTypeIds = serverTypeIds;
  }
  
  public void createControl(Composite parent)
  {
    Composite composite = new Composite(parent, 0);
    GridLayout layout = new GridLayout();
    marginWidth = 5;
    marginHeight = 5;
    numColumns = 2;
    composite.setLayout(layout);
    
    Label label = new Label(composite, 64);
    label.setText(Messages.serverLaunchDescription);
    GridData data = new GridData(256);
    horizontalSpan = 2;
    grabExcessHorizontalSpace = false;
    widthHint = 300;
    label.setLayoutData(data);
    
    label = new Label(composite, 0);
    label.setText(Messages.serverLaunchServer);
    serverCombo = new Combo(composite, 2060);
    serverCombo.setLayoutData(new GridData(768));
    serverCombo.addSelectionListener(new SelectionListener()
    {
      public void widgetDefaultSelected(SelectionEvent e)
      {
        widgetSelected(e);
      }
      
      public void widgetSelected(SelectionEvent e)
      {
        handleServerSelection();
      }
    });
    PlatformUI.getWorkbench().getHelpSystem().setHelp(serverCombo, "org.eclipse.wst.server.ui.swsl0000");
    
    label = new Label(composite, 0);
    label.setText(Messages.serverLaunchRuntime);
    runtimeLabel = new Label(composite, 0);
    runtimeLabel.setLayoutData(new GridData(768));
    
    label = new Label(composite, 0);
    label.setText(Messages.serverLaunchHost);
    hostname = new Label(composite, 0);
    hostname.setLayoutData(new GridData(768));
    
    IServer[] servers2 = ServerCore.getServers();
    servers = new ArrayList();
    if (servers2 != null)
    {
      int size = servers2.length;
      for (int i = 0; i < size; i++)
      {
        IServer server2 = servers2[i];
        if ((server2.getServerType() != null) && (isSupportedServer(server2.getServerType().getId())))
        {
          serverCombo.add(server2.getName());
          servers.add(server2);
        }
      }
    }
    if (serverCombo.getItemCount() > 0) {
      serverCombo.select(0);
    }
    handleServerSelection();
    
    serverCombo.forceFocus();
    
    Dialog.applyDialogFont(composite);
    setControl(composite);
  }
  
  private boolean isSupportedServer(String serverTypeId)
  {
    if (serverTypeIds == null) {
      return true;
    }
    int size = serverTypeIds.length;
    for (int i = 0; i < size; i++) {
      if (matches(serverTypeId, serverTypeIds[i])) {
        return true;
      }
    }
    return false;
  }
  
  private static boolean matches(String a, String b)
  {
    if ((a == null) || (b == null) || ("*".equals(a)) || ("*".equals(b)) || (a.startsWith(b)) || (b.startsWith(a))) {
      return true;
    }
    return false;
  }
  
  protected void handleServerSelection()
  {
    if (servers.isEmpty()) {
      server = null;
    } else {
      server = ((IServer)servers.get(serverCombo.getSelectionIndex()));
    }
    IRuntime runtime = null;
    if (server != null)
    {
      runtime = server.getRuntime();
      hostname.setText(server.getHost());
    }
    else
    {
      hostname.setText("");
    }
    if ((runtime != null) && (server != null) && (server.getServerType() != null) && (server.getServerType().hasRuntime())) {
      runtimeLabel.setText(runtime.getName());
    } else {
      runtimeLabel.setText("");
    }
    try
    {
      if (wc != null) {
        ((Server)server).setupLaunchConfiguration(wc, new NullProgressMonitor());
      }
    }
    catch (Exception localException) {}
    if (server == null) {
      setErrorMessage(Messages.errorNoServerSelected);
    } else if (server.getServerState() != 4) {
      setErrorMessage(Messages.errorServerAlreadyRunning);
    } else {
      setErrorMessage(null);
    }
    updateLaunchConfigurationDialog();
  }
  
  public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
  {
    setErrorMessage(null);
    if (serverCombo != null)
    {
      serverCombo.setEnabled(true);
      if (serverCombo.getItemCount() > 0) {
        serverCombo.select(0);
      }
    }
    if (servers != null)
    {
      server = ((IServer)servers.get(serverCombo.getSelectionIndex()));
      if (server != null) {
        ((Server)server).setupLaunchConfiguration(configuration, null);
      }
    }
    wc = configuration;
  }
  
  public void initializeFrom(ILaunchConfiguration configuration)
  {
    serverCombo.setEnabled(true);
    
    setErrorMessage(null);
    try
    {
      String serverId = configuration.getAttribute("server-id", "");
      if ((serverId != null) && (!serverId.equals("")))
      {
        server = ServerCore.findServer(serverId);
        if (server == null)
        {
          setErrorMessage(Messages.errorInvalidServer);
          
          serverCombo.setEnabled(false);
          return;
        }
        serverCombo.setText(server.getName());
        if (server.getServerState() != 4) {
          setErrorMessage(Messages.errorServerAlreadyRunning);
        }
      }
      else if (serverCombo.getItemCount() > 0)
      {
        serverCombo.select(0);
      }
      handleServerSelection();
      if (configuration.getAttribute("read-only", false)) {
        serverCombo.setEnabled(false);
      }
    }
    catch (CoreException localCoreException) {}
  }
  
  public void performApply(ILaunchConfigurationWorkingCopy configuration)
  {
    if (server != null) {
      configuration.setAttribute("server-id", server.getId());
    } else {
      configuration.setAttribute("server-id", null);
    }
    wc = configuration;
  }
  
  public boolean isValid(ILaunchConfiguration launchConfig)
  {
    try
    {
      String id = launchConfig.getAttribute("server-id", "");
      if ((id != null) && (!id.equals("")))
      {
        IServer server2 = ServerCore.findServer(id);
        if (server2 == null) {
          return false;
        }
        if (server2.getServerState() == 4) {
          return true;
        }
      }
    }
    catch (CoreException localCoreException) {}
    return false;
  }
  
  public Image getImage()
  {
    return ImageResource.getImage("server");
  }
  
  public String getName()
  {
    return Messages.serverLaunchConfigurationTab;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.ServerLaunchConfigurationTab
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.wst.server.ui.internal.ServerLabelProvider;

public final class ServerUICore
{
  public static ILabelProvider getLabelProvider()
  {
    return new ServerLabelProvider();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.ServerUICore
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui;

import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;

public final class ServerUIUtil
{
  public static boolean showNewRuntimeWizard(Shell shell, String typeId, String versionId)
  {
    return ServerUIPlugin.showNewRuntimeWizard(shell, typeId, versionId, null);
  }
  
  public static boolean showNewRuntimeWizard(Shell shell, String typeId, String versionId, String runtimeTypeId)
  {
    return ServerUIPlugin.showNewRuntimeWizard(shell, typeId, versionId, runtimeTypeId);
  }
  
  public static boolean showNewServerWizard(Shell shell, String typeId, String versionId, String serverTypeId)
  {
    return ServerUIPlugin.showNewServerWizard(shell, typeId, versionId, serverTypeId);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.ServerUIUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.actions;

import java.util.HashMap;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;

public class RunOnServerAction
  extends Action
{
  protected RunOnServerActionDelegate delegate;
  protected HashMap<String, Object> actionProperties;
  
  public RunOnServerAction(Object object)
  {
    this(object, "run");
  }
  
  public RunOnServerAction(Object object, HashMap<String, Object> actionProperties)
  {
    this(object, "run");
    this.actionProperties = actionProperties;
    delegate.setActionProperties(actionProperties);
  }
  
  public RunOnServerAction(Object object, String launchMode)
  {
    if (actionProperties == null) {
      actionProperties = new HashMap();
    }
    if ("debug".equals(launchMode))
    {
      setText(Messages.actionDebugOnServer);
      setDisabledImageDescriptor(ImageResource.getImageDescriptor("IMG_DTOOL_CLIENT2"));
      setHoverImageDescriptor(ImageResource.getImageDescriptor("IMG_CTOOL_CLIENT2"));
      setImageDescriptor(ImageResource.getImageDescriptor("IMG_ETOOL_CLIENT2"));
    }
    else if ("profile".equals(launchMode))
    {
      setText(Messages.actionProfileOnServer);
      setDisabledImageDescriptor(ImageResource.getImageDescriptor("IMG_DTOOL_CLIENT3"));
      setHoverImageDescriptor(ImageResource.getImageDescriptor("IMG_CTOOL_CLIENT3"));
      setImageDescriptor(ImageResource.getImageDescriptor("IMG_ETOOL_CLIENT3"));
    }
    else
    {
      setText(Messages.actionRunOnServer);
      setDisabledImageDescriptor(ImageResource.getImageDescriptor("IMG_DTOOL_CLIENT"));
      setHoverImageDescriptor(ImageResource.getImageDescriptor("IMG_CTOOL_CLIENT"));
      setImageDescriptor(ImageResource.getImageDescriptor("IMG_ETOOL_CLIENT"));
    }
    delegate = new RunOnServerActionDelegate(actionProperties);
    delegate.setLaunchMode(launchMode);
    if (object != null)
    {
      StructuredSelection sel = new StructuredSelection(object);
      delegate.selectionChanged(this, sel);
    }
    else
    {
      delegate.selectionChanged(this, null);
    }
  }
  
  public void run()
  {
    delegate.run(this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.actions.RunOnServerAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.editor;

import org.eclipse.ui.IEditorInput;
import org.eclipse.wst.server.core.IServerWorkingCopy;

public abstract interface IServerEditorPartInput
  extends IEditorInput
{
  public abstract IServerWorkingCopy getServer();
  
  public abstract boolean isServerReadOnly();
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.editor.IServerEditorPartInput
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.editor;

public enum ServerEditorOverviewPageModifier$UI_LOCATION
{
  OVERVIEW,  OTHER;
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.editor.ServerEditorOverviewPageModifier.UI_LOCATION
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.editor;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.AbstractUIControl;

public abstract class ServerEditorOverviewPageModifier
  extends AbstractUIControl
{
  protected IServerWorkingCopy serverWc = null;
  public abstract void createControl(UI_LOCATION paramUI_LOCATION, Composite paramComposite);
  
  public static enum UI_LOCATION
  {
    OVERVIEW,  OTHER;
  }
  
  public void setServerWorkingCopy(IServerWorkingCopy curServerWc)
  {
    serverWc = curServerWc;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.editor.ServerEditorOverviewPageModifier
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.editor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.core.commands.operations.IUndoableOperation;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.Trace;
import org.eclipse.wst.server.ui.internal.editor.IServerEditorPageSectionFactory;
import org.eclipse.wst.server.ui.internal.editor.IServerEditorPartFactory;
import org.eclipse.wst.server.ui.internal.editor.ServerEditor;
import org.eclipse.wst.server.ui.internal.editor.ServerEditorCore;
import org.eclipse.wst.server.ui.internal.editor.ServerEditorPartInput;
import org.eclipse.wst.server.ui.internal.editor.ServerResourceCommandManager;

public abstract class ServerEditorPart
  extends EditorPart
{
  public static final int PROP_ERROR = 5;
  private String errorMessage = null;
  private Map<String, List<ServerEditorSection>> sectionToInsertionId = null;
  private List<ServerEditorSection> sections = null;
  private ServerResourceCommandManager commandManager;
  private FormToolkit toolkit;
  private IManagedForm managedForm;
  protected IServerWorkingCopy server;
  protected boolean readOnly;
  
  public void doSave(IProgressMonitor monitor)
  {
    if (monitor == null) {
      return;
    }
    List<ServerEditorSection> curSections = getSections();
    int ticks = 100;
    monitor.beginTask(Messages.savingTask, curSections.size() * ticks);
    for (ServerEditorSection section : curSections) {
      section.doSave(new SubProgressMonitor(monitor, ticks));
    }
  }
  
  public void doSaveAs()
  {
    for (ServerEditorSection section : getSections()) {
      section.doSaveAs();
    }
  }
  
  public boolean isDirty()
  {
    return false;
  }
  
  public boolean isSaveAsAllowed()
  {
    return false;
  }
  
  protected void setManagedForm(IManagedForm managedForm)
  {
    this.managedForm = managedForm;
  }
  
  protected IManagedForm getManagedForm()
  {
    return managedForm;
  }
  
  public void setErrorMessage(String error)
  {
    if ((error == null) && (errorMessage == null)) {
      return;
    }
    if ((error != null) && (error.equals(errorMessage))) {
      return;
    }
    errorMessage = error;
    super.firePropertyChange(5);
  }
  
  public void updateErrorMessage()
  {
    super.firePropertyChange(5);
  }
  
  public String getErrorMessage()
  {
    if (errorMessage == null)
    {
      Iterator iterator = getSections().iterator();
      while (iterator.hasNext())
      {
        ServerEditorSection section = (ServerEditorSection)iterator.next();
        String error = section.getErrorMessage();
        if (error != null) {
          return error;
        }
      }
    }
    return errorMessage;
  }
  
  public IStatus[] getSaveStatus()
  {
    Iterator iterator = getSections().iterator();
    List<IStatus> list = new ArrayList();
    while (iterator.hasNext())
    {
      ServerEditorSection section = (ServerEditorSection)iterator.next();
      IStatus[] status = section.getSaveStatus();
      if (status != null)
      {
        int size = status.length;
        for (int i = 0; i < size; i++) {
          if (status[i].getSeverity() != 0) {
            list.add(status[i]);
          }
        }
      }
    }
    int size = list.size();
    IStatus[] status = new IStatus[size];
    list.toArray(status);
    return status;
  }
  
  private List<ServerEditorSection> getSections()
  {
    if (sections == null)
    {
      sections = new ArrayList();
      sectionToInsertionId = new HashMap();
      if (commandManager != null)
      {
        ServerEditor serverEditor = commandManager.getServerEditor();
        Iterator iterator = ServerEditorCore.getServerEditorPageSectionFactories().iterator();
        String insertionId = null;
        while (iterator.hasNext()) {
          try
          {
            IServerEditorPageSectionFactory factory = (IServerEditorPageSectionFactory)iterator.next();
            insertionId = factory.getInsertionId();
            
            IServerEditorPartFactory pageFactory = serverEditor.getPageFactory(this);
            if (pageFactory.supportsInsertionId(insertionId))
            {
              String serverTypeId = null;
              if ((server != null) && (server.getServerType() != null)) {
                serverTypeId = server.getServerType().getId();
              }
              if ((serverTypeId != null) && (factory.supportsType(serverTypeId)) && 
                (factory.shouldCreateSection(server)))
              {
                ServerEditorSection section = factory.createSection();
                if (section != null)
                {
                  section.setServerEditorPart(this);
                  sections.add(section);
                  List<ServerEditorSection> list = null;
                  list = (List)sectionToInsertionId.get(insertionId);
                  if (list == null) {
                    list = new ArrayList();
                  }
                  list.add(section);
                  sectionToInsertionId.put(insertionId, list);
                }
              }
            }
          }
          catch (Exception e)
          {
            if (Trace.WARNING) {
              Trace.trace("/warning", "Failed to get sections " + insertionId + ": ", e);
            }
          }
        }
      }
    }
    return sections;
  }
  
  private List getSections(String insertionId)
  {
    if (insertionId == null) {
      return null;
    }
    getSections();
    List<ServerEditorSection> list = new ArrayList();
    try
    {
      List<ServerEditorSection> sections2 = (List)sectionToInsertionId.get(insertionId);
      if (sections2 != null)
      {
        Iterator<ServerEditorSection> iterator = sections2.iterator();
        while (iterator.hasNext()) {
          list.add((ServerEditorSection)iterator.next());
        }
      }
    }
    catch (Exception localException) {}
    return list;
  }
  
  public void init(IEditorSite site, IEditorInput input)
  {
    setSite(site);
    setInput(input);
    if ((input instanceof IServerEditorPartInput))
    {
      IServerEditorPartInput sepi = (IServerEditorPartInput)input;
      server = sepi.getServer();
      commandManager = ((ServerEditorPartInput)sepi).getServerCommandManager();
      readOnly = sepi.isServerReadOnly();
    }
    Iterator iterator = getSections().iterator();
    while (iterator.hasNext())
    {
      ServerEditorSection section = (ServerEditorSection)iterator.next();
      section.init(site, input);
    }
  }
  
  public void execute(IUndoableOperation operation)
  {
    commandManager.execute(operation);
  }
  
  public IServerWorkingCopy getServer()
  {
    return server;
  }
  
  public void insertSections(Composite parent, String id)
  {
    if (id == null) {
      return;
    }
    Iterator iterator = getSections(id).iterator();
    while (iterator.hasNext())
    {
      ServerEditorSection section = (ServerEditorSection)iterator.next();
      try
      {
        section.createSection(parent);
      }
      catch (RuntimeException e)
      {
        if (Trace.SEVERE) {
          Trace.trace("/severe", "Failed to insert editor section: " + id + "\n" + e.getLocalizedMessage(), e);
        }
      }
    }
  }
  
  public void dispose()
  {
    super.dispose();
    
    Iterator iterator = getSections().iterator();
    while (iterator.hasNext())
    {
      ServerEditorSection section = (ServerEditorSection)iterator.next();
      section.dispose();
    }
    if (toolkit != null)
    {
      toolkit.dispose();
      toolkit = null;
    }
    commandManager = null;
    sectionToInsertionId = null;
    sections = null;
  }
  
  protected FormToolkit getFormToolkit(Display display)
  {
    if (managedForm != null) {
      return managedForm.getToolkit();
    }
    if (toolkit == null) {
      toolkit = new FormToolkit(display);
    }
    return toolkit;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.editor.ServerEditorPart
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.editor;

import org.eclipse.core.commands.operations.IUndoableOperation;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.internal.editor.ServerEditorPartInput;
import org.eclipse.wst.server.ui.internal.editor.ServerResourceCommandManager;

public abstract class ServerEditorSection
{
  private String errorMessage = null;
  private ServerResourceCommandManager commandManager;
  private Composite parentComp;
  private ServerEditorPart editor;
  protected IServerWorkingCopy server;
  protected boolean readOnly;
  
  public void init(IEditorSite site, IEditorInput input)
  {
    if ((input instanceof IServerEditorPartInput))
    {
      IServerEditorPartInput sepi = (IServerEditorPartInput)input;
      server = sepi.getServer();
      commandManager = ((ServerEditorPartInput)sepi).getServerCommandManager();
      readOnly = sepi.isServerReadOnly();
    }
  }
  
  public void execute(IUndoableOperation operation)
  {
    commandManager.execute(operation);
  }
  
  public void createSection(Composite parent)
  {
    parentComp = parent;
  }
  
  public Shell getShell()
  {
    return parentComp.getShell();
  }
  
  public String getErrorMessage()
  {
    return errorMessage;
  }
  
  public IStatus[] getSaveStatus()
  {
    return new IStatus[] { Status.OK_STATUS };
  }
  
  public void setServerEditorPart(ServerEditorPart editor)
  {
    this.editor = editor;
  }
  
  public void setErrorMessage(String error)
  {
    if ((error == null) && (errorMessage == null)) {
      return;
    }
    if ((error != null) && (error.equals(errorMessage))) {
      return;
    }
    errorMessage = error;
    if (editor != null) {
      editor.updateErrorMessage();
    }
  }
  
  protected FormToolkit getFormToolkit(Display display)
  {
    return editor.getFormToolkit(display);
  }
  
  protected IManagedForm getManagedForm()
  {
    return editor.getManagedForm();
  }
  
  public void doSave(IProgressMonitor monitor)
  {
    monitor.worked(100);
  }
  
  public void doSaveAs() {}
  
  public void dispose() {}
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.editor.ServerEditorSection
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.internal;

public abstract interface ContextIds
{
  public static final String SELECT_SERVER_WIZARD = "org.eclipse.wst.server.ui.swsi0000";
  public static final String SELECT_SERVER_EXISTING = "org.eclipse.wst.server.ui.swsi0002";
  public static final String SELECT_SERVER_EXISTING_TABLE = "org.eclipse.wst.server.ui.swsi0004";
  public static final String SELECT_SERVER_CREATE = "org.eclipse.wst.server.ui.swsi0010";
  public static final String SELECT_SERVER_CREATE_TABLE = "org.eclipse.wst.server.ui.swsi0012";
  public static final String SELECT_SERVER_PREFERENCE = "org.eclipse.wst.server.ui.swsi0014";
  public static final String SELECT_CLIENT_WIZARD = "org.eclipse.wst.server.ui.swsc0000";
  public static final String SELECT_CLIENT = "org.eclipse.wst.server.ui.swsc0002";
  public static final String NEW_SERVER_WIZARD = "org.eclipse.wst.server.ui.swns0000";
  public static final String NEW_SERVER_TYPE = "org.eclipse.wst.server.ui.swns0006";
  public static final String SERVER_PROPERTY_PAGE = "org.eclipse.wst.server.ui.svcp0004";
  public static final String NEW_RUNTIME_WIZARD = "org.eclipse.wst.server.ui.swnr0000";
  public static final String LAUNCH_CONFIGURATION_SERVER_COMBO = "org.eclipse.wst.server.ui.swsl0000";
  public static final String SELECT_TASK_WIZARD = "org.eclipse.wst.server.ui.sstw0000";
  public static final String MODIFY_MODULES_COMPOSITE = "org.eclipse.wst.server.ui.swmm0000";
  public static final String TERMINATE_SERVER_DIALOG = "org.eclipse.wst.server.ui.sdti0000";
  public static final String DELETE_SERVER_DIALOG = "org.eclipse.wst.server.ui.svcp0002";
  public static final String PREF_GENERAL = "org.eclipse.wst.server.ui.spge0000";
  public static final String PREF_GENERAL_PUBLISH_BEFORE_START = "org.eclipse.wst.server.ui.spge0012";
  public static final String PREF_GENERAL_SHOW_ON_ACTIVITY = "org.eclipse.wst.server.ui.spge0022";
  public static final String PREF_GENERAL_SAVE_EDITORS = "org.eclipse.wst.server.ui.spge0024";
  public static final String PREF_GENERAL_LAUNCH_MODE = "org.eclipse.wst.server.ui.spge0030";
  public static final String PREF_GENERAL_LAUNCH_MODE_DEBUG = "org.eclipse.wst.server.ui.spge0031";
  public static final String PREF_GENERAL_ENABLE_BREAKPOINTS = "org.eclipse.wst.server.ui.spge0032";
  public static final String PREF_GENERAL_RESTART = "org.eclipse.wst.server.ui.spge0034";
  public static final String VIEW_SERVERS = "org.eclipse.wst.server.ui.svcp0000";
  public static final String PUBLISH_DETAILS_DIALOG = "org.eclipse.wst.server.ui.sdpd0000";
  public static final String PUBLISH_DETAILS_DIALOG_STATUS = "org.eclipse.wst.server.ui.sdpd0002";
  public static final String PUBLISH_DETAILS_DIALOG_DETAILS_BUTTON = "org.eclipse.wst.server.ui.sdpd0004";
  public static final String PUBLISH_DETAILS_DIALOG_DETAILS = "org.eclipse.wst.server.ui.sdpd0006";
  public static final String PROMPT_IRREVERSIBLE_DIALOG = "org.eclipse.wst.server.ui.sdpi0000";
  public static final String EDITOR_OVERVIEW_PAGE = "org.eclipse.wst.server.ui.seop0000";
  public static final String EDITOR_SERVER = "org.eclipse.wst.server.ui.seop0002";
  public static final String EDITOR_CONFIGURATION = "org.eclipse.wst.server.ui.seop0004";
  public static final String EDITOR_HOSTNAME = "org.eclipse.wst.server.ui.seop0006";
  public static final String EDITOR_RUNTIME = "org.eclipse.wst.server.ui.seop0008";
  public static final String EDITOR_AUTOPUBLISH_ENABLE = "org.eclipse.wst.server.ui.seop0012";
  public static final String EDITOR_AUTOPUBLISH_BUILD = "org.eclipse.wst.server.ui.seop0014";
  public static final String EDITOR_AUTOPUBLISH_DISABLE = "org.eclipse.wst.server.ui.seop0016";
  public static final String EDITOR_AUTOPUBLISH_INTERVAL = "org.eclipse.wst.server.ui.seop0018";
  public static final String EDITOR_PUBLISHTASKS_CONFIGURATION = "org.eclipse.wst.server.ui.seop0020";
  public static final String EDITOR_TIMEOUT_START = "org.eclipse.wst.server.ui.spge0026";
  public static final String EDITOR_TIMEOUT_STOP = "org.eclipse.wst.server.ui.spge0027";
  public static final String AUDIO_PREFERENCES = "org.eclipse.wst.server.ui.aupr0000";
  public static final String AUDIO_PREFERENCES_ENABLE = "org.eclipse.wst.server.ui.aupr0002";
  public static final String AUDIO_PREFERENCES_VOLUME = "org.eclipse.wst.server.ui.aupr0004";
  public static final String AUDIO_PREFERENCES_SOUNDS_TABLE = "org.eclipse.wst.server.ui.aupr0006";
  public static final String AUDIO_PREFERENCES_PLAY = "org.eclipse.wst.server.ui.aupr0008";
  public static final String AUDIO_PREFERENCES_BROWSE = "org.eclipse.wst.server.ui.aupr0010";
  public static final String AUDIO_PREFERENCES_RESET = "org.eclipse.wst.server.ui.aupr0012";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.internal.ContextIds
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.internal;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitorListener;
import org.eclipse.wst.internet.monitor.core.internal.provisional.MonitorCore;

class DefaultMonitorDelegate$1
  implements IMonitorListener
{
  DefaultMonitorDelegate$1(DefaultMonitorDelegate paramDefaultMonitorDelegate) {}
  
  public void monitorAdded(IMonitor monitor) {}
  
  public void monitorChanged(IMonitor monitor) {}
  
  public void monitorRemoved(IMonitor monitor)
  {
    if (monitor == null) {
      return;
    }
    Object monKey = null;
    Iterator iterator = this$0.monitors.keySet().iterator();
    while (iterator.hasNext())
    {
      Object key = iterator.next();
      Object value = this$0.monitors.get(key);
      if (monitor.equals(value)) {
        monKey = key;
      }
    }
    if (monKey != null) {
      this$0.monitors.remove(monKey);
    }
    if (this$0.monitors.isEmpty())
    {
      MonitorCore.removeMonitorListener(this$0.listener);
      this$0.listener = null;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.server.ui.internal.DefaultMonitorDelegate.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.server.ui.internal;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitorListener;
import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitorWorkingCopy;
import org.eclipse.wst.internet.monitor.core.internal.provisional.MonitorCore;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerPort;
import org.eclipse.wst.server.core.internal.ServerMonitorDelegate;
import org.eclipse.wst.server.core.util.SocketUtil;

public class DefaultMonitorDelegate
  extends ServerMonitorDelegate
{
  protected Map<ServerPort, IMonitor> monitors = new HashMap();
  protected IMonitorListener listener;
  
  private void addListener()
  {
    if (listener != null) {
      return;
    }
    listener = new IMonitorListener()
    {
      public void monitorAdded(IMonitor monitor) {}
      
      public void monitorChanged(IMonitor monitor) {}
      
      public void monitorRemoved(IMonitor monitor)
      {
        if (monitor == null) {
          return;
        }
        Object monKey = null;
        Iterator iterator = monitors.keySet().iterator();
        while (iterator.hasNext())
        {
          Object key = iterator.next();
          Object value = monitors.get(key);
          if (monitor.equals(value)) {
            monKey = key;
          }
        }
        if (monKey != null) {
          monitors.remove(monKey);
        }
        if (monitors.isEmpty())
        {
          MonitorCore.removeMonitorListener(listener);
          listener = null;
        }
      }
    };
    MonitorCore.addMonitorListener(listener);
  }
  
  public int startMonitoring(IServer server, ServerPort port, int monitorPort)
    throws CoreException
  {
    try
    {
      IMonitor monitor = (IMonitor)monitors.get(port);
      int mport = -1;
      if (monitor == null)
      {
        mport = monitorPort;
        if (mport == -1) {
          mport = SocketUtil.findUnusedPort(5000, 15000);
        }
        IMonitorWorkingCopy wc = MonitorCore.createMonitor();
        wc.setLocalPort(mport);
        wc.setRemoteHost(server.getHost());
        wc.setRemotePort(port.getPort());
        if ("HTTP".equals(port.getProtocol())) {
          wc.setProtocol("HTTP");
        }
        monitor = wc.save();
        addListener();
      }
      else
      {
        mport = monitor.getLocalPort();
      }
      monitor.start();
      monitors.put(port, monitor);
      return mport;
    }
    catch (Exception e)
    {
      if (Trace.SEVERE) {
        Trace.trace("/severe", "Could not start monitoring", e);
      }
      throw new CoreException(new Status(4, "org.eclipse.wst.server.ui", 0, NLS.bind(Messages.errorStartingMonitor, e.getLocalizedMessage()), null));
    }
  }
  
  public void stopMonitoring(IServer server, ServerPort port)
  {
    try
    {
      IMonitor monitor = (IMonitor)monitors.get(port);
      if (monitor != null) {
        monitor.stop();
      }
    }
    catch (Excepti
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd