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

    HtmlViewerConfiguration.access$1(this$0).getTextPresentation() : 
      HtmlViewerConfiguration.access$0(this$0);
    presentation.clear();
    if (viewerPresentation == null) {
      return;
    }
    StyleRange defaultStyleRange = viewerPresentation.getDefaultStyleRange();
    presentation.setDefaultStyleRange(
    
      (StyleRange)(defaultStyleRange == null ? null : defaultStyleRange.clone()));
    List<StyleRange> ranges = new ArrayList();
    
    Iterator<?> allStyleRangeIterator = viewerPresentation.getAllStyleRangeIterator();
    while (allStyleRangeIterator.hasNext())
    {
      StyleRange range = (StyleRange)allStyleRangeIterator.next();
      ranges.add((StyleRange)range.clone());
    }
    int start = damage.getOffset();
    for (int x = 0; x < ranges.size(); x++)
    {
      StyleRange range = (StyleRange)ranges.get(x);
      if (start > start)
      {
        StyleRange newRange = defaultStyleRange == null ? 
          new StyleRange() : 
          (StyleRange)defaultStyleRange.clone();
        start = start;
        length = (start - start);
        
        ranges.add(++x, newRange);
      }
      start = start + length + 1;
    }
    if (start < damage.getOffset() + damage.getLength())
    {
      StyleRange newRange = defaultStyleRange == null ? 
        new StyleRange() : 
        (StyleRange)defaultStyleRange.clone();
      start = start;
      length = (damage.getOffset() + damage.getLength() - start);
      ranges.add(newRange);
    }
    presentation.replaceStyleRanges((StyleRange[])ranges.toArray(new StyleRange[ranges.size()]));
  }
}

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

import org.eclipse.osgi.util.NLS;

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

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

import org.eclipse.jface.text.source.Annotation;

public class TitleAnnotation
  extends Annotation
{
  private final String titleType;
  public static final String TYPE = "org.eclipse.mylyn.wikitext.ui.annotation.title";
  
  public TitleAnnotation(String title, String titleType)
  {
    super("org.eclipse.mylyn.wikitext.ui.annotation.title", false, title);
    this.titleType = titleType;
  }
  
  public String getTitleType()
  {
    return titleType;
  }
  
  public String getTitle()
  {
    return getText();
  }
}

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

import org.eclipse.jface.text.source.Annotation;

public class AnchorHrefAnnotation
  extends Annotation
{
  public static final String TYPE = "org.eclipse.mylyn.wikitext.ui.annotation.anchor";
  
  public AnchorHrefAnnotation(String href)
  {
    super("org.eclipse.mylyn.wikitext.ui.annotation.anchor", false, href);
  }
  
  public String getAnchorHref()
  {
    return getText();
  }
}

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

import org.eclipse.jface.text.source.Annotation;

public class AnchorNameAnnotation
  extends Annotation
{
  public static final String TYPE = "org.eclipse.mylyn.wikitext.ui.annotation.anchorName";
  
  public AnchorNameAnnotation(String name)
  {
    super("org.eclipse.mylyn.wikitext.ui.annotation.anchorName", false, name);
  }
  
  public String getAnchorName()
  {
    return getText();
  }
}

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

import org.eclipse.jface.text.source.Annotation;

public class IdAnnotation
  extends Annotation
{
  public static final String TYPE = "org.eclipse.mylyn.wikitext.ui.annotation.id";
  
  public IdAnnotation(String id)
  {
    super("org.eclipse.mylyn.wikitext.ui.annotation.id", false, id);
  }
  
  public String getElementId()
  {
    return getText();
  }
}

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

import org.eclipse.jface.text.source.Annotation;

public class ClassAnnotation
  extends Annotation
{
  public static final String TYPE = "org.eclipse.mylyn.wikitext.ui.annotation.class";
  
  public ClassAnnotation(String cssClass)
  {
    super("org.eclipse.mylyn.wikitext.ui.annotation.class", false, cssClass);
  }
  
  public String getCssClass()
  {
    return getText();
  }
}

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

