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

11(this$0);
  }
}

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

import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
import org.eclipse.jface.text.reconciler.MonoReconciler;

public class MarkupMonoReconciler
  extends MonoReconciler
{
  public MarkupMonoReconciler(IReconcilingStrategy strategy, boolean isIncremental)
  {
    super(strategy, isIncremental);
  }
  
  public void forceReconciling()
  {
    super.forceReconciling();
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.reconciler.DirtyRegion;
import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;
import org.eclipse.mylyn.internal.wikitext.ui.editor.validation.AnnotationMarkupValidator;
import org.eclipse.mylyn.internal.wikitext.ui.editor.validation.DocumentRegionValidator;
import org.eclipse.mylyn.internal.wikitext.ui.editor.validation.ResourceMarkerMarkupValidator;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;

public class MarkupValidationReconcilingStrategy
  implements IReconcilingStrategy, IReconcilingStrategyExtension
{
  private IDocument document;
  private IProgressMonitor monitor;
  private final ISourceViewer viewer;
  private DocumentRegionValidator validator;
  private IResource resource;
  private MarkupLanguage markupLanguage;
  
  public MarkupValidationReconcilingStrategy(ISourceViewer viewer)
  {
    this.viewer = viewer;
  }
  
  public MarkupLanguage getMarkupLanguage()
  {
    return markupLanguage;
  }
  
  public void setMarkupLanguage(MarkupLanguage markupLanguage)
  {
    this.markupLanguage = markupLanguage;
  }
  
  public IResource getResource()
  {
    return resource;
  }
  
  public void setResource(IResource resource)
  {
    this.resource = resource;
  }
  
  public void reconcile(IRegion partition)
  {
    if (document == null) {
      return;
    }
    if (validator == null) {
      validator = (resource == null ? new AnnotationMarkupValidator() : new ResourceMarkerMarkupValidator());
    }
    validator.setMarkupLanguage(markupLanguage);
    validator.setAnnotationModel(getAnnotationModel());
    validator.setResource(resource);
    try
    {
      validator.validate(monitor == null ? new NullProgressMonitor() : monitor, document, partition);
    }
    catch (CoreException e)
    {
      WikiTextUiPlugin.getDefault().log(e);
    }
  }
  
  private IAnnotationModel getAnnotationModel()
  {
    return viewer.getAnnotationModel();
  }
  
  public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion)
  {
    reconcile(subRegion);
  }
  
  public void setDocument(IDocument document)
  {
    this.document = document;
  }
  
  public void initialReconcile()
  {
    if (document == null) {
      return;
    }
    reconcile(new Region(0, document.getLength()));
  }
  
  public void setProgressMonitor(IProgressMonitor monitor)
  {
    this.monitor = monitor;
  }
}

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

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.reconciler.DirtyRegion;
import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension;

public class MultiReconcilingStrategy
  implements IReconcilingStrategy, IReconcilingStrategyExtension
{
  private final List<IReconcilingStrategy> strategies = new CopyOnWriteArrayList();
  
  public void add(IReconcilingStrategy strategy)
  {
    if (strategy == null) {
      throw new IllegalArgumentException();
    }
    strategies.add(strategy);
  }
  
  public void remove(IReconcilingStrategy strategy)
  {
    if (strategy == null) {
      throw new IllegalArgumentException();
    }
    strategies.remove(strategy);
  }
  
  public boolean contains(IReconcilingStrategy reconcilingStrategy)
  {
    return strategies.contains(reconcilingStrategy);
  }
  
  public void initialReconcile()
  {
    for (IReconcilingStrategy strategy : strategies) {
      if ((strategy instanceof IReconcilingStrategyExtension)) {
        ((IReconcilingStrategyExtension)strategy).initialReconcile();
      }
    }
  }
  
  public void setProgressMonitor(IProgressMonitor monitor)
  {
    for (IReconcilingStrategy strategy : strategies) {
      if ((strategy instanceof IReconcilingStrategyExtension)) {
        ((IReconcilingStrategyExtension)strategy).setProgressMonitor(monitor);
      }
    }
  }
  
  public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion)
  {
    for (IReconcilingStrategy strategy : strategies) {
      strategy.reconcile(dirtyRegion, subRegion);
    }
  }
  
  public void reconcile(IRegion partition)
  {
    for (IReconcilingStrategy strategy : strategies) {
      strategy.reconcile(partition);
    }
  }
  
  public void setDocument(IDocument document)
  {
    for (IReconcilingStrategy strategy : strategies) {
      strategy.setDocument(document);
    }
  }
}

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

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

