org.eclipse.mylyn.commons.workbench_3.7.1.v20120425-0100

16:46:35.056 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.commons.workbench_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.commons.workbench;

import java.lang.reflect.Field;
import org.eclipse.mylyn.commons.workbench.search.SearchHistoryPopupDialog;
import org.eclipse.mylyn.commons.workbench.search.TextSearchControl;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.TypedListener;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;

public class EnhancedFilteredTree
  extends FilteredTree
{
  protected boolean useNewLook;
  private TextSearchControl searchControl;
  
  public EnhancedFilteredTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook)
  {
    super(parent, treeStyle, filter);
  }
  
  public EnhancedFilteredTree(Composite parent, int treeStyle, PatternFilter filter)
  {
    super(parent, treeStyle, filter);
  }
  
  public EnhancedFilteredTree(Composite parent)
  {
    super(parent);
  }
  
  protected void createControl(Composite parent, int treeStyle)
  {
    super.createControl(parent, treeStyle);
    
    useNewLook = setNewLook(this);
  }
  
  protected Composite createFilterControls(Composite parent)
  {
    createFilterText(parent);
    return parent;
  }
  
  public static boolean setNewLook(FilteredTree tree)
  {
    try
    {
      Field newStyleField = FilteredTree.class.getDeclaredField("useNewLook");
      newStyleField.setAccessible(true);
      newStyleField.setBoolean(tree, true);
      return newStyleField.getBoolean(tree);
    }
    catch (Exception localException) {}
    return false;
  }
  
  protected void createFilterText(Composite parent)
  {
    super.createFilterText(parent);
    if ((searchControl != null) && (searchControl.hasHistorySupport()))
    {
      Text textControl = searchControl.getTextControl();
      KeyListener downArrowListener = null;
      Listener[] listeners = textControl.getListeners(1);
      if ((listeners != null) && (listeners.length > 0))
      {
        Listener[] arrayOfListener1;
        int j = (arrayOfListener1 = listeners).length;
        for (int i = 0; i < j; i++)
        {
          Listener listener = arrayOfListener1[i];
          if ((listener instanceof TypedListener)) {
            if ((((TypedListener)listener).getEventListener().getClass().getName().startsWith("org.eclipse.ui.dialogs.FilteredTree$")) && 
              ((((TypedListener)listener).getEventListener() instanceof KeyListener)))
            {
              downArrowListener = (KeyListener)((TypedListener)listener).getEventListener();
              break;
            }
          }
        }
      }
      if (downArrowListener != null)
      {
        final KeyListener oldKeyListener = downArrowListener;
        textControl.removeKeyListener(downArrowListener);
        textControl.addKeyListener(new KeyAdapter()
        {
          public void keyPressed(KeyEvent e)
          {
            if (doit) {
              oldKeyListener.keyPressed(e);
            }
          }
          
          public void keyReleased(KeyEvent e)
          {
            if (doit) {
              oldKeyListener.keyReleased(e);
            }
          }
        });
      }
    }
  }
  
  protected Text doCreateFilterText(Composite parent)
  {
    searchControl = new TextSearchControl(parent, true, getHistoryPopupDialog());
    
    searchControl.addSelectionListener(new SelectionAdapter()
    {
      public void widgetDefaultSelected(SelectionEvent e)
      {
        if (detail == 256) {
          clearText();
        }
        if (detail == 512) {
          textChanged();
        }
      }
    });
    searchControl.setLayoutData(new GridData(4, 1, true, false));
    return searchControl.getTextControl();
  }
  
  public TextSearchControl getTextSearchControl()
  {
    return searchControl;
  }
  
  protected SearchHistoryPopupDialog getHistoryPopupDialog()
  {
    return new SearchHistoryPopupDialog(getShell(), 128);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.EnhancedFilteredTree
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench;

import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.dialogs.PatternFilter;

public class TableTreePatternFilter
  extends PatternFilter
{
  protected boolean isParentMatch(Viewer viewer, Object element)
  {
    if ((viewer instanceof AbstractTreeViewer)) {
      return super.isParentMatch(viewer, element);
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.TableTreePatternFilter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench;

import java.lang.reflect.InvocationTargetException;
import java.util.Set;
import org.eclipse.core.commands.NotEnabledException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.commons.core.ICoreRunnable;
import org.eclipse.mylyn.internal.commons.workbench.CommonsWorkbenchPlugin;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IPluginContribution;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.activities.IActivityManager;
import org.eclipse.ui.activities.IIdentifier;
import org.eclipse.ui.activities.IWorkbenchActivitySupport;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.progress.IProgressService;
import org.eclipse.ui.services.IServiceLocator;

public class WorkbenchUtil
{
  public static final String GROUP_EDIT = "group.edit";
  public static final String GROUP_FILE = "group.file";
  public static final String GROUP_REFRESH = "group.refresh";
  public static final String GROUP_FILTER = "group.filter";
  public static final String GROUP_NAVIGATE = "group.navigate";
  public static final String GROUP_NEW = "group.new";
  public static final String GROUP_OPEN = "group.open";
  public static final String GROUP_PREFERENCES = "group.preferences";
  public static final String GROUP_PROPERTIES = "group.properties";
  public static final String GROUP_RUN = "group.run";
  public static final QualifiedName SHOW_IN_TASKBAR_ICON_PROPERTY = new QualifiedName(
    "org.eclipse.ui.workbench.progress", "inTaskBarIcon");
  
  public static IViewPart showViewInActiveWindow(String viewId)
  {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null)
    {
      IWorkbenchPage page = window.getActivePage();
      if (page != null) {
        try
        {
          return page.showView(viewId);
        }
        catch (PartInitException localPartInitException) {}
      }
    }
    return null;
  }
  
  private static Shell getModalShellExcluding(Shell shell)
  {
    IWorkbench workbench = PlatformUI.getWorkbench();
    Shell[] shells = workbench.getDisplay().getShells();
    int modal = 229376;
    Shell[] arrayOfShell1;
    int j = (arrayOfShell1 = shells).length;
    for (int i = 0; i < j; i++)
    {
      Shell shell2 = arrayOfShell1[i];
      if (shell2.equals(shell)) {
        break;
      }
      if (shell2.isVisible())
      {
        int style = shell2.getStyle();
        if ((style & modal) != 0) {
          return shell2;
        }
      }
    }
    return null;
  }
  
  public static Shell getShell()
  {
    if ((!PlatformUI.isWorkbenchRunning()) || (PlatformUI.getWorkbench().isClosing())) {
      return null;
    }
    Shell modal = getModalShellExcluding(null);
    if (modal != null) {
      return modal;
    }
    return getNonModalShell();
  }
  
  private static Shell getNonModalShell()
  {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window == null)
    {
      IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
      if (windows.length > 0) {
        return windows[0].getShell();
      }
    }
    else
    {
      return window.getShell();
    }
    return null;
  }
  
  public static final boolean isFiltering()
  {
    return !PlatformUI.getWorkbench().getActivitySupport().getActivityManager().getDefinedActivityIds().isEmpty();
  }
  
  public static boolean allowUseOf(Object object)
  {
    if (!isFiltering()) {
      return true;
    }
    if ((object instanceof IPluginContribution))
    {
      IPluginContribution contribution = (IPluginContribution)object;
      if (contribution.getPluginId() != null)
      {
        IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
        IIdentifier identifier = workbenchActivitySupport.getActivityManager().getIdentifier(
          createUnifiedId(contribution));
        return identifier.isEnabled();
      }
    }
    if ((object instanceof String))
    {
      IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
      IIdentifier identifier = workbenchActivitySupport.getActivityManager().getIdentifier((String)object);
      return identifier.isEnabled();
    }
    return true;
  }
  
  private static final String createUnifiedId(IPluginContribution contribution)
  {
    if (contribution.getPluginId() != null) {
      return contribution.getPluginId() + '/' + contribution.getLocalId();
    }
    return contribution.getLocalId();
  }
  
  public static void addDefaultGroups(IMenuManager menuManager)
  {
    menuManager.add(new Separator("group.new"));
    menuManager.add(new Separator("group.open"));
    menuManager.add(new Separator("group.edit"));
    menuManager.add(new Separator("group.file"));
    menuManager.add(new Separator("group.run"));
    menuManager.add(new Separator("group.navigate"));
    menuManager.add(new Separator("group.refresh"));
    menuManager.add(new Separator("group.filter"));
    menuManager.add(new Separator("additions"));
    menuManager.add(new Separator("group.properties"));
  }
  
  public static Object openProperties(IServiceLocator serviceLocator)
  {
    IHandlerService service = (IHandlerService)serviceLocator.getService(IHandlerService.class);
    if (service != null) {
      try
      {
        return service.executeCommand("org.eclipse.ui.file.properties", null);
      }
      catch (NotEnabledException localNotEnabledException) {}catch (Exception e)
      {
        CommonsWorkbenchPlugin.getDefault().getLog().log(new Status(4, "org.eclipse.mylyn.commons.workbench", 
          "Opening repository properties failed", e));
      }
    }
    return Integer.valueOf(8);
  }
  
  public static void busyCursorWhile(ICoreRunnable runnable)
    throws OperationCanceledException, CoreException
  {
    try
    {
      IRunnableWithProgress runner = new IRunnableWithProgress()
      {
        /* Error */
        public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
          throws InvocationTargetException, InterruptedException
        {
          // Byte code:
          //   0: aload_0
          //   1: getfield 43	org/eclipse/mylyn/commons/workbench/WorkbenchUtil$1:val$runnable	Lorg/eclipse/mylyn/commons/core/ICoreRunnable;
          //   4: aload_1
          //   5: invokeinterface 48 2 0
          //   10: goto +31 -> 41
          //   13: astore_2
          //   14: new 22	java/lang/reflect/InvocationTargetException
          //   17: dup
          //   18: aload_2
          //   19: invokespecial 46	java/lang/reflect/InvocationTargetException:<init>	(Ljava/lang/Throwable;)V
          //   22: athrow
          //   23: pop
          //   24: new 20	java/lang/InterruptedException
          //   27: dup
          //   28: invokespecial 44	java/lang/InterruptedException:<init>	()V
          //   31: athrow
          //   32: astore_3
          //   33: aload_1
          //   34: invokeinterface 47 1 0
          //   39: aload_3
          //   40: athrow
          //   41: aload_1
          //   42: invokeinterface 47 1 0
          //   47: return
          // Line number table:
          //   Java source line #244	-> byte code offset #0
          //   Java source line #245	-> byte code offset #13
          //   Java source line #246	-> byte code offset #14
          //   Java source line #247	-> byte code offset #23
          //   Java source line #248	-> byte code offset #24
          //   Java source line #249	-> byte code offset #32
          //   Java source line #250	-> byte code offset #33
          //   Java source line #251	-> byte code offset #39
          //   Java source line #250	-> byte code offset #41
          //   Java source line #252	-> byte code offset #47
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	48	0	this	1
          //   0	48	1	monitor	org.eclipse.core.runtime.IProgressMonitor
          //   13	6	2	e	CoreException
          //   32	8	3	localObject	Object
          //   23	1	4	localOperationCanceledException	OperationCanceledException
          // Exception table:
          //   from	to	target	type
          //   0	10	13	org/eclipse/core/runtime/CoreException
          //   0	10	23	org/eclipse/core/runtime/OperationCanceledException
          //   0	32	32	finally
        }
      };
      PlatformUI.getWorkbench().getProgressService().busyCursorWhile(runner);
    }
    catch (InvocationTargetException e)
    {
      if ((e.getCause() instanceof CoreException)) {
        throw ((CoreException)e.getCause());
      }
      CommonsWorkbenchPlugin.getDefault().getLog().log(new Status(4, "org.eclipse.mylyn.commons.workbench", "Unexpected exception", e));
    }
    catch (InterruptedException localInterruptedException)
    {
      throw new OperationCanceledException();
    }
  }
  
  public static void runInUi(ICoreRunnable runnable, ISchedulingRule rule)
    throws CoreException
  {
    runInUi(PlatformUI.getWorkbench().getProgressService(), runnable, rule);
  }
  
  public static void runInUi(IRunnableContext context, ICoreRunnable runnable, ISchedulingRule rule)
    throws CoreException
  {
    try
    {
      IRunnableWithProgress runner = new IRunnableWithProgress()
      {
        /* Error */
        public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
          throws InvocationTargetException, InterruptedException
        {
          // Byte code:
          //   0: aload_0
          //   1: getfield 44	org/eclipse/mylyn/commons/workbench/WorkbenchUtil$2:val$runnable	Lorg/eclipse/mylyn/commons/core/ICoreRunnable;
          //   4: aload_1
          //   5: invokeinterface 49 2 0
          //   10: goto +31 -> 41
          //   13: astore_2
          //   14: new 22	java/lang/reflect/InvocationTargetException
          //   17: dup
          //   18: aload_2
          //   19: invokespecial 47	java/lang/reflect/InvocationTargetException:<init>	(Ljava/lang/Throwable;)V
          //   22: athrow
          //   23: pop
          //   24: new 20	java/lang/InterruptedException
          //   27: dup
          //   28: invokespecial 45	java/lang/InterruptedException:<init>	()V
          //   31: athrow
          //   32: astore_3
          //   33: aload_1
          //   34: invokeinterface 48 1 0
          //   39: aload_3
          //   40: athrow
          //   41: aload_1
          //   42: invokeinterface 48 1 0
          //   47: return
          // Line number table:
          //   Java source line #278	-> byte code offset #0
          //   Java source line #279	-> byte code offset #13
          //   Java source line #280	-> byte code offset #14
          //   Java source line #281	-> byte code offset #23
          //   Java source line #282	-> byte code offset #24
          //   Java source line #283	-> byte code offset #32
          //   Java source line #284	-> byte code offset #33
          //   Java source line #285	-> byte code offset #39
          //   Java source line #284	-> byte code offset #41
          //   Java source line #286	-> byte code offset #47
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	48	0	this	2
          //   0	48	1	monitor	org.eclipse.core.runtime.IProgressMonitor
          //   13	6	2	e	CoreException
          //   32	8	3	localObject	Object
          //   23	1	4	localOperationCanceledException	OperationCanceledException
          // Exception table:
          //   from	to	target	type
          //   0	10	13	org/eclipse/core/runtime/CoreException
          //   0	10	23	org/eclipse/core/runtime/OperationCanceledException
          //   0	32	32	finally
        }
      };
      PlatformUI.getWorkbench().getProgressService().runInUI(context, runner, rule);
    }
    catch (InvocationTargetException e)
    {
      if ((e.getCause() instanceof CoreException)) {
        throw ((CoreException)e.getCause());
      }
      CommonsWorkbenchPlugin.getDefault().getLog().log(new Status(4, "org.eclipse.mylyn.commons.workbench", "Unexpected exception", e));
    }
    catch (InterruptedException localInterruptedException)
    {
      throw new OperationCanceledException();
    }
  }
  
  public static Image getWorkbenchShellImage(int maximumHeight)
  {
    IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
    if ((windows != null) && (windows.length > 0))
    {
      IWorkbenchWindow workbenchWindow = windows[0];
      if ((workbenchWindow != null) && (!workbenchWindow.getShell().isDisposed()))
      {
        Image image = getShell().getImage();
        int diff = Integer.MAX_VALUE;
        if ((image != null) && (getBoundsheight <= maximumHeight)) {
          diff = maximumHeight - getBoundsheight;
        } else {
          image = null;
        }
        Image[] images = getShell().getImages();
        if ((images != null) && (images.length > 0))
        {
          Image[] arrayOfImage1;
          int j = (arrayOfImage1 = images).length;
          for (int i = 0; i < j; i++)
          {
            Image image2 = arrayOfImage1[i];
            int newDiff = maximumHeight - getBoundsheight;
            if ((newDiff >= 0) && (newDiff <= diff))
            {
              diff = newDiff;
              image = image2;
            }
          }
        }
        return image;
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.WorkbenchUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench;

import java.util.Map;
import java.util.Set;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;

class InPlaceCheckBoxTreeDialog$1
  implements ITreeContentProvider
{
  InPlaceCheckBoxTreeDialog$1(InPlaceCheckBoxTreeDialog paramInPlaceCheckBoxTreeDialog) {}
  
  public Object[] getChildren(Object parentElement)
  {
    if ((parentElement instanceof Map)) {
      return ((Map)parentElement).keySet().toArray();
    }
    return null;
  }
  
  public Object getParent(Object element)
  {
    return null;
  }
  
  public boolean hasChildren(Object element)
  {
    return false;
  }
  
  public Object[] getElements(Object inputElement)
  {
    return getChildren(inputElement);
  }
  
  public void dispose() {}
  
  public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.InPlaceCheckBoxTreeDialog.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench;

import org.eclipse.swt.graphics.Image;

public abstract interface BusyAnimator$IBusyClient
{
  public abstract void setImage(Image paramImage);
  
  public abstract Image getImage();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.BusyAnimator.IBusyClient
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.texteditor;

public class DeleteLineToEndHandler
  extends AbstractDeleteLineHandler
{
  public DeleteLineToEndHandler()
  {
    super(2, false);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.texteditor.DeleteLineToEndHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.texteditor;

public class DeleteLineHandler
  extends AbstractDeleteLineHandler
{
  public DeleteLineHandler()
  {
    super(0, false);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.texteditor.DeleteLineHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.texteditor;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.ui.handlers.HandlerUtil;

public abstract class AbstractTextViewerHandler
  extends AbstractHandler
{
  protected ITextViewer getTextViewer(ExecutionEvent event)
    throws ExecutionException
  {
    Object activeFocusControl = HandlerUtil.getVariable(event, "activeFocusControl");
    if ((activeFocusControl instanceof StyledText))
    {
      StyledText textWidget = (StyledText)activeFocusControl;
      ITextViewer viewer = (ITextViewer)textWidget.getData(ITextViewer.class.getName());
      if (viewer == null) {
        viewer = (ITextViewer)textWidget.getData(ISourceViewer.class.getName());
      }
      return viewer;
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.texteditor.AbstractTextViewerHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.texteditor;

public class CutLineToBeginningHandler
  extends AbstractDeleteLineHandler
{
  public CutLineToBeginningHandler()
  {
    super(1, true);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.texteditor.CutLineToBeginningHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.texteditor;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.ui.texteditor.TextViewerDeleteLineTarget;

public class AbstractDeleteLineHandler
  extends AbstractTextViewerHandler
  implements IHandler
{
  protected final int type;
  protected final boolean copyToClipboard;
  
  protected AbstractDeleteLineHandler(int type, boolean copyToClipboard)
  {
    this.type = type;
    this.copyToClipboard = copyToClipboard;
  }
  
  public Object execute(ExecutionEvent event)
    throws ExecutionException
  {
    ITextViewer viewer = getTextViewer(event);
    if (viewer != null)
    {
      TextViewerDeleteLineTarget target = new TextViewerDeleteLineTarget(viewer);
      try
      {
        ITextSelection textSelection = (ITextSelection)viewer.getSelectionProvider().getSelection();
        
        target.deleteLine(viewer.getDocument(), textSelection, type, copyToClipboard);
      }
      catch (BadLocationException e)
      {
        throw new ExecutionException(e.getMessage(), e);
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.texteditor.AbstractDeleteLineHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.texteditor;

public class DeleteLineToBeginningHandler
  extends AbstractDeleteLineHandler
{
  public DeleteLineToBeginningHandler()
  {
    super(1, false);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.texteditor.DeleteLineToBeginningHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.texteditor;

public class CutLineHandler
  extends AbstractDeleteLineHandler
{
  public CutLineHandler()
  {
    super(0, true);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.texteditor.CutLineHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.texteditor;

public class CutLineToEndHandler
  extends AbstractDeleteLineHandler
{
  public CutLineToEndHandler()
  {
    super(2, true);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.texteditor.CutLineToEndHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.forms;

import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.ImageHyperlink;

class MessageControl$2
  extends HyperlinkAdapter
{
  MessageControl$2(MessageControl paramMessageControl) {}
  
  public void linkActivated(HyperlinkEvent e)
  {
    this$0.closeMessage();
  }
  
  public void linkEntered(HyperlinkEvent e)
  {
    MessageControl.access$0(this$0).setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CLOSE_HOVER));
  }
  
  public void linkExited(HyperlinkEvent e)
  {
    MessageControl.access$0(this$0).setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CLOSE));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.forms.MessageControl.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.forms;

import java.util.Calendar;
import org.eclipse.jface.viewers.ISelection;

public class DatePickerPanel$DateSelection
  implements ISelection
{
  private final Calendar date;
  private final boolean isDefaultSelection;
  
  public DatePickerPanel$DateSelection(DatePickerPanel paramDatePickerPanel, Calendar calendar)
  {
    this(paramDatePickerPanel, calendar, false);
  }
  
  public DatePickerPanel$DateSelection(DatePickerPanel paramDatePickerPanel, Calendar calendar, boolean isDefaultSelection)
  {
    date = calendar;
    this.isDefaultSelection = isDefaultSelection;
  }
  
  public boolean isEmpty()
  {
    return date == null;
  }
  
  public boolean isDefaultSelection()
  {
    return isDefaultSelection;
  }
  
  public Calendar getDate()
  {
    return date;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.forms.DatePickerPanel.DateSelection
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.forms;

import java.util.Calendar;
import org.eclipse.mylyn.commons.ui.dialogs.IInPlaceDialogListener;
import org.eclipse.mylyn.commons.ui.dialogs.InPlaceDialogEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

class DatePicker$3
  extends SelectionAdapter
{
  DatePicker$3(DatePicker paramDatePicker) {}
  
  public void widgetSelected(SelectionEvent arg0)
  {
    final Calendar newCalendar = Calendar.getInstance();
    newCalendar.set(11, 0);
    newCalendar.set(12, 0);
    newCalendar.set(13, 0);
    newCalendar.set(14, 0);
    if (DatePicker.access$5(this$0) != null) {
      newCalendar.setTime(DatePicker.access$5(this$0).getTime());
    }
    Shell shell = DatePicker.access$6(this$0).getShell();
    if (shell == null) {
      if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
        shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
      } else {
        shell = new Shell(PlatformUI.getWorkbench().getDisplay());
      }
    }
    final InPlaceDateSelectionDialog dialog = new InPlaceDateSelectionDialog(shell, DatePicker.access$6(this$0), 
      newCalendar, DatePicker.TITLE_DIALOG, DatePicker.access$7(this$0), DatePicker.access$8(this$0));
    dialog.addEventListener(new IInPlaceDialogListener()
    {
      public void buttonPressed(InPlaceDialogEvent event)
      {
        Calendar selectedCalendar = null;
        if ((event.getReturnCode() == 0) && (dialog.getDate() != null))
        {
          selectedCalendar = newCalendar;
          selectedCalendar.setTime(dialog.getDate());
        }
        this$0.dateSelected(event.getReturnCode() == 1, selectedCalendar);
      }
    });
    dialog.open();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.forms.DatePicker.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.forms;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.ListViewer;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.commons.ui.compatibility.CommonColors;
import org.eclipse.mylyn.internal.commons.workbench.Messages;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.Hyperlink;

public class DatePickerPanel
  extends Composite
  implements KeyListener, ISelectionProvider
{
  private org.eclipse.swt.widgets.List timeList = null;
  private ISelection selection = null;
  private Calendar date = null;
  private DateTime calendar = null;
  private final java.util.List<ISelectionChangedListener> selectionListeners = new ArrayList();
  private int hourOfDay = 0;
  
  public DatePickerPanel(Composite parent, int style, Calendar initialDate, boolean includeTime, int hourOfDay)
  {
    this(parent, style, initialDate, includeTime, hourOfDay, -1);
  }
  
  public DatePickerPanel(Composite parent, int style, Calendar initialDate, boolean includeTime, int hourOfDay, int marginSize)
  {
    super(parent, style);
    date = initialDate;
    this.hourOfDay = hourOfDay;
    initialize(includeTime, marginSize);
    setDate(date);
  }
  
  private void initialize(boolean includeTime, int marginSize)
  {
    if (date == null)
    {
      date = Calendar.getInstance();
      date.set(11, hourOfDay);
      date.set(12, 0);
      date.set(13, 0);
      date.set(14, 0);
    }
    GridLayout gridLayout = new GridLayout();
    if (includeTime) {
      numColumns = 2;
    } else {
      numColumns = 1;
    }
    if (marginSize != -1) {
      marginWidth = marginSize;
    }
    setLayout(gridLayout);
    
    calendar = new DateTime(this, 1024);
    calendar.addSelectionListener(new SelectionAdapter()
    {
      public void widgetDefaultSelected(SelectionEvent e)
      {
        date.set(1, calendar.getYear());
        date.set(2, calendar.getMonth());
        date.set(5, calendar.getDay());
        setSelection(new DatePickerPanel.DateSelection(DatePickerPanel.this, date, true));
        DatePickerPanel.this.notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
      }
      
      public void widgetSelected(SelectionEvent e)
      {
        date.set(1, calendar.getYear());
        date.set(2, calendar.getMonth());
        date.set(5, calendar.getDay());
        setSelection(new DatePickerPanel.DateSelection(DatePickerPanel.this, date));
        DatePickerPanel.this.notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
      }
    });
    if (includeTime) {
      createTimeList(this);
    }
    Hyperlink todayLink = new Hyperlink(this, 0);
    todayLink.setText(Messages.DatePickerPanel_Today);
    todayLink.setUnderlined(true);
    todayLink.setForeground(CommonColors.HYPERLINK_WIDGET);
    GridDataFactory.fillDefaults().span(2, 1).grab(true, false).align(16777216, 128).applyTo(todayLink);
    todayLink.addHyperlinkListener(new HyperlinkAdapter()
    {
      public void linkActivated(HyperlinkEvent e)
      {
        Calendar today = Calendar.getInstance();
        ISelection selection = getSelection();
        if (((selection instanceof DatePickerPanel.DateSelection)) && (!selection.isEmpty()))
        {
          Calendar selectedDate = ((DatePickerPanel.DateSelection)selection).getDate();
          if (selectedDate != null)
          {
            today.set(11, selectedDate.get(11));
            today.set(12, selectedDate.get(12));
            today.set(13, selectedDate.get(13));
            today.set(14, selectedDate.get(14));
          }
        }
        setDate(today, true);
      }
    });
  }
  
  private void createTimeList(Composite composite)
  {
    DateFormat dateFormat = DateFormat.getTimeInstance(3);
    Calendar tempCalendar = Calendar.getInstance();
    tempCalendar.set(12, 0);
    tempCalendar.set(13, 0);
    String[] times = new String[24];
    for (int x = 0; x < 24; x++)
    {
      tempCalendar.set(11, x);
      String timeString = dateFormat.format(tempCalendar.getTime());
      times[x] = timeString;
    }
    ListViewer listViewer = new ListViewer(composite);
    
    listViewer.setContentProvider(new ArrayContentProvider());
    listViewer.setInput(times);
    
    timeList = listViewer.getList();
    
    listViewer.addSelectionChangedListener(new ISelectionChangedListener()
    {
      public void selectionChanged(SelectionChangedEvent event)
      {
        date.set(11, timeList.getSelectionIndex());
        date.set(12, 0);
        setSelection(new DatePickerPanel.DateSelection(DatePickerPanel.this, date));
        DatePickerPanel.this.notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
      }
    });
    listViewer.addOpenListener(new IOpenListener()
    {
      public void open(OpenEvent event)
      {
        date.set(11, timeList.getSelectionIndex());
        date.set(12, 0);
        setSelection(new DatePickerPanel.DateSelection(DatePickerPanel.this, date, true));
        DatePickerPanel.this.notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
      }
    });
    GridDataFactory.fillDefaults().hint(-1, 50).applyTo(timeList);
    if (date != null) {
      listViewer.setSelection(new StructuredSelection(times[date.get(11)]), true);
    } else {
      listViewer.setSelection(new StructuredSelection(times[8]), true);
    }
    timeList.addKeyListener(this);
  }
  
  public void setDate(Calendar date)
  {
    setDate(date, false);
  }
  
  public void setDate(Calendar date, boolean notifyListeners)
  {
    this.date = date;
    calendar.setYear(date.get(1));
    calendar.setMonth(date.get(2));
    calendar.setDay(date.get(5));
    if (notifyListeners)
    {
      setSelection(new DateSelection(date, false));
      notifyListeners(new SelectionChangedEvent(this, getSelection()));
    }
  }
  
  public void keyPressed(KeyEvent e)
  {
    if (keyCode == 27)
    {
      SelectionChangedEvent changeEvent = new SelectionChangedEvent(this, new ISelection()
      {
        public boolean isEmpty()
        {
          return true;
        }
      });
      notifyListeners(changeEvent);
    }
  }
  
  public void keyReleased(KeyEvent e) {}
  
  private void notifyListeners(SelectionChangedEvent event)
  {
    for (ISelectionChangedListener listener : selectionListeners) {
      listener.selectionChanged(event);
    }
  }
  
  public void addSelectionChangedListener(ISelectionChangedListener listener)
  {
    selectionListeners.add(listener);
  }
  
  public ISelection getSelection()
  {
    return selection;
  }
  
  public void removeSelectionChangedListener(ISelectionChangedListener listener)
  {
    selectionListeners.remove(listener);
  }
  
  public void setSelection(ISelection selection)
  {
    this.selection = selection;
  }
  
  public class DateSelection
    implements ISelection
  {
    private final Calendar date;
    private final boolean isDefaultSelection;
    
    public DateSelection(Calendar calendar)
    {
      this(calendar, false);
    }
    
    public DateSelection(Calendar calendar, boolean isDefaultSelection)
    {
      date = calendar;
      this.isDefaultSelection = isDefaultSelection;
    }
    
    public boolean isEmpty()
    {
      return date == null;
    }
    
    public boolean isDefaultSelection()
    {
      return isDefaultSelection;
    }
    
    public Calendar getDate()
    {
      return date;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.forms.DatePickerPanel
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.forms;

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.ui.forms.widgets.FormToolkit;

class SectionComposite$1
  implements DisposeListener
{
  SectionComposite$1(SectionComposite paramSectionComposite) {}
  
  public void widgetDisposed(DisposeEvent e)
  {
    if (SectionComposite.access$1(this$0) != null)
    {
      SectionComposite.access$1(this$0).dispose();
      SectionComposite.access$2(this$0, null);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.forms.SectionComposite.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.workbench.forms;

import java.util.Calendar;
import org.eclipse.mylyn.commons.ui.dialogs.IInPlaceDialogListener;
import org.eclipse.mylyn.commons.ui.dialogs.InPlaceDialogEvent;

class DatePicker$3$1
  implements IInPlaceDialogListener
{
  DatePicker$3$1(DatePicker.3 param3, InPlaceDateSelectionDialog paramInPlaceDateSelectionDialog, Calendar paramCalendar) {}
  
  public void buttonPressed(InPlaceDialogEvent event)
  {
    Calendar selectedCalendar = null;
    if ((event.getReturnCode() == 0) && (val$dialog.getDate() != null))
    {
      selectedCalendar = val$newCalendar;
      selectedCalendar.setTime(val$dialog.getDate());
    }
    DatePicker.3.access$0(this$1).dateSelected(event.getReturnCode() == 1, selectedCalendar);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.workbench.forms.DatePicker.3.1
1 2 3 4 5 6 7

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