org.eclipse.jst.common.project.facet.ui_1.4.200.v201008182133

16:45:41.739 INFO  jd.cli.Main - Decompiling org.eclipse.jst.common.project.facet.ui_1.4.200.v201008182133.jar
package org.eclipse.jst.common.project.facet.ui.internal;

import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;

public final class FacetedProjectFrameworkJavaExtUiPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.jst.common.project.facet.ui";
  public static final String IMG_PATH_JAVA_WIZBAN = "images/java-wizban.png";
  public static final String IMG_PATH_SOURCE_FOLDER = "images/source-folder.gif";
  public static final String IMG_PATH_WIZBAN_DOWNLOAD_LIBRARY = "images/wizban/download-library.png";
  public static final String IMG_PATH_BUTTON_DOWNLOAD = "images/buttons/download.png";
  public static final String IMG_PATH_BUTTON_MANAGE_LIBRARIES = "images/buttons/manage-libraries.gif";
  public static final String IMG_PATH_OBJECTS_LIBRARY = "images/objects/library.gif";
  private static final ILog platformLog = Platform.getLog(Platform.getBundle("org.eclipse.jst.common.project.facet.ui"));
  
  public static ImageDescriptor getImageDescriptor(String path)
  {
    return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.jst.common.project.facet.ui", path);
  }
  
  public static void log(Exception e)
  {
    String message = e.getMessage();
    log(createErrorStatus(message, e));
  }
  
  public static void log(IStatus status)
  {
    platformLog.log(status);
  }
  
  public static IStatus createErrorStatus(String message)
  {
    return createErrorStatus(message, null);
  }
  
  public static IStatus createErrorStatus(String message, Exception e)
  {
    return new Status(4, "org.eclipse.jst.common.project.facet.ui", -1, message, e);
  }
}

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

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;

class JavaFacetInstallPage$1
  implements DisposeListener
{
  JavaFacetInstallPage$1(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public void widgetDisposed(DisposeEvent e)
  {
    JavaFacetInstallPage.access$1(this$0);
  }
}

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

import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig.ChangeEvent;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wst.common.project.facet.core.util.IEventListener;
import org.eclipse.wst.common.project.facet.core.util.internal.ObjectReference;

class JavaFacetInstallPage$10
  implements IEventListener<JavaFacetInstallConfig.ChangeEvent>
{
  JavaFacetInstallPage$10(JavaFacetInstallPage paramJavaFacetInstallPage, ObjectReference paramObjectReference, JavaFacetInstallConfig paramJavaFacetInstallConfig, Text paramText) {}
  
  /* Error */
  public void handleEvent(JavaFacetInstallConfig.ChangeEvent event)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 71	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
    //   4: invokevirtual 79	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:get	()Ljava/lang/Object;
    //   7: checkcast 29	java/lang/Boolean
    //   10: invokevirtual 72	java/lang/Boolean:booleanValue	()Z
    //   13: ifeq +4 -> 17
    //   16: return
    //   17: aload_0
    //   18: getfield 71	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
    //   21: iconst_1
    //   22: invokestatic 73	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
    //   25: invokevirtual 80	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
    //   28: aload_0
    //   29: getfield 69	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:this$0	Lorg/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage;
    //   32: aload_0
    //   33: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$installConfig	Lorg/eclipse/jst/common/project/facet/core/JavaFacetInstallConfig;
    //   36: invokevirtual 75	org/eclipse/jst/common/project/facet/core/JavaFacetInstallConfig:getDefaultOutputFolder	()Lorg/eclipse/core/runtime/IPath;
    //   39: invokestatic 76	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage:access$8	(Lorg/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage;Lorg/eclipse/core/runtime/IPath;)Ljava/lang/String;
    //   42: astore_2
    //   43: aload_0
    //   44: getfield 70	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$defaultOutputFolderTextField	Lorg/eclipse/swt/widgets/Text;
    //   47: aload_2
    //   48: invokevirtual 78	org/eclipse/swt/widgets/Text:setText	(Ljava/lang/String;)V
    //   51: goto +17 -> 68
    //   54: astore_3
    //   55: aload_0
    //   56: getfield 71	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
    //   59: iconst_0
    //   60: invokestatic 73	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
    //   63: invokevirtual 80	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
    //   66: aload_3
    //   67: athrow
    //   68: aload_0
    //   69: getfield 71	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
    //   72: iconst_0
    //   73: invokestatic 73	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
    //   76: invokevirtual 80	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
    //   79: return
    // Line number table:
    //   Java source line #305	-> byte code offset #0
    //   Java source line #307	-> byte code offset #16
    //   Java source line #310	-> byte code offset #17
    //   Java source line #314	-> byte code offset #28
    //   Java source line #315	-> byte code offset #43
    //   Java source line #318	-> byte code offset #54
    //   Java source line #319	-> byte code offset #55
    //   Java source line #320	-> byte code offset #66
    //   Java source line #319	-> byte code offset #68
    //   Java source line #321	-> byte code offset #79
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	80	0	this	10
    //   0	80	1	event	JavaFacetInstallConfig.ChangeEvent
    //   42	6	2	newValue	String
    //   54	13	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   28	54	54	finally
  }
}

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;