public class MoveSectionsCommand$OffsetComparator
  implements Comparator<OutlineItem>
{
  public int compare(OutlineItem o1, OutlineItem o2)
  {
    if (o1 == o2) {
      return 0;
    }
    if (o1.getOffset() < o2.getOffset()) {
      return -1;
    }
    if (o1.getOffset() > o2.getOffset()) {
      return 1;
    }
    return 0;
  }
}

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

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.swt.widgets.Text;

public class MoveSectionsCommand
  extends AbstractDocumentCommand
{
  private final OutlineItem target;
  private final List<OutlineItem> items;
  private final InsertLocation location;
  
  public static class OffsetComparator
    implements Comparator<OutlineItem>
  {
    public int compare(OutlineItem o1, OutlineItem o2)
    {
      if (o1 == o2) {
        return 0;
      }
      if (o1.getOffset() < o2.getOffset()) {
        return -1;
      }
      if (o1.getOffset() > o2.getOffset()) {
        return 1;
      }
      return 0;
    }
  }
  
  public MoveSectionsCommand(OutlineItem target, List<OutlineItem> items, InsertLocation location)
  {
    if ((target == null) || (items == null) || (location == null)) {
      throw new IllegalArgumentException();
    }
    if (items.isEmpty()) {
      throw new IllegalArgumentException();
    }
    this.target = target;
    this.items = items;
    this.location = location;
    validate();
  }
  
  private void validate()
  {
    for (int x = 0; x < items.size(); x++)
    {
      OutlineItem item = (OutlineItem)items.get(x);
      if (item.contains(target)) {
        setProblemText(Messages.MoveSectionsCommand_invalidTargetLocation_self);
      }
    }
  }
  
  private static class Section
  {
    int offset;
    int length;
    
    public Section(int offset, int length)
    {
      this.offset = offset;
      this.length = length;
    }
  }
  
  protected void doCommand(IDocument document)
    throws BadLocationException
  {
    for (int x = 0; x < items.size(); x++)
    {
      OutlineItem item = (OutlineItem)items.get(x);
      for (int y = 0; y < x; y++)
      {
        OutlineItem previousItem = (OutlineItem)items.get(y);
        if (previousItem.contains(item))
        {
          items.remove(x);
          x--;
          break;
        }
        if (item.contains(previousItem))
        {
          items.remove(y);
          x--;
          y--;
        }
      }
    }
    if (items.size() > 1) {
      Collections.sort(items, new OffsetComparator());
    }
    Section[] sections = new Section[items.size()];
    for (int x = 0; x < items.size(); x++)
    {
      OutlineItem item = (OutlineItem)items.get(x);
      sections[x] = new Section(item.getOffset(), item.getSectionLength());
    }
    int insertLocation = target.getOffset();
    if (location == InsertLocation.WITHIN)
    {
      List<OutlineItem> children = target.getChildren();
      if (children.isEmpty())
      {
        insertLocation += target.getLength();
        while (insertLocation < document.getLength())
        {
          char c = document.getChar(insertLocation);
          if ((c != '\r') && (c != '\n')) {
            break;
          }
          insertLocation++;
        }
      }
      else
      {
        insertLocation = ((OutlineItem)children.get(0)).getOffset();
      }
    }
    else if (location == InsertLocation.AFTER)
    {
      insertLocation += target.getSectionLength();
    }
    String twoNewlines = Text.DELIMITER + Text.DELIMITER;
    for (int x = 0; x < sections.length; x++)
    {
      Section section = sections[x];
      
      String text = document.get(offset, length);
      document.replace(offset, length, "");
      
      int adjustmentFactor = 0;
      if (!text.endsWith(twoNewlines))
      {
        text = text + twoNewlines;
        adjustmentFactor = twoNewlines.length();
        length += adjustmentFactor;
      }
      if (offset < insertLocation) {
        insertLocation -= length;
      }
      int insertedLocation = insertLocation;
      document.replace(insertedLocation, 0, text);
      insertLocation += length;
      for (int y = x + 1; y < sections.length; y++)
      {
        Section section2 = sections[y];
        if (offset < insertedLocation) {
          offset -= length;
        } else if (adjustmentFactor > 0) {
          offset += adjustmentFactor;
        }
      }
    }
  }
}

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