import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WhitespaceRule;

public class CssBlockScanner
  extends RuleBasedScanner
{
  public CssBlockScanner(ColorRegistry colorRegistry)
  {
    setRules(new IRule[] {
    
      new CommentRule(new Token(new TextAttribute(colorRegistry.get("css.comment")))), 
      new PropertyNameRule(new Token(new TextAttribute(colorRegistry.get("css.property.name")))), 
      new PropertyValueRule(new Token(new TextAttribute(colorRegistry.get("css.property.value")))), 
      new WhitespaceRule(new CssWhitespaceDetector()) });
  }
}

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

abstract interface package-info {}

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

import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.presentation.IPresentationReconciler;
import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
import org.eclipse.jface.text.rules.ITokenScanner;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.swt.graphics.RGB;

public class CssConfiguration
  extends SourceViewerConfiguration
{
  private final ColorRegistry colorRegistry;
  
  public CssConfiguration(ColorRegistry colorRegistry)
  {
    this.colorRegistry = colorRegistry;
    for (Map.Entry<String, RGB> colorEnt : Colors.keyToRgb.entrySet()) {
      colorRegistry.put((String)colorEnt.getKey(), (RGB)colorEnt.getValue());
    }
  }
  
  public String[] getConfiguredContentTypes(ISourceViewer sourceViewer)
  {
    return new String[] { "__dftl_partition_content_type", "__css_comment", 
      "__css_block" };
  }
  
  public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer)
  {
    PresentationReconciler reconciler = new PresentationReconciler();
    
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCssTokenScanner());
    reconciler.setDamager(dr, "__css_block");
    reconciler.setRepairer(dr, "__css_block");
    
    dr = new DefaultDamagerRepairer(getCssScanner());
    reconciler.setDamager(dr, "__dftl_partition_content_type");
    reconciler.setRepairer(dr, "__dftl_partition_content_type");
    
    CommentDamagerRepairer commentDamagerRepairer = new CommentDamagerRepairer(new TextAttribute(
      colorRegistry.get("css.comment")));
    reconciler.setDamager(commentDamagerRepairer, "__css_comment");
    reconciler.setRepairer(commentDamagerRepairer, "__css_comment");
    
    return reconciler;
  }
  
  private ITokenScanner getCssScanner()
  {
    return new CssScanner(colorRegistry);
  }
  
  private ITokenScanner getCssTokenScanner()
  {
    return new CssBlockScanner(colorRegistry);
  }
}

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

import org.eclipse.jface.text.rules.IPredicateRule;
import org.eclipse.jface.text.rules.MultiLineRule;
import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
import org.eclipse.jface.text.rules.Token;

class CssPartitionScanner
  extends RuleBasedPartitionScanner
{
  public static final String CONTENT_TYPE_COMMENT = "__css_comment";
  public static final String CONTENT_TYPE_BLOCK = "__css_block";
  
  public CssPartitionScanner()
  {
    setPredicateRules(new IPredicateRule[] {
    
      new MultiLineRule("/*", "*/", new Token("__css_comment")), 
      new MultiLineRule("{", "}", new Token("__css_block")) });
  }
}

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

import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WhitespaceRule;

public class CssScanner
  extends RuleBasedScanner
{
  public CssScanner(ColorRegistry colorRegistry)
  {
    setRules(new IRule[] {
    
      new SelectorRule(new Token(new TextAttribute(colorRegistry.get("css.selector")))), 
      new WhitespaceRule(new CssWhitespaceDetector()) });
  }
}

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

import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IPredicateRule;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;