class JavaFacetInstallPage$11
  implements IInputValidator
{
  JavaFacetInstallPage$11(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public String isValid(String newText)
  {
    IStatus status = this$0.getConfig().validateSourceFolder(newText);
    if (!status.isOK()) {
      return status.getMessage();
    }
    return null;
  }
}

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

import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;

class JavaFacetInstallPage$2
  extends AccessibleAdapter
{
  JavaFacetInstallPage$2(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public void getName(AccessibleEvent event)
  {
    if (childID == -1) {
      result = JavaFacetInstallPage.Resources.sourceFoldersAccessibilityLabel;
    }
  }
}

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

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;

class JavaFacetInstallPage$3
  implements ISelectionChangedListener
{
  JavaFacetInstallPage$3(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    JavaFacetInstallPage.access$2(this$0);
  }
}

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

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig.ChangeEvent;
import org.eclipse.wst.common.project.facet.core.util.IEventListener;

class JavaFacetInstallPage$4
  implements IEventListener<JavaFacetInstallConfig.ChangeEvent>
{
  JavaFacetInstallPage$4(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public void handleEvent(JavaFacetInstallConfig.ChangeEvent event)
  {
    JavaFacetInstallPage.access$3(this$0).refresh();
  }
}

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

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

class JavaFacetInstallPage$5
  extends SelectionAdapter
{
  JavaFacetInstallPage$5(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public void widgetSelected(SelectionEvent event)
  {
    JavaFacetInstallPage.access$4(this$0);
  }
}

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

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

class JavaFacetInstallPage$6
  extends SelectionAdapter
{
  JavaFacetInstallPage$6(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public void widgetSelected(SelectionEvent event)
  {
    JavaFacetInstallPage.access$5(this$0);
  }
}

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

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

class JavaFacetInstallPage$7
  extends SelectionAdapter
{
  JavaFacetInstallPage$7(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public void widgetSelected(SelectionEvent event)
  {
    JavaFacetInstallPage.access$6(this$0);
  }
}

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig.ChangeEvent;
import org.eclipse.wst.common.project.facet.core.util.IEventListener;

class JavaFacetInstallPage$8
  implements IEventListener<JavaFacetInstallConfig.ChangeEvent>
{
  JavaFacetInstallPage$8(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public void handleEvent(JavaFacetInstallConfig.ChangeEvent event)
  {
    IStatus status = JavaFacetInstallPage.access$7(this$0).validate();
    if (!status.isOK())
    {
      this$0.setErrorMessage(status.getMessage());
      this$0.setPageComplete(false);
    }
    else
    {
      this$0.setErrorMessage(null);
      this$0.setPageComplete(true);
    }
  }
}

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

import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wst.common.project.facet.core.util.internal.ObjectReference;

class JavaFacetInstallPage$9
  implements ModifyListener
{
  JavaFacetInstallPage$9(JavaFacetInstallPage paramJavaFacetInstallPage, ObjectReference paramObjectReference, Text paramText, JavaFacetInstallConfig paramJavaFacetInstallConfig) {}
  
  /* Error */
  public void modifyText(org.eclipse.swt.events.ModifyEvent e)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
    //   4: invokevirtual 75	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:get	()Ljava/lang/Object;
    //   7: checkcast 28	java/lang/Boolean
    //   10: invokevirtual 69	java/lang/Boolean:booleanValue	()Z
    //   13: ifeq +4 -> 17
    //   16: return
    //   17: aload_0
    //   18: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
    //   21: iconst_1
    //   22: invokestatic 70	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
    //   25: invokevirtual 76	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
    //   28: aload_0
    //   29: getfield 67	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$defaultOutputFolderTextField	Lorg/eclipse/swt/widgets/Text;
    //   32: invokevirtual 74	org/eclipse/swt/widgets/Text:getText	()Ljava/lang/String;
    //   35: astore_2
    //   36: aload_0
    //   37: getfield 65	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$installConfig	Lorg/eclipse/jst/common/project/facet/core/JavaFacetInstallConfig;
    //   40: new 30	org/eclipse/core/runtime/Path
    //   43: dup
    //   44: aload_2
    //   45: invokespecial 72	org/eclipse/core/runtime/Path:<init>	(Ljava/lang/String;)V
    //   48: invokevirtual 73	org/eclipse/jst/common/project/facet/core/JavaFacetInstallConfig:setDefaultOutputFolder	(Lorg/eclipse/core/runtime/IPath;)V
    //   51: goto +17 -> 68
    //   54: astore_3
    //   55: aload_0
    //   56: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
    //   59: iconst_0
    //   60: invokestatic 70	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
    //   63: invokevirtual 76	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
    //   66: aload_3
    //   67: athrow
    //   68: aload_0
    //   69: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
    //   72: iconst_0
    //   73: invokestatic 70	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
    //   76: invokevirtual 76	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
    //   79: return
    // Line number table:
    //   Java source line #280	-> byte code offset #0
    //   Java source line #282	-> byte code offset #16
    //   Java source line #285	-> byte code offset #17
    //   Java source line #289	-> byte code offset #28
    //   Java source line #290	-> byte code offset #36
    //   Java source line #293	-> byte code offset #54
    //   Java source line #294	-> byte code offset #55
    //   Java source line #295	-> byte code offset #66
    //   Java source line #294	-> byte code offset #68
    //   Java source line #296	-> byte code offset #79
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	80	0	this	9
    //   0	80	1	e	org.eclipse.swt.events.ModifyEvent
    //   35	10	2	newValue	String
    //   54	13	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   28	54	54	finally
  }
}

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

import org.eclipse.osgi.util.NLS;

final class JavaFacetInstallPage$Resources
  extends NLS
{
  public static String pageTitle;
  public static String pageDescription;
  public static String defaultOutputFolderLabel;
  public static String sourceFoldersLabel;
  public static String sourceFoldersAccessibilityLabel;
  public static String addFolderButton;
  public static String editButton;
  public static String removeButton;
  public static String addSourceFolderDialogTitle;
  public static String addSourceFolderDialogMessage;
  public static String editSourceFolderDialogTitle;
  public static String editSourceFolderDialogMessage;
  
  static
  {
    initializeMessages(JavaFacetInstallPage.class.getName(), Resources.class);
  }
}

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

import java.util.List;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;

final class JavaFacetInstallPage$SourceFoldersContentProvider
  implements ITreeContentProvider
{
  private JavaFacetInstallPage$SourceFoldersContentProvider(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public Object[] getElements(Object element)
  {
    return this$0.getConfig().getSourceFolders().toArray();
  }
  
  public Object[] getChildren(Object parent)
  {
    return new Object[0];
  }
  
  public Object getParent(Object element)
  {
    return null;
  }
  
  public boolean hasChildren(Object element)
  {
    return false;
  }
  
  public void dispose() {}
  
  public void inputChanged(Viewer viewer, Object oldObject, Object newObject) {}
}

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

import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;

final class JavaFacetInstallPage$SourceFoldersLabelProvider
  implements ILabelProvider
{
  private JavaFacetInstallPage$SourceFoldersLabelProvider(JavaFacetInstallPage paramJavaFacetInstallPage) {}
  
  public String getText(Object element)
  {
    return ((IPath)element).toOSString();
  }
  
  public Image getImage(Object element)
  {
    return JavaFacetInstallPage.access$0(this$0).get("source.folder");
  }
  
  public boolean isLabelProperty(Object obj, String s)
  {
    return false;
  }
  
  public void dispose() {}
  
  public void addListener(ILabelProviderListener listener) {}
  
  public void removeListener(ILabelProviderListener listener) {}
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig.ChangeEvent;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig.ChangeEvent.Type;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.accessibility.Accessible;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.wst.common.project.facet.core.util.IEventListener;
import org.eclipse.wst.common.project.facet.core.util.internal.ObjectReference;
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
import org.eclipse.wst.common.project.facet.ui.internal.util.GridLayoutUtil;

public final class JavaFacetInstallPage
  extends AbstractFacetWizardPage
{
  private static final String WIZARD_PAGE_NAME = "java.facet.install.page";
  private static final String IMG_KEY_SOURCE_FOLDER = "source.folder";
  private JavaFacetInstallConfig installConfig = null;
  private ImageRegistry imageRegistry = null;
  private Text defaultOutputFolderTextField = null;
  private TreeViewer sourceFoldersTreeViewer = null;
  private Tree sourceFoldersTree = null;
  private Button addButton = null;
  private Button editButton = null;
  private Button removeButton = null;
  
  public JavaFacetInstallPage()
  {
    super("java.facet.install.page");
    
    setTitle(Resources.pageTitle);
    setDescription(Resources.pageDescription);
    setImageDescriptor(FacetedProjectFrameworkJavaExtUiPlugin.getImageDescriptor("images/java-wizban.png"));
    
    imageRegistry = new ImageRegistry();
    imageRegistry.put("source.folder", FacetedProjectFrameworkJavaExtUiPlugin.getImageDescriptor("images/source-folder.gif"));
  }
  
  public JavaFacetInstallConfig getConfig()
  {
    return installConfig;
  }
  
  public void setConfig(Object config)
  {
    installConfig = ((JavaFacetInstallConfig)config);
  }
  
  public void createControl(Composite parent)
  {
    Composite composite = new Composite(parent, 0);
    composite.setLayoutData(GridLayoutUtil.gdfill());
    composite.setLayout(GridLayoutUtil.gl(2));
    
    composite.addDisposeListener(
    
      new DisposeListener()
      {
        public void widgetDisposed(DisposeEvent e)
        {
          JavaFacetInstallPage.this.handleDisposeEvent();
        }
      });
    Label sourceFoldersLabel = new Label(composite, 0);
    sourceFoldersLabel.setLayoutData(GridLayoutUtil.gdhspan(GridLayoutUtil.gd(), 2));
    sourceFoldersLabel.setText(Resources.sourceFoldersLabel);
    
    sourceFoldersTreeViewer = new TreeViewer(composite, 2048);
    sourceFoldersTree = sourceFoldersTreeViewer.getTree();
    sourceFoldersTree.setLayoutData(GridLayoutUtil.gdfill());
    
    sourceFoldersTree.getAccessible().addAccessibleListener(
    
      new AccessibleAdapter()
      {
        public void getName(AccessibleEvent event)
        {
          if (childID == -1) {
            result = JavaFacetInstallPage.Resources.sourceFoldersAccessibilityLabel;
          }
        }
      });
    sourceFoldersTreeViewer.setContentProvider(new SourceFoldersContentProvider(null));
    sourceFoldersTreeViewer.setLabelProvider(new SourceFoldersLabelProvider(null));
    sourceFoldersTreeViewer.setInput(new Object());
    
    sourceFoldersTreeViewer.addSelectionChangedListener(
    
      new ISelectionChangedListener()
      {
        public void selectionChanged(SelectionChangedEvent event)
        {
          JavaFacetInstallPage.this.updateButtonEnablement();
        }
      });
    installConfig.addListener(
    
      new IEventListener()
      {
        public void handleEvent(JavaFacetInstallConfig.ChangeEvent event)
        {
          sourceFoldersTreeViewer.refresh();
        }
      }, new JavaFacetInstallConfig.ChangeEvent.Type[] {
      
      JavaFacetInstallConfig.ChangeEvent.Type.SOURCE_FOLDERS_CHANGED });
    
    Composite buttons = new Composite(composite, 0);
    buttons.setLayoutData(GridLayoutUtil.gdvalign(GridLayoutUtil.gd(), 128));
    buttons.setLayout(GridLayoutUtil.glmargins(GridLayoutUtil.gl(1), 0, 0));
    
    addButton = new Button(buttons, 8);
    addButton.setText(Resources.addFolderButton);
    GridDataFactory.defaultsFor(addButton).applyTo(addButton);
    
    addButton.addSelectionListener(
    
      new SelectionAdapter()
      {
        public void widgetSelected(SelectionEvent event)
        {
          JavaFacetInstallPage.this.handleAddButtonPressed();
        }
      });
    editButton = new Button(buttons, 8);
    editButton.setText(Resources.editButton);
    GridDataFactory.defaultsFor(editButton).applyTo(editButton);
    
    editButton.addSelectionListener(
    
      new SelectionAdapter()
      {
        public void widgetSelected(SelectionEvent event)
        {
          JavaFacetInstallPage.this.handleEditButtonPressed();
        }
      });
    removeButton = new Button(buttons, 8);
    removeButton.setText(Resources.removeButton);
    GridDataFactory.defaultsFor(removeButton).applyTo(removeButton);
    
    removeButton.addSelectionListener(
    
      new SelectionAdapter()
      {
        public void widgetSelected(SelectionEvent event)
        {
          JavaFacetInstallPage.this.handleRemoveButtonPressed();
        }
      });
    updateButtonEnablement();
    
    Label defaultOutputFolderLabel = new Label(composite, 0);
    defaultOutputFolderLabel.setLayoutData(GridLayoutUtil.gdhspan(GridLayoutUtil.gd(), 2));
    defaultOutputFolderLabel.setText(Resources.defaultOutputFolderLabel);
    
    defaultOutputFolderTextField = new Text(composite, 2048);
    defaultOutputFolderTextField.setLayoutData(GridLayoutUtil.gdhspan(GridLayoutUtil.gdhfill(), 2));
    
    bindUiToModel();
    
    setControl(composite);
  }
  
  private void bindUiToModel()
  {
    bindDefaultOutputFolder();
    
    installConfig.addListener(
    
      new IEventListener()
      {
        public void handleEvent(JavaFacetInstallConfig.ChangeEvent event)
        {
          IStatus status = installConfig.validate();
          if (!status.isOK())
          {
            setErrorMessage(status.getMessage());
            setPageComplete(false);
          }
          else
          {
            setErrorMessage(null);
            setPageComplete(true);
          }
        }
      }, JavaFacetInstallConfig.ChangeEvent.Type.values());
  }
  
  private void bindDefaultOutputFolder()
  {
    final JavaFacetInstallConfig installConfig = this.installConfig;
    final Text defaultOutputFolderTextField = this.defaultOutputFolderTextField;
    
    final ObjectReference<Boolean> updating = new ObjectReference(Boolean.valueOf(false));
    
    this.defaultOutputFolderTextField.addModifyListener(
    
      new ModifyListener()
      {
        /* Error */
        public void modifyText(org.eclipse.swt.events.ModifyEvent e)
        {
          // Byte code:
          //   0: aload_0
          //   1: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
          //   4: invokevirtual 75	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:get	()Ljava/lang/Object;
          //   7: checkcast 28	java/lang/Boolean
          //   10: invokevirtual 69	java/lang/Boolean:booleanValue	()Z
          //   13: ifeq +4 -> 17
          //   16: return
          //   17: aload_0
          //   18: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
          //   21: iconst_1
          //   22: invokestatic 70	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
          //   25: invokevirtual 76	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
          //   28: aload_0
          //   29: getfield 67	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$defaultOutputFolderTextField	Lorg/eclipse/swt/widgets/Text;
          //   32: invokevirtual 74	org/eclipse/swt/widgets/Text:getText	()Ljava/lang/String;
          //   35: astore_2
          //   36: aload_0
          //   37: getfield 65	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$installConfig	Lorg/eclipse/jst/common/project/facet/core/JavaFacetInstallConfig;
          //   40: new 30	org/eclipse/core/runtime/Path
          //   43: dup
          //   44: aload_2
          //   45: invokespecial 72	org/eclipse/core/runtime/Path:<init>	(Ljava/lang/String;)V
          //   48: invokevirtual 73	org/eclipse/jst/common/project/facet/core/JavaFacetInstallConfig:setDefaultOutputFolder	(Lorg/eclipse/core/runtime/IPath;)V
          //   51: goto +17 -> 68
          //   54: astore_3
          //   55: aload_0
          //   56: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
          //   59: iconst_0
          //   60: invokestatic 70	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
          //   63: invokevirtual 76	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
          //   66: aload_3
          //   67: athrow
          //   68: aload_0
          //   69: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$9:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
          //   72: iconst_0
          //   73: invokestatic 70	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
          //   76: invokevirtual 76	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
          //   79: return
          // Line number table:
          //   Java source line #280	-> byte code offset #0
          //   Java source line #282	-> byte code offset #16
          //   Java source line #285	-> byte code offset #17
          //   Java source line #289	-> byte code offset #28
          //   Java source line #290	-> byte code offset #36
          //   Java source line #293	-> byte code offset #54
          //   Java source line #294	-> byte code offset #55
          //   Java source line #295	-> byte code offset #66
          //   Java source line #294	-> byte code offset #68
          //   Java source line #296	-> byte code offset #79
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	80	0	this	9
          //   0	80	1	e	org.eclipse.swt.events.ModifyEvent
          //   35	10	2	newValue	String
          //   54	13	3	localObject	Object
          // Exception table:
          //   from	to	target	type
          //   28	54	54	finally
        }
      });
    IEventListener<JavaFacetInstallConfig.ChangeEvent> modelEventListener = 
      new IEventListener()
      {
        /* Error */
        public void handleEvent(JavaFacetInstallConfig.ChangeEvent event)
        {
          // Byte code:
          //   0: aload_0
          //   1: getfield 71	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
          //   4: invokevirtual 79	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:get	()Ljava/lang/Object;
          //   7: checkcast 29	java/lang/Boolean
          //   10: invokevirtual 72	java/lang/Boolean:booleanValue	()Z
          //   13: ifeq +4 -> 17
          //   16: return
          //   17: aload_0
          //   18: getfield 71	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
          //   21: iconst_1
          //   22: invokestatic 73	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
          //   25: invokevirtual 80	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
          //   28: aload_0
          //   29: getfield 69	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:this$0	Lorg/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage;
          //   32: aload_0
          //   33: getfield 68	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$installConfig	Lorg/eclipse/jst/common/project/facet/core/JavaFacetInstallConfig;
          //   36: invokevirtual 75	org/eclipse/jst/common/project/facet/core/JavaFacetInstallConfig:getDefaultOutputFolder	()Lorg/eclipse/core/runtime/IPath;
          //   39: invokestatic 76	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage:access$8	(Lorg/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage;Lorg/eclipse/core/runtime/IPath;)Ljava/lang/String;
          //   42: astore_2
          //   43: aload_0
          //   44: getfield 70	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$defaultOutputFolderTextField	Lorg/eclipse/swt/widgets/Text;
          //   47: aload_2
          //   48: invokevirtual 78	org/eclipse/swt/widgets/Text:setText	(Ljava/lang/String;)V
          //   51: goto +17 -> 68
          //   54: astore_3
          //   55: aload_0
          //   56: getfield 71	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
          //   59: iconst_0
          //   60: invokestatic 73	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
          //   63: invokevirtual 80	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
          //   66: aload_3
          //   67: athrow
          //   68: aload_0
          //   69: getfield 71	org/eclipse/jst/common/project/facet/ui/internal/JavaFacetInstallPage$10:val$updating	Lorg/eclipse/wst/common/project/facet/core/util/internal/ObjectReference;
          //   72: iconst_0
          //   73: invokestatic 73	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
          //   76: invokevirtual 80	org/eclipse/wst/common/project/facet/core/util/internal/ObjectReference:set	(Ljava/lang/Object;)V
          //   79: return
          // Line number table:
          //   Java source line #305	-> byte code offset #0
          //   Java source line #307	-> byte code offset #16
          //   Java source line #310	-> byte code offset #17
          //   Java source line #314	-> byte code offset #28
          //   Java source line #315	-> byte code offset #43
          //   Java source line #318	-> byte code offset #54
          //   Java source line #319	-> byte code offset #55
          //   Java source line #320	-> byte code offset #66
          //   Java source line #319	-> byte code offset #68
          //   Java source line #321	-> byte code offset #79
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	80	0	this	10
          //   0	80	1	event	JavaFacetInstallConfig.ChangeEvent
          //   42	6	2	newValue	String
          //   54	13	3	localObject	Object
          // Exception table:
          //   from	to	target	type
          //   28	54	54	finally
        }
      };
      this.installConfig.addListener(
      
        modelEventListener, new JavaFacetInstallConfig.ChangeEvent.Type[] {
        JavaFacetInstallConfig.ChangeEvent.Type.DEFAULT_OUTPUT_FOLDER_CHANGED });
      
      modelEventListener.handleEvent(null);
    }
    
    private ImageRegistry getImageRegistry()
    {
      return imageRegistry;
    }
    
    private IPath getSelectedSourceFolder()
    {
      IStructuredSelection sel = (IStructuredSelection)sourceFoldersTreeViewer.getSelection();
      return (IPath)sel.getFirstElement();
    }
    
    private String convertToString(IPath path)
    {
      return path == null ? "" : path.toOSString();
    }
    
    private void updateButtonEnablement()
    {
      boolean haveSelection = !sourceFoldersTreeViewer.getSelection().isEmpty();
      
      editButton.setEnabled(haveSelection);
      removeButton.setEnabled(haveSelection);
    }
    
    private void handleAddButtonPressed()
    {
      InputDialog dialog = 
        new InputDialog(addButton.getShell(), Resources.addSourceFolderDialogTitle, 
        Resources.addSourceFolderDialogMessage, null, 
        createSourceFolderInputValidator());
      if (dialog.open() == 0)
      {
        String path = dialog.getValue();
        installConfig.addSourceFolder(new Path(path));
      }
    }
    
    private void handleEditButtonPressed()
    {
      IPath selectedSourceFolder = getSelectedSourceFolder();
      
      InputDialog dialog = 
        new InputDialog(addButton.getShell(), Resources.editSourceFolderDialogTitle, 
        Resources.editSourceFolderDialogMessage, 
        selectedSourceFolder.toOSString(), 
        createSourceFolderInputValidator());
      if (dialog.open() == 0)
      {
        IPath newSourceFolder = new Path(dialog.getValue());
        List<IPath> sourceFolders = new ArrayList(installConfig.getSourceFolders());
        int position = sourceFolders.indexOf(selectedSourceFolder);
        sourceFolders.set(position, newSourceFolder);
        installConfig.setSourceFolders(sourceFolders);
      }
    }
    
    private void handleRemoveButtonPressed()
    {
      IPath selectedSourceFolder = getSelectedSourceFolder();
      installConfig.removeSourceFolder(selectedSourceFolder);
    }
    
    private void handleDisposeEvent()
    {
      imageRegistry.dispose();
    }
    
    private IInputValidator createSourceFolderInputValidator()
    {
      IInputValidator validator = new IInputValidator()
      {
        public String isValid(String newText)
        {
          IStatus status = getConfig().validateSourceFolder(newText
1 2 3 4 5

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