class MoveSectionsCommand$Section
{
  int offset;
  int length;
  
  public MoveSectionsCommand$Section(int offset, int length)
  {
    this.offset = offset;
    this.length = length;
  }
}

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

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

public abstract class AbstractDocumentCommand
{
  protected String problemText;
  
  /* Error */
  public void execute(org.eclipse.jface.text.IUndoManager undoManager, IDocument document)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 60	org/eclipse/mylyn/internal/wikitext/ui/editor/operations/AbstractDocumentCommand:isEnabled	()Z
    //   4: ifne +11 -> 15
    //   7: new 25	java/lang/IllegalStateException
    //   10: dup
    //   11: invokespecial 55	java/lang/IllegalStateException:<init>	()V
    //   14: athrow
    //   15: aload_1
    //   16: invokeinterface 63 1 0
    //   21: aload_0
    //   22: aload_2
    //   23: invokevirtual 62	org/eclipse/mylyn/internal/wikitext/ui/editor/operations/AbstractDocumentCommand:doCommand	(Lorg/eclipse/jface/text/IDocument;)V
    //   26: goto +12 -> 38
    //   29: astore_3
    //   30: aload_1
    //   31: invokeinterface 64 1 0
    //   36: aload_3
    //   37: athrow
    //   38: aload_1
    //   39: invokeinterface 64 1 0
    //   44: goto +20 -> 64
    //   47: astore_3
    //   48: new 27	org/eclipse/core/runtime/CoreException
    //   51: dup
    //   52: invokestatic 58	org/eclipse/mylyn/internal/wikitext/ui/WikiTextUiPlugin:getDefault	()Lorg/eclipse/mylyn/internal/wikitext/ui/WikiTextUiPlugin;
    //   55: iconst_4
    //   56: aload_3
    //   57: invokevirtual 59	org/eclipse/mylyn/internal/wikitext/ui/WikiTextUiPlugin:createStatus	(ILjava/lang/Throwable;)Lorg/eclipse/core/runtime/IStatus;
    //   60: invokespecial 57	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   63: athrow
    //   64: return
    // Line number table:
    //   Java source line #29	-> byte code offset #0
    //   Java source line #30	-> byte code offset #7
    //   Java source line #33	-> byte code offset #15
    //   Java source line #35	-> byte code offset #21
    //   Java source line #36	-> byte code offset #29
    //   Java source line #37	-> byte code offset #30
    //   Java source line #38	-> byte code offset #36
    //   Java source line #37	-> byte code offset #38
    //   Java source line #39	-> byte code offset #47
    //   Java source line #40	-> byte code offset #48
    //   Java source line #42	-> byte code offset #64
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	65	0	this	AbstractDocumentCommand
    //   0	65	1	undoManager	org.eclipse.jface.text.IUndoManager
    //   0	65	2	document	IDocument
    //   29	8	3	localObject	Object
    //   47	10	3	e	BadLocationException
    // Exception table:
    //   from	to	target	type
    //   21	29	29	finally
    //   15	44	47	org/eclipse/jface/text/BadLocationException
  }
  
  public boolean isEnabled()
  {
    return getProblemText() == null;
  }
  
  public String getProblemText()
  {
    return problemText;
  }
  
  protected void setProblemText(String problemText)
  {
    this.problemText = problemText;
  }
  
  protected abstract void doCommand(IDocument paramIDocument)
    throws BadLocationException;
}

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

