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

      this.markupLanguage.getName())))) {
      return;
    }
    this.markupLanguage = markupLanguage;
    delegate = (markupLanguage == null ? null : WikiText.getMarkupValidator(markupLanguage.getName()));
  }
  
  public IResource getResource()
  {
    return resource;
  }
  
  public void setResource(IResource resource)
  {
    this.resource = resource;
  }
  
  public IAnnotationModel getAnnotationModel()
  {
    return annotationModel;
  }
  
  public void setAnnotationModel(IAnnotationModel annotationModel)
  {
    this.annotationModel = annotationModel;
  }
  
  protected boolean overlaps(IRegion region, int offset, int length)
  {
    int end = offset + length;
    if (region.getOffset() > offset) {
      return end > region.getOffset();
    }
    if (offset < region.getOffset() + region.getLength()) {
      return true;
    }
    return false;
  }
}

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ISynchronizable;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.IAnnotationModelExtension;
import org.eclipse.mylyn.wikitext.core.validation.ValidationProblem;

public class AnnotationMarkupValidator
  extends DocumentRegionValidator
{
  protected void clearProblems(IProgressMonitor monitor, IDocument document, IRegion region)
    throws CoreException
  {
    monitor.beginTask(Messages.AnnotationMarkupValidator_clearingProblems, 100);
    
    monitor.done();
  }
  
  protected void createProblems(IProgressMonitor monitor, IDocument document, IRegion region, List<ValidationProblem> problems)
    throws CoreException
  {
    Object lockObject;
    Object lockObject;
    if ((annotationModel instanceof ISynchronizable)) {
      lockObject = ((ISynchronizable)annotationModel).getLockObject();
    } else {
      lockObject = annotationModel;
    }
    synchronized (lockObject)
    {
      List<Annotation> toRemove = null;
      Iterator<Annotation> annotationIterator = annotationModel.getAnnotationIterator();
      int offset;
      while (annotationIterator.hasNext())
      {
        Annotation annotation = (Annotation)annotationIterator.next();
        if (ValidationProblemAnnotation.isValidationAnnotation(annotation))
        {
          Position position = annotationModel.getPosition(annotation);
          offset = position.getOffset();
          if ((overlaps(region, offset, position.getLength())) || (offset >= document.getLength()))
          {
            if (toRemove == null) {
              toRemove = new ArrayList();
            }
            toRemove.add(annotation);
          }
        }
      }
      Map<Annotation, Position> annotationsToAdd = new HashMap();
      for (ValidationProblem problem : problems) {
        annotationsToAdd.put(new ValidationProblemAnnotation(problem), new Position(problem.getOffset(), 
          problem.getLength()));
      }
      if ((toRemove != null) && ((annotationModel instanceof IAnnotationModelExtension)))
      {
        Annotation[] annotationsToRemove = (Annotation[])toRemove.toArray(new Annotation[toRemove.size()]);
        ((IAnnotationModelExtension)annotationModel).replaceAnnotations(annotationsToRemove, annotationsToAdd);
      }
      else
      {
        if (toRemove != null) {
          for (Annotation annotation : toRemove) {
            annotationModel.removeAnnotation(annotation);
          }
        }
        for (Map.Entry<Annotation, Position> entry : annotationsToAdd.entrySet()) {
          annotationModel.addAnnotation((Annotation)entry.getKey(), (Position)entry.getValue());
        }
      }
    }
  }
  
  public void validate(IProgressMonitor monitor, IDocument document, IRegion region)
    throws CoreException
  {
    if (annotationModel == null) {
      return;
    }
    super.validate(monitor, document, region);
  }
}

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.mylyn.wikitext.core.validation.ValidationProblem;
import org.eclipse.mylyn.wikitext.core.validation.ValidationProblem.Severity;