class PropertyNameRule
  implements IRule, IPredicateRule
{
  private final Token token;
  private int readCount = 0;
  
  public PropertyNameRule(Token token)
  {
    this.token = token;
  }
  
  public IToken evaluate(ICharacterScanner scanner)
  {
    return evaluate(scanner, false);
  }
  
  public IToken evaluate(ICharacterScanner scanner, boolean resume)
  {
    readCount = 0;
    if (resume)
    {
      if (endSequenceDetected(scanner)) {
        return token;
      }
    }
    else if ((startSequenceDetected(scanner)) && 
      (endSequenceDetected(scanner))) {
      return token;
    }
    while (readCount > 0)
    {
      readCount -= 1;
      scanner.unread();
    }
    return Token.UNDEFINED;
  }
  
  private boolean endSequenceDetected(ICharacterScanner scanner)
  {
    int read = read(scanner);
    for (;; read = read(scanner))
    {
      if ((read == -1) || (read == 58))
      {
        scanner.unread();
        readCount -= 1;
        return true;
      }
      if ((read == 59) || (read == 123) || (read == 125) || (read == 47) || (read == 42)) {
        return false;
      }
    }
  }
  
  private boolean startSequenceDetected(ICharacterScanner scanner)
  {
    int read = read(scanner);
    if (isWordChar(read)) {
      return true;
    }
    return false;
  }
  
  private boolean isWordChar(int read)
  {
    return (read != -1) && (read != 123) && (read != 125) && (read != 58) && (read != 59) && (read != 47) && (read != 42) && (read != 44) && (!Character.isWhitespace(read));
  }
  
  private int read(ICharacterScanner scanner)
  {
    readCount += 1;
    return scanner.read();
  }
  
  public IToken getSuccessToken()
  {
    return token;
  }
}

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

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.swt.graphics.RGB;

class Colors
{
  static final RGB RGB_DEFAULT = new RGB(0, 0, 0);
  static final RGB RGB_COMMENT = new RGB(63, 95, 191);
  static final RGB RGB_SELECTOR = new RGB(42, 129, 128);
  static final RGB RGB_PROPERTY_NAME = new RGB(129, 0, 129);
  static final RGB RGB_PROPERTY_VALUE = new RGB(42, 0, 225);
  static final Map<String, RGB> keyToRgb;
  public static final String KEY_DEFAULT = "css.default";
  public static final String KEY_COMMENT = "css.comment";
  public static final String KEY_SELECTOR = "css.selector";
  public static final String KEY_PROPERTY_NAME = "css.property.name";
  public static final String KEY_PROPERTY_VALUE = "css.property.value";
  
  static
  {
    Map<String, RGB> tempKeyToRgb = new HashMap();
    tempKeyToRgb.put("css.default", RGB_DEFAULT);
    tempKeyToRgb.put("css.comment", RGB_COMMENT);
    tempKeyToRgb.put("css.selector", RGB_SELECTOR);
    tempKeyToRgb.put("css.property.name", RGB_PROPERTY_NAME);
    tempKeyToRgb.put("css.property.value", RGB_PROPERTY_VALUE);
    keyToRgb = Collections.unmodifiableMap(tempKeyToRgb);
  }
}

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

import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.TextPresentation;
import org.eclipse.jface.text.presentation.IPresentationDamager;
import org.eclipse.jface.text.presentation.IPresentationRepairer;
import org.eclipse.swt.custom.StyleRange;