public enum InsertLocation
{
  BEFORE,  AFTER,  WITHIN;
}

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

import org.eclipse.osgi.util.NLS;

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

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

import org.eclipse.core.runtime.CoreException;

public abstract interface CommandManager
{
  public abstract void perform(AbstractDocumentCommand paramAbstractDocumentCommand)
    throws CoreException;
}

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

import java.util.Iterator;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.mylyn.internal.wikitext.core.util.css.CssParser;
import org.eclipse.mylyn.internal.wikitext.core.util.css.CssRule;
import org.eclipse.mylyn.internal.wikitext.ui.viewer.CssStyleManager;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;

public class CssStyleFieldEditor
  extends StringFieldEditor
{
  private final CssStyleManager cssStyleManager;
  
  public CssStyleFieldEditor(CssStyleManager cssStyleManager, String preferenceKey, String key, Composite parent)
  {
    super(preferenceKey, key, parent);
    this.cssStyleManager = cssStyleManager;
  }
  
  protected boolean doCheckState()
  {
    String value = getStringValue();
    if ((value != null) && (value.trim().length() > 0))
    {
      int offset = 0;
      Iterator<CssRule> ruleIterator = new CssParser().createRuleIterator(value);
      while (ruleIterator.hasNext())
      {
        CssRule rule = (CssRule)ruleIterator.next();
        if (offset > offset)
        {
          String gap = value.substring(offset, offset);
          if (gap.trim().length() != 0)
          {
            setErrorMessage(NLS.bind(Messages.CssStyleFieldEditor_unexpectedToken, 
              new Object[] { gap.trim(), Integer.valueOf(offset) }));
            return false;
          }
        }
        offset = offset + length;
        if (!cssStyleManager.isKnownRule(rule))
        {
          StringBuilder recognizedNames = new StringBuilder();
          for (String recognizedName : cssStyleManager.getRecognizedRuleNames())
          {
            if (recognizedNames.length() > 0) {
              recognizedNames.append(Messages.CssStyleFieldEditor_1);
            }
            recognizedNames.append(recognizedName);
          }
          setErrorMessage(NLS.bind(Messages.CssStyleFieldEditor_unsupportedRule, new Object[] { name, 
            recognizedNames }));
          return false;
        }
        if (("color".equals(name)) || 
          ("background-color".equals(name)))
        {
          Integer rgb = CssStyleManager.cssColorRgb(value);
          if (rgb == null)
          {
            setErrorMessage(NLS.bind(Messages.CssStyleFieldEditor_invalidColor, new Object[] { value }));
            return false;
          }
        }
      }
      if (offset < value.length() - 1)
      {
        String gap = value.substring(offset, value.length());
        if (gap.trim().length() != 0)
        {
          setErrorMessage(NLS.bind(Messages.CssStyleFieldEditor_unexpectedToken, new Object[] { gap.trim(), 
            Integer.valueOf(offset) }));
          return false;
        }
      }
    }
    return super.doCheckState();
  }
}

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

import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;
import org.eclipse.mylyn.internal.wikitext.ui.viewer.CssStyleManager;
import org.eclipse.swt.custom.ScrolledComposite;
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.Group;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.IWorkbenchHelpSystem;

