com.crashlytics.tools.eclipse.exporter_1.6.1.201405061826

16:34:25.698 INFO  jd.cli.Main - Decompiling com.crashlytics.tools.eclipse.exporter_1.6.1.201405061826.jar
package com.crashlytics.tools.eclipse.exporter;

import org.eclipse.core.resources.IProject;
import org.eclipse.jface.dialogs.IPageChangedListener;
import org.eclipse.jface.dialogs.PageChangedEvent;
import org.eclipse.jface.wizard.IWizardPage;

class AbstractExportWizardDialog$1
  implements IPageChangedListener
{
  AbstractExportWizardDialog$1(AbstractExportWizardDialog paramAbstractExportWizardDialog) {}
  
  public void pageChanged(PageChangedEvent event)
  {
    IWizardPage currentPage = this$0.getCurrentPage();
    if (currentPage.getName().equals("Page_KeyCheck"))
    {
      IProject project = AbstractExportWizardDialog.access$0(currentPage.getWizard());
      this$0.preExport(project);
    }
  }
}

/* Location:
 * Qualified Name:     com.crashlytics.tools.eclipse.exporter.AbstractExportWizardDialog.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.crashlytics.tools.eclipse.exporter;

import com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard;
import com.crashlytics.tools.eclipse.CrashlyticsAdtPlugin;
import java.lang.reflect.Field;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.dialogs.IPageChangedListener;
import org.eclipse.jface.dialogs.PageChangedEvent;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

public abstract class AbstractExportWizardDialog
  extends WizardDialog
{
  private static final Class<ExportWizard> EXPORT_WIZARD_TYPE = ExportWizard.class;
  private static final String PAGE_KEY_CHECK = "Page_KeyCheck";
  private static final String EXPORT_WIZARD_PROJECT_FIELD = "mProject";
  
  public AbstractExportWizardDialog(IWizard wizard)
  {
    super(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
    if (!EXPORT_WIZARD_TYPE.isInstance(wizard)) {
      throw new IllegalArgumentException("Expected instance of " + EXPORT_WIZARD_TYPE + ", got " + 
        wizard.getClass());
    }
    addPageChangedListener(_pageChangeListener);
  }
  
  private final IPageChangedListener _pageChangeListener = new IPageChangedListener()
  {
    public void pageChanged(PageChangedEvent event)
    {
      IWizardPage currentPage = getCurrentPage();
      if (currentPage.getName().equals("Page_KeyCheck"))
      {
        IProject project = AbstractExportWizardDialog.getExportWizardProject(currentPage.getWizard());
        preExport(project);
      }
    }
  };
  
  protected abstract void preExport(IProject paramIProject);
  
  protected abstract void postExport();
  
  private static IProject getExportWizardProject(IWizard wizard)
  {
    try
    {
      Field projectField = EXPORT_WIZARD_TYPE.getDeclaredField("mProject");
      projectField.setAccessible(true);
      return (IProject)projectField.get(wizard);
    }
    catch (Exception e)
    {
      CrashlyticsAdtPlugin.log(4, "Could not resolve ADT ExportWizard's project field", e);
    }
    return null;
  }
  
  protected void finishPressed()
  {
    super.finishPressed();
    postExport();
  }
}

/* Location:
 * Qualified Name:     com.crashlytics.tools.eclipse.exporter.AbstractExportWizardDialog
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.crashlytics.tools.eclipse.exporter;

import com.crashlytics.tools.eclipse.workbench.ExportWizardFactoryDelegate;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IExportWizard;

class ExporterActivator$1
  implements ExportWizardFactoryDelegate
{
  ExporterActivator$1(ExporterActivator paramExporterActivator, ExportWizardFactory paramExportWizardFactory) {}
  
  public IExportWizard createAndroidExportWizard()
    throws CoreException
  {
    return val$factory.create();
  }
}

/* Location:
 * Qualified Name:     com.crashlytics.tools.eclipse.exporter.ExporterActivator.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.crashlytics.tools.eclipse.exporter;

import com.crashlytics.tools.eclipse.workbench.ExportWizardFactoryDelegate;
import com.crashlytics.tools.eclipse.workbench.WorkbenchPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.ui.IExportWizard;
import org.osgi.framework.BundleContext;

public class ExporterActivator
  extends Plugin
{
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    
    final ExportWizardFactory factory = new ExportWizardFactory();
    WorkbenchPlugin.getDefault().setExportWizardFactoryDelegate(new ExportWizardFactoryDelegate()
    {
      public IExportWizard createAndroidExportWizard()
        throws CoreException
      {
        return factory.create();
      }
    });
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    if (WorkbenchPlugin.getDefault() != null) {
      WorkbenchPlugin.getDefault().setExportWizardFactoryDelegate(null);
    }
    super.stop(context);
  }
}

/* Location:
 * Qualified Name:     com.crashlytics.tools.eclipse.exporter.ExporterActivator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.crashlytics.tools.eclipse.exporter;

import com.crashlytics.tools.eclipse.CrashlyticsAdtPlugin;
import com.crashlytics.tools.eclipse.ProjectAssemblyListener;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.wizard.IWizard;

public class ExportWizardDialog
  extends AbstractExportWizardDialog
{
  private IProject _project = null;
  private final ProjectAssemblyListener _listener;
  
  public ExportWizardDialog(IWizard wizard)
  {
    super(wizard);
    CrashlyticsAdtPlugin plugin = CrashlyticsAdtPlugin.getDefault();
    if (CrashlyticsAdtPlugin.isActive(plugin)) {
      _listener = plugin.getAssemblyListener();
    } else {
      _listener = null;
    }
  }
  
  protected synchronized void preExport(IProject project)
  {
    _project = project;
    if (_listener != null) {
      _listener.preExport(project);
    }
  }
  
  protected void postExport()
  {
    if (_project == null)
    {
      CrashlyticsAdtPlugin.log(2, "ExportWizard finished with null Android project", null);
      return;
    }
    if (_listener != null) {
      _listener.postExport(_project);
    }
    _project = null;
  }
}

/* Location:
 * Qualified Name:     com.crashlytics.tools.eclipse.exporter.ExportWizardDialog
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.crashlytics.tools.eclipse.exporter;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IExportWizard;
import org.eclipse.ui.IWorkbench;

class ExportWizardFactory$WizardDialogWrapper
  extends Wizard
  implements IExportWizard
{
  private final WizardDialog _dialog;
  
  ExportWizardFactory$WizardDialogWrapper(WizardDialog dialog)
  {
    _dialog = dialog;
  }
  
  public void init(IWorkbench workbench, IStructuredSelection selection)
  {
    _dialog.open();
  }
  
  public boolean performFinish()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     com.crashlytics.tools.eclipse.exporter.ExportWizardFactory.WizardDialogWrapper
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.crashlytics.tools.eclipse.exporter;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IExecutableExtensionFactory;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IExportWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.wizards.IWizardDescriptor;
import org.eclipse.ui.wizards.IWizardRegistry;

public class ExportWizardFactory
  implements IExecutableExtensionFactory
{
  private IExportWizard createAdtExportWizard()
  {
    try
    {
      IWizardDescriptor descriptor = PlatformUI.getWorkbench().getExportWizardRegistry()
        .findWizard("com.android.ide.eclipse.adt.project.ExportWizard");
      wizard = (IExportWizard)descriptor.createWizard();
    }
    catch (CoreException e)
    {
      IExportWizard wizard;
      e.printStackTrace();
      throw new RuntimeException(e);
    }
    IExportWizard wizard;
    return wizard;
  }
  
  public IExportWizard create()
    throws CoreException
  {
    IExportWizard wizard = createAdtExportWizard();
    
    WizardDialog wd = new ExportWizardDialog(wizard);
    return new WizardDialogWrapper(wd);
  }
  
  private static class WizardDialogWrapper
    extends Wizard
    implements IExportWizard
  {
    private final WizardDialog _dialog;
    
    WizardDialogWrapper(WizardDialog dialog)
    {
      _dialog = dialog;
    }
    
    public void init(IWorkbench workbench, IStructuredSelection selection)
    {
      _dialog.open();
    }
    
    public boolean performFinish()
    {
      return false;
    }
  }
}

/* Location:
 * Qualified Name:     com.crashlytics.tools.eclipse.exporter.ExportWizardFactory
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

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