public class ResourceMarkerMarkupValidator
  extends DocumentRegionValidator
{
  protected void clearProblems(IProgressMonitor monitor, IDocument document, IRegion region)
    throws CoreException
  {
    monitor.beginTask(Messages.ResourceMarkerMarkupValidator_clearingMarkers, 1);
    
    monitor.done();
  }
  
  protected void createProblems(IProgressMonitor monitor, IDocument document, IRegion region, List<ValidationProblem> problems)
    throws CoreException
  {
    monitor.beginTask(Messages.ResourceMarkerMarkupValidator_creatingMarkers, problems.size() + 100 + 
      10);
    
    List<IMarker> markersInRegion = new ArrayList(5);
    
    Map<Integer, IMarker> markerByOffset = new HashMap();
    
    IMarker[] findMarkers = resource.findMarkers("org.eclipse.mylyn.wikitext.core.validation.problem", true, 
      0);
    IMarker[] arrayOfIMarker1;
    int j = (arrayOfIMarker1 = findMarkers).length;
    IMarker marker;
    for (int i = 0; i < j; i++)
    {
      marker = arrayOfIMarker1[i];
      int offset = marker.getAttribute("charStart", 0);
      int end = marker.getAttribute("charEnd", offset);
      if ((overlaps(region, offset, end - offset)) || (offset >= document.getLength()))
      {
        markersInRegion.add(marker);
        markerByOffset.put(Integer.valueOf(offset), marker);
      }
    }
    monitor.worked(100);
    if (problems.isEmpty())
    {
      for (IMarker marker : markersInRegion) {
        marker.delete();
      }
      monitor.worked(10);
      monitor.done();
      return;
    }
    monitor.worked(10);
    IMarker marker;
    if (!markersInRegion.isEmpty())
    {
      Iterator<ValidationProblem> problemIt = problems.iterator();
      while (problemIt.hasNext())
      {
        ValidationProblem problem = (ValidationProblem)problemIt.next();
        marker = (IMarker)markerByOffset.get(Integer.valueOf(problem.getOffset()));
        if (marker != null)
        {
          int charEnd = ((IMarker)marker).getAttribute("charEnd", -1);
          if ((problem.getOffset() + problem.getLength() == charEnd) && 
            (toMarkerSeverity(problem.getSeverity()) == ((IMarker)marker).getAttribute("severity", -1)) && 
            (problem.getMessage().equals(((IMarker)marker).getAttribute("message", ""))))
          {
            problemIt.remove();
            markerByOffset.remove(Integer.valueOf(problem.getOffset()));
            markersInRegion.remove(marker);
            monitor.worked(1);
          }
        }
      }
      for (Object marker = markersInRegion.iterator(); ((Iterator)marker).hasNext();)
      {
        marker = (IMarker)((Iterator)marker).next();
        marker.delete();
      }
    }
    for (ValidationProblem problem : problems)
    {
      IMarker marker = resource.createMarker(problem.getMarkerId());
      
      marker.setAttribute("transient", true);
      marker.setAttribute("severity", toMarkerSeverity(problem.getSeverity()));
      marker.setAttribute("message", problem.getMessage());
      marker.setAttribute("charStart", problem.getOffset());
      marker.setAttribute("charEnd", problem.getOffset() + problem.getLength());
      try
      {
        int line = document.getLineOfOffset(problem.getOffset());
        marker.setAttribute("lineNumber", line + 1);
      }
      catch (BadLocationException localBadLocationException) {}
      monitor.worked(1);
    }
    monitor.done();
  }
  
  private int toMarkerSeverity(ValidationProblem.Severity severity)
  {
    switch (severity)
    {
    case WARNING: 
      return 2;
    case ERROR: 
      return 1;
    }
    throw new IllegalStateException(severity.name());
  }
}

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

import org.eclipse.osgi.util.NLS;

class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.wikitext.ui.editor.validation.messages";
  public static String AnnotationMarkupValidator_clearingProblems;
  public static String DocumentRegionValidator_validating;
  public static String DocumentRegionValidator_validation;
  public static String ResourceMarkerMarkupValidator_clearingMarkers;
  public static String ResourceMarkerMarkupValidator_creatingMarkers;
  
  static
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.wikitext.ui.editor.validation.messages", Messages.class);
  }
}

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

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.text.ITextOperationTarget;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.handlers.HandlerUtil;