public class EditorPreferencePage
  extends FieldEditorPreferencePage
  implements IWorkbenchPreferencePage
{
  public EditorPreferencePage()
  {
    super(1);
    setPreferenceStore(WikiTextUiPlugin.getDefault().getPreferenceStore());
    setDescription(Messages.EditorPreferencePage_introInfo);
  }
  
  public Control createContents(Composite parent)
  {
    ScrolledComposite scrolledComposite = new ScrolledComposite(parent, 768)
    {
      public Point computeSize(int hint, int hint2, boolean changed)
      {
        return new Point(64, 64);
      }
    };
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);
    
    Composite body = new Composite(scrolledComposite, 0);
    scrolledComposite.setContent(body);
    GridLayoutFactory.fillDefaults().margins(0, 0).numColumns(1).applyTo(body);
    
    Control contents = super.createContents(body);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(contents);
    
    scrolledComposite.setMinSize(body.computeSize(-1, -1, true));
    return scrolledComposite;
  }
  
  public void createFieldEditors()
  {
    Preferences prefs = new Preferences();
    
    Layout fieldEditorParentLayout = getFieldEditorParent().getLayout();
    if ((fieldEditorParentLayout instanceof GridLayout))
    {
      GridLayout layout = (GridLayout)fieldEditorParentLayout;
      marginRight = 5;
    }
    Group blockGroup = new Group(getFieldEditorParent(), 0);
    blockGroup.setText(Messages.EditorPreferencePage_blockModifiers);
    blockGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());
    
    CssStyleManager cssStyleManager = new CssStyleManager(getFont());
    for (Map.Entry<String, String> ent : prefs.getCssByBlockModifierType().entrySet())
    {
      String preferenceKey = Preferences.toPreferenceKey((String)ent.getKey(), true);
      addField(new CssStyleFieldEditor(cssStyleManager, preferenceKey, (String)ent.getKey(), blockGroup));
    }
    Layout layout = blockGroup.getLayout();
    if ((layout instanceof GridLayout))
    {
      GridLayout gridLayout = (GridLayout)layout;
      marginWidth = 5;
      marginHeight = 5;
    }
    Group phraseModifierGroup = new Group(getFieldEditorParent(), 0);
    phraseModifierGroup.setText(Messages.EditorPreferencePage_phraseModifiers);
    phraseModifierGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());
    for (Map.Entry<String, String> ent : prefs.getCssByPhraseModifierType().entrySet())
    {
      String preferenceKey = Preferences.toPreferenceKey((String)ent.getKey(), false);
      addField(new CssStyleFieldEditor(cssStyleManager, preferenceKey, (String)ent.getKey(), phraseModifierGroup));
    }
    layout = phraseModifierGroup.getLayout();
    if ((layout instanceof GridLayout))
    {
      GridLayout gridLayout = (GridLayout)layout;
      marginWidth = 5;
      marginHeight = 5;
    }
    applyDialogFont(getFieldEditorParent());
    blockGroup.setFont(getFieldEditorParent().getFont());
    phraseModifierGroup.setFont(getFieldEditorParent().getFont());
    
    PlatformUI.getWorkbench()
      .getHelpSystem()
      .setHelp(getControl(), "org.eclipse.mylyn.wikitext.help.ui.preferences");
  }
  
  public void init(IWorkbench workbench) {}
}

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

import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;

public class PreferenceInitializer
  extends AbstractPreferenceInitializer
{
  public void initializeDefaultPreferences()
  {
    IPreferenceStore store = WikiTextUiPlugin.getDefault().getPreferenceStore();
    Preferences defaults = new Preferences();
    defaults.save(store, true);
  }
}

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

import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;
import org.eclipse.mylyn.internal.wikitext.ui.editor.assist.WikiTextTemplateAccess;
import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;

public class WikiTextTemplatePreferencePage
  extends TemplatePreferencePage
{
  public WikiTextTemplatePreferencePage()
  {
    setPreferenceStore(WikiTextUiPlugin.getDefault().getPreferenceStore());
    setTemplateStore(WikiTextTemplateAccess.getInstance().getTemplateStore());
    setContextTypeRegistry(WikiTextTemplateAccess.getInstance().getContextTypeRegistry());
  }
  
  protected boolean isShowFormatterSetting()
  {
    return false;
  }
}

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

import java.io.IOException;
import java.io.Reader;
import java.io.StringWriter;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.mylyn.internal.wikitext.core.util.css.CssParser;
import org.eclipse.mylyn.internal.wikitext.core.util.css.Stylesheet;
import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;
import org.eclipse.mylyn.internal.wikitext.ui.viewer.HtmlTextPresentationParser;