class CommentDamagerRepairer
  implements IPresentationDamager, IPresentationRepairer
{
  private IDocument document;
  private final TextAttribute defaultTextAttribute;
  
  public CommentDamagerRepairer(TextAttribute defaultTextAttribute)
  {
    this.defaultTextAttribute = defaultTextAttribute;
  }
  
  public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent event, boolean documentPartitioningChanged)
  {
    if (!documentPartitioningChanged) {
      try
      {
        IRegion lineRegion = document.getLineInformationOfOffset(event.getOffset());
        int start = Math.max(lineRegion.getOffset(), partition.getOffset());
        int end = event.getOffset();
        if (event.getText() == null) {
          end += event.getLength();
        } else {
          end += event.getText().length();
        }
        if ((lineRegion.getOffset() <= end) && (end <= lineRegion.getOffset() + lineRegion.getLength())) {
          end = lineRegion.getOffset() + lineRegion.getLength();
        } else {
          end = toLineEnd(end);
        }
        int partitionEnd = partition.getOffset() + partition.getLength();
        end = Math.min(partitionEnd, end);
        return new Region(start, end - start);
      }
      catch (BadLocationException localBadLocationException) {}
    }
    return partition;
  }
  
  private int toLineEnd(int offset)
    throws BadLocationException
  {
    IRegion lineRegion = document.getLineInformationOfOffset(offset);
    int lineEndOffset = lineRegion.getOffset() + lineRegion.getLength();
    if (offset <= lineEndOffset) {
      return lineEndOffset;
    }
    int line = document.getLineOfOffset(offset);
    try
    {
      lineRegion = document.getLineInformation(line + 1);
      return lineRegion.getOffset() + lineRegion.getLength();
    }
    catch (BadLocationException localBadLocationException) {}
    return document.getLength();
  }
  
  public void setDocument(IDocument document)
  {
    this.document = document;
  }
  
  public void createPresentation(TextPresentation presentation, ITypedRegion damage)
  {
    presentation.addStyleRange(new StyleRange(damage.getOffset(), damage.getLength(), 
      defaultTextAttribute.getForeground(), defaultTextAttribute.getBackground(), 
      defaultTextAttribute.getStyle()));
  }
}

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

import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IPredicateRule;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;

class PropertyValueRule
  implements IRule, IPredicateRule
{
  private final Token token;
  private int readCount = 0;
  
  public PropertyValueRule(Token token)
  {
    this.token = token;
  }
  
  public IToken evaluate(ICharacterScanner scanner)
  {
    return evaluate(scanner, false);
  }
  
  public IToken evaluate(ICharacterScanner scanner, boolean resume)
  {
    readCount = 0;
    if (resume)
    {
      if (endSequenceDetected(scanner)) {
        return token;
      }
    }
    else if ((startSequenceDetected(scanner)) && 
      (endSequenceDetected(scanner))) {
      return token;
    }
    while (readCount > 0)
    {
      readCount -= 1;
      scanner.unread();
    }
    return Token.UNDEFINED;
  }
  
  private boolean endSequenceDetected(ICharacterScanner scanner)
  {
    int read = read(scanner);
    for (;; read = read(scanner))
    {
      if ((read == -1) || (read == 59) || (read == 125))
      {
        scanner.unread();
        readCount -= 1;
        return true;
      }
      if ((read == 58) || (read == 123) || (read == 47) || (read == 42)) {
        return false;
      }
    }
  }
  
  private boolean startSequenceDetected(ICharacterScanner scanner)
  {
    int read = read(scanner);
    if (isWordChar(read)) {
      return true;
    }
    return false;
  }
  
  private boolean isWordChar(int read)
  {
    return (read != -1) && (read != 123) && (read != 125) && (read != 58) && (read != 59) && (read != 47) && (read != 42) && (!Character.isWhitespace(read));
  }
  
  private int read(ICharacterScanner scanner)
  {
    readCount += 1;
    return scanner.read();
  }
  
  public IToken getSuccessToken()
  {
    return token;
  }
}

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

import org.eclipse.jface.text.rules.FastPartitioner;

public class CssPartitioner
  extends FastPartitioner
{
  public CssPartitioner()
  {
    super(new CssPartitionScanner(), new String[] { "__css_block", "__css_comment" });
  }
}

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

import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IPredicateRule;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;

