org.eclipse.mylyn.wikitext.ui_1.6.1.v20120425-0100

;
    dragSource.addDragListener(dragAdapter);
    dragSource.setTransfer(dragAdapter.getTransfers());
    
    dropAdapter = new DelegatingDropAdapter();
    dropTarget = new DropTarget(control, 3);
    dropAdapter.addDropTargetListener(new OutlineDropTargetListener(commandManager));
    dropTarget.addDropListener(dropAdapter);
    dropTarget.setTransfer(dropAdapter.getTransfers());
  }
  
  public void dispose()
  {
    if (dragSource != null)
    {
      dragSource.dispose();
      dragSource = null;
    }
    if (dropTarget != null)
    {
      dropTarget.dispose();
      dropTarget = null;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.dnd.DndConfigurationStrategy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor.dnd;

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;
import org.eclipse.mylyn.internal.wikitext.ui.editor.operations.AbstractDocumentCommand;
import org.eclipse.mylyn.internal.wikitext.ui.editor.operations.CommandManager;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

class OutlineDropTargetListener$1
  implements ISafeRunnable
{
  OutlineDropTargetListener$1(OutlineDropTargetListener paramOutlineDropTargetListener, AbstractDocumentCommand paramAbstractDocumentCommand) {}
  
  public void handleException(Throwable exception)
  {
    WikiTextUiPlugin.getDefault().log(exception);
    MessageDialog.openError(
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), 
      Messages.OutlineDropTargetListener_0, 
      NLS.bind(Messages.OutlineDropTargetListener_1, 
      new Object[] { exception.getMessage() }));
  }
  
  public void run()
    throws Exception
  {
    OutlineDropTargetListener.access$0(this$0).perform(val$command);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.dnd.OutlineDropTargetListener.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor.dnd;

import org.eclipse.jface.util.LocalSelectionTransfer;
import org.eclipse.jface.util.TransferDragSourceListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.Transfer;

public class OutlineDragSourceListener
  implements TransferDragSourceListener
{
  private final ISelectionProvider selectionProvider;
  
  public OutlineDragSourceListener(ISelectionProvider selectionProvider)
  {
    this.selectionProvider = selectionProvider;
  }
  
  public Transfer getTransfer()
  {
    return LocalSelectionTransfer.getTransfer();
  }
  
  public void dragFinished(DragSourceEvent event)
  {
    LocalSelectionTransfer.getTransfer().setSelection(null);
  }
  
  public void dragSetData(DragSourceEvent event) {}
  
  public void dragStart(DragSourceEvent event)
  {
    LocalSelectionTransfer.getTransfer().setSelection(selectionProvider.getSelection());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.dnd.OutlineDragSourceListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor.dnd;

import org.eclipse.osgi.util.NLS;

class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.wikitext.ui.editor.dnd.messages";
  public static String OutlineDropTargetListener_0;
  public static String OutlineDropTargetListener_1;
  public static String OutlineDropTargetListener_2;
  public static String OutlineDropTargetListener_3;
  
  static
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.wikitext.ui.editor.dnd.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.dnd.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor.help;

import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Bundle;

public class HelpContent
{
  private final Bundle provider;
  private final String resourcePath;
  private final String resourceContentLanguage;
  private final String markupLanguageName;
  
  public HelpContent(Bundle provider, String resourcePath, String resourceContentLanguage, String markupLanguage)
  {
    if ((provider == null) || (resourcePath == null) || (markupLanguage == null)) {
      throw new IllegalArgumentException();
    }
    this.provider = provider;
    this.resourcePath = resourcePath;
    this.resourceContentLanguage = resourceContentLanguage;
    markupLanguageName = markupLanguage;
  }
  
  public String getMarkupLanguageName()
  {
    return markupLanguageName;
  }
  
  public Bundle getProvider()
  {
    return provider;
  }
  
  /* Error */
  public String getContent()
    throws IOException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_1
    //   2: aload_0
    //   3: invokespecial 214	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent:getResource	()Ljava/net/URL;
    //   6: astore_2
    //   7: new 88	java/io/InputStreamReader
    //   10: dup
    //   11: new 86	java/io/BufferedInputStream
    //   14: dup
    //   15: aload_2
    //   16: invokevirtual 208	java/net/URL:openStream	()Ljava/io/InputStream;
    //   19: invokespecial 188	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   22: invokespecial 190	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;)V
    //   25: astore_3
    //   26: new 94	java/lang/StringBuilder
    //   29: dup
    //   30: invokespecial 203	java/lang/StringBuilder:<init>	()V
    //   33: astore 4
    //   35: goto +12 -> 47
    //   38: aload 4
    //   40: iload 5
    //   42: i2c
    //   43: invokevirtual 206	java/lang/StringBuilder:append	(C)Ljava/lang/StringBuilder;
    //   46: pop
    //   47: aload_3
    //   48: invokevirtual 191	java/io/Reader:read	()I
    //   51: dup
    //   52: istore 5
    //   54: iconst_m1
    //   55: if_icmpne -17 -> 38
    //   58: aload 4
    //   60: invokevirtual 204	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   63: astore_1
    //   64: goto +12 -> 76
    //   67: astore 6
    //   69: aload_3
    //   70: invokevirtual 192	java/io/Reader:close	()V
    //   73: aload 6
    //   75: athrow
    //   76: aload_3
    //   77: invokevirtual 192	java/io/Reader:close	()V
    //   80: aload_0
    //   81: getfield 182	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent:resourceContentLanguage	Ljava/lang/String;
    //   84: ifnull +15 -> 99
    //   87: ldc 3
    //   89: aload_0
    //   90: getfield 182	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent:resourceContentLanguage	Ljava/lang/String;
    //   93: invokevirtual 201	java/lang/String:equalsIgnoreCase	(Ljava/lang/String;)Z
    //   96: ifeq +5 -> 101
    //   99: aload_1
    //   100: areturn
    //   101: aload_0
    //   102: getfield 182	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent:resourceContentLanguage	Ljava/lang/String;
    //   105: invokestatic 216	org/eclipse/mylyn/wikitext/core/WikiText:getMarkupLanguage	(Ljava/lang/String;)Lorg/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage;
    //   108: astore 4
    //   110: aload 4
    //   112: ifnonnull +28 -> 140
    //   115: new 87	java/io/IOException
    //   118: dup
    //   119: getstatic 187	org/eclipse/mylyn/internal/wikitext/ui/editor/help/Messages:HelpContent_noSuchMarkupLanguage	Ljava/lang/String;
    //   122: iconst_1
    //   123: anewarray 92	java/lang/Object
    //   126: dup
    //   127: iconst_0
    //   128: aload_0
    //   129: getfield 182	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent:resourceContentLanguage	Ljava/lang/String;
    //   132: aastore
    //   133: invokestatic 219	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   136: invokespecial 189	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   139: athrow
    //   140: new 104	org/eclipse/mylyn/wikitext/core/parser/MarkupParser
    //   143: dup
    //   144: aload 4
    //   146: invokespecial 217	org/eclipse/mylyn/wikitext/core/parser/MarkupParser:<init>	(Lorg/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage;)V
    //   149: astore 5
    //   151: aload 5
    //   153: aload_1
    //   154: invokevirtual 218	org/eclipse/mylyn/wikitext/core/parser/MarkupParser:parseToHtml	(Ljava/lang/String;)Ljava/lang/String;
    //   157: areturn
    //   158: astore_1
    //   159: new 101	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent$1
    //   162: dup
    //   163: aload_0
    //   164: getstatic 185	org/eclipse/mylyn/internal/wikitext/ui/editor/help/Messages:HelpContent_cannotAccessContent	Ljava/lang/String;
    //   167: iconst_3
    //   168: anewarray 92	java/lang/Object
    //   171: dup
    //   172: iconst_0
    //   173: aload_0
    //   174: getfield 184	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent:provider	Lorg/osgi/framework/Bundle;
    //   177: invokeinterface 224 1 0
    //   182: aastore
    //   183: dup
    //   184: iconst_1
    //   185: aload_0
    //   186: getfield 183	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent:resourcePath	Ljava/lang/String;
    //   189: aastore
    //   190: dup
    //   191: iconst_2
    //   192: aload_1
    //   193: invokevirtual 193	java/lang/Exception:getMessage	()Ljava/lang/String;
    //   196: aastore
    //   197: invokestatic 219	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   200: aload_1
    //   201: invokespecial 215	org/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent$1:<init>	(Lorg/eclipse/mylyn/internal/wikitext/ui/editor/help/HelpContent;Ljava/lang/String;Ljava/lang/Exception;)V
    //   204: athrow
    // Line number table:
    //   Java source line #94	-> byte code offset #0
    //   Java source line #95	-> byte code offset #2
    //   Java source line #96	-> byte code offset #7
    //   Java source line #98	-> byte code offset #26
    //   Java source line #100	-> byte code offset #35
    //   Java source line #101	-> byte code offset #38
    //   Java source line #100	-> byte code offset #47
    //   Java source line #103	-> byte code offset #58
    //   Java source line #104	-> byte code offset #67
    //   Java source line #105	-> byte code offset #69
    //   Java source line #106	-> byte code offset #73
    //   Java source line #105	-> byte code offset #76
    //   Java source line #107	-> byte code offset #80
    //   Java source line #108	-> byte code offset #99
    //   Java source line #110	-> byte code offset #101
    //   Java source line #111	-> byte code offset #110
    //   Java source line #112	-> byte code offset #115
    //   Java source line #113	-> byte code offset #122
    //   Java source line #112	-> byte code offset #133
    //   Java source line #115	-> byte code offset #140
    //   Java source line #116	-> byte code offset #151
    //   Java source line #117	-> byte code offset #158
    //   Java source line #118	-> byte code offset #159
    //   Java source line #119	-> byte code offset #167
    //   Java source line #118	-> byte code offset #197
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	205	0	this	HelpContent
    //   1	153	1	content	String
    //   158	43	1	e	Exception
    //   6	10	2	resource	URL
    //   25	52	3	reader	java.io.Reader
    //   33	26	4	buf	StringBuilder
    //   108	37	4	markupLanguage	org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage
    //   38	3	5	i	int
    //   52	3	5	i	int
    //   149	3	5	markupParser	org.eclipse.mylyn.wikitext.core.parser.MarkupParser
    //   67	7	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   26	67	67	finally
    //   0	100	158	java/lang/Exception
    //   101	157	158	java/lang/Exception
  }
  
  private URL getResource()
    throws Exception
  {
    int idx = resourcePath.lastIndexOf('.');
    List<String> paths = new ArrayList();
    String extension;
    if (idx != -1)
    {
      String basePath = resourcePath.substring(0, idx);
      extension = resourcePath.substring(idx + 1);
      
      Locale locale = Locale.getDefault();
      String language = locale.getLanguage();
      String country = locale.getCountry();
      String variant = locale.getVariant();
      if (variant.length() > 0) {
        paths.add(basePath + "_" + language + "_" + country + "_" + variant + "." + extension);
      }
      if (country.length() > 0) {
        paths.add(basePath + "_" + language + "_" + country + "." + extension);
      }
      if (language.length() > 0) {
        paths.add(basePath + "_" + language + "." + extension);
      }
    }
    paths.add(resourcePath);
    for (String path : paths)
    {
      URL resource = provider.getResource(path);
      if (resource != null) {
        return resource;
      }
    }
    throw new Exception(NLS.bind(Messages.HelpContent_cannotFindResource, 
      new Object[] { resourcePath, provider.getSymbolicName() }));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.help.HelpContent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor.help;

import java.io.IOException;

class HelpContent$1
  extends IOException
{
  HelpContent$1(HelpContent paramHelpContent, String $anonymous0, Exception paramException)
  {
    super($anonymous0);
  }
  
  public Throwable getCause()
  {
    return val$e;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.help.HelpContent.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor.help;

import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.osgi.framework.Bundle;

public class CheatSheetContent
  extends HelpContent
{
  private final Pattern headingOpenTagPattern = Pattern.compile("(<h[4-6][^>]*)>", 10);
  
  public CheatSheetContent(Bundle provider, String resourcePath, String resourceContentLanguage, String markupLanguageName)
  {
    super(provider, resourcePath, resourceContentLanguage, markupLanguageName);
  }
  
  public String getContent()
    throws IOException
  {
    String content = super.getContent();
    Matcher headingMatcher = headingOpenTagPattern.matcher(content);
    return headingMatcher.replaceAll("$1 style=\"color: DarkBlue;\">");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.help.CheatSheetContent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor.help;

import org.eclipse.osgi.util.NLS;

class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.wikitext.ui.editor.help.messages";
  public static String HelpContent_cannotAccessContent;
  public static String HelpContent_cannotFindResource;
  public static String HelpContent_noSuchMarkupLanguage;
  
  static
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.wikitext.ui.editor.help.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.help.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.window.ToolTip;
import org.eclipse.mylyn.internal.wikitext.ui.editor.dnd.DndConfigurationStrategy;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.IShowInSource;
import org.eclipse.ui.part.IShowInTarget;
import org.eclipse.ui.part.ShowInContext;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.eclipse.ui.texteditor.IUpdate;
import org.eclipse.ui.views.contentoutline.ContentOutlinePage;

public class MarkupEditorOutline
  extends ContentOutlinePage
  implements IShowInSource, IShowInTarget
{
  private final MarkupEditor editor;
  private boolean disableReveal;
  private DndConfigurationStrategy dndConfigurationStrategy;
  
  public MarkupEditorOutline(MarkupEditor editor)
  {
    this.editor = editor;
  }
  
  public void createControl(Composite parent)
  {
    super.createControl(parent);
    
    TreeViewer viewer = getTreeViewer();
    viewer.setUseHashlookup(true);
    viewer.setAutoExpandLevel(-1);
    viewer.setContentProvider(new BaseWorkbenchContentProvider());
    viewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
    viewer.setInput(editor.getOutlineModel());
    
    viewer.addOpenListener(new IOpenListener()
    {
      public void open(OpenEvent event)
      {
        MarkupEditorOutline.this.revealInEditor(event.getSelection(), true);
      }
    });
    viewer.addPostSelectionChangedListener(new ISelectionChangedListener()
    {
      public void selectionChanged(SelectionChangedEvent event)
      {
        MarkupEditorOutline.this.revealInEditor(event.getSelection(), false);
      }
    });
    viewer.expandAll();
    
    new ToolTip(viewer.getControl(), 1, false);
    {
      protected Composite createToolTipContentArea(Event event, Composite parent)
      {
        Composite comp = new Composite(parent, 0);
        comp.setBackground(parent.getDisplay().getSystemColor(29));
        
        GridLayout gl = new GridLayout(1, false);
        marginBottom = 2;
        marginTop = 2;
        marginHeight = 0;
        marginWidth = 0;
        marginLeft = 2;
        marginRight = 2;
        verticalSpacing = 1;
        comp.setLayout(gl);
        
        Object tipItem = getToolTipItem(new Point(x, y));
        if ((tipItem instanceof OutlineItem))
        {
          OutlineItem outlineItem = (OutlineItem)tipItem;
          Label label = new Label(comp, 64);
          label.setBackground(comp.getBackground());
          label.setText(outlineItem.getTooltip());
        }
        return comp;
      }
      
      protected boolean shouldCreateToolTip(Event event)
      {
        Object eventItem = getToolTipItem(new Point(x, y));
        boolean shouldCreate = (eventItem != null) && ((eventItem instanceof OutlineItem)) && 
          (super.shouldCreateToolTip(event));
        if (!shouldCreate) {
          hide();
        }
        return shouldCreate;
      }
      
      protected Object getToolTipItem(Point point)
      {
        TreeItem item = ((Tree)getTreeViewer().getControl()).getItem(point);
        if (item != null) {
          return item.getData();
        }
        return null;
      }
    };
    getSite().setSelectionProvider(viewer);
    
    MenuManager manager = new MenuManager("#PopUp");
    manager.setRemoveAllWhenShown(true);
    manager.addMenuListener(new IMenuListener()
    {
      public void menuAboutToShow(IMenuManager menuManager)
      {
        contextMenuAboutToShow(menuManager);
      }
    });
    viewer.getTree().setMenu(manager.createContextMenu(viewer.getTree()));
    
    getSite().registerContextMenu("org.eclipse.mylyn.wikitext.ui.editor.markupEditor.outlineContextMenu", manager, viewer);
    
    configureDnd();
    configureActions();
  }
  
  public void dispose()
  {
    if (dndConfigurationStrategy != null)
    {
      dndConfigurationStrategy.dispose();
      dndConfigurationStrategy = null;
    }
    super.dispose();
  }
  
  private void configureDnd()
  {
    dndConfigurationStrategy = new DndConfigurationStrategy();
    dndConfigurationStrategy.configure(editor, getControl(), getTreeViewer());
  }
  
  private void configureActions()
  {
    registerAction(ITextEditorActionConstants.UNDO);
    registerAction(ITextEditorActionConstants.REDO);
    registerAction(ITextEditorActionConstants.REVERT);
    registerAction(ITextEditorActionConstants.SAVE);
    registerAction(ITextEditorActionConstants.FIND);
    registerAction(ITextEditorActionConstants.PRINT);
  }
  
  private void registerAction(String actionId)
  {
    IAction action = editor.getAction(actionId);
    if (action != null) {
      getSite().getActionBars().setGlobalActionHandler(actionId, action);
    }
  }
  
  protected void contextMenuAboutToShow(IMenuManager menuManager)
  {
    menuManager.add(new Separator("group.undo"));
    menuManager.add(new GroupMarker("group.save"));
    menuManager.add(new Separator("group.copy"));
    menuManager.add(new Separator("group.print"));
    menuManager.add(new Separator("group.edit"));
    menuManager.add(new Separator("group.find"));
    menuManager.add(new Separator("group.add"));
    menuManager.add(new Separator("group.showIn"));
    menuManager.add(new Separator("group.reorganize"));
    menuManager.add(new Separator("group.rest"));
    menuManager.add(new Separator("additions"));
    
    addAction(menuManager, "group.undo", ITextEditorActionConstants.UNDO);
    addAction(menuManager, "group.undo", ITextEditorActionConstants.REDO);
    addAction(menuManager, "group.undo", ITextEditorActionConstants.REVERT);
    addAction(menuManager, "group.save", ITextEditorActionConstants.SAVE);
    addAction(menuManager, "group.find", ITextEditorActionConstants.FIND);
    addAction(menuManager, "group.print", ITextEditorActionConstants.PRINT);
  }
  
  protected final void addAction(IMenuManager menu, String group, String actionId)
  {
    IAction action = editor.getAction(actionId);
    if (action != null)
    {
      if ((action instanceof IUpdate)) {
        ((IUpdate)action).update();
      }
      IMenuManager subMenu = menu.findMenuUsingPath(group);
      if (subMenu != null) {
        subMenu.add(action);
      } else {
        menu.appendToGroup(group, action);
      }
    }
  }
  
  protected TreeViewer getTreeViewer()
  {
    return super.getTreeViewer();
  }
  
  private void revealInEditor(ISelection selection, boolean open)
  {
    if (disableReveal) {
      return;
    }
    if ((selection instanceof IStructuredSelection))
    {
      IStructuredSelection structuredSelection = (IStructuredSelection)selection;
      Object firstElement = structuredSelection.getFirstElement();
      if ((firstElement instanceof OutlineItem))
      {
        OutlineItem item = (OutlineItem)firstElement;
        editor.selectAndReveal(item);
      }
    }
  }
  
  /* Error */
  public void refresh()
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 291	org/eclipse/mylyn/internal/wikitext/ui/editor/MarkupEditorOutline:getTreeViewer	()Lorg/eclipse/jface/viewers/TreeViewer;
    //   4: invokevirtual 281	org/eclipse/jface/viewers/TreeViewer:getTree	()Lorg/eclipse/swt/widgets/Tree;
    //   7: iconst_0
    //   8: invokevirtual 302	org/eclipse/swt/widgets/Tree:setRedraw	(Z)V
    //   11: aload_0
    //   12: invokevirtual 291	org/eclipse/mylyn/internal/wikitext/ui/editor/MarkupEditorOutline:getTreeViewer	()Lorg/eclipse/jface/viewers/TreeViewer;
    //   15: invokevirtual 272	org/eclipse/jface/viewers/TreeViewer:refresh	()V
    //   18: aload_0
    //   19: invokevirtual 291	org/eclipse/mylyn/internal/wikitext/ui/editor/MarkupEditorOutline:getTreeViewer	()Lorg/eclipse/jface/viewers/TreeViewer;
    //   22: invokevirtual 271	org/eclipse/jface/viewers/TreeViewer:expandAll	()V
    //   25: goto +17 -> 42
    //   28: astore_1
    //   29: aload_0
    //   30: invokevirtual 291	org/eclipse/mylyn/internal/wikitext/ui/editor/MarkupEditorOutline:getTreeViewer	()Lorg/eclipse/jface/viewers/TreeViewer;
    //   33: invokevirtual 281	org/eclipse/jface/viewers/TreeViewer:getTree	()Lorg/eclipse/swt/widgets/Tree;
    //   36: iconst_1
    //   37: invokevirtual 302	org/eclipse/swt/widgets/Tree:setRedraw	(Z)V
    //   40: aload_1
    //   41: athrow
    //   42: aload_0
    //   43: invokevirtual 291	org/eclipse/mylyn/internal/wikitext/ui/editor/MarkupEditorOutline:getTreeViewer	()Lorg/eclipse/jface/viewers/TreeViewer;
    //   46: invokevirtual 281	org/eclipse/jface/viewers/TreeViewer:getTree	()Lorg/eclipse/swt/widgets/Tree;
    //   49: iconst_1
    //   50: invokevirtual 302	org/eclipse/swt/widgets/Tree:setRedraw	(Z)V
    //   53: return
    // Line number table:
    //   Java source line #240	-> byte code offset #0
    //   Java source line #242	-> byte code offset #11
    //   Java source line #243	-> byte code offset #18
    //   Java source line #244	-> byte code offset #28
    //   Java source line #245	-> byte code offset #29
    //   Java source line #246	-> byte code offset #40
    //   Java source line #245	-> byte code offset #42
    //   Java source line #247	-> byte code offset #53
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	54	0	this	MarkupEditorOutline
    //   28	13	1	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   11	28	28	finally
  }
  
  /* Error */
  public void setSelection(ISelection selection)
  {
    // Byte code:
    //   0: aload_0
    //   1: iconst_1
    //   2: putfield 256	org/eclipse/mylyn/internal/wikitext/ui/editor/MarkupEditorOutline:disableReveal	Z
    //   5: aload_0
    //   6: aload_1
    //   7: invokespecial 308	org/eclipse/ui/views/contentoutline/ContentOutlinePage:setSelection	(Lorg/eclipse/jface/viewers/ISelection;)V
    //   10: goto +11 -> 21
    //   13: astore_2
    //   14: aload_0
    //   15: iconst_0
    //   16: putfield 256	org/eclipse/mylyn/internal/wikitext/ui/editor/MarkupEditorOutline:disableReveal	Z
    //   19: aload_2
    //   20: athrow
    //   21: aload_0
    //   22: iconst_0
    //   23: putfield 256	org/eclipse/mylyn/internal/wikitext/ui/editor/MarkupEditorOutline:disableReveal	Z
    //   26: return
    // Line number table:
    //   Java source line #251	-> byte code offset #0
    //   Java source line #253	-> byte code offset #5
    //   Java source line #254	-> byte code offset #13
    //   Java source line #255	-> byte code offset #14
    //   Java source line #256	-> byte code offset #19
    //   Java source line #255	-> byte code offset #21
    //   Java source line #257	-> byte code offset #26
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	27	0	this	MarkupEditorOutline
    //   0	27	1	selection	ISelection
    //   13	7	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   5	13	13	finally
  }
  
  public ShowInContext getShowInContext()
  {
    return editor.getShowInContext();
  }
  
  public boolean show(ShowInContext context)
  {
    return editor.show(context);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditorOutline
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineParser;
import org.eclipse.swt.widgets.Display;

class MarkupEditor$15
  extends Job
{
  MarkupEditor$15(MarkupEditor paramMarkupEditor, String $anonymous0, MarkupLanguage paramMarkupLanguage, String paramString1, Display paramDisplay, int paramInt)
  {
    super($anonymous0);
  }
  
  protected IStatus run(IProgressMonitor monitor)
  {
    MarkupEditor.access$18(this$0).setMarkupLanguage(val$language);
    if (shouldCancel()) {
      return Status.CANCEL_STATUS;
    }
    final OutlineItem rootItem = MarkupEditor.access$18(this$0).parse(val$content);
    if (shouldCancel()) {
      return Status.CANCEL_STATUS;
    }
    val$display.asyncExec(new Runnable()
    {
      public void run()
      {
        MarkupEditor.access$19(this$0, val$contentGeneration, rootItem);
      }
    });
    return Status.OK_STATUS;
  }
  
  private boolean shouldCancel()
  {
    synchronized (this$0)
    {
      if (val$contentGeneration != this$0.documentGeneration) {
        return true;
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.15
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

class MarkupEditor$7$1
  implements Runnable
{
  MarkupEditor$7$1(MarkupEditor.7 param7) {}
  
  public void run()
  {
    MarkupEditor.access$6(MarkupEditor.7.access$0(this$1));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.7.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;

class MarkupEditor$15$1
  implements Runnable
{
  MarkupEditor$15$1(MarkupEditor.15 param15, int paramInt, OutlineItem paramOutlineItem) {}
  
  public void run()
  {
    MarkupEditor.access$19(MarkupEditor.15.access$0(this$1), val$contentGeneration, val$rootItem);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.15.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;

class MarkupEditor$5
  extends KeyAdapter
{
  MarkupEditor$5(MarkupEditor paramMarkupEditor) {}
  
  public void keyReleased(KeyEvent e)
  {
    if (isRelevantKeyCode(keyCode)) {
      MarkupEditor.access$3(this$0);
    }
  }
  
  private boolean isRelevantKeyCode(int keyCode)
  {
    switch (keyCode)
    {
    case 16777217: 
    case 16777218: 
    case 16777219: 
    case 16777220: 
    case 16777221: 
    case 16777222: 
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.5
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.jface.text.information.IInformationPresenter;
import org.eclipse.jface.text.reconciler.IReconciler;
import org.eclipse.jface.text.source.IOverviewRuler;
import org.eclipse.jface.text.source.IVerticalRuler;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.jface.text.source.projection.ProjectionViewer;
import org.eclipse.mylyn.wikitext.ui.editor.MarkupSourceViewerConfiguration;
import org.eclipse.swt.widgets.Composite;

public class MarkupProjectionViewer
  extends ProjectionViewer
{
  public static final int QUICK_OUTLINE = 513;
  private IInformationPresenter outlinePresenter;
  
  public MarkupProjectionViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles)
  {
    super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles);
  }
  
  public IReconciler getReconciler()
  {
    return fReconciler;
  }
  
  public void doOperation(int operation)
  {
    if ((operation == 513) && (outlinePresenter != null))
    {
      outlinePresenter.showInformation();
      return;
    }
    super.doOperation(operation);
  }
  
  public boolean canDoOperation(int operation)
  {
    if ((operation == 513) && (outlinePresenter != null)) {
      return true;
    }
    return super.canDoOperation(operation);
  }
  
  public void configure(SourceViewerConfiguration configuration)
  {
    super.configure(configuration);
    if ((configuration instanceof MarkupSourceViewerConfiguration))
    {
      outlinePresenter = ((MarkupSourceViewerConfiguration)configuration).getOutlineInformationPresenter(this);
      outlinePresenter.install(this);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupProjectionViewer
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

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

class MarkupEditorOutline$2
  implements ISelectionChangedListener
{
  MarkupEditorOutline$2(MarkupEditorOutline paramMarkupEditorOutline) {}
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    MarkupEditorOutline.access$0(this$0, event.getSelection(), false);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditorOutline.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.swt.graphics.Point;

final class FindAndReplaceTarget$Result
{
  private final Point selection;
  private final String findString;
  private final int index;
  private final boolean findHit;
  
  public FindAndReplaceTarget$Result(Point selection, String findString, int index, boolean findHit)
  {
    this.findString = findString;
    this.index = index;
    this.selection = new Point(x, y);
    this.findHit = findHit;
  }
  
  public String toString()
  {
    return 
      "Result [selection=" + selection + ", findString=" + findString + ", index=" + index + ", findHit=" + findHit + "]";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.FindAndReplaceTarget.Result
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.swt.widgets.Control;

class MarkupEditor$16
  implements Runnable
{
  MarkupEditor$16(MarkupEditor paramMarkupEditor) {}
  
  public void run()
  {
    if ((MarkupEditor.access$20(this$0) != null) && (MarkupEditor.access$20(this$0).getControl() != null) && 
      (!MarkupEditor.access$20(this$0).getControl().isDisposed())) {
      MarkupEditor.access$3(this$0);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.16
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.ui.editors.text.TextEditorActionContributor;

public class MarkupEditorActionBarContributor
  extends TextEditorActionContributor
{}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditorActionBarContributor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import java.util.Collection;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;

class FoldingStructure$1
  extends FoldingStructure.AbstractItemsAnnotationOperation
{
  FoldingStructure$1(FoldingStructure paramFoldingStructure, Collection $anonymous0)
  {
    super($anonymous0);
  }
  
  public boolean operateOnSelected(HeadingProjectionAnnotation annotation)
  {
    return operateOnUnselected(annotation);
  }
  
  public boolean operateOnUnselected(HeadingProjectionAnnotation annotation)
  {
    if (!annotation.isCollapsed())
    {
      annotation.markCollapsed();
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.FoldingStructure.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;

class MarkupEditor$6
  extends MouseAdapter
{
  MarkupEditor$6(MarkupEditor paramMarkupEditor) {}
  
  public void mouseUp(MouseEvent e)
  {
    MarkupEditor.access$3(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.6
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.window.ToolTip;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

class MarkupEditorOutline$3
  extends ToolTip
{
  MarkupEditorOutline$3(MarkupEditorOutline paramMarkupEditorOutline, Control $anonymous0, int $anonymous1, boolean $anonymous2)
  {
    super($anonymous0, $anonymous1, $anonymous2);
  }
  
  protected Composite createToolTipContentArea(Event event, Composite parent)
  {
    Composite comp = new Composite(parent, 0);
    comp.setBackground(parent.getDisplay().getSystemColor(29));
    
    GridLayout gl = new GridLayout(1, false);
    marginBottom = 2;
    marginTop = 2;
    marginHeight = 0;
    marginWidth = 0;
    marginLeft = 2;
    marginRight = 2;
    verticalSpacing = 1;
    comp.setLayout(gl);
    
    Object tipItem = getToolTipItem(new Point(x, y));
    if ((tipItem instanceof OutlineItem))
    {
      OutlineItem outlineItem = (OutlineItem)tipItem;
      Label label = new Label(comp, 64);
      label.setBackground(comp.getBackground());
      label.setText(outlineItem.getTooltip());
    }
    return comp;
  }
  
  protected boolean shouldCreateToolTip(Event event)
  {
    Object eventItem = getToolTipItem(new Point(x, y));
    boolean shouldCreate = (eventItem != null) && ((eventItem instanceof OutlineItem)) && 
      (super.shouldCreateToolTip(event));
    if (!shouldCreate) {
      hide();
    }
    return shouldCreate;
  }
  
  protected Object getToolTipItem(Point point)
  {
    TreeItem item = ((Tree)this$0.getTreeViewer().getControl()).getItem(point);
    if (item != null) {
      return item.getData();
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditorOutline.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.wikitext.ui.editor;

import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentPartitioningListener;

class MarkupEditor$10
  implements IDocumentPartitioningListener
{
  MarkupEditor$10(MarkupEditor paramMarkupEditor) {}
  
  public void documentPartitioningChanged(IDocument document)
  {
    MarkupEditor.access$
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

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