org.eclipse.wst.common.project.facet.ui_1.4.201.v201201101553

16:48:54.236 INFO  jd.cli.Main - Decompiling org.eclipse.wst.common.project.facet.ui_1.4.201.v201201101553.jar
package org.eclipse.wst.common.project.facet.ui;

import org.eclipse.jface.wizard.WizardPage;

public abstract class AbstractFacetWizardPage
  extends WizardPage
  implements IFacetWizardPage
{
  protected IWizardContext context;
  
  public AbstractFacetWizardPage(String name)
  {
    super(name);
  }
  
  public final void setWizardContext(IWizardContext context)
  {
    this.context = context;
  }
  
  public void transferStateToConfig() {}
}

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

import org.eclipse.wst.common.project.facet.core.IFacetedProject;

/**
 * @deprecated
 */
public class AddRemoveFacetsWizard
  extends ModifyFacetedProjectWizard
{
  public AddRemoveFacetsWizard(IFacetedProject fproj)
  {
    super(fproj);
  }
}

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

import org.eclipse.osgi.util.NLS;

final class BasicFacetedProjectWizard$Resources
  extends NLS
{
  public static String wizardTitle;
  public static String firstPageDescription;
  
  static
  {
    initializeMessages(BasicFacetedProjectWizard.class.getName(), 
      Resources.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.BasicFacetedProjectWizard.Resources
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.ui.internal.FacetUiPlugin;

public class BasicFacetedProjectWizard
  extends ModifyFacetedProjectWizard
  implements INewWizard
{
  private IWizardPage firstPage;
  private IWorkbench workbench;
  private IStructuredSelection selection;
  
  public BasicFacetedProjectWizard()
  {
    setWindowTitle(Resources.wizardTitle);
    setDefaultPageImageDescriptor(FacetUiPlugin.getImageDescriptor("images/newprj-wizban.png"));
  }
  
  public void init(IWorkbench workbench, IStructuredSelection selection)
  {
    this.workbench = workbench;
    this.selection = selection;
  }
  
  public IWizardPage getFirstPage()
  {
    return firstPage;
  }
  
  public IWorkbench getWorkbench()
  {
    return workbench;
  }
  
  public IStructuredSelection getSelection()
  {
    return selection;
  }
  
  protected IWizardPage createFirstPage()
  {
    IWizardPage firstPage = new BasicFacetedProjectWizardFirstPage("first.page");
    firstPage.setTitle(Resources.wizardTitle);
    firstPage.setDescription(Resources.firstPageDescription);
    
    return firstPage;
  }
  
  protected String getProjectName()
  {
    return ((WizardNewProjectCreationPage)getFirstPage()).getProjectName();
  }
  
  protected IPath getProjectLocation()
  {
    IPath location = ((WizardNewProjectCreationPage)getFirstPage()).getLocationPath();
    if ((location != null) && (location.equals(ResourcesPlugin.getWorkspace().getRoot().getLocation()))) {
      location = null;
    }
    return location;
  }
  
  public void addPages()
  {
    firstPage = createFirstPage();
    addPage(firstPage);
    super.addPages();
  }
  
  public IWizardPage[] getPages()
  {
    IWizardPage[] base = super.getPages();
    IWizardPage[] pages = new IWizardPage[base.length + 1];
    
    pages[0] = firstPage;
    System.arraycopy(base, 0, pages, 1, base.length);
    
    return pages;
  }
  
  public IWizardPage getNextPage(IWizardPage page)
  {
    if (page == firstPage)
    {
      IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
      fpjwc.setProjectName(getProjectName());
      fpjwc.setProjectLocation(getProjectLocation());
    }
    return super.getNextPage(page);
  }
  
  public boolean canFinish()
  {
    return (firstPage.isPageComplete()) && (super.canFinish());
  }
  
  public boolean performFinish()
  {
    super.performFinish();
    if ((firstPage instanceof WizardNewProjectCreationPage))
    {
      IProject project = getFacetedProjectWorkingCopy().getProject();
      WizardNewProjectCreationPage mainPage = (WizardNewProjectCreationPage)firstPage;
      IWorkingSet[] workingSets = mainPage.getSelectedWorkingSets();
      getWorkbench().getWorkingSetManager().addToWorkingSets(project, workingSets);
    }
    return true;
  }
  
  private static final class Resources
    extends NLS
  {
    public static String wizardTitle;
    public static String firstPageDescription;
    
    static
    {
      initializeMessages(BasicFacetedProjectWizard.class.getName(), 
        Resources.class);
    }
  }
}

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

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;

public class BasicFacetedProjectWizardFirstPage
  extends WizardNewProjectCreationPage
{
  public BasicFacetedProjectWizardFirstPage(String pageName)
  {
    super(pageName);
  }
  
  public void createControl(Composite parent)
  {
    super.createControl(parent);
    
    Composite composite = (Composite)getControl();
    
    createWorkingSetGroup(composite, ((BasicFacetedProjectWizard)getWizard()).getSelection(), 
      new String[] { "org.eclipse.ui.resourceWorkingSetPage" });
    
    Dialog.applyDialogFont(composite);
  }
}

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

public final class FacetUiHelpContextIds
{
  public static final String FACETS_SELECTION_PAGE = "org.eclipse.wst.common.project.facet.ui.facetsSelectionPage";
}

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

import org.eclipse.osgi.util.NLS;

final class FacetedProjectWizard$Resources
  extends NLS
{
  public static String newPrefix;
  
  static
  {
    initializeMessages(FacetedProjectWizard.class.getName(), 
      Resources.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.FacetedProjectWizard.Resources
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IPreset;

public abstract class FacetedProjectWizard
  extends ModifyFacetedProjectWizard
  implements INewWizard
{
  private final IFacetedProjectTemplate template;
  private WizardNewProjectCreationPage firstPage;
  
  public FacetedProjectWizard()
  {
    template = getTemplate();
    
    IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
    fpjwc.setSelectedPreset(template.getInitialPreset().getId());
    fpjwc.setFixedProjectFacets(template.getFixedProjectFacets());
    
    setWindowTitle(Resources.newPrefix + template.getLabel());
    
    ImageDescriptor defImageDescriptor = getDefaultPageImageDescriptor();
    if (defImageDescriptor != null) {
      setDefaultPageImageDescriptor(defImageDescriptor);
    }
  }
  
  public void init(IWorkbench workbench, IStructuredSelection selection) {}
  
  public void addPages()
  {
    firstPage = new WizardNewProjectCreationPage("first.page");
    firstPage.setTitle(template.getLabel());
    firstPage.setDescription(getPageDescription());
    
    addPage(firstPage);
    
    super.addPages();
  }
  
  public boolean canFinish()
  {
    return (firstPage.isPageComplete()) && (super.canFinish());
  }
  
  public IWizardPage[] getPages()
  {
    IWizardPage[] base = super.getPages();
    IWizardPage[] pages = new IWizardPage[base.length + 1];
    
    pages[0] = firstPage;
    System.arraycopy(base, 0, pages, 1, base.length);
    
    return pages;
  }
  
  public IWizardPage getNextPage(IWizardPage page)
  {
    if (page == firstPage)
    {
      IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
      fpjwc.setProjectName(firstPage.getProjectName());
      fpjwc.setProjectLocation(firstPage.useDefaults() ? null : firstPage.getLocationPath());
    }
    return super.getNextPage(page);
  }
  
  protected abstract IFacetedProjectTemplate getTemplate();
  
  protected abstract String getPageDescription();
  
  protected abstract ImageDescriptor getDefaultPageImageDescriptor();
  
  private static final class Resources
    extends NLS
  {
    public static String newPrefix;
    
    static
    {
      initializeMessages(FacetedProjectWizard.class.getName(), 
        Resources.class);
    }
  }
}

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

import org.eclipse.jface.resource.ImageDescriptor;

public abstract interface IDecorationsProvider
{
  public abstract ImageDescriptor getIcon();
}

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

import org.eclipse.jface.wizard.IWizardPage;

public abstract interface IFacetWizardPage
  extends IWizardPage
{
  public abstract void setWizardContext(IWizardContext paramIWizardContext);
  
  public abstract void setConfig(Object paramObject);
  
  public abstract void transferStateToConfig();
}

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

public abstract interface IRuntimeComponentLabelProvider
{
  public abstract String getLabel();
}

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

import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action.Type;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;

public abstract interface IWizardContext
{
  public abstract String getProjectName();
  
  public abstract Set getSelectedProjectFacets();
  
  public abstract boolean isProjectFacetSelected(IProjectFacetVersion paramIProjectFacetVersion);
  
  public abstract Set getActions();
  
  public abstract IFacetedProject.Action getAction(IFacetedProject.Action.Type paramType, IProjectFacetVersion paramIProjectFacetVersion);
  
  public abstract Object getConfig(IProjectFacetVersion paramIProjectFacetVersion, IFacetedProject.Action.Type paramType, String paramString)
    throws CoreException;
}

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

class ModifyFacetedProjectWizard$1$1
  implements Runnable
{
  ModifyFacetedProjectWizard$1$1(ModifyFacetedProjectWizard.1 param1) {}
  
  public void run()
  {
    ModifyFacetedProjectWizard.access$0(ModifyFacetedProjectWizard.1.access$0(this$1));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.1.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import org.eclipse.swt.widgets.Display;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;

class ModifyFacetedProjectWizard$1
  implements IFacetedProjectListener
{
  ModifyFacetedProjectWizard$1(ModifyFacetedProjectWizard paramModifyFacetedProjectWizard) {}
  
  public void handleEvent(IFacetedProjectEvent event)
  {
    Runnable runnable = new Runnable()
    {
      public void run()
      {
        ModifyFacetedProjectWizard.access$0(this$0);
      }
    };
    Display.getDefault().asyncExec(runnable);
  }
}

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

import org.eclipse.wst.common.project.facet.core.ICategory;

class ModifyFacetedProjectWizard$10
  implements Runnable
{
  ModifyFacetedProjectWizard$10(ModifyFacetedProjectWizard paramModifyFacetedProjectWizard, ICategory paramICategory, boolean paramBoolean) {}
  
  public void run()
  {
    this$0.setCategoryExpandedState(val$category, val$expanded);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.10
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;

class ModifyFacetedProjectWizard$2
  implements Runnable
{
  ModifyFacetedProjectWizard$2(ModifyFacetedProjectWizard paramModifyFacetedProjectWizard, IFacetedProjectListener paramIFacetedProjectListener) {}
  
  public void run()
  {
    ModifyFacetedProjectWizard.access$1(this$0).removeListener(val$listener);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

class ModifyFacetedProjectWizard$3
  implements IWorkspaceRunnable
{
  ModifyFacetedProjectWizard$3(ModifyFacetedProjectWizard paramModifyFacetedProjectWizard) {}
  
  public void run(IProgressMonitor monitor)
    throws CoreException
  {
    this$0.performFinish(monitor);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

class ModifyFacetedProjectWizard$4
  implements IRunnableWithProgress
{
  ModifyFacetedProjectWizard$4(ModifyFacetedProjectWizard paramModifyFacetedProjectWizard, IWorkspaceRunnable paramIWorkspaceRunnable) {}
  
  public void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    try
    {
      IWorkspace ws = ResourcesPlugin.getWorkspace();
      ws.run(val$wr, ws.getRoot(), 1, monitor);
    }
    catch (CoreException e)
    {
      throw new InvocationTargetException(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.util.Comparator;
import org.eclipse.wst.common.project.facet.core.IPreset;

class ModifyFacetedProjectWizard$5$1$1
  implements Comparator<IPreset>
{
  ModifyFacetedProjectWizard$5$1$1(ModifyFacetedProjectWizard.5.1 param1) {}
  
  public int compare(IPreset p1, IPreset p2)
  {
    if (p1 == p2) {
      return 0;
    }
    return p1.getLabel().compareTo(p2.getLabel());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.5.1.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.util.IFilter;

class ModifyFacetedProjectWizard$5$1
  implements Runnable
{
  ModifyFacetedProjectWizard$5$1(ModifyFacetedProjectWizard.5 param5, Combo paramCombo, List paramList, IFilter paramIFilter, IFacetedProjectWorkingCopy paramIFacetedProjectWorkingCopy) {}
  
  public void run()
  {
    if (val$combo.isDisposed()) {
      return;
    }
    synchronized (val$sortedPresets)
    {
      val$sortedPresets.clear();
      if (val$filter != null) {
        for (IPreset preset : val$fpjwc.getAvailablePresets()) {
          if (val$filter.check(preset)) {
            val$sortedPresets.add(preset);
          }
        }
      } else {
        val$sortedPresets.addAll(val$fpjwc.getAvailablePresets());
      }
      Collections.sort(
      
        val$sortedPresets, 
        new Comparator()
        {
          public int compare(IPreset p1, IPreset p2)
          {
            if (p1 == p2) {
              return 0;
            }
            return p1.getLabel().compareTo(p2.getLabel());
          }
        });
      IPreset selectedPreset = val$fpjwc.getSelectedPreset();
      
      val$combo.removeAll();
      val$combo.add(ModifyFacetedProjectWizard.Resources.customPreset);
      if (selectedPreset == null) {
        val$combo.select(0);
      }
      for (IPreset preset : val$sortedPresets)
      {
        val$combo.add(preset.getLabel());
        if ((selectedPreset != null) && 
          (preset.getId().equals(selectedPreset.getId()))) {
          val$combo.select(val$combo.getItemCount() - 1);
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.5.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.util.IFilter;

class ModifyFacetedProjectWizard$5
  implements IFacetedProjectListener
{
  ModifyFacetedProjectWizard$5(Combo paramCombo, List paramList, IFilter paramIFilter, IFacetedProjectWorkingCopy paramIFacetedProjectWorkingCopy) {}
  
  public void handleEvent(IFacetedProjectEvent event)
  {
    Runnable runnable = new Runnable()
    {
      public void run()
      {
        if (val$combo.isDisposed()) {
          return;
        }
        synchronized (val$sortedPresets)
        {
          val$sortedPresets.clear();
          if (val$filter != null) {
            for (IPreset preset : val$fpjwc.getAvailablePresets()) {
              if (val$filter.check(preset)) {
                val$sortedPresets.add(preset);
              }
            }
          } else {
            val$sortedPresets.addAll(val$fpjwc.getAvailablePresets());
          }
          Collections.sort(
          
            val$sortedPresets, 
            new Comparator()
            {
              public int compare(IPreset p1, IPreset p2)
              {
                if (p1 == p2) {
                  return 0;
                }
                return p1.getLabel().compareTo(p2.getLabel());
              }
            });
          IPreset selectedPreset = val$fpjwc.getSelectedPreset();
          
          val$combo.removeAll();
          val$combo.add(ModifyFacetedProjectWizard.Resources.customPreset);
          if (selectedPreset == null) {
            val$combo.select(0);
          }
          for (IPreset preset : val$sortedPresets)
          {
            val$combo.add(preset.getLabel());
            if ((selectedPreset != null) && 
              (preset.getId().equals(selectedPreset.getId()))) {
              val$combo.select(val$combo.getItemCount() - 1);
            }
          }
        }
      }
    };
    Display.getDefault().asyncExec(runnable);
  }
}

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

import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.util.IFilter.IFilterEvent;
import org.eclipse.wst.common.project.facet.core.util.IFilter.IFilterListener;

class ModifyFacetedProjectWizard$6
  implements IFilter.IFilterListener<IPreset>
{
  ModifyFacetedProjectWizard$6(IFacetedProjectListener paramIFacetedProjectListener) {}
  
  public void handleEvent(IFilter.IFilterEvent<IPreset> event)
  {
    val$availablePresetsChangedListener.handleEvent(null);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.6
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.util.List;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IPreset;

class ModifyFacetedProjectWizard$7$1
  implements Runnable
{
  ModifyFacetedProjectWizard$7$1(ModifyFacetedProjectWizard.7 param7, List paramList, IFacetedProjectWorkingCopy paramIFacetedProjectWorkingCopy, Combo paramCombo) {}
  
  public void run()
  {
    synchronized (val$sortedPresets)
    {
      IPreset preset = val$fpjwc.getSelectedPreset();
      int index;
      int index;
      if (preset == null) {
        index = -1;
      } else {
        index = val$sortedPresets.indexOf(preset);
      }
      val$combo.select(index + 1);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.7.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.util.List;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;

class ModifyFacetedProjectWizard$7
  implements IFacetedProjectListener
{
  ModifyFacetedProjectWizard$7(List paramList, IFacetedProjectWorkingCopy paramIFacetedProjectWorkingCopy, Combo paramCombo) {}
  
  public void handleEvent(IFacetedProjectEvent event)
  {
    Runnable runnable = new Runnable()
    {
      public void run()
      {
        synchronized (val$sortedPresets)
        {
          IPreset preset = val$fpjwc.getSelectedPreset();
          int index;
          int index;
          if (preset == null) {
            index = -1;
          } else {
            index = val$sortedPresets.indexOf(preset);
          }
          val$combo.select(index + 1);
        }
      }
    };
    Display.getDefault().asyncExec(runnable);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.7
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.util.List;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IPreset;

class ModifyFacetedProjectWizard$8
  extends SelectionAdapter
{
  ModifyFacetedProjectWizard$8(List paramList, Combo paramCombo, IFacetedProjectWorkingCopy paramIFacetedProjectWorkingCopy) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    synchronized (val$sortedPresets)
    {
      int selection = val$combo.getSelectionIndex();
      String presetId;
      String presetId;
      if (selection == 0) {
        presetId = null;
      } else {
        presetId = ((IPreset)val$sortedPresets.get(selection - 1)).getId();
      }
      val$fpjwc.setSelectedPreset(presetId);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.8
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;

class ModifyFacetedProjectWizard$9
  implements DisposeListener
{
  ModifyFacetedProjectWizard$9(IFacetedProjectWorkingCopy paramIFacetedProjectWorkingCopy, IFacetedProjectListener paramIFacetedProjectListener1, IFacetedProjectListener paramIFacetedProjectListener2) {}
  
  public void widgetDisposed(DisposeEvent event)
  {
    val$fpjwc.removeListener(val$availablePresetsChangedListener);
    val$fpjwc.removeListener(val$selectedPresetChangedListener);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.9
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.util.List;
import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;

final class ModifyFacetedProjectWizard$FacetPages
{
  public IFacetedProject.Action action;
  public List<IFacetWizardPage> pages;
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.FacetPages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import org.eclipse.osgi.util.NLS;

final class ModifyFacetedProjectWizard$Resources
  extends NLS
{
  public static String wizardTitle;
  public static String errDlgTitle;
  public static String customPreset;
  
  static
  {
    initializeMessages(ModifyFacetedProjectWizard.class.getName(), 
      Resources.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.Resources
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.util.Set;
import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action.Type;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;

final class ModifyFacetedProjectWizard$WizardContext
  implements IWizardContext
{
  private ModifyFacetedProjectWizard$WizardContext(ModifyFacetedProjectWizard paramModifyFacetedProjectWizard) {}
  
  public String getProjectName()
  {
    return this$0.getFacetedProjectWorkingCopy().getProjectName();
  }
  
  public Set<IProjectFacetVersion> getSelectedProjectFacets()
  {
    return this$0.getFacetedProjectWorkingCopy().getProjectFacets();
  }
  
  public boolean isProjectFacetSelected(IProjectFacetVersion fv)
  {
    return getSelectedProjectFacets().contains(fv);
  }
  
  public Set<IFacetedProject.Action> getActions()
  {
    return this$0.getFacetedProjectWorkingCopy().getProjectFacetActions();
  }
  
  public IFacetedProject.Action getAction(IFacetedProject.Action.Type type, IProjectFacetVersion f)
  {
    for (IFacetedProject.Action action : getActions()) {
      if ((action.getType() == type) && (action.getProjectFacetVersion() == f)) {
        return action;
      }
    }
    return null;
  }
  
  public Object getConfig(IProjectFacetVersion fv, IFacetedProject.Action.Type type, String pjname)
  {
    IFacetedProject.Action action = getAction(type, fv);
    return action != null ? action.getConfig() : null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.WizardContext
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.project.facet.ui;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFrameworkException;
import org.eclipse.wst.common.project.facet.core.IActionDefinition;
import org.eclipse.wst.common.project.facet.core.ICategory;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action.Type;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent.Type;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.util.IFilter;
import org.eclipse.wst.common.project.facet.core.util.IFilter.IFilterEvent;
import org.eclipse.wst.common.project.facet.core.util.IFilter.IFilterEvent.Type;
import org.eclipse.wst.common.project.facet.core.util.IFilter.IFilterListener;
import org.eclipse.wst.common.project.facet.ui.internal.FacetUiPlugin;
import org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPage;
import org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPanel;

public class ModifyFacetedProjectWizard
  extends Wizard
{
  private IFacetedProjectWorkingCopy fpjwc;
  private final WizardContext context = new WizardContext(null);
  private boolean showFacetsSelectionPage;
  private FacetsSelectionPage facetsSelectionPage;
  private FacetPages[] facetPages = new FacetPages[0];
  private Composite pageContainer;
  private final List<IWizardPage> pagesToDispose = new ArrayList();
  private final List<Runnable> delayedActions;
  private final List<Runnable> onDisposeActions;
  private final boolean disposeWorkingCopy;
  
  public ModifyFacetedProjectWizard()
  {
    this(null);
  }
  
  public ModifyFacetedProjectWizard(IFacetedProject fproj)
  {
    this(fproj == null ? FacetedProjectFramework.createNewProject() : fproj.createWorkingCopy(), true);
  }
  
  public ModifyFacetedProjectWizard(IFacetedProjectWorkingCopy fpjwc)
  {
    this(fpjwc, false);
  }
  
  private ModifyFacetedProjectWizard(IFacetedProjectWorkingCopy fpjwc, boolean disposeWorkingCopy)
  {
    try
    {
      this.fpjwc = fpjwc;
      delayedActions = new ArrayList();
      onDisposeActions = new ArrayList();
      this.disposeWorkingCopy = disposeWorkingCopy;
      facetsSelectionPage = null;
      showFacetsSelectionPage = true;
      
      setNeedsProgressMonitor(true);
      setForcePreviousAndNextButtons(true);
      setWindowTitle(Resources.wizardTitle);
    }
    catch (RuntimeException e)
    {
      FacetUiPlugin.log(e);
      throw e;
    }
  }
  
  public final IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy()
  {
    return fpjwc;
  }
  
  public void setFacetedProjectWorkingCopy(IFacetedProjectWorkingCopy fpjwc)
  {
    this.fpjwc = fpjwc;
  }
  
  public final IFacetedProject getFacetedProject()
  {
    IFacetedProject fproj = fpjwc.getFacetedProject();
    if (fproj == null)
    {
      String projectName = fpjwc.getProjectName();
      if (projectName != null)
      {
        IProject proj = 
          ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
        try
        {
          fproj = ProjectFacetsManager.create(proj);
        }
        catch (CoreException e)
        {
          FacetUiPlugin.log(e);
        }
      }
    }
    return fproj;
  }
  
  public void addPages()
  {
    final IFacetedProjectListener listener = new IFacetedProjectListener()
    {
      public void handleEvent(IFacetedProjectEvent event)
      {
        Runnable runnable = new Runnable()
        {
          public void run()
          {
            ModifyFacetedProjectWizard.this.handleSelectedFacetsChangedEvent();
          }
        };
        Display.getDefault().asyncExec(runnable);
      }
    };
    fpjwc.addListener(listener, new IFacetedProjectEvent.Type[] { IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED });
    
    onDisposeActions.add(
    
      new Runnable()
      {
        public void run()
        {
          fpjwc.removeListener(listener);
        }
      });
    if (getShowFacetsSelectionPage())
    {
      facetsSelectionPage = new FacetsSelectionPage(getBaseFacets(), fpjwc);
      addPage(facetsSelectionPage);
    }
  }
  
  public int getPageCount()
  {
    return getPages().length;
  }
  
  public IWizardPage[] getPages()
  {
    List<IWizardPage> list = new ArrayList();
    if (facetsSelectionPage != null) {
      list.add(facetsSelectionPage);
    }
    for (int i = 0; i < facetPages.length; i++) {
      list.addAll(facetPages[i].pages);
    }
    return (IWizardPage[])list.toArray(new IWizardPage[list.size()]);
  }
  
  public IWizardPage getPage(String pageName)
  {
    IWizardPage[] pages = getPages();
    for (int i = 0; i < pages.length; i++)
    {
      IWizardPage page = pages[i];
      if (page.getName().equals(pageName)) {
        return page;
      }
    }
    return null;
  }
  
  public IWizardPage getStartingPage()
  {
    return getPages()[0];
  }
  
  public IWizardPage getNextPage(IWizardPage page)
  {
    IWizardPage[] pages = getPages();
    
    int pos = -1;
    for (int i = 0; i < pages.length; i++) {
      if (pages[i] == page) {
        pos = i;
      }
    }
    if (pos == pages.length - 1) {
      return null;
    }
    return pages[(pos + 1)];
  }
  
  public IWizardPage getPreviousPage(IWizardPage page)
  {
    IWizardPage[] pages = getPages();
    
    int pos = -1;
    for (int i = 0; i < pages.length; i++) {
      if (pages[i] == page) {
        pos = i;
      }
    }
    if (pos == 0) {
      return null;
    }
    return pages[(pos - 1)];
  }
  
  public boolean canFinish()
  {
    if ((facetsSelectionPage != null) && (!facetsSelectionPage.isPageComplete())) {
      return false;
    }
    IWizardPage[] pages = getPages();
    for (int i = 0; i < pages.length; i++) {
      if (!pages[i].isPageComplete()) {
        return false;
      }
    }
    return true;
  }
  
  public void createPageControls(Composite container)
  {
    super.createPageControls(container);
    pageContainer = container;
    handleSelectedFacetsChangedEvent();
    executeDelayedActions();
  }
  
  public boolean performFinish()
  {
    for (int i = 0; i < facetPages.length; i++) {
      for (IFacetWizardPage fp : facetPages[i].pages) {
        fp.transferStateToConfig();
      }
    }
    final IWorkspaceRunnable wr = new IWorkspaceRunnable()
    {
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        performFinish(monitor);
      }
    };
    IRunnableWithProgress op = new IRunnableWithProgress()
    {
      public void run(IProgressMonitor monitor)
        throws InvocationTargetException, InterruptedException
      {
        try
        {
          IWorkspace ws = ResourcesPlugin.getWorkspace();
          ws.run(wr, ws.getRoot(), 1, monitor);
        }
        catch (CoreException e)
        {
          throw new InvocationTargetException(e);
        }
      }
    };
    try
    {
      getContainer().run(true, false, op);
    }
    catch (InterruptedException localInterruptedException)
    {
      return false;
    }
    catch (InvocationTargetException e)
    {
      Throwable te = e.getTargetException();
      if ((te instanceof CoreException))
      {
        IStatus st = ((CoreException)te).getStatus();
        String msg = st.getMessage();
        if ((!(te instanceof FacetedProjectFrameworkException)) || 
          (!((FacetedProjectFrameworkException)te).isExpected())) {
          FacetUiPlugin.log(st);
        }
        Throwable cause = st.getException();
        if ((cause instanceof CoreException)) {
          st = ((CoreException)cause).getStatus();
        }
        ErrorDialog.openError(getShell(), Resources.errDlgTitle, msg, st);
      }
      else
      {
        throw new RuntimeException(e.getTargetException());
      }
    }
    return true;
  }
  
  protected void performFinish(IProgressMonitor monitor)
    throws CoreException
  {
    fpjwc.commitChanges(monitor);
 
1 2 3 4 5 6 7 8 9 10 11

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-2019. Infinite Loop Ltd