class CommentRule
  implements IRule, IPredicateRule
{
  private final Token token;
  private int readCount = 0;
  
  public CommentRule(Token token)
  {
    this.token = token;
  }
  
  public IToken evaluate(ICharacterScanner scanner)
  {
    return evaluate(scanner, false);
  }
  
  public IToken evaluate(ICharacterScanner scanner, boolean resume)
  {
    readCount = 0;
    if (resume)
    {
      if (endSequenceDetected(scanner)) {
        return token;
      }
    }
    else if ((startSequenceDetected(scanner)) && 
      (endSequenceDetected(scanner))) {
      return token;
    }
    while (readCount > 0)
    {
      readCount -= 1;
      scanner.unread();
    }
    return Token.UNDEFINED;
  }
  
  private boolean endSequenceDetected(ICharacterScanner scanner)
  {
    int previous = -1;
    int read = read(scanner);
    for (;; read = read(scanner))
    {
      if (read == -1)
      {
        scanner.unread();
        readCount -= 1;
        return true;
      }
      if ((previous == 42) && (read == 47)) {
        return true;
      }
    }
  }
  
  private boolean startSequenceDetected(ICharacterScanner scanner)
  {
    int read = read(scanner);
    if (read == 47)
    {
      read = read(scanner);
      return read == 42;
    }
    return false;
  }
  
  private int read(ICharacterScanner scanner)
  {
    readCount += 1;
    return scanner.read();
  }
  
  public IToken getSuccessToken()
  {
    return token;
  }
}

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

import org.eclipse.jface.text.rules.IWhitespaceDetector;

