platform

16:51:00.814 INFO  jd.cli.Main - Decompiling platform.jar
package org.eclipse.platform.internal;

import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.cheatsheets.CheatSheetViewerFactory;
import org.eclipse.ui.cheatsheets.ICheatSheetViewer;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.intro.IIntroPart;
import org.eclipse.ui.intro.config.IStandbyContentPart;

public final class CheatSheetStandbyContent
  implements IStandbyContentPart
{
  private static String MEMENTO_CHEATSHEET_ID_ATT = "cheatsheetId";
  private ICheatSheetViewer viewer;
  private Composite container;
  private String input;
  
  public void init(IIntroPart introPart, IMemento memento)
  {
    input = getCachedInput(memento);
  }
  
  public void createPartControl(Composite parent, FormToolkit toolkit)
  {
    container = toolkit.createComposite(parent);
    FillLayout layout = new FillLayout();
    marginWidth = (marginHeight = 0);
    container.setLayout(layout);
    
    viewer = CheatSheetViewerFactory.createCheatSheetView();
    viewer.createPartControl(container);
  }
  
  public Control getControl()
  {
    return container;
  }
  
  public void setInput(Object input)
  {
    if (input != null) {
      this.input = ((String)input);
    }
    viewer.setInput(this.input);
  }
  
  public void setFocus()
  {
    viewer.setFocus();
  }
  
  public void dispose() {}
  
  public void saveState(IMemento memento)
  {
    String currentCheatSheetId = viewer.getCheatSheetID();
    if (currentCheatSheetId != null) {
      memento.putString(MEMENTO_CHEATSHEET_ID_ATT, currentCheatSheetId);
    }
  }
  
  private String getCachedInput(IMemento memento)
  {
    if (memento == null) {
      return null;
    }
    return memento.getString(MEMENTO_CHEATSHEET_ID_ATT);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.platform.internal.CheatSheetStandbyContent
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.platform.internal;

class LaunchUpdateIntroAction$1
  implements Runnable
{
  final LaunchUpdateIntroAction this$0;
  
  LaunchUpdateIntroAction$1(LaunchUpdateIntroAction paramLaunchUpdateIntroAction)
  {
    this$0 = paramLaunchUpdateIntroAction;
  }
  
  public void run()
  {
    if (!this$0.executeUpdateCommand("org.eclipse.equinox.p2.ui.sdk.update")) {
      this$0.executeUpdateCommand("org.eclipse.ui.update.findAndInstallUpdates");
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.platform.internal.LaunchUpdateIntroAction.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.platform.internal;

import java.util.Properties;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.NotEnabledException;
import org.eclipse.core.commands.NotHandledException;
import org.eclipse.core.commands.common.NotDefinedException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.intro.IIntroSite;
import org.eclipse.ui.intro.config.IIntroAction;
import org.osgi.framework.Bundle;

public class LaunchUpdateIntroAction
  implements IIntroAction
{
  private static final String COMMAND_P2 = "org.eclipse.equinox.p2.ui.sdk.update";
  private static final String COMMAND_UPDATE_MANAGER = "org.eclipse.ui.update.findAndInstallUpdates";
  
  public void run(IIntroSite site, Properties params)
  {
    Runnable r = new Runnable()
    {
      public void run()
      {
        if (!executeUpdateCommand("org.eclipse.equinox.p2.ui.sdk.update")) {
          executeUpdateCommand("org.eclipse.ui.update.findAndInstallUpdates");
        }
      }
    };
    Shell currentShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    currentShell.getDisplay().asyncExec(r);
  }
  
  boolean executeUpdateCommand(String command)
  {
    ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
    IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
    
    Command cmd = commandService.getCommand(command);
    ExecutionEvent executionEvent = handlerService.createExecutionEvent(cmd, null);
    try
    {
      cmd.executeWithChecks(executionEvent);
    }
    catch (ExecutionException e)
    {
      String bundleId = "org.eclipse.platform";
      Bundle bundle = Platform.getBundle(bundleId);
      if (bundle != null) {
        Platform.getLog(bundle).log(new Status(4, bundleId, "Exception executing command: " + command, e));
      }
    }
    catch (NotDefinedException localNotDefinedException)
    {
      return false;
    }
    catch (NotEnabledException localNotEnabledException)
    {
      return false;
    }
    catch (NotHandledException localNotHandledException)
    {
      return false;
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.platform.internal.LaunchUpdateIntroAction
 * Java Class Version: 1.2 (46.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-2017. Infinite Loop Ltd