public class ShowQuickOutlineCommand
  extends AbstractHandler
{
  public static final int QUICK_OUTLINE = 513;
  
  public Object execute(ExecutionEvent event)
    throws ExecutionException
  {
    Object activeFocusControl = HandlerUtil.getVariable(event, "activeFocusControl");
    if ((activeFocusControl instanceof Control))
    {
      Control control = (Control)activeFocusControl;
      if (!control.isDisposed())
      {
        ISourceViewer viewer = (ISourceViewer)control.getData(ISourceViewer.class.getName());
        if (viewer != null)
        {
          ITextOperationTarget operationTarget = viewer.getTextOperationTarget();
          if (operationTarget.canDoOperation(513)) {
            operationTarget.doOperation(513);
          }
        }
      }
    }
    return null;
  }
}

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

import org.eclipse.jface.text.information.InformationPresenter;

class ShowCheatSheetCommand$1
  implements Runnable
{
  ShowCheatSheetCommand$1(ShowCheatSheetCommand paramShowCheatSheetCommand, InformationPresenter paramInformationPresenter) {}
  
  public void run()
  {
    val$informationPresenter.showInformation();
  }
}

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

import java.util.SortedMap;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.text.information.InformationPresenter;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;
import org.eclipse.mylyn.internal.wikitext.ui.editor.actions.ContextHelpAction;
import org.eclipse.mylyn.internal.wikitext.ui.editor.help.HelpContent;
import org.eclipse.mylyn.internal.wikitext.ui.util.InformationPresenterUtil;
import org.eclipse.mylyn.internal.wikitext.ui.util.InformationPresenterUtil.SizeConstraint;
import org.eclipse.mylyn.wikitext.core.WikiText;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.handlers.HandlerUtil;

public class ShowCheatSheetCommand
  extends AbstractHandler
{
  public Object execute(ExecutionEvent event)
    throws ExecutionException
  {
    Object activeFocusControl = HandlerUtil.getVariable(event, "activeFocusControl");
    if ((activeFocusControl instanceof Control))
    {
      Control control = (Control)activeFocusControl;
      MarkupLanguage markupLanguage = (MarkupLanguage)control.getData(MarkupLanguage.class.getName());
      ISourceViewer viewer = (ISourceViewer)control.getData(ISourceViewer.class.getName());
      if ((markupLanguage != null) && (viewer != null))
      {
        ToolBarManager toolBarManager = new ToolBarManager();
        toolBarManager.add(new ContextHelpAction());
        final InformationPresenter informationPresenter = InformationPresenterUtil.getHtmlInformationPresenter(
          viewer, new InformationPresenterUtil.SizeConstraint(50, 200, true, true), toolBarManager, 
          computeCheatSheet(markupLanguage));
        
        Display.getCurrent().asyncExec(new Runnable()
        {
          public void run()
          {
            informationPresenter.showInformation();
          }
        });
      }
    }
    return null;
  }
  
  private String computeCheatSheet(MarkupLanguage markupLanguage)
  {
    HelpContent content = null;
    if (markupLanguage != null)
    {
      content = (HelpContent)WikiTextUiPlugin.getDefault().getCheatSheets().get(markupLanguage.getName());
      if (content == null)
      {
        MarkupLanguage l = markupLanguage;
        while ((content == null) && (l != null) && (l.getExtendsLanguage() != null))
        {
          l = WikiText.getMarkupLanguage(l.getExtendsLanguage());
          if (l != null) {
            content = (HelpContent)WikiTextUiPlugin.getDefault().getCheatSheets().get(l.getName());
          }
        }
      }
    }
    if (content != null) {
      try
      {
        return content.getContent();
      }
      catch (Exception e)
      {
        WikiTextUiPlugin.getDefault().log(e);
      }
    }
    return NLS.bind(Messages.ShowCheatSheetCommand_noCheatSheetContent, new Object[] { markupLanguage == null ? 
      Messages.ShowCheatSheetCommand_unknownLanguage : 
      markupLanguage.getName() });
  }
}

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

import org.eclipse.osgi.util.NLS;

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

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

import org.eclipse.ui.part.IShowInTargetList;