public class Preferences
  implements Cloneable
{
  private static final String KEY_MARKUP_VIEWER_CSS = "preview.css";
  private static final String KEY_EDITOR_FOLDING = "editorFolding";
  private static final Pattern BAD_CHAR_PATTERN = Pattern.compile("[^a-zA-Z0-9]");
  public static final String PHRASE_CODE = "@code@";
  public static final String PHRASE_SPAN = "%span%";
  public static final String PHRASE_SUBSCRIPT = "~subscript~";
  public static final String PHRASE_SUPERSCRIPT = "^superscript^";
  public static final String PHRASE_INSERTED_TEXT = "+inserted text+";
  public static final String PHRASE_DELETED_TEXT = "-deleted text-";
  public static final String PHRASE_CITATION = "??citation??";
  public static final String PHRASE_BOLD = "**bold**";
  public static final String PHRASE_ITALIC = "__italic__";
  public static final String PHRASE_STRONG = "*strong*";
  public static final String PHRASE_EMPHASIS = "_emphasis_";
  public static final String PHRASE_MONOSPACE = "monospace";
  public static final String PHRASE_UNDERLINED = "underlined";
  public static final String PHRASE_QUOTE = "quote";
  public static final String BLOCK_QUOTE = "bq.";
  public static final String BLOCK_PRE = "pre.";
  public static final String BLOCK_BC = "bc.";
  public static final String BLOCK_H6 = "h6.";
  public static final String BLOCK_H5 = "h5.";
  public static final String BLOCK_H4 = "h4.";
  public static final String BLOCK_H3 = "h3.";
  public static final String BLOCK_H2 = "h2.";
  public static final String BLOCK_H1 = "h1.";
  public static final String[] HEADING_PREFERENCES = { 0, "h1.", "h2.", "h3.", "h4.", 
    "h5.", "h6." };
  private Map<String, String> cssByBlockModifierType;
  private Map<String, String> cssByPhraseModifierType;
  private boolean editorFolding;
  private String markupViewerCss;
  private Stylesheet stylesheet;
  private boolean mutable;
  
  public Preferences()
  {
    cssByBlockModifierType = new LinkedHashMap();
    
    cssByBlockModifierType.put("h1.", "font-size: 120%; font-weight: bold; color: #172f47;");
    cssByBlockModifierType.put("h2.", "font-size: 110%; font-weight: bold; color: #172f47;");
    cssByBlockModifierType.put("h3.", "font-size: 105%; font-weight: bold; color: #172f47;");
    cssByBlockModifierType.put("h4.", "font-weight: bold; color: #172f47;");
    cssByBlockModifierType.put("h5.", "font-size: 90%; font-weight: bold; color: #172f47;");
    cssByBlockModifierType.put("h6.", "font-size: 80%; font-weight: bold; color: #172f47;");
    cssByBlockModifierType.put("bc.", "font-family: monospace; color: #4444CC;");
    cssByBlockModifierType.put("pre.", "font-family: monospace;");
    cssByBlockModifierType.put("bq.", "color: rgb(38,86,145);");
    
    cssByPhraseModifierType = new LinkedHashMap();
    
    cssByPhraseModifierType.put("_emphasis_", "font-style: italic;");
    cssByPhraseModifierType.put("*strong*", "font-weight: bold;");
    cssByPhraseModifierType.put("__italic__", "font-style: italic;");
    cssByPhraseModifierType.put("**bold**", "font-weight: bold;");
    cssByPhraseModifierType.put("??citation??", "font-style: italic;");
    cssByPhraseModifierType.put("-deleted text-", "text-decoration: line-through;");
    cssByPhraseModifierType.put("+inserted text+", "text-decoration: underline;");
    cssByPhraseModifierType.put("^superscript^", "font-size: smaller; vertical-align: super;");
    cssByPhraseModifierType.put("~subscript~", "font-size: smaller; vertical-align: sub;");
    cssByPhraseModifierType.put("%span%", "");
    cssByPhraseModifierType.put("@code@", "font-family: monospace; color: #4444CC;");
    cssByPhraseModifierType.put("monospace", "font-family: monospace;");
    cssByPhraseModifierType.put("underlined", "text-decoration: underline;");
    cssByPhraseModifierType.put("quote", "color: rgb(38,86,145);");
    
    editorFolding = true;
    
    mutable = true;
  }
  
  public Map<String, String> getCssByBlockModifierType()
  {
    return cssByBlockModifierType;
  }
  
  public Map<String, String> getCssByPhraseModifierType()
  {
    return cssByPhraseModifierType;
  }
  
  public boolean isEditorFolding()
  {
    return editorFolding;
  }
  
  public void setEditorFolding(boolean editorFolding)
  {
    if (!mutable) {
      throw new UnsupportedOperationException();
    }
    this.editorFolding = editorFolding;
  }
  
  public String getMarkupViewerCss()
  {
    if (markupViewerCss == null) {
      markupViewerCss = getDefaultMarkupViewerCss();
    }
    return markupViewerCss;
  }
  
  public void setMarkupViewerCss(String markupViewerCss)
  {
    if (!mutable) {
      throw new UnsupportedOperationException();
    }
    this.markupViewerCss = markupViewerCss;
    stylesheet = null;
  }
  
  public Stylesheet getStylesheet()
  {
    if (stylesheet == null) {
      stylesheet = new CssParser().parse(getMarkupViewerCss());
    }
    return stylesheet;
  }
  
  public boolean isMutable()
  {
    return mutable;
  }
  
  public void makeImmutable()
  {
    if (mutable)
    {
      mutable = false;
      cssByBlockModifierType = Collections.unmodifiableMap(cssByBlockModifierType);
      cssByPhraseModifierType = Collections.unmodifiableMap(cssByPhraseModifierType);
    }
  }
  
  public void save(IPreferenceStore store, boolean asDefault)
  {
    for (Map.Entry<String, String> ent : cssByBlockModifierType.entrySet())
    {
      String propKey = toPreferenceKey((String)ent.getKey(), true);
      if (asDefault) {
        store.setDefault(propKey, (String)ent.getValue());
      } else {
        store.setValue(propKey, (String)ent.getValue());
      }
    }
    for (Map.Entry<String, String> ent : cssByPhraseModifierType.entrySet())
    {
      String propKey = toPreferenceKey((String)ent.getKey(), false);
      if (asDefault) {
        store.setDefault(propKey, (String)ent.getValue());
      } else {
        store.setValue(propKey, (String)ent.getValue());
      }
    }
    if (asDefault)
    {
      store.setDefault("editorFolding", editorFolding);
      store.setDefault("preview.css", getDefaultMarkupViewerCss());
    }
    else
    {
      store.setValue("editorFolding", editorFolding);
      store.setValue("preview.css", markupViewerCss);
    }
  }
  
  public static String toPreferenceKey(String key, boolean block)
  {
    String propKey = (block ? "block-" : "phrase-") + BAD_CHAR_PATTERN.matcher(key).replaceAll("");
    return propKey;
  }
  
  public void load(IPreferenceStore store)
  {
    if (!mutable) {
      throw new UnsupportedOperationException();
    }
    for (Map.Entry<String, String> ent : cssByBlockModifierType.entrySet())
    {
      String propKey = toPreferenceKey((String)ent.getKey(), true);
      
      String value = store.getString(propKey);
      if (value != null) {
        ent.setValue(value);
      }
    }
    for (Map.Entry<String, String> ent : cssByPhraseModifierType.entrySet())
    {
      String propKey = toPreferenceKey((String)ent.getKey(), false);
      String value = store.getString(propKey);
      if (value != null) {
        ent.setValue(value);
      }
    }
    editorFolding = store.getBoolean("editorFolding");
    markupViewerCss = store.getString("preview.css");
    if (isEmpty(markupViewerCss)) {
      markupViewerCss = getDefaultMarkupViewerCss();
    }
    stylesheet = null;
  }
  
  private String getDefaultMarkupViewerCss()
  {
    try
    {
      return readFully(HtmlTextPresentationParser.getDefaultStylesheetContent());
    }
    catch (IOException e)
    {
      WikiTextUiPlugin.getDefault().log(e);
    }
    return "";
  }
  
  private String readFully(Reader reader)
    throws IOException
  {
    try
    {
      StringWriter writer = new StringWriter();
      int c;
      while ((c = reader.read()) != -1)
      {
        int c;
        writer.write(c);
      }
      return writer.toString();
    }
    finally
    {
      reader.close();
    }
  }
  
  private boolean isEmpty(String text)
  {
    if ((text == null) || (text.length() == 0)) {
      return true;
    }
    int length = text.length();
    for (int x = 0; x < length; x++)
    {
      char c = text.charAt(x);
      if (!Character.isWhitespace(c)) {
        return false;
      }
    }
    return true;
  }
  
  public Preferences clone()
  {
    try
    {
      Preferences copy = (Preferences)super.clone();
      mutable = true;
      return copy;
    }
    catch (CloneNotSupportedException localCloneNotSupportedException)
    {
      throw new IllegalStateException();
    }
  }
}

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