public class CssWhitespaceDetector
  implements IWhitespaceDetector
{
  public boolean isWhitespace(char c)
  {
    return (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r');
  }
}

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

import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IPredicateRule;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;

class SelectorRule
  implements IRule, IPredicateRule
{
  private final Token token;
  private int readCount = 0;
  
  public SelectorRule(Token token)
  {
    this.token = token;
  }
  
  public IToken evaluate(ICharacterScanner scanner)
  {
    return evaluate(scanner, false);
  }
  
  public IToken evaluate(ICharacterScanner scanner, boolean resume)
  {
    readCount = 0;
    if (resume)
    {
      if (endSequenceDetected(scanner)) {
        return token;
      }
    }
    else if ((startSequenceDetected(scanner)) && 
      (endSequenceDetected(scanner))) {
      return token;
    }
    while (readCount > 0)
    {
      readCount -= 1;
      scanner.unread();
    }
    return Token.UNDEFINED;
  }
  
  private boolean endSequenceDetected(ICharacterScanner scanner)
  {
    int read = read(scanner);
    for (;; read = read(scanner))
    {
      if ((read == -1) || (read == 47) || (read == 123) || (read == 125))
      {
        scanner.unread();
        readCount -= 1;
        return true;
      }
      if ((read == 123) || (read == 125) || (read == 47)) {
        return false;
      }
    }
  }
  
  private boolean startSequenceDetected(ICharacterScanner scanner)
  {
    int read = read(scanner);
    if (isWordChar(read)) {
      return true;
    }
    return false;
  }
  
  private boolean isWordChar(int read)
  {
    return (read != -1) && (read != 123) && (read != 125) && (read != 47) && (!Character.isWhitespace(read));
  }
  
  private int read(ICharacterScanner scanner)
  {
    readCount += 1;
    return scanner.read();
  }
  
  public IToken getSuccessToken()
  {
    return token;
  }
}

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

import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.ui.model.IWorkbenchAdapter;

public class OutlineItemAdapterFactory
  implements IAdapterFactory
{
  private static final Class<?>[] ADAPTER_LIST = { IWorkbenchAdapter.class };
  
  public Object getAdapter(Object adaptableObject, Class adapterType)
  {
    if ((adapterType == IWorkbenchAdapter.class) && ((adaptableObject instanceof OutlineItem))) {
      return OutlineItemWorkbenchAdapter.instance();
    }
    return null;
  }
  
  public Class<?>[] getAdapterList()
  {
    return ADAPTER_LIST;
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension2;
import org.eclipse.ui.texteditor.HyperlinkDetectorDescriptor;

public class HyperlinkDetectorDelegate
  implements IHyperlinkDetector, IHyperlinkDetectorExtension, IHyperlinkDetectorExtension2
{
  private HyperlinkDetectorDescriptor descriptor;
  private AbstractHyperlinkDetector delegate;
  private boolean createFailed;
  private IAdaptable context;
  private int stateMask;
  private boolean enabled;
  
  public HyperlinkDetectorDelegate(HyperlinkDetectorDescriptor descriptor, IPreferenceStore preferenceStore)
  {
    this.descriptor = descriptor;
    if (preferenceStore != null)
    {
      stateMask = preferenceStore.getInt(descriptor.getId() + "_stateMask");
      enabled = (!preferenceStore.getBoolean(descriptor.getId()));
    }
  }
  
  public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks)
  {
    if (!isEnabled()) {
      return null;
    }
    if ((!createFailed) && (delegate == null))
    {
      try
      {
        delegate = descriptor.createHyperlinkDetector();
      }
      catch (CoreException localCoreException)
      {
        createFailed = true;
      }
      if ((delegate != null) && (context != null)) {
        delegate.setContext(context);
      }
    }
    if (delegate != null) {
      return delegate.detectHyperlinks(textViewer, region, canShowMultipleHyperlinks);
    }
    return null;
  }
  
  public boolean isEnabled()
  {
    return enabled;
  }
  
  public void setContext(IAdaptable context)
  {
    this.context = context;
  }
  
  public void dispose()
  {
    if (delegate != null)
    {
      delegate.dispose();
      delegate = null;
    }
    descriptor = null;
    context = null;
  }
  
  public int getStateMask()
  {
    return stateMask;
  }
}

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

import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;

public class WikiTextUiResources
{
  private static final String KEY_COLOR_REGISTRY = WikiTextUiResources.class.getName() + "#colorRegistry";
  public static final String PREFERENCE_TEXT_FONT = "org.eclipse.mylyn.wikitext.ui.presentation.textFont";
  public static final String PREFERENCE_MONOSPACE_FONT = "org.eclipse.mylyn.wikitext.ui.presentation.monospaceFont";
  public static final String COLOR_HR = "HR";
  public static final String COLOR_HR_SHADOW = "HR_SHADOW";
  
  public static ColorRegistry getColors()
  {
    ColorRegistry colorRegistry = (ColorRegistry)Display.getCurrent().getData(KEY_COLOR_REGISTRY);
    if (colorRegistry == null)
    {
      colorRegistry = new ColorRegistry();
      
      colorRegistry.put("HR", new RGB(132, 132, 132));
      colorRegistry.put("HR_SHADOW", new RGB(206, 206, 206));
      
      Display.getCurrent().setData(KEY_COLOR_REGISTRY, colorRegistry);
    }
    return colorRegistry;
  }
}

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

import org.eclipse.core.runtime.ListenerList;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;

public abstract class PreferenceStoreFacade
  implements IPreferenceStore
{
  private final ListenerList listeners = new ListenerList(1);
  private IPropertyChangeListener forwardingListener;
  protected IPreferenceStore delegate;
  
  protected PreferenceStoreFacade(IPreferenceStore preferenceStore)
  {
    delegate = preferenceStore;
  }
  
  public void addPropertyChangeListener(IPropertyChangeListener listener)
  {
    listeners.add(listener);
    if (forwardingListener == null)
    {
      forwardingListener = new IPropertyChangeListener()
      {
        public void propertyChange(PropertyChangeEvent event)
        {
          firePropertyChangeEvent(event.getProperty(), event.getOldValue(), event.getNewValue());
        }
      };
      delegate.addPropertyChangeListener(forwardingListener);
    }
  }
  
  public void removePropertyChangeListener(IPropertyChangeListener listener)
  {
    listeners.remove(listener);
    if ((listeners.isEmpty()) && 
      (forwardingListener != null))
    {
      delegate.removePropertyChangeListener(forwardingListener);
      forwardingListener = null;
    }
  }
  
  public void firePropertyChangeEvent(String name, Object oldValue, Object newValue)
  {
    if (listeners.isEmpty()) {
      return;
    }
    if ((newValue instanceof Boolean)) {
      newValue = Boolean.valueOf(getBoolean(name));
    } else if ((newValue instanceof Integer)) {
      newValue = Integer.valueOf(getInt(name));
    } else if ((newValue instanceof Long)) {
      newValue = Long.valueOf(getLong(name));
    } else if ((newValue instanceof Double)) {
      newValue = Double.valueOf(getDouble(name));
    } else if ((newValue instanceof Float)) {
      newValue = Float.valueOf(getFloat(name));
    } else if ((newValue instanceof String)) {
      newValue = getString(name);
    }
    if ((newValue == oldValue) || ((newValue != null) && (newValue.equals(oldValue)))) {
      return;
    }
    PropertyChangeEvent event = new PropertyChangeEvent(this, name, oldValue, newValue);
    Object[] arrayOfObject;
    int j = (arrayOfObject = listeners.getListeners()).length;
    for (int i = 0; i < j; i++)
    {
      Object o = arrayOfObject[i];
      IPropertyChangeListener listener = (IPropertyChangeListener)o;
      listener.propertyChange(event);
    }
  }
  
  public boolean contains(String name)
  {
    return delegate.contains(name);
  }
  
  public boolean getBoolean(String name)
  {
    return delegate.getBoolean(name);
  }
  
  public boolean getDefaultBoolean(String name)
  {
    return delegate.getDefaultBoolean(name);
  }
  
  public double getDefaultDouble(String name)
  {
    return delegate.getDefaultDouble(name);
  }
  
  public float getDefaultFloat(String name)
  {
    return delegate.getDefaultFloat(name);
  }
  
  public int getDefaultInt(String name)
  {
    return delegate.getDefaultInt(name);
  }
  
  public long getDefaultLong(String name)
  {
    return delegate.getDefaultLong(name);
  }
  
  public String getDefaultString(String name)
  {
    return delegate.getDefaultString(name);
  }
  
  public double getDouble(String name)
  {
    return delegate.getDouble(name);
  }
  
  public float getFloat(String name)
  {
    return delegate.getFloat(name);
  }
  
  public int getInt(String name)
  {
    return delegate.getInt(name);
  }
  
  public long getLong(String name)
  {
    return delegate.getLong(name);
  }
  
  public String getString(String name)
  {
    return delegate.getString(name);
  }
  
  public boolean isDefault(String name)
  {
    return delegate.isDefault(name);
  }
  
  public boolean needsSaving()
  {
    return delegate.needsSaving();
  }
  
  public void putValue(String name, String value)
  {
    delegate.putValue(name, value);
  }
  
  public void setDefault(String name, boolean value)
  {
    delegate.setDefault(name, value);
  }
  
  public void setDefault(String name, double value)
  {
    delegate.setDefault(name, value);
  }
  
  public void setDefault(String name, float value)
  {
    delegate.setDefault(name, value);
  }
  
  public void setDefault(String name, int value)
  {
    delegate.setDefault(name, value);
  }
  
  public void setDefault(String name, long value)
  {
    delegate.setDefault(name, value);
  }
  
  public void setDefault(String name, String defaultObject)
  {
    delegate.setDefault(name, defaultObject);
  }
  
  public void setToDefault(String name)
  {
    delegate.setToDefault(name);
  }
  
  public void setValue(String name, boolean value)
  {
    delegate.setValue(name, value);
  }
  
  public void setValue(String name, double value)
  {
    delegate.setValue(name, value);
  }
  
  public void setValue(String name, float value)
  {
    delegate.setValue(name, value);
  }
  
  public void setValue(String name, int value)
  {
    delegate.setValue(name, value);
  }
  
  public void setValue(String name, long value)
  {
    delegate.setValue(name, value);
  }
  
  public void setValue(String name, String value)
  {
    delegate.setValue(name, value);
  }
}

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

import java.lang.reflect.Constructor;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.text.DefaultInformationControl;
import org.eclipse.jface.text.DefaultInformationControl.IInformationPresenter;
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.mylyn.wikitext.ui.viewer.HtmlTextPresenter;
import org.eclipse.swt.widgets.Shell;

class InformationPresenterUtil$1
  implements IInformationControlCreator
{
  InformationPresenterUtil$1(ToolBarManager paramToolBarManager) {}
  
  public IInformationControl createInformationControl(Shell shell)
  {
    try
    {
      return 
      
        (IInformationControl)DefaultInformationControl.class.getConstructor(new Class[] { Shell.class, ToolBarManager.class, DefaultInformationControl.IInformationPresenter.class }).newInstance(new Object[] { shell, val$toolBarManager, new HtmlTextPresenter() });
    }
    catch (NoSuchMethodException localNoSuchMethodException)
    {
      return new DefaultInformationControl(shell, 16, 768, 
        new HtmlTextPresenter());
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
}

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

import java.util.List;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.ui.model.IWorkbenchAdapter;

public class OutlineItemWorkbenchAdapter
  implements IWorkbenchAdapter
{
  private static final Object[] NO_CHILDREN = new Object[0];
  private static OutlineItemWorkbenchAdapter instance = new OutlineItemWorkbenchAdapter();
  
  public Object[] getChildren(Object o)
  {
    if ((o instanceof OutlineItem))
    {
      OutlineItem item = (OutlineItem)o;
      if (!item.getChildren().isEmpty()) {
        return item.getChildren().toArray();
      }
    }
    return NO_CHILDREN;
  }
  
  public ImageDescriptor getImageDescriptor(Object object)
  {
    return null;
  }
  
  public String getLabel(Object o)
  {
    if ((o instanceof OutlineItem))
    {
      OutlineItem item = (OutlineItem)o;
      if (item.getKind() == null) {
        return item.getLabel();
      }
      return item.getKind() + ". " + item.getLabel();
    }
    return null;
  }
  
  public Object getParent(Object o)
  {
    if ((o instanceof OutlineItem))
    {
      OutlineItem item = (OutlineItem)o;
      return item.getParent();
    }
    return null;
  }
  
  public static OutlineItemWorkbenchAdapter instance()
  {
    return instance;
  }
}

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

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

class InformationPresenterUtil$2
  extends InformationPresenter
{
  InformationPresenterUtil$2(IInformationControlCreator $anonymous0)
  {
    super($anonymous0);
  }
  
  public IInformationProvider getInformationProvider(String contentType)
  {
    IInformationProvider informationProvider = super.getInformationProvider(contentType);
    if (informationProvider == null) {
      informationProvider = super.getInformationProvider("__dftl_partition_content_type");
    }
    return informationProvider;
  }
}

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

import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.information.IInformationProvider;
import org.eclipse.jface.text.information.IInformationProviderExtension;
import org.eclipse.jface.text.information.IInformationProviderExtension2;

final class InformationPresenterUtil$InformationProvider
  implements IInformationProvider, IInformationProviderExtension, IInformationProviderExtension2
{
  private final IRegion hoverRegion;
  private final Object hoverInfo;
  private final IInformationControlCreator controlCreator;
  
  InformationPresenterUtil$InformationProvider(IRegion hoverRegion, Object info, IInformationControlCreator controlCreator)
  {
    this.hoverRegion = hoverRegion;
    hoverInfo = info;
    this.controlCreator = controlCreator;
  }
  
  public IRegion getSubject(ITextViewer textViewer, int invocationOffset)
  {
    return hoverRegion;
  }
  
  public String getInformation(ITextViewer textViewer, IRegion subject)
  {
    return hoverInfo.toString();
  }
  
  public Object getInformation2(ITextViewer textViewer, IRegion subject)
  {
    return hoverInfo;
  }
  
  public IInformationControlCreator getInformationPresenterControlCreator()
  {
    return controlCreator
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