class MarkupEditor$1
  implements IShowInTargetList
{
  public String[] getShowInTargetIds()
  {
    return MarkupEditor.access$0();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.1
 * 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$3
  extends FoldingStructure.AbstractItemsAnnotationOperation
{
  FoldingStructure$3(FoldingStructure paramFoldingStructure, Collection $anonymous0)
  {
    super($anonymous0);
  }
  
  public boolean operateOnSelected(HeadingProjectionAnnotation annotation)
  {
    if (annotation.isCollapsed())
    {
      annotation.markExpanded();
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.FoldingStructure.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.source.projection.IProjectionListener;

class MarkupEditor$8
  implements IProjectionListener
{
  MarkupEditor$8(MarkupEditor paramMarkupEditor) {}
  
  public void projectionDisabled()
  {
    MarkupEditor.access$7(this$0, null);
    this$0.saveProjectionPreferences();
  }
  
  public void projectionEnabled()
  {
    this$0.saveProjectionPreferences();
    MarkupEditor.access$8(this$0);
  }
}

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

abstract interface FoldingStructure$AnnotationOperation
{
  public abstract boolean operate(HeadingProjectionAnnotation paramHeadingProjectionAnnotation);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.FoldingStructure.AnnotationOperation
 * 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;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressAdapter;
import org.eclipse.swt.browser.ProgressEvent;

class MarkupEditor$12
  extends ProgressAdapter
{
  MarkupEditor$12(MarkupEditor paramMarkupEditor, OutlineItem paramOutlineItem, int paramInt) {}
  
  public void completed(ProgressEvent event)
  {
    MarkupEditor.access$12(this$0).removeProgressListener(this);
    if (val$outlineItem != null) {
      MarkupEditor.access$13(this$0, val$outlineItem);
    } else {
      MarkupEditor.access$12(this$0).execute(String.format("window.scrollTo(0,%d);", new Object[] { Integer.valueOf(val$verticalScrollbarPos) }));
    }
  }
}

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

import org.eclipse.help.HelpSystem;
import org.eclipse.help.IContext;
import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.ui.plugin.AbstractUIPlugin;

public class ContextHelpAction
  extends Action
{
  private static final String DEFAULT_WIKITEXT_HELP_ID = "org.eclipse.mylyn.wikitext.help.ui.markupSourceContext";
  private final String contextId;
  
  public ContextHelpAction(String contextId)
  {
    super("", 1);
    this.contextId = contextId;
    setToolTipText(Messages.ContextHelpAction_tooltip);
    setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(WikiTextUiPlugin.getDefault().getPluginId(), 
      "icons/help.gif"));
  }
  
  public ContextHelpAction()
  {
    this("org.eclipse.mylyn.wikitext.help.ui.markupSourceContext");
  }
  
  public void run()
  {
    IContext context = HelpSystem.getContext(contextId);
    if (context != null) {
      PlatformUI.getWorkbench().getHelpSystem().displayHelp(context);
    } else {
      PlatformUI.getWorkbench().getHelpSystem().displayHelp();
    }
  }
}

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

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
import org.eclipse.mylyn.internal.wikitext.ui.util.NlsResourceBundle;
import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.TextOperationAction;

public class CollapseAllFoldingRulerAction
  extends AbstractRulerActionDelegate
{
  protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo)
  {
    TextOperationAction action = new TextOperationAction(new NlsResourceBundle(Messages.class), 
      "CollapseAllFoldingRulerAction_", editor, 21, true);
    action.setActionDefinitionId("org.eclipse.ui.edit.text.folding.collapse_all");
    return action;
  }
}

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

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
import org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor;
import org.eclipse.mylyn.internal.wikitext.ui.util.NlsResourceBundle;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.TextOperationAction;

public class ToggleFoldingRulerAction
  extends AbstractRulerActionDelegate
{
  private IAction callerAction;
  private TextOperationAction action;
  private ITextEditor editor;
  
  protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo)
  {
    this.editor = editor;
    action = new TextOperationAction(new NlsResourceBundle(Messages.class), "ToggleFoldingRulerAction_", 
      editor, 19, true);
    action.setActionDefinitionId("org.eclipse.ui.edit.text.folding.toggle");
    return action;
  }
  
  public void setActiveEditor(IAction callerAction, IEditorPart targetEditor)
  {
    this.callerAction = callerAction;
    super.setActiveEditor(callerAction, targetEditor);
  }
  
  public void menuAboutToShow(IMenuManager manager)
  {
    update();
    super.menuAboutToShow(manager);
  }
  
  private void update()
  {
    if ((editor instanceof MarkupEditor)) {
      callerAction.setChecked(((MarkupEditor)editor).isFoldingEnabled());
    }
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor;
import org.eclipse.mylyn.wikitext.core.WikiText;

public class SetMarkupLanguageAction
  extends Action
{
  private final MarkupEditor markupEditor;
  private final String markupLanguageName;
  private final boolean checked;
  
  public SetMarkupLanguageAction(MarkupEditor markupEditor, String markupLanguageName, boolean checked)
  {
    super(markupLanguageName, 2);
    setChecked(checked);
    this.markupEditor = markupEditor;
    this.markupLanguageName = markupLanguageName;
    this.checked = checked;
  }
  
  public void run()
  {
    if (checked) {
      return;
    }
    markupEditor.setMarkupLanguage(WikiText.getMarkupLanguage(markupLanguageName), true);
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.osgi.util.NLS;

public class PreviewOutlineItemAction
  extends Action
{
  private final MarkupEditor editor;
  private final OutlineItem outlineItem;
  
  public PreviewOutlineItemAction(MarkupEditor editor, OutlineItem outlineItem)
  {
    this.editor = editor;
    this.outlineItem = outlineItem;
    setText(NLS.bind(Messages.PreviewOutlineItemAction_label, outlineItem.getLabel()));
  }
  
  public void run()
  {
    editor.showPreview(outlineItem);
  }
}

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

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
import org.eclipse.mylyn.internal.wikitext.ui.util.NlsResourceBundle;
import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.TextOperationAction;

public class ExpandAllFoldingRulerAction
  extends AbstractRulerActionDelegate
{
  protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo)
  {
    TextOperationAction action = new TextOperationAction(new NlsResourceBundle(Messages.class), 
      "ExpandAllFoldingRulerAction_", editor, 20, true);
    action.setActionDefinitionId("org.eclipse.ui.edit.text.folding.expand_all");
    return action;
  }
}

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

import org.eclipse.osgi.util.NLS;

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

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.actions.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.text.source.projection.ProjectionAnnotation;

class HeadingProjectionAnnotation
  extends ProjectionAnnotation
{
  private final String headingId;
  
  public HeadingProjectionAnnotation(String headingId)
  {
    this.headingId = headingId;
  }
  
  public String getHeadingId()
  {
    return headingId;
  }
}

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

import java.net.URL;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.hyperlink.URLHyperlink;
import org.eclipse.swt.browser.LocationEvent;
import org.eclipse.swt.browser.LocationListener;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;

class MarkupEditor$2
  implements LocationListener
{
  MarkupEditor$2(MarkupEditor paramMarkupEditor) {}
  
  public void changed(LocationEvent event)
  {
    doit = false;
  }
  
  public void changing(LocationEvent event)
  {
    if (location.matches("([a-zA-Z]{3,8})://?.*"))
    {
      int idxOfSlashHash = location.indexOf("/#");
      if (idxOfSlashHash != -1)
      {
        if (!location.startsWith("file:///#")) {
          doit = false;
        }
        return;
      }
      doit = false;
      try
      {
        PlatformUI.getWorkbench().getBrowserSupport().createBrowser("org.eclipse.ui.browser").openURL(new URL(location));
      }
      catch (Exception localException)
      {
        new URLHyperlink(new Region(0, 1), location).open();
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.2
 * 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$4
  extends FoldingStructure.AbstractItemsAnnotationOperation
{
  FoldingStructure$4(FoldingStructure paramFoldingStructure, Collection $anonymous0)
  {
    super($anonymous0);
  }
  
  public boolean operateOnSelected(HeadingProjectionAnnotation annotation)
  {
    if (annotation.isCollapsed())
    {
      annotation.markExpanded();
      return true;
    }
    return false;
  }
  
  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.4
 * 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.DocumentEvent;
import org.eclipse.jface.text.IDocumentListener;

class MarkupEditor$9
  implements IDocumentListener
{
  MarkupEditor$9(MarkupEditor paramMarkupEditor) {}
  
  public void documentAboutToBeChanged(DocumentEvent event) {}
  
  public void documentChanged(DocumentEvent event)
  {
    MarkupEditor.access$9(this$0, true);
    MarkupEditor.access$10(this$0, true);
    synchronized (this$0)
    {
      this$0.documentGeneration += 1;
    }
    MarkupEditor.access$11(this$0);
    if (MarkupEditor.access$1(this$0)) {
      MarkupEditor.access$2(this$0);
    }
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation;
import org.eclipse.ui.texteditor.IDocumentProvider;

class MarkupDocumentProvider$1
  extends TextFileDocumentProvider.DocumentProviderOperation
{
  MarkupDocumentProvider$1(MarkupDocumentProvider paramMarkupDocumentProvider, Object paramObject, IDocument paramIDocument, boolean paramBoolean) {}
  
  protected void execute(IProgressMonitor monitor)
    throws CoreException
  {
    MarkupDocumentProvider.access$1(this$0).saveDocument(monitor, val$element, val$document, val$overwrite);
  }
}

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

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Segments<T extends Segment<?>>
{
  private List<T> list;
  
  public void add(T t)
  {
    if (list == null)
    {
      list = new ArrayList();
    }
    else if (list.size() > 0)
    {
      Segment<?> previousSegment = (Segment)list.get(list.size() - 1);
      int tOffset = t.getOffset();
      if (previousSegment.getOffset() > tOffset) {
        throw new IllegalArgumentException();
      }
      if (previousSegment.getEndOffset() > tOffset)
      {
        int newLength = tOffset - previousSegment.getOffset();
        previousSegment.setLength(newLength);
      }
    }
    list.add(t);
  }
  
  public void remove(T t)
  {
    list.remove(t);
  }
  
  public List<T> asList()
  {
    if (list == null) {
      return Collections.emptyList();
    }
    return list;
  }
  
  public boolean isEmpty()
  {
    return (list == null) || (list.isEmpty());
  }
  
  public int size()
  {
    return list == null ? 0 : list.size();
  }
}

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

import org.eclipse.mylyn.wikitext.core.parser.Attributes;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.BlockType;

public class Block
  extends Segment<Segment<?>>
{
  private final DocumentBuilder.BlockType type;
  private final int headingLevel;
  private boolean spansComputed = false;
  
  public Block(DocumentBuilder.BlockType type, int offset, int length)
  {
    super(offset, length);
    this.type = type;
    headingLevel = 0;
  }
  
  public Block(int headingLevel, int offset, int length)
  {
    super(offset, length);
    if (headingLevel <= 0) {
      throw new IllegalArgumentException();
    }
    this.headingLevel = headingLevel;
    type = null;
  }
  
  public Block(DocumentBuilder.BlockType type, Attributes attributes, int offset, int length)
  {
    super(attributes, offset, length);
    this.type = type;
    headingLevel = 0;
  }
  
  public Block(int headingLevel, Attributes attributes, int offset, int length)
  {
    super(attributes, offset, length);
    this.headingLevel = headingLevel;
    type = null;
  }
  
  public Block getParent()
  {
    return (Block)super.getParent();
  }
  
  public DocumentBuilder.BlockType getType()
  {
    return type;
  }
  
  public int getHeadingLevel()
  {
    return headingLevel;
  }
  
  public boolean isSpansComputed()
  {
    return spansComputed;
  }
  
  public void setSpansComputed(boolean spansComputed)
  {
    this.spansComputed = spansComputed;
  }
  
  public String toString()
  {
    StringBuilder buf = new StringBuilder();
    buf.append("<");
    String elementName;
    String elementName;
    if (type != null) {
      elementName = type.name();
    } else {
      elementName = "h" + headingLevel;
    }
    buf.append(elementName);
    buf.append(" offset=\"");
    buf.append(getOffset());
    buf.append("\" length=\"");
    buf.append(getLength());
    buf.append('"');
    if ((getChildren() == null) || (getChildren().isEmpty()))
    {
      buf.append("/>\n");
    }
    else
    {
      buf.append(">\n");
      StringBuilder buf2 = new StringBuilder();
      buf2.append("\t");
      for (Segment<?> child : getChildren().asList()) {
        buf2.append(child);
      }
      String children = buf2.toString();
      children = children.replace("\n", "\n\t");
      if (children.endsWith("\t")) {
        children = children.substring(0, children.length() - 1);
      } else {
        children = children + "\n";
      }
      buf.append(children);
      buf.append("</");
      buf.append(elementName);
      buf.append(">\n");
    }
    return buf.toString();
  }
}

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

import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.mylyn.internal.wikitext.ui.viewer.FontState;

public class MarkupTokenScanner$Token
  extends Token
{
  private final int offset;
  private final int length;
  private final FontState fontState;
  
  public MarkupTokenScanner$Token(FontState fontState, TextAttribute attribute, int offset, int length)
  {
    super(attribute);
    this.fontState = fontState;
    if (offset < 0) {
      throw new IllegalArgumentException();
    }
    if (length < 0) {
      throw new IllegalArgumentException();
    }
    this.offset = offset;
    this.length = length;
  }
  
  public int getOffset()
  {
    return offset;
  }
  
  public int getLength()
  {
    return length;
  }
  
  public FontState getFontState()
  {
    return fontState;
  }
  
  public TextAttribute getData()
  {
    return (TextAttribute)super.getData();
  }
  
  public String toString()
  {
    return "Token [offset=" + offset + ", length=" + length + "]";
  }
}

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

import org.eclipse.jface.text.IRegion;

class MarkupHyperlinkDetector$HyperlinkDescriptor
{
  String href;
  IRegion region;
  
  protected MarkupHyperlinkDetector$HyperlinkDescriptor(String href, IRegion region)
  {
    this.href = href;
    this.region = region;
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.mylyn.wikitext.core.parser.Attributes;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.BlockType;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.SpanType;
import org.eclipse.mylyn.wikitext.core.parser.Locator;

class FastMarkupPartitioner$PartitionBuilder
  extends DocumentBuilder
{
  private final Block outerBlock = new Block(null, 0, 1073741823);
  private Block currentBlock = outerBlock;
  private Span currentSpan = null;
  private final int offset;
  private List<FastMarkupPartitioner.MarkupPartition> partitions;
  private final boolean blocksOnly;
  
  public FastMarkupPartitioner$PartitionBuilder(int offset, boolean blocksOnly)
  {
    this.offset = offset;
    this.blocksOnly = blocksOnly;
  }
  
  public void acronym(String text, String definition) {}
  
  public void beginBlock(DocumentBuilder.BlockType type, Attributes attributes)
  {
    int newBlockOffset = getLocator().getDocumentOffset() + offset;
    Block newBlock = new Block(type, attributes, newBlockOffset, currentBlock.getLength() - (
      newBlockOffset - currentBlock.getOffset()));
    newBlock.setSpansComputed(!blocksOnly);
    currentBlock.add(newBlock);
    currentBlock = newBlock;
  }
  
  public void beginDocument() {}
  
  public void beginHeading(int level, Attributes attributes)
  {
    int newBlockOffset = getLocator().getDocumentOffset() + offset;
    Block newBlock = new Block(level, attributes, newBlockOffset, currentBlock.getLength() - (
      newBlockOffset - currentBlock.getOffset()));
    newBlock.setSpansComputed(!blocksOnly);
    currentBlock.add(newBlock);
    currentBlock = newBlock;
  }
  
  public void beginSpan(DocumentBuilder.SpanType type, Attributes attributes)
  {
    Span span = new Span(type, attributes, getLocator().getDocumentOffset() + offset, 
      getLocator().getLineSegmentEndOffset() - getLocator().getLineCharacterOffset());
    if (currentSpan != null)
    {
      currentSpan.add(span);
      currentSpan = span;
    }
    else
    {
      currentSpan = span;
      currentBlock.add(span);
    }
  }
  
  public void characters(String text) {}
  
  public void charactersUnescaped(String literal) {}
  
  public void endBlock()
  {
    currentBlock = cur
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