import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;

class EditorPreferencePage$1
  extends ScrolledComposite
{
  EditorPreferencePage$1(EditorPreferencePage paramEditorPreferencePage, Composite $anonymous0, int $anonymous1)
  {
    super($anonymous0, $anonymous1);
  }
  
  public Point computeSize(int hint, int hint2, boolean changed)
  {
    return new Point(64, 64);
  }
}

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

import org.eclipse.osgi.util.NLS;

class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.wikitext.ui.editor.preferences.messages";
  public static String CssStyleFieldEditor_1;
  public static String CssStyleFieldEditor_invalidColor;
  public static String CssStyleFieldEditor_unexpectedToken;
  public static String CssStyleFieldEditor_unsupportedRule;
  public static String EditorPreferencePage_blockModifiers;
  public static String EditorPreferencePage_introInfo;
  public static String EditorPreferencePage_phraseModifiers;
  
  static
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.wikitext.ui.editor.preferences.messages", Messages.class);
  }
}

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

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.FoldingStructure.2
 * 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.ISourceViewer;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Display;

class MarkupEditor$7
  implements IPropertyChangeListener
{
  MarkupEditor$7(MarkupEditor paramMarkupEditor) {}
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if (MarkupEditor.access$4(this$0).getTextWidget().isDisposed()) {
      return;
    }
    if (MarkupEditor.access$5(this$0, event)) {
      MarkupEditor.access$4(this$0).getTextWidget().getDisplay().asyncExec(new Runnable()
      {
        public void run()
        {
          MarkupEditor.access$6(this$0);
        }
      });
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.7
 * 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.IMenuListener;
import org.eclipse.jface.action.IMenuManager;

class MarkupEditorOutline$4
  implements IMenuListener
{
  MarkupEditorOutline$4(MarkupEditorOutline paramMarkupEditorOutline) {}
  
  public void menuAboutToShow(IMenuManager menuManager)
  {
    this$0.contextMenuAboutToShow(menuManager);
  }
}

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

import java.io.Writer;
import org.eclipse.mylyn.wikitext.core.parser.builder.HtmlDocumentBuilder;
import org.eclipse.mylyn.wikitext.core.util.XmlStreamWriter;

class MarkupEditor$11
  extends HtmlDocumentBuilder
{
  MarkupEditor$11(MarkupEditor paramMarkupEditor, Writer $anonymous0)
  {
    super($anonymous0);
  }
  
  protected void emitAnchorHref(String href)
  {
    if (href.startsWith("#"))
    {
      writer.writeAttribute(
        "onclick", String.format("javascript: window.location.hash = '%s'; return false;", new Object[] { href }));
      writer.writeAttribute("href", "#");
    }
    else
    {
      super.emitAnchorHref(href);
    }
  }
}

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

import java.u
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-2017. Infinite Loop Ltd