org.eclipse.pde.api.tools.ui_1.0.301.v20110803_r371

 PropertyDescriptor("IDelta.Flags", P_FLAGS);
      propertyDescriptor.setCategory(P_INFO_CATEGORY);
      Descriptors.add(propertyDescriptor);
      
      propertyDescriptor = new PropertyDescriptor("IDelta.ElementType", P_ELEMENT_TYPE);
      propertyDescriptor.setCategory(P_INFO_CATEGORY);
      Descriptors.add(propertyDescriptor);
    }
    
    static List getDescriptors()
    {
      return Descriptors;
    }
    
    public TreeNode(int id, String name, Object data)
    {
      this.name = name;
      this.id = id;
      this.data = data;
    }
    
    public Object[] getChildren()
    {
      if (children == null) {
        return DeltaSession.NO_CHILDREN;
      }
      return children.values().toArray(new Object[children.size()]);
    }
    
    public TreeNode getNode(String name)
    {
      if (children == null) {
        return null;
      }
      return (TreeNode)children.get(name);
    }
    
    public int getId()
    {
      return id;
    }
    
    public void add(TreeNode node)
    {
      if (children == null) {
        children = new HashMap();
      }
      children.put(name, node);
    }
    
    public boolean hasChildren()
    {
      return (children != null) && (!children.isEmpty());
    }
    
    public String toString()
    {
      return String.valueOf(name);
    }
    
    public Object getData()
    {
      return data;
    }
    
    public Object getEditableValue()
    {
      return this;
    }
    
    public IPropertyDescriptor[] getPropertyDescriptors()
    {
      if (data != null) {
        return (IPropertyDescriptor[])getDescriptors().toArray(
          new IPropertyDescriptor[getDescriptors().size()]);
      }
      return NO_PROPERTY_DESCRIPTORS;
    }
    
    public Object getPropertyValue(Object propKey)
    {
      if (data == null) {
        return null;
      }
      IDelta delta = (IDelta)data;
      if ("IDelta.Message".equals(propKey)) {
        return delta.getMessage();
      }
      if ("IDelta.Component".equals(propKey)) {
        return delta.getComponentVersionId();
      }
      if ("IDelta.ElementType".equals(propKey))
      {
        int elementType = delta.getElementType();
        StringBuffer buffer = new StringBuffer(Util.getDeltaElementType(elementType));
        buffer.append(" (").append(elementType).append(')');
        return String.valueOf(buffer);
      }
      if ("IDelta.Flags".equals(propKey))
      {
        int flags = delta.getFlags();
        StringBuffer buffer = new StringBuffer(Util.getDeltaFlagsName(flags));
        buffer.append(" (").append(flags).append(')');
        return String.valueOf(buffer);
      }
      if (ID_KEY.equals(propKey)) {
        return delta.getKey();
      }
      if (ID_KIND.equals(propKey))
      {
        int kind = delta.getKind();
        StringBuffer buffer = new StringBuffer(Util.getDeltaKindName(kind));
        buffer.append(" (").append(kind).append(')');
        return String.valueOf(buffer);
      }
      if (ID_NEW_MODIFIERS.equals(propKey)) {
        return getDisplayedModifiers(delta.getNewModifiers());
      }
      if (ID_OLD_MODIFIERS.equals(propKey)) {
        return getDisplayedModifiers(delta.getOldModifiers());
      }
      if (ID_CURRENT_RESTRICTIONS.equals(propKey))
      {
        int restrictions = delta.getCurrentRestrictions();
        return getDisplayRestrictions(restrictions);
      }
      if (ID_PREVIOUS_RESTRICTIONS.equals(propKey))
      {
        int restrictions = delta.getPreviousRestrictions();
        return getDisplayRestrictions(restrictions);
      }
      if (ID_TYPENAME.equals(propKey)) {
        return delta.getTypeName();
      }
      return null;
    }
    
    private Object getDisplayRestrictions(int restrictions)
    {
      StringBuffer buffer = new StringBuffer(RestrictionModifiers.getRestrictionText(restrictions));
      buffer.append(" (0x").append(Integer.toHexString(restrictions)).append(')');
      return String.valueOf(buffer);
    }
    
    public boolean isPropertySet(Object id)
    {
      return false;
    }
    
    public void resetPropertyValue(Object id) {}
    
    public void setPropertyValue(Object id, Object value) {}
    
    public Object getAdapter(Class adapter)
    {
      Class tmp4_1 = DeltaSession.class$0;
      if (tmp4_1 == null)
      {
        tmp4_1;
        try
        {
          tmpTernaryOp = (DeltaSession.class$0 = Class.forName("org.eclipse.ui.views.properties.IPropertySource"));
        }
        catch (ClassNotFoundException localClassNotFoundException)
        {
          throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
        }
      }
      if (adapter == tmp4_1) {
        return this;
      }
      return null;
    }
    
    private static String getDisplayedModifiers(int newModifiers)
    {
      StringBuffer buffer = new StringBuffer();
      if (newModifiers == 0)
      {
        buffer.append(ActionMessages.PropertyPackageVisibility);
      }
      else
      {
        if (Flags.isAbstract(newModifiers)) {
          buffer.append("abstract");
        }
        String separator = " | ";
        if (Flags.isFinal(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("final");
        }
        if (Flags.isNative(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("native");
        }
        if (Flags.isPrivate(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("private");
        }
        if (Flags.isProtected(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("protected");
        }
        if (Flags.isPublic(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("public");
        }
        if (Flags.isStatic(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("static");
        }
        if (Flags.isStrictfp(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("strictfp");
        }
        if (Flags.isSynchronized(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("synchronized");
        }
        if (Flags.isTransient(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("transient");
        }
        if (Flags.isVolatile(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("volatile");
        }
        if (Flags.isVarargs(newModifiers))
        {
          if (buffer.length() > 0) {
            buffer.append(separator);
          }
          buffer.append("vargars");
        }
      }
      buffer.append(" (0x").append(Integer.toHexString(newModifiers)).append(')');
      return buffer.toString();
    }
    
    public boolean isPropertyResettable(Object id)
    {
      return false;
    }
  }
  
  static class TreeModel
    implements ITreeModel
  {
    DeltaSession.TreeNode root;
    
    TreeModel(DeltaSession.TreeNode root)
    {
      this.root = root;
    }
    
    public ITreeNode getRoot()
    {
      return root;
    }
  }
  
  public DeltaSession(String description, IDelta delta, String baselineName)
  {
    this.delta = delta;
    this.baselineName = baselineName;
    timestamp = DateFormat.getDateTimeInstance(2, 2).format(new Date(System.currentTimeMillis()));
    this.description = description;
  }
  
  class 1$TreeBuilder
    extends DeltaVisitor
  {
    DeltaSession.TreeNode node;
    
    public 1$TreeBuilder(DeltaSession.TreeNode node)
    {
      this.node = node;
    }
    
    public void endVisit(IDelta delta)
    {
      if (delta.getChildren().length == 0)
      {
        String typeName = delta.getTypeName();
        if (typeName == null)
        {
          node.add(new DeltaSession.TreeNode(0, delta.getKey(), delta));
        }
        else if (typeName.length() == 0)
        {
          node.add(new DeltaSession.TreeNode(0, delta.getMessage(), delta));
        }
        else
        {
          int index = typeName.lastIndexOf('.');
          String packageName = "<default package>";
          String actualTypeName = null;
          if (index != -1)
          {
            packageName = typeName.substring(0, index);
            actualTypeName = typeName.substring(index + 1);
          }
          else
          {
            actualTypeName = typeName;
          }
          DeltaSession.TreeNode node2 = node.getNode(packageName);
          if (node2 == null)
          {
            node2 = new DeltaSession.TreeNode(5, packageName, null);
            node.add(node2);
          }
          DeltaSession.TreeNode node3 = node2.getNode(actualTypeName);
          if (node3 == null)
          {
            int id = 0;
            switch (delta.getElementType())
            {
            case 1: 
              id = 3;
              break;
            case 8: 
              id = 2;
              break;
            case 4: 
              id = 1;
              break;
            case 6: 
              id = 4;
            case 2: 
            case 3: 
            case 5: 
            case 7: 
            default: 
              try
              {
                String componentVersionId = delta.getComponentVersionId();
                if (componentVersionId != null)
                {
                  int modifiers = retrieveTypeModifiers(
                    delta, 
                    typeName, 
                    componentVersionId);
                  if (Flags.isEnum(modifiers)) {
                    id = 4;
                  } else if (Flags.isAnnotation(modifiers)) {
                    id = 3;
                  } else if (Flags.isInterface(modifiers)) {
                    id = 2;
                  } else {
                    id = 1;
                  }
                }
              }
              catch (CoreException localCoreException) {}
            }
            node3 = new DeltaSession.TreeNode(id, actualTypeName, null);
            node2.add(node3);
          }
          node3.add(new DeltaSession.TreeNode(0, delta.getMessage(), delta));
        }
      }
    }
    
    private int retrieveTypeModifiers(IDelta delta, String typeName, String componentVersionId)
      throws CoreException
    {
      int indexOfOpen = componentVersionId.lastIndexOf('(');
      String componentID = componentVersionId.substring(0, indexOfOpen);
      IApiBaseline baseline = ApiBaselineManager.getManager().getApiBaseline(baselineName);
      int modifiers = 0;
      if (baseline != null)
      {
        IApiComponent apiComponent = baseline.getApiComponent(componentID);
        int kind = delta.getKind();
        if ((apiComponent != null) && (kind == 3))
        {
          IApiTypeRoot typeRoot = null;
          String id = apiComponent.getSymbolicName();
          switch (delta.getFlags())
          {
          case 70: 
          case 71: 
            String packageName = "";
            int indexOf = typeName.lastIndexOf('.');
            if (indexOf != -1) {
              packageName = typeName.substring(0, indexOf);
            }
            IApiComponent[] providers = apiComponent.getBaseline().resolvePackage(apiComponent, packageName);
            int index = 0;
            do
            {
              IApiComponent p = providers[index];
              if (!p.equals(apiComponent))
              {
                String id2 = p.getSymbolicName();
                if ("org.eclipse.swt".equals(id2)) {
                  typeRoot = p.findTypeRoot(typeName);
                } else {
                  typeRoot = p.findTypeRoot(typeName, id2);
                }
              }
              index++;
              if (typeRoot != null) {
                break;
              }
            } while (index < providers.length);
            break;
          default: 
            if ("org.eclipse.swt".equals(id)) {
              typeRoot = apiComponent.findTypeRoot(typeName);
            } else {
              typeRoot = apiComponent.findTypeRoot(typeName, id);
            }
            break;
          }
          if (typeRoot != null)
          {
            IApiType structure = typeRoot.getStructure();
            if (structure != null) {
              modifiers = structure.getModifiers();
            }
          }
        }
      }
      if (modifiers == 0)
      {
        baseline = ApiBaselineManager.getManager().getWorkspaceBaseline();
        if (baseline != null)
        {
          IApiComponent apiComponent = baseline.getApiComponent(componentID);
          if (apiComponent != null)
          {
            IApiTypeRoot typeRoot = null;
            String id = apiComponent.getSymbolicName();
            switch (delta.getFlags())
            {
            case 70: 
            case 71: 
              String packageName = "";
              int indexOf = typeName.lastIndexOf('.');
              if (indexOf != -1) {
                packageName = typeName.substring(0, indexOf);
              }
              IApiComponent[] providers = apiComponent.getBaseline().resolvePackage(apiComponent, packageName);
              int index = 0;
              do
              {
                IApiComponent p = providers[index];
                if (!p.equals(apiComponent))
                {
                  String id2 = p.getSymbolicName();
                  if ("org.eclipse.swt".equals(id2)) {
                    typeRoot = p.findTypeRoot(typeName);
                  } else {
                    typeRoot = p.findTypeRoot(typeName, id2);
                  }
                }
                index++;
                if (typeRoot != null) {
                  break;
                }
              } while (index < providers.length);
              break;
            default: 
              if ("org.eclipse.swt".equals(id)) {
                typeRoot = apiComponent.findTypeRoot(typeName);
              } else {
                typeRoot = apiComponent.findTypeRoot(typeName, id);
              }
              break;
            }
            if (typeRoot != null)
            {
              IApiType structure = typeRoot.getStructure();
              modifiers = structure.getModifiers();
            }
          }
        }
      }
      return modifiers;
    }
  }
  
  public ITreeModel getModel()
  {
    TreeNode root = new TreeNode(0, null, delta);
    TreeModel model = new TreeModel(root);
    if (delta == ApiComparator.NO_DELTA) {
      root.add(new TreeNode(0, ActionMessages.CompareTaskNoChanges, null));
    } else {
      delta.accept(new 1.TreeBuilder(root));
    }
    return model;
  }
  
  public String getDescription()
  {
    return NLS.bind(ActionMessages.SessionDescription, new String[] { timestamp, description });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.actions.DeltaSession
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.pde.api.tools.ui.internal.ApiUIPlugin;

public class ExpandAllAction
  extends Action
{
  private TreeViewer fViewer;
  
  public ExpandAllAction(TreeViewer viewer)
  {
    setText(ActionMessages.ExpandAllAction_label);
    setToolTipText(ActionMessages.ExpandAllAction_tooltip);
    ImageDescriptor enabledImageDescriptor = ApiUIPlugin.getImageDescriptor("IMG_ELCL_EXPANDALL");
    setImageDescriptor(enabledImageDescriptor);
    ImageDescriptor disabledImageDescriptor = ApiUIPlugin.getImageDescriptor("IMG_DLCL_EXPANDALL");
    setDisabledImageDescriptor(disabledImageDescriptor);
    fViewer = viewer;
  }
  
  /* Error */
  public void run()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 59	org/eclipse/pde/api/tools/ui/internal/actions/ExpandAllAction:fViewer	Lorg/eclipse/jface/viewers/TreeViewer;
    //   4: invokevirtual 62	org/eclipse/jface/viewers/TreeViewer:getControl	()Lorg/eclipse/swt/widgets/Control;
    //   7: iconst_0
    //   8: invokevirtual 68	org/eclipse/swt/widgets/Control:setRedraw	(Z)V
    //   11: aload_0
    //   12: getfield 59	org/eclipse/pde/api/tools/ui/internal/actions/ExpandAllAction:fViewer	Lorg/eclipse/jface/viewers/TreeViewer;
    //   15: invokevirtual 61	org/eclipse/jface/viewers/TreeViewer:expandAll	()V
    //   18: goto +17 -> 35
    //   21: astore_1
    //   22: aload_0
    //   23: getfield 59	org/eclipse/pde/api/tools/ui/internal/actions/ExpandAllAction:fViewer	Lorg/eclipse/jface/viewers/TreeViewer;
    //   26: invokevirtual 62	org/eclipse/jface/viewers/TreeViewer:getControl	()Lorg/eclipse/swt/widgets/Control;
    //   29: iconst_1
    //   30: invokevirtual 68	org/eclipse/swt/widgets/Control:setRedraw	(Z)V
    //   33: aload_1
    //   34: athrow
    //   35: aload_0
    //   36: getfield 59	org/eclipse/pde/api/tools/ui/internal/actions/ExpandAllAction:fViewer	Lorg/eclipse/jface/viewers/TreeViewer;
    //   39: invokevirtual 62	org/eclipse/jface/viewers/TreeViewer:getControl	()Lorg/eclipse/swt/widgets/Control;
    //   42: iconst_1
    //   43: invokevirtual 68	org/eclipse/swt/widgets/Control:setRedraw	(Z)V
    //   46: return
    // Line number table:
    //   Java source line #39	-> byte code offset #0
    //   Java source line #40	-> byte code offset #11
    //   Java source line #41	-> byte code offset #21
    //   Java source line #42	-> byte code offset #22
    //   Java source line #43	-> byte code offset #33
    //   Java source line #42	-> byte code offset #35
    //   Java source line #44	-> byte code offset #46
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	47	0	this	ExpandAllAction
    //   21	13	1	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	21	21	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.actions.ExpandAllAction
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.actions;

import org.eclipse.jface.dialogs.IInputValidator;

class ExportDialog$1
  implements IInputValidator
{
  public String isValid(String newText)
  {
    if ((newText != null) && (newText.length() > 0))
    {
      if (((newText.endsWith(".html") ? 0 : 1) & (newText.endsWith(".xml") ? 0 : 1)) != 0) {
        return ActionMessages.ExportDialogErrorMessage;
      }
      return null;
    }
    return ActionMessages.ExportDialogErrorMessage;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.actions.ExportDialog.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.actions;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class ExportDialog$2
  implements ModifyListener
{
  final ExportDialog this$0;
  
  ExportDialog$2(ExportDialog paramExportDialog)
  {
    this$0 = paramExportDialog;
  }
  
  public void modifyText(ModifyEvent e)
  {
    this$0.validateInput();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.actions.ExportDialog.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.actions;

import java.io.File;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Text;

class ExportDialog$3
  extends SelectionAdapter
{
  final ExportDialog this$0;
  
  ExportDialog$3(ExportDialog paramExportDialog)
  {
    this$0 = paramExportDialog;
  }
  
  public void widgetSelected(SelectionEvent e)
  {
    FileDialog dialog = new FileDialog(this$0.getShell());
    dialog.setText(ActionMessages.SelectFileName);
    String loctext = this$0.getValue().trim();
    if (loctext.length() > 0)
    {
      File file = new File(loctext).getParentFile();
      if ((file != null) && (file.exists())) {
        dialog.setFilterPath(file.getAbsolutePath());
      }
    }
    String newPath = dialog.open();
    if (newPath != null) {
      this$0.getText().setText(newPath);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.actions.ExportDialog.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.actions;

import java.io.File;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.resource.StringConverter;
import org.eclipse.pde.api.tools.ui.internal.ApiUIPlugin;
import org.eclipse.pde.api.tools.ui.internal.IApiToolsHelpContextIds;
import org.eclipse.pde.api.tools.ui.internal.SWTFactory;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.IWorkbenchHelpSystem;

public class ExportDialog
  extends Dialog
{
  static final String SETTINGS_SECTION = "org.eclipse.pde.api.tools.ui.api.exportsession";
  static final String REPORT_PATH_STATE = "org.eclipse.pde.api.tools.ui.api.exportsession.reportpath";
  private String title;
  private String message;
  private String value = "";
  private IInputValidator validator;
  private Button okButton;
  private Text text;
  private Text errorMessageText;
  private String errorMessage;
  
  public ExportDialog(Shell shell, String title)
  {
    this(shell, title, ActionMessages.ExportDialogDescription, "", new IInputValidator()
    {
      public String isValid(String newText)
      {
        if ((newText != null) && (newText.length() > 0))
        {
          if (((newText.endsWith(".html") ? 0 : 1) & (newText.endsWith(".xml") ? 0 : 1)) != 0) {
            return ActionMessages.ExportDialogErrorMessage;
          }
          return null;
        }
        return ActionMessages.ExportDialogErrorMessage;
      }
    });
  }
  
  public ExportDialog(Shell parentShell, String dialogTitle, String dialogMessage, String initialValue, IInputValidator validator)
  {
    super(parentShell);
    title = dialogTitle;
    message = dialogMessage;
    if (initialValue == null) {
      value = "";
    } else {
      value = initialValue;
    }
    this.validator = validator;
  }
  
  protected void buttonPressed(int buttonId)
  {
    if (buttonId == 0) {
      value = text.getText();
    } else {
      value = null;
    }
    super.buttonPressed(buttonId);
  }
  
  protected void configureShell(Shell shell)
  {
    super.configureShell(shell);
    if (title != null) {
      shell.setText(title);
    }
  }
  
  protected void createButtonsForButtonBar(Composite parent)
  {
    okButton = createButton(parent, 0, 
      IDialogConstants.OK_LABEL, true);
    createButton(parent, 1, 
      IDialogConstants.CANCEL_LABEL, false);
    
    text.setFocus();
    if (value != null)
    {
      text.setText(value);
      text.selectAll();
    }
    initialize();
  }
  
  protected Control createDialogArea(Composite parent)
  {
    Composite composite = (Composite)super.createDialogArea(parent);
    Composite comp = new Composite(composite, 0);
    GridLayout layout = new GridLayout(2, false);
    marginWidth = 0;
    comp.setLayout(layout);
    comp.setLayoutData(new GridData(4, 4, true, false));
    if (message != null)
    {
      Label label = new Label(comp, 64);
      label.setText(message);
      GridData data = new GridData(1796);
      
      horizontalSpan = 2;
      widthHint = convertHorizontalDLUsToPixels(300);
      label.setLayoutData(data);
      label.setFont(parent.getFont());
    }
    text = new Text(comp, getInputTextStyle());
    text.setLayoutData(new GridData(768));
    text.addModifyListener(new ModifyListener()
    {
      public void modifyText(ModifyEvent e)
      {
        validateInput();
      }
    });
    Button browseButton = SWTFactory.createPushButton(comp, ActionMessages.Browse, null, 131072);
    GridData data = new GridData(16384, 16777216, false, false);
    browseButton.setLayoutData(data);
    
    browseButton.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent e)
      {
        FileDialog dialog = new FileDialog(getShell());
        dialog.setText(ActionMessages.SelectFileName);
        String loctext = getValue().trim();
        if (loctext.length() > 0)
        {
          File file = new File(loctext).getParentFile();
          if ((file != null) && (file.exists())) {
            dialog.setFilterPath(file.getAbsolutePath());
          }
        }
        String newPath = dialog.open();
        if (newPath != null) {
          getText().setText(newPath);
        }
      }
    });
    errorMessageText = new Text(comp, 72);
    GridData layoutData = new GridData(768);
    
    horizontalSpan = 2;
    errorMessageText.setLayoutData(layoutData);
    errorMessageText.setBackground(errorMessageText.getDisplay()
      .getSystemColor(22));
    
    setErrorMessage(errorMessage);
    
    applyDialogFont(comp);
    initialize();
    PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IApiToolsHelpContextIds.API_COMPARE_EXPORT_DIALOG);
    return parent;
  }
  
  protected Button getOkButton()
  {
    return okButton;
  }
  
  protected Text getText()
  {
    return text;
  }
  
  protected IInputValidator getValidator()
  {
    return validator;
  }
  
  public String getValue()
  {
    return value;
  }
  
  protected void validateInput()
  {
    String errorMessage = null;
    if (validator != null) {
      errorMessage = validator.isValid(text.getText());
    }
    setErrorMessage(errorMessage);
  }
  
  public void setErrorMessage(String errorMessage)
  {
    this.errorMessage = errorMessage;
    if ((errorMessageText != null) && (!errorMessageText.isDisposed()))
    {
      errorMessageText.setText(errorMessage == null ? " \n " : errorMessage);
      
      boolean hasError = (errorMessage != null) && (StringConverter.removeWhiteSpaces(errorMessage).length() > 0);
      errorMessageText.setEnabled(hasError);
      errorMessageText.setVisible(hasError);
      errorMessageText.getParent().update();
      
      Control button = getButton(0);
      if (button != null) {
        button.setEnabled(errorMessage == null);
      }
    }
  }
  
  protected int getInputTextStyle()
  {
    return 2052;
  }
  
  protected void okPressed()
  {
    saveWidgetState();
    super.okPressed();
  }
  
  private void restoreTextSelection(String id, IDialogSettings settings)
  {
    String restoredValue = settings.get(id);
    if (restoredValue != null) {
      getText().setText(restoredValue);
    }
  }
  
  void saveWidgetState()
  {
    IDialogSettings rootsettings = ApiUIPlugin.getDefault().getDialogSettings();
    IDialogSettings settings = rootsettings.getSection("org.eclipse.pde.api.tools.ui.api.exportsession");
    if (settings == null) {
      settings = rootsettings.addNewSection("org.eclipse.pde.api.tools.ui.api.exportsession");
    }
    settings.put("org.eclipse.pde.api.tools.ui.api.exportsession.reportpath", getValue());
  }
  
  void initialize()
  {
    IDialogSettings settings = ApiUIPlugin.getDefault().getDialogSettings().getSection("org.eclipse.pde.api.tools.ui.api.exportsession");
    if (settings != null) {
      restoreTextSelection("org.eclipse.pde.api.tools.ui.api.exportsession.reportpath", settings);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.actions.ExportDialog
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.actions;

import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.pde.api.tools.internal.provisional.ISession;

class ExportSessionAction$1
  extends Job
{
  final ExportSessionAction this$0;
  private final String val$lowerCase;
  private final String val$reportFileName;
  private final ISession val$activeSession;
  
  ExportSessionAction$1(ExportSessionAction paramExportSessionAction, String $anonymous0, String paramString1, String paramString2, ISession paramISession)
  {
    super($anonymous0);this$0 = paramExportSessionAction;val$lowerCase = paramString1;val$reportFileName = paramString2;val$activeSession = paramISession;
  }
  
  /* Error */
  protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
  {
    // Byte code:
    //   0: aload_1
    //   1: bipush 100
    //   3: invokestatic 268	org/eclipse/core/runtime/SubMonitor:convert	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/SubMonitor;
    //   6: astore_2
    //   7: aload_2
    //   8: getstatic 234	org/eclipse/pde/api/tools/ui/internal/actions/ActionMessages:CompareDialogCollectingElementTaskName	Ljava/lang/String;
    //   11: invokevirtual 267	org/eclipse/core/runtime/SubMonitor:subTask	(Ljava/lang/String;)V
    //   14: aload_0
    //   15: getfield 238	org/eclipse/pde/api/tools/ui/internal/actions/ExportSessionAction$1:val$lowerCase	Ljava/lang/String;
    //   18: ldc 1
    //   20: invokevirtual 256	java/lang/String:endsWith	(Ljava/lang/String;)Z
    //   23: istore_3
    //   24: aconst_null
    //   25: astore 4
    //   27: aload_2
    //   28: getstatic 235	org/eclipse/pde/api/tools/ui/internal/actions/ActionMessages:CompareDialogComputeDeltasTaskName	Ljava/lang/String;
    //   31: invokevirtual 267	org/eclipse/core/runtime/SubMonitor:subTask	(Ljava/lang/String;)V
    //   34: new 110	java/io/File
    //   37: dup
    //   38: aload_0
    //   39: getfield 239	org/eclipse/pde/api/tools/ui/internal/actions/ExportSessionAction$1:val$reportFileName	Ljava/lang/String;
    //   42: invokespecial 250	java/io/File:<init>	(Ljava/lang/String;)V
    //   45: astore 5
    //   47: aload_2
    //   48: bipush 25
    //   50: invokevirtual 266	org/eclipse/core/runtime/SubMonitor:worked	(I)V
    //   53: aload_2
    //   54: invokestatic 273	org/eclipse/pde/api/tools/internal/util/Util:updateMonitor	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   57: aconst_null
    //   58: astore 6
    //   60: iload_3
    //   61: ifeq +19 -> 80
    //   64: invokestatic 257	java/lang/System:currentTimeMillis	()J
    //   67: invokestatic 255	java/lang/String:valueOf	(J)Ljava/lang/String;
    //   70: ldc 2
    //   72: invokestatic 274	org/eclipse/pde/api/tools/internal/util/Util:createTempFile	(Ljava/lang/String;Ljava/lang/String;)Ljava/io/File;
    //   75: astore 4
    //   77: goto +7 -> 84
    //   80: aload 5
    //   82: astore 4
    //   84: aload 4
    //   86: invokevirtual 247	java/io/File:exists	()Z
    //   89: ifeq +12 -> 101
    //   92: aload 4
    //   94: invokevirtual 246	java/io/File:delete	()Z
    //   97: pop
    //   98: goto +64 -> 162
    //   101: aload 4
    //   103: invokevirtual 249	java/io/File:getParentFile	()Ljava/io/File;
    //   106: astore 7
    //   108: aload 7
    //   110: invokevirtual 247	java/io/File:exists	()Z
    //   113: ifne +49 -> 162
    //   116: aload 7
    //   118: invokevirtual 248	java/io/File:mkdirs	()Z
    //   121: ifne +41 -> 162
    //   124: new 128	org/eclipse/core/runtime/Status
    //   127: dup
    //   128: iconst_4
    //   129: ldc 4
    //   131: getstatic 236	org/eclipse/pde/api/tools/ui/internal/actions/ActionMessages:ExportSessionAction_failed_to_create_parent_folders	Ljava/lang/String;
    //   134: invokespecial 265	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;)V
    //   137: astore 11
    //   139: aload 6
    //   141: ifnull +12 -> 153
    //   144: aload 6
    //   146: invokevirtual 242	java/io/BufferedWriter:close	()V
    //   149: goto +4 -> 153
    //   152: pop
    //   153: aload_1
    //   154: invokeinterface 276 1 0
    //   159: aload 11
    //   161: areturn
    //   162: new 109	java/io/BufferedWriter
    //   165: dup
    //   166: new 111	java/io/FileWriter
    //   169: dup
    //   170: aload 4
    //   172: invokespecial 251	java/io/FileWriter:<init>	(Ljava/io/File;)V
    //   175: invokespecial 244	java/io/BufferedWriter:<init>	(Ljava/io/Writer;)V
    //   178: astore 6
    //   180: new 131	org/eclipse/pde/api/tools/internal/comparator/DeltaXmlVisitor
    //   183: dup
    //   184: invokespecial 270	org/eclipse/pde/api/tools/internal/comparator/DeltaXmlVisitor:<init>	()V
    //   187: astore 7
    //   189: aload_0
    //   190: getfield 240	org/eclipse/pde/api/tools/ui/internal/actions/ExportSessionAction$1:val$activeSession	Lorg/eclipse/pde/api/tools/internal/provisional/ISession;
    //   193: invokeinterface 277 1 0
    //   198: invokeinterface 278 1 0
    //   203: invokeinterface 279 1 0
    //   208: astore 8
    //   210: aload 8
    //   212: instanceof 136
    //   215: ifeq +120 -> 335
    //   218: aload 8
    //   220: checkcast 136	org/eclipse/pde/api/tools/internal/provisional/comparator/IDelta
    //   223: astore 9
    //   225: aload_2
    //   226: bipush 25
    //   228: invokevirtual 266	org/eclipse/core/runtime/SubMonitor:worked	(I)V
    //   231: aload_2
    //   232: invokestatic 273	org/eclipse/pde/api/tools/internal/util/Util:updateMonitor	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   235: aload 9
    //   237: aload 7
    //   239: invokeinterface 280 2 0
    //   244: aload 6
    //   246: aload 7
    //   248: invokevirtual 271	org/eclipse/pde/api/tools/internal/comparator/DeltaXmlVisitor:getXML	()Ljava/lang/String;
    //   251: invokevirtual 245	java/io/BufferedWriter:write	(Ljava/lang/String;)V
    //   254: aload 6
    //   256: invokevirtual 243	java/io/BufferedWriter:flush	()V
    //   259: aload_2
    //   260: bipush 25
    //   262: invokevirtual 266	org/eclipse/core/runtime/SubMonitor:worked	(I)V
    //   265: goto +70 -> 335
    //   268: astore 7
    //   270: aload 7
    //   272: invokestatic 272	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:log	(Ljava/lang/Throwable;)V
    //   275: aload 6
    //   277: ifnull +72 -> 349
    //   280: aload 6
    //   282: invokevirtual 242	java/io/BufferedWriter:close	()V
    //   285: goto +64 -> 349
    //   288: pop
    //   289: goto +60 -> 349
    //   292: astore 7
    //   294: aload 7
    //   296: invokestatic 272	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:log	(Ljava/lang/Throwable;)V
    //   299: aload 6
    //   301: ifnull +48 -> 349
    //   304: aload 6
    //   306: invokevirtual 242	java/io/BufferedWriter:close	()V
    //   309: goto +40 -> 349
    //   312: pop
    //   313: goto +36 -> 349
    //   316: astore 10
    //   318: aload 6
    //   320: ifnull +12 -> 332
    //   323: aload 6
    //   325: invokevirtual 242	java/io/BufferedWriter:close	()V
    //   328: goto +4 -> 332
    //   331: pop
    //   332: aload 10
    //   334: athrow
    //   335: aload 6
    //   337: ifnull +12 -> 349
    //   340: aload 6
    //   342: invokevirtual 242	java/io/BufferedWriter:close	()V
    //   345: goto +4 -> 349
    //   348: pop
    //   349: iload_3
    //   350: ifeq +306 -> 656
    //   353: aload_2
    //   354: invokestatic 273	org/eclipse/pde/api/tools/internal/util/Util:updateMonitor	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   357: new 124	javax/xml/transform/stream/StreamSource
    //   360: dup
    //   361: aload 4
    //   363: invokespecial 263	javax/xml/transform/stream/StreamSource:<init>	(Ljava/io/File;)V
    //   366: astore 7
    //   368: getstatic 237	org/eclipse/pde/api/tools/ui/internal/actions/ExportSessionAction:class$0	Ljava/lang/Class;
    //   371: dup
    //   372: ifnonnull +28 -> 400
    //   375: pop
    //   376: ldc 5
    //   378: invokestatic 253	java/lang/Class:forName	(Ljava/lang/String;)Ljava/lang/Class;
    //   381: dup
    //   382: putstatic 237	org/eclipse/pde/api/tools/ui/internal/actions/ExportSessionAction:class$0	Ljava/lang/Class;
    //   385: goto +15 -> 400
    //   388: new 115	java/lang/NoClassDefFoundError
    //   391: dup_x1
    //   392: swap
    //   393: invokevirtual 258	java/lang/Throwable:getMessage	()Ljava/lang/String;
    //   396: invokespecial 254	java/lang/NoClassDefFoundError:<init>	(Ljava/lang/String;)V
    //   399: athrow
    //   400: ldc 3
    //   402: invokevirtual 252	java/lang/Class:getResourceAsStream	(Ljava/lang/String;)Ljava/io/InputStream;
    //   405: astore 8
    //   407: new 124	javax/xml/transform/stream/StreamSource
    //   410: dup
    //   411: aload 8
    //   413: invokespecial 264	javax/xml/transform/stream/StreamSource:<init>	(Ljava/io/InputStream;)V
    //   416: astore 9
    //   418: aload 5
    //   420: invokevirtual 247	java/io/File:exists	()Z
    //   423: ifeq +12 -> 435
    //   426: aload 5
    //   428: invokevirtual 246	java/io/File:delete	()Z
    //   431: pop
    //   432: goto +64 -> 496
    //   435: aload 5
    //   437: invokevirtual 249	java/io/File:getParentFile	()Ljava/io/File;
    //   440: astore 10
    //   442: aload 10
    //   444: invokevirtual 247	java/io/File:exists	()Z
    //   447: ifne +49 -> 496
    //   450: aload 10
    //   452: invokevirtual 248	java/io/File:mkdirs	()Z
    //   455: ifne +41 -> 496
    //   458: new 128	org/eclipse/core/runtime/Status
    //   461: dup
    //   462: iconst_4
    //   463: ldc 4
    //   465: getstatic 236	org/eclipse/pde/api/tools/ui/internal/actions/ActionMessages:ExportSessionAction_failed_to_create_parent_folders	Ljava/lang/String;
    //   468: invokespecial 265	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;)V
    //   471: astore 14
    //   473: aload 6
    //   475: ifnull +12 -> 487
    //   478: aload 6
    //   480: invokevirtual 242	java/io/BufferedWriter:close	()V
    //   483: goto +4 -> 487
    //   486: pop
    //   487: aload_1
    //   488: invokeinterface 276 1 0
    //   493: aload 14
    //   495: areturn
    //   496: new 109	java/io/BufferedWriter
    //   499: dup
    //   500: new 111	java/io/FileWriter
    //   503: dup
    //   504: aload 5
    //   506: invokespecial 251	java/io/FileWriter:<init>	(Ljava/io/File;)V
    //   509: invokespecial 244	java/io/BufferedWriter:<init>	(Ljava/io/Writer;)V
    //   512: astore 6
    //   514: new 123	javax/xml/transform/stream/StreamResult
    //   517: dup
    //   518: aload 6
    //   520: invokespecial 262	javax/xml/transform/stream/StreamResult:<init>	(Ljava/io/Writer;)V
    //   523: astore 10
    //   525: invokestatic 260	javax/xml/transform/TransformerFactory:newInstance	()Ljavax/xml/transform/TransformerFactory;
    //   528: astore 11
    //   530: aload 11
    //   532: aload 9
    //   534: invokevirtual 261	javax/xml/transform/TransformerFactory:newTransformer	(Ljavax/xml/transform/Source;)Ljavax/xml/transform/Transformer;
    //   537: astore 12
    //   539: aload 12
    //   541: aload 7
    //  
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

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