org-openide-text

16:40:42.138 INFO  jd.cli.Main - Decompiling org-openide-text.jar
package org.netbeans.modules.openide.text;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import org.openide.modules.ModuleInstall;

public class Installer
  extends ModuleInstall
{
  private static Map<String, Integer> mimeTypes = new HashMap();
  
  public static void add(String paramString)
  {
    Integer localInteger;
    if (mimeTypes.containsKey(paramString))
    {
      localInteger = (Integer)mimeTypes.get(paramString);
      localInteger = Integer.valueOf(localInteger.intValue() + 1);
      mimeTypes.put(paramString, localInteger);
    }
    else
    {
      localInteger = new Integer(1);
      mimeTypes.put(paramString, localInteger);
    }
  }
  
  public void close()
  {
    for (String str : mimeTypes.keySet())
    {
      Logger localLogger = Logger.getLogger("org.netbeans.ui.metrics.editor");
      LogRecord localLogRecord = new LogRecord(Level.INFO, "USG_EDITOR_MIME_TYPE");
      localLogRecord.setParameters(new Object[] { str, mimeTypes.get(str) });
      localLogRecord.setLoggerName(localLogger.getName());
      localLogger.log(localLogRecord);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.text.Installer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.cookies;

import java.beans.PropertyChangeListener;

public abstract interface EditorCookie$Observable
  extends EditorCookie
{
  public static final String PROP_DOCUMENT = "document";
  public static final String PROP_MODIFIED = "modified";
  public static final String PROP_OPENED_PANES = "openedPanes";
  
  public abstract void addPropertyChangeListener(PropertyChangeListener paramPropertyChangeListener);
  
  public abstract void removePropertyChangeListener(PropertyChangeListener paramPropertyChangeListener);
}

/* Location:
 * Qualified Name:     org.openide.cookies.EditorCookie.Observable
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.cookies;

import java.beans.PropertyChangeListener;
import java.io.IOException;
import javax.swing.JEditorPane;
import javax.swing.text.StyledDocument;
import org.openide.util.Task;

public abstract interface EditorCookie
  extends LineCookie
{
  public abstract void open();
  
  public abstract boolean close();
  
  public abstract Task prepareDocument();
  
  public abstract StyledDocument openDocument()
    throws IOException;
  
  public abstract StyledDocument getDocument();
  
  public abstract void saveDocument()
    throws IOException;
  
  public abstract boolean isModified();
  
  public abstract JEditorPane[] getOpenedPanes();
  
  public static abstract interface Observable
    extends EditorCookie
  {
    public static final String PROP_DOCUMENT = "document";
    public static final String PROP_MODIFIED = "modified";
    public static final String PROP_OPENED_PANES = "openedPanes";
    
    public abstract void addPropertyChangeListener(PropertyChangeListener paramPropertyChangeListener);
    
    public abstract void removePropertyChangeListener(PropertyChangeListener paramPropertyChangeListener);
  }
}

/* Location:
 * Qualified Name:     org.openide.cookies.EditorCookie
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.cookies;

import org.openide.nodes.Node.Cookie;
import org.openide.text.Line.Set;

public abstract interface LineCookie
  extends Node.Cookie
{
  public abstract Line.Set getLineSet();
}

/* Location:
 * Qualified Name:     org.openide.cookies.LineCookie
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import java.awt.datatransfer.DataFlavor;
import javax.swing.text.JTextComponent;

public abstract interface ActiveEditorDrop
{
  public static final DataFlavor FLAVOR = ;
  
  public abstract boolean handleTransfer(JTextComponent paramJTextComponent);
}

/* Location:
 * Qualified Name:     org.openide.text.ActiveEditorDrop
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public abstract class Annotatable
{
  public static final String PROP_ANNOTATION_COUNT = "annotationCount";
  public static final String PROP_DELETED = "deleted";
  public static final String PROP_TEXT = "text";
  private final PropertyChangeSupport propertyChangeSupport;
  private final List<Annotation> attachedAnnotations;
  private boolean deleted;
  
  public Annotatable()
  {
    deleted = false;
    propertyChangeSupport = new PropertyChangeSupport(this);
    attachedAnnotations = Collections.synchronizedList(new LinkedList());
  }
  
  protected void addAnnotation(Annotation paramAnnotation)
  {
    int i;
    synchronized (attachedAnnotations)
    {
      attachedAnnotations.add(paramAnnotation);
      i = attachedAnnotations.size();
    }
    propertyChangeSupport.firePropertyChange("annotationCount", i - 1, i);
  }
  
  protected void removeAnnotation(Annotation paramAnnotation)
  {
    int i;
    synchronized (attachedAnnotations)
    {
      attachedAnnotations.remove(paramAnnotation);
      i = attachedAnnotations.size();
    }
    propertyChangeSupport.firePropertyChange("annotationCount", i + 1, i);
  }
  
  List<? extends Annotation> getAnnotations()
  {
    return attachedAnnotations;
  }
  
  public final void addPropertyChangeListener(PropertyChangeListener paramPropertyChangeListener)
  {
    propertyChangeSupport.addPropertyChangeListener(paramPropertyChangeListener);
  }
  
  public final void removePropertyChangeListener(PropertyChangeListener paramPropertyChangeListener)
  {
    propertyChangeSupport.removePropertyChangeListener(paramPropertyChangeListener);
  }
  
  protected final void firePropertyChange(String paramString, Object paramObject1, Object paramObject2)
  {
    propertyChangeSupport.firePropertyChange(paramString, paramObject1, paramObject2);
  }
  
  public final boolean isDeleted()
  {
    return deleted;
  }
  
  public abstract String getText();
  
  void setDeleted(boolean paramBoolean)
  {
    if (deleted != paramBoolean)
    {
      deleted = paramBoolean;
      propertyChangeSupport.firePropertyChange("deleted", !paramBoolean, paramBoolean);
    }
  }
  
  public final int getAnnotationCount()
  {
    return attachedAnnotations.size();
  }
}

/* Location:
 * Qualified Name:     org.openide.text.Annotatable
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public abstract class Annotation
{
  public static final String PROP_SHORT_DESCRIPTION = "shortDescription";
  public static final String PROP_ANNOTATION_TYPE = "annotationType";
  public static final String PROP_MOVE_TO_FRONT = "moveToFront";
  private PropertyChangeSupport support;
  private Annotatable attached;
  private boolean inDocument = false;
  
  public Annotation()
  {
    support = new PropertyChangeSupport(this);
  }
  
  public abstract String getAnnotationType();
  
  public abstract String getShortDescription();
  
  public final void attach(Annotatable paramAnnotatable)
  {
    if (attached != null) {
      detach();
    }
    attached = paramAnnotatable;
    
    attached.addAnnotation(this);
    notifyAttached(attached);
  }
  
  protected void notifyAttached(Annotatable paramAnnotatable) {}
  
  public final void detach()
  {
    if (attached != null)
    {
      attached.removeAnnotation(this);
      
      Annotatable localAnnotatable = attached;
      attached = null;
      notifyDetached(localAnnotatable);
    }
  }
  
  protected void notifyDetached(Annotatable paramAnnotatable) {}
  
  public final Annotatable getAttachedAnnotatable()
  {
    return attached;
  }
  
  public final void addPropertyChangeListener(PropertyChangeListener paramPropertyChangeListener)
  {
    support.addPropertyChangeListener(paramPropertyChangeListener);
  }
  
  public final void removePropertyChangeListener(PropertyChangeListener paramPropertyChangeListener)
  {
    support.removePropertyChangeListener(paramPropertyChangeListener);
  }
  
  protected final void firePropertyChange(String paramString, Object paramObject1, Object paramObject2)
  {
    support.firePropertyChange(paramString, paramObject1, paramObject2);
  }
  
  public final void moveToFront()
  {
    support.firePropertyChange("moveToFront", null, null);
  }
  
  final boolean isInDocument()
  {
    return inDocument;
  }
  
  final void setInDocument(boolean paramBoolean)
  {
    inDocument = paramBoolean;
  }
}

/* Location:
 * Qualified Name:     org.openide.text.Annotation
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import org.openide.util.Lookup;

public abstract interface AnnotationProvider
{
  public abstract void annotate(Line.Set paramSet, Lookup paramLookup);
}

/* Location:
 * Qualified Name:     org.openide.text.AnnotationProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import java.awt.Color;
import java.awt.Font;
import java.awt.font.TextAttribute;
import java.text.AttributedCharacterIterator;
import java.text.AttributedCharacterIterator.Attribute;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class AttributedCharacters$AttributedCharacterIteratorImpl
  implements AttributedCharacterIterator
{
  protected int current;
  protected char[] chars;
  protected Font[] fonts;
  protected Color[] colors;
  protected int[] runStart;
  protected int[] runLimit;
  protected Set<AttributedCharacterIterator.Attribute> singleton;
  
  public AttributedCharacters$AttributedCharacterIteratorImpl(char[] paramArrayOfChar, Font[] paramArrayOfFont, Color[] paramArrayOfColor, int[] paramArrayOfInt1, int[] paramArrayOfInt2)
  {
    chars = paramArrayOfChar;
    fonts = paramArrayOfFont;
    colors = paramArrayOfColor;
    runStart = paramArrayOfInt1;
    runLimit = paramArrayOfInt2;
  }
  
  public Object clone()
  {
    try
    {
      return super.clone();
    }
    catch (CloneNotSupportedException localCloneNotSupportedException) {}
    return null;
  }
  
  public char current()
  {
    if (current >= chars.length) {
      return 65535;
    }
    return chars[current];
  }
  
  public char first()
  {
    current = 0;
    if (current >= chars.length) {
      return 65535;
    }
    return chars[current];
  }
  
  public int getBeginIndex()
  {
    return 0;
  }
  
  public int getEndIndex()
  {
    return chars.length;
  }
  
  public int getIndex()
  {
    return current;
  }
  
  public char last()
  {
    int i = getEndIndex();
    if (i == 0) {
      return 65535;
    }
    return chars[(current = i - 1)];
  }
  
  public char next()
  {
    if (current >= getEndIndex() - 1) {
      return 65535;
    }
    return chars[(++current)];
  }
  
  public char previous()
  {
    if (current == 0) {
      return 65535;
    }
    return chars[(--current)];
  }
  
  public char setIndex(int paramInt)
  {
    if (paramInt < 0) {
      throw new IllegalArgumentException();
    }
    if (paramInt == getEndIndex())
    {
      current = getEndIndex();
      
      return 65535;
    }
    return chars[(current = paramInt)];
  }
  
  public Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys()
  {
    if (singleton == null)
    {
      HashSet localHashSet = new HashSet(4);
      localHashSet.add(TextAttribute.FONT);
      localHashSet.add(TextAttribute.FOREGROUND);
      singleton = Collections.unmodifiableSet(localHashSet);
    }
    return singleton;
  }
  
  public Object getAttribute(AttributedCharacterIterator.Attribute paramAttribute)
  {
    if (paramAttribute == TextAttribute.FONT) {
      return fonts[getIndex()];
    }
    if (paramAttribute == TextAttribute.FOREGROUND) {
      return colors[getIndex()];
    }
    return null;
  }
  
  public Map<AttributedCharacterIterator.Attribute, Object> getAttributes()
  {
    HashMap localHashMap = new HashMap(1);
    localHashMap.put(TextAttribute.FONT, fonts[getIndex()]);
    localHashMap.put(TextAttribute.FOREGROUND, colors[getIndex()]);
    
    return localHashMap;
  }
  
  public int getRunLimit()
  {
    return runLimit[runStart[getIndex()]] + 1;
  }
  
  public int getRunLimit(AttributedCharacterIterator.Attribute paramAttribute)
  {
    if ((paramAttribute != TextAttribute.FONT) && (paramAttribute != TextAttribute.FOREGROUND)) {
      return getEndIndex();
    }
    return getRunLimit();
  }
  
  public int getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> paramSet)
  {
    if ((paramSet.contains(TextAttribute.FONT)) || (paramSet.contains(TextAttribute.FOREGROUND))) {
      return getRunLimit();
    }
    return getEndIndex();
  }
  
  public int getRunStart()
  {
    return runStart[getIndex()];
  }
  
  public int getRunStart(AttributedCharacterIterator.Attribute paramAttribute)
  {
    if ((paramAttribute != TextAttribute.FONT) && (paramAttribute != TextAttribute.FOREGROUND)) {
      return 0;
    }
    return getRunStart();
  }
  
  public int getRunStart(Set<? extends AttributedCharacterIterator.Attribute> paramSet)
  {
    if ((paramSet.contains(TextAttribute.FONT)) || (paramSet.contains(TextAttribute.FOREGROUND))) {
      return getRunStart();
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.openide.text.AttributedCharacters.AttributedCharacterIteratorImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import java.awt.Color;
import java.awt.Font;
import java.awt.font.TextAttribute;
import java.text.AttributedCharacterIterator;
import java.text.AttributedCharacterIterator.Attribute;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class AttributedCharacters
{
  protected char[] chars;
  protected Font[] fonts;
  protected Color[] colors;
  protected int[] runStart;
  protected int[] runLimit;
  protected int current;
  
  public AttributedCharacters()
  {
    chars = new char[10];
    fonts = new Font[10];
    colors = new Color[10];
    runStart = new int[10];
    runLimit = new int[10];
    current = -1;
  }
  
  public void append(char paramChar, Font paramFont, Color paramColor)
  {
    if (paramFont == null) {
      return;
    }
    if (++current == chars.length)
    {
      char[] arrayOfChar = new char[2 * chars.length];
      Font[] arrayOfFont = new Font[2 * chars.length];
      Color[] arrayOfColor = new Color[2 * chars.length];
      int[] arrayOfInt1 = new int[2 * chars.length];
      int[] arrayOfInt2 = new int[2 * chars.length];
      System.arraycopy(chars, 0, arrayOfChar, 0, chars.length);
      System.arraycopy(fonts, 0, arrayOfFont, 0, chars.length);
      System.arraycopy(colors, 0, arrayOfColor, 0, chars.length);
      System.arraycopy(runStart, 0, arrayOfInt1, 0, chars.length);
      System.arraycopy(runLimit, 0, arrayOfInt2, 0, chars.length);
      chars = arrayOfChar;
      fonts = arrayOfFont;
      colors = arrayOfColor;
      runStart = arrayOfInt1;
      runLimit = arrayOfInt2;
    }
    chars[current] = paramChar;
    fonts[current] = paramFont;
    colors[current] = paramColor;
    if (current != 0)
    {
      int i = current - 1;
      if ((fonts[i].equals(paramFont)) && (colors[i].equals(paramColor)))
      {
        runLimit[(runStart[current] = runStart[i])] = current;
      }
      else
      {
        runLimit[current] = current;
        runStart[current] = current;
      }
    }
  }
  
  public void append(char[] paramArrayOfChar, Font paramFont, Color paramColor)
  {
    if ((paramArrayOfChar == null) || (paramArrayOfChar.length == 0) || (paramFont == null) || (paramColor == null)) {
      return;
    }
    if (++current + paramArrayOfChar.length >= chars.length)
    {
      i = Math.max(current + paramArrayOfChar.length, 2 * chars.length);
      char[] arrayOfChar = new char[i];
      Font[] arrayOfFont = new Font[i];
      Color[] arrayOfColor = new Color[i];
      int[] arrayOfInt1 = new int[i];
      int[] arrayOfInt2 = new int[i];
      System.arraycopy(chars, 0, arrayOfChar, 0, chars.length);
      System.arraycopy(fonts, 0, arrayOfFont, 0, fonts.length);
      System.arraycopy(colors, 0, arrayOfColor, 0, chars.length);
      System.arraycopy(runStart, 0, arrayOfInt1, 0, chars.length);
      System.arraycopy(runLimit, 0, arrayOfInt2, 0, chars.length);
      chars = arrayOfChar;
      fonts = arrayOfFont;
      colors = arrayOfColor;
      runStart = arrayOfInt1;
      runLimit = arrayOfInt2;
    }
    System.arraycopy(paramArrayOfChar, 0, chars, current, paramArrayOfChar.length);
    for (int i = 0; i < paramArrayOfChar.length; i++)
    {
      fonts[(i + current)] = paramFont;
      colors[(i + current)] = paramColor;
    }
    i = current - 1;
    int j = current + paramArrayOfChar.length - 1;
    if (i < 0)
    {
      runLimit[0] = j;
    }
    else
    {
      int k;
      if ((fonts[i].equals(paramFont)) && (colors[i].equals(paramColor)))
      {
        runLimit[runStart[i]] = j;
        k = runStart[i];
      }
      else
      {
        runLimit[current] = j;
        k = current;
      }
      for (int m = current; m <= j; m++) {
        runStart[m] = k;
      }
    }
    current = j;
  }
  
  public AttributedCharacterIterator iterator()
  {
    int i = current + 1;
    char[] arrayOfChar = new char[i];
    Font[] arrayOfFont = new Font[i];
    Color[] arrayOfColor = new Color[i];
    int[] arrayOfInt1 = new int[i];
    int[] arrayOfInt2 = new int[i];
    System.arraycopy(runStart, 0, arrayOfInt1, 0, i);
    System.arraycopy(runLimit, 0, arrayOfInt2, 0, i);
    System.arraycopy(chars, 0, arrayOfChar, 0, i);
    System.arraycopy(fonts, 0, arrayOfFont, 0, i);
    System.arraycopy(colors, 0, arrayOfColor, 0, i);
    
    AttributedCharacterIteratorImpl localAttributedCharacterIteratorImpl = new AttributedCharacterIteratorImpl(arrayOfChar, arrayOfFont, arrayOfColor, arrayOfInt1, arrayOfInt2);
    
    return localAttributedCharacterIteratorImpl;
  }
  
  public static class AttributedCharacterIteratorImpl
    implements AttributedCharacterIterator
  {
    protected int current;
    protected char[] chars;
    protected Font[] fonts;
    protected Color[] colors;
    protected int[] runStart;
    protected int[] runLimit;
    protected Set<AttributedCharacterIterator.Attribute> singleton;
    
    public AttributedCharacterIteratorImpl(char[] paramArrayOfChar, Font[] paramArrayOfFont, Color[] paramArrayOfColor, int[] paramArrayOfInt1, int[] paramArrayOfInt2)
    {
      chars = paramArrayOfChar;
      fonts = paramArrayOfFont;
      colors = paramArrayOfColor;
      runStart = paramArrayOfInt1;
      runLimit = paramArrayOfInt2;
    }
    
    public Object clone()
    {
      try
      {
        return super.clone();
      }
      catch (CloneNotSupportedException localCloneNotSupportedException) {}
      return null;
    }
    
    public char current()
    {
      if (current >= chars.length) {
        return 65535;
      }
      return chars[current];
    }
    
    public char first()
    {
      current = 0;
      if (current >= chars.length) {
        return 65535;
      }
      return chars[current];
    }
    
    public int getBeginIndex()
    {
      return 0;
    }
    
    public int getEndIndex()
    {
      return chars.length;
    }
    
    public int getIndex()
    {
      return current;
    }
    
    public char last()
    {
      int i = getEndIndex();
      if (i == 0) {
        return 65535;
      }
      return chars[(current = i - 1)];
    }
    
    public char next()
    {
      if (current >= getEndIndex() - 1) {
        return 65535;
      }
      return chars[(++current)];
    }
    
    public char previous()
    {
      if (current == 0) {
        return 65535;
      }
      return chars[(--current)];
    }
    
    public char setIndex(int paramInt)
    {
      if (paramInt < 0) {
        throw new IllegalArgumentException();
      }
      if (paramInt == getEndIndex())
      {
        current = getEndIndex();
        
        return 65535;
      }
      return chars[(current = paramInt)];
    }
    
    public Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys()
    {
      if (singleton == null)
      {
        HashSet localHashSet = new HashSet(4);
        localHashSet.add(TextAttribute.FONT);
        localHashSet.add(TextAttribute.FOREGROUND);
        singleton = Collections.unmodifiableSet(localHashSet);
      }
      return singleton;
    }
    
    public Object getAttribute(AttributedCharacterIterator.Attribute paramAttribute)
    {
      if (paramAttribute == TextAttribute.FONT) {
        return fonts[getIndex()];
      }
      if (paramAttribute == TextAttribute.FOREGROUND) {
        return colors[getIndex()];
      }
      return null;
    }
    
    public Map<AttributedCharacterIterator.Attribute, Object> getAttributes()
    {
      HashMap localHashMap = new HashMap(1);
      localHashMap.put(TextAttribute.FONT, fonts[getIndex()]);
      localHashMap.put(TextAttribute.FOREGROUND, colors[getIndex()]);
      
      return localHashMap;
    }
    
    public int getRunLimit()
    {
      return runLimit[runStart[getIndex()]] + 1;
    }
    
    public int getRunLimit(AttributedCharacterIterator.Attribute paramAttribute)
    {
      if ((paramAttribute != TextAttribute.FONT) && (paramAttribute != TextAttribute.FOREGROUND)) {
        return getEndIndex();
      }
      return getRunLimit();
    }
    
    public int getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> paramSet)
    {
      if ((paramSet.contains(TextAttribute.FONT)) || (paramSet.contains(TextAttribute.FOREGROUND))) {
        return getRunLimit();
      }
      return getEndIndex();
    }
    
    public int getRunStart()
    {
      return runStart[getIndex()];
    }
    
    public int getRunStart(AttributedCharacterIterator.Attribute paramAttribute)
    {
      if ((paramAttribute != TextAttribute.FONT) && (paramAttribute != TextAttribute.FOREGROUND)) {
        return 0;
      }
      return getRunStart();
    }
    
    public int getRunStart(Set<? extends AttributedCharacterIterator.Attribute> paramSet)
    {
      if ((paramSet.contains(TextAttribute.FONT)) || (paramSet.contains(TextAttribute.FOREGROUND))) {
        return getRunStart();
      }
      return 0;
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.text.AttributedCharacters
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.Document;
import javax.swing.text.Position;
import org.openide.util.WeakListeners;

class BackwardPosition
  implements Position, DocumentListener
{
  private int offset;
  
  private BackwardPosition(int paramInt)
  {
    offset = paramInt;
  }
  
  public static Position create(Document paramDocument, int paramInt)
  {
    BackwardPosition localBackwardPosition = new BackwardPosition(paramInt);
    paramDocument.addDocumentListener(WeakListeners.document(localBackwardPosition, paramDocument));
    
    return localBackwardPosition;
  }
  
  public int getOffset()
  {
    return offset;
  }
  
  public void insertUpdate(DocumentEvent paramDocumentEvent)
  {
    if (paramDocumentEvent.getOffset() < offset) {
      offset += paramDocumentEvent.getLength();
    }
  }
  
  public void removeUpdate(DocumentEvent paramDocumentEvent)
  {
    int i = paramDocumentEvent.getOffset();
    if (i < offset)
    {
      offset -= paramDocumentEvent.getLength();
      if (offset < i) {
        offset = i;
      }
    }
  }
  
  public void changedUpdate(DocumentEvent paramDocumentEvent) {}
}

/* Location:
 * Qualified Name:     org.openide.text.BackwardPosition
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

class CloneableEditor$1
  implements Runnable
{
  CloneableEditor$1(CloneableEditor paramCloneableEditor) {}
  
  public void run()
  {
    this$0.removeAll();
  }
}

/* Location:
 * Qualified Name:     org.openide.text.CloneableEditor.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

class CloneableEditor$2
  implements Runnable
{
  CloneableEditor$2(CloneableEditor paramCloneableEditor, CloneableEditorSupport paramCloneableEditorSupport) {}
  
  public void run()
  {
    String str = val$ces.messageHtmlName();
    this$0.setHtmlDisplayName(str);
    str = val$ces.messageName();
    this$0.setDisplayName(str);
    this$0.setName(str);
    
    this$0.setToolTipText(val$ces.messageToolTip());
  }
}

/* Location:
 * Qualified Name:     org.openide.text.CloneableEditor.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.NotifyDescriptor.Confirmation;
import org.openide.util.UserQuestionException;

class CloneableEditor$AWTQuery
  implements Runnable
{
  private UserQuestionException ex;
  private boolean isConfirmed;
  
  public CloneableEditor$AWTQuery(CloneableEditor paramCloneableEditor, UserQuestionException paramUserQuestionException)
  {
    ex = paramUserQuestionException;
  }
  
  public boolean confirmed()
  {
    return isConfirmed;
  }
  
  public void run()
  {
    NotifyDescriptor.Confirmation localConfirmation = new NotifyDescriptor.Confirmation(ex.getLocalizedMessage(), 0);
    
    localConfirmation.setOptions(new Object[] { NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION });
    CloneableEditor.access$002(true);
    Object localObject = DialogDisplayer.getDefault().notify(localConfirmation);
    CloneableEditor.access$002(false);
    if (NotifyDescriptor.OK_OPTION.equals(localObject)) {
      isConfirmed = true;
    } else {
      isConfirmed = false;
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.text.CloneableEditor.AWTQuery
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

class CloneableEditor$DoInitialize$1
  implements Runnable
{
  CloneableEditor$DoInitialize$1(CloneableEditor.DoInitialize paramDoInitialize) {}
  
  public void run()
  {
    this$1.this$0.close();
  }
}

/* Location:
 * Qualified Name:     org.openide.text.CloneableEditor.DoInitialize.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.NotifyDescriptor.Confirmation;
import org.openide.util.UserQuestionException;

class CloneableEditor$DoInitialize$1Query
  implements Runnable
{
  private CloneableEditor.DoInitialize doInit;
  boolean inAWT;
  boolean finished;
  
  public CloneableEditor$DoInitialize$1Query(CloneableEditor.DoInitialize paramDoInitialize)
  {
    CloneableEditor.DoInitialize localDoInitialize;
    doInit = localDoInitialize;
  }
  
  public void run()
  {
    synchronized (this)
    {
      inAWT = true;
      notifyAll();
      if (finished) {
        return;
      }
    }
    try
    {
      doQuestion();
    }
    finally
    {
      synchronized (this)
      {
        finished = true;
        notifyAll();
      }
    }
  }
  
  private void doQuestion()
  {
    UserQuestionException localUserQuestionException = (UserQuestionException)val$ex.getCause();
    NotifyDescriptor.Confirmation localConfirmation = new NotifyDescriptor.Confirmation(localUserQuestionException.getLocalizedMessage(), 0);
    
    localConfirmation.setOptions(new Object[] { NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION });
    CloneableEditor.access$002(true);
    Object localObject = DialogDisplayer.getDefault().notify(localConfirmation);
    CloneableEditor.access$002(false);
    if (NotifyDescriptor.OK_OPTION.equals(localObject)) {
      CloneableEditor.DoInitialize.access$602(doInit, true);
    } else {}
  }
  
  public synchronized boolean awaitAWT()
    throws InterruptedException
  {
    if (!inAWT) {
      wait(10000L);
    }
    return inAWT;
  }
  
  public synchronized void waitRest()
    throws InterruptedException
  {
    while ((inAWT) && (!finished)) {
      wait();
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.text.CloneableEditor.DoInitialize.1Query
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

class CloneableEditor$DoInitialize$2
  implements Runnable
{
  CloneableEditor$DoInitialize$2(CloneableEditor.DoInitialize paramDoInitialize) {}
  
  public void run()
  {
    this$1.this$0.revalidate();
  }
}

/* Location:
 * Qualified Name:     org.openide.text.CloneableEditor.DoInitialize.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

class CloneableEditor$DoInitialize$3
  implements Runnable
{
  CloneableEditor$DoInitialize$3(CloneableEditor.DoInitialize paramDoInitialize) {}
  
  public void run()
  {
    CloneableEditor.access$300(this$1.this$0).ensureAnnotationsLoaded();
  }
}

/* Location:
 * Qualified Name:     org.openide.text.CloneableEditor.DoInitialize.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.text;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ActionMap;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.text.Caret;
import javax.swing.text.Document;
import javax.swing.text.EditorKit;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.NotifyDescriptor.Confirmation;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.util.RequestProcessor;
import org.openide.util.RequestProcessor.Task;
import org.openide.util.Task;
import org.openide.util.UserQuestionException;
import org.openide.windows.TopComponent;
import org.openide.windows.TopComponent.Registry;
import org.openide.windows.WindowManager;

class CloneableEditor$DoInitialize
  implements Runnable, ActionListener
{
  private final QuietEditorPane tmp;
  private Document doc;
  private RequestProcessor.Task task;
  private int phase;
  private EditorKit kit;
  private JComponent tmpComp;
  private boolean initialized = false;
  private boolean isInInitVisual = false;
  private boolean confirmed = false;
  
  public CloneableEditor$DoInitialize(CloneableEditor paramCloneableEditor, QuietEditorPane paramQuietEditorPane)
  {
    tmp = paramQuietEditorPane;
    tmpComp = initLoading();
    new Timer(1000, this).start();
    if (paramCloneableEditor.newInitialize())
    {
      task = CloneableEditor.access$100().create(this);
      task.setPriority(3);
      task.schedule(0);
    }
    else
    {
      run();
    }
  }
  
  private JComponent initLoading()
  {
    this$0.setLayout(new BorderLayout());
    
    JLabel localJLabel = new JLabel(NbBundle.getMessage(CloneableEditor.class, "LBL_EditorLoading"));
    localJLabel.setOpaque(true);
    localJLabel.setHorizontalAlignment(0);
    localJLabel.setBorder(new EmptyBorder(new Insets(11, 11, 11, 11)));
    localJLabel.setVisible(false);
    this$0.add(localJLabel, "Center");
    
    return localJLabel;
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    tmpComp.setVisible(true);
    Timer localTimer = (Timer)paramActionEvent.getSource();
    localTimer.stop();
  }
  
  public void run()
  {
    long l1 = System.currentTimeMillis();
    
    int i = phase;
    switch (phase++)
    {
    case 0: 
      synchronized (CloneableEditor.access$200(this$0))
      {
        phase = initNonVisual(phase);
        if (phase == Integer.MAX_VALUE) {
          break label257;
        }
      }
      if (this$0.newInitialize()) {
        WindowManager.getDefault().invokeWhenUIReady(this);
      }
      break;
    case 1: 
      if (this$0.pane != tmp)
      {
        phase = Integer.MAX_VALUE;
      }
      else if ((CloneableEditor.access$300(this$0).getDocument() == null) || (CloneableEditor.access$300(this$0).cesKit() == null))
      {
        phase = Integer.MAX_VALUE;
      }
      else
      {
        initVisual();
        if (this$0.newInitialize()) {
          task.schedule(1000);
        }
      }
      break;
    case 2: 
      initRest();
      break;
    }
    throw new IllegalStateException("Wrong phase: " + phase + " for " + CloneableEditor.access$300(this$0));
    label257:
    long l2 = System.currentTimeMillis() - l1;
    if (CloneableEditor.TIMER.isLoggable(Level.FINE))
    {
      String str = SwingUtilities.isEventDispatchThread() ? "AWT" : "RP";
      Document localDocument = doc;
      Object localObject2 = localDocument == null ? null : localDocument.getProperty("stream");
      if (localObject2 == null) {
        localObject2 = CloneableEditor.access$300(this$0).messageName();
      }
      CloneableEditor.TIMER.log(Level.FINE, "Open Editor, phase " + i + ", " + str + " [ms]", new Object[] { localObject2, Long.valueOf(l2) });
    }
  }
  
  private int initNonVisual(int paramInt)
  {
    if (CloneableEditor.access$400().isLoggable(Level.FINE)) {
      CloneableEditor.access$400().log(Level.FINE, "DoInitialize.initNonVisual Enter Time:" + System.currentTimeMillis() + " Thread:" + Thread.currentThread().getName() + " ce:[" + Integer.toHexString(System.identityHashCode(this$0)) + "]" + " support:[" + Integer.toHexString(System.identityHashCode(CloneableEditor.access$300(this$0))) + "]" + " Name:" + this$0.getName());
    }
    Task localTask = CloneableEditor.access$300(this$0).prepareDocument();
    assert (localTask != null) : "Failed to get prepareTask";
    localTask.waitFinished();
    final Throwable localThrowable = CloneableEditor.access$300(this$0).getPrepareDocumentRuntimeException();
    if (localThrowable == null) {
      CloneableEditor.access$502(this$0, false);
    }
    if (CloneableEditor.access$300(this$0).asynchronousOpen())
    {
      if (((localThrowable instanceof CloneableEditorSupport.DelegateIOExc)) && 
        ((localThrowable.getCause() instanceof UserQuestionException)))
      {
        Object localObject1;
        if (CloneableEditor.access$700())
        {
          localObject1 = (UserQuestionException)localThrowable.getCause();
          CloneableEditor.AWTQuery localAWTQuery = new CloneableEditor.AWTQuery(this$0, (UserQuestionException)localObject1);
          CloneableEditor.access$800().add(localAWTQuery);
          synchronized (this)
          {
            notifyAll();
            try
            {
              while ((CloneableEditor.access$900().isEmpty()) || 
              
                (!CloneableEditor.access$900().remove(localAWTQuery))) {
                wait();
              }
            }
            catch (InterruptedException localInterruptedException2)
            {
              Exceptions.printStackTrace(localInterruptedException2);
            }
          }
          if (CloneableEditor.AWTQuery.access$1000(localAWTQuery))
          {
            confirmed = true;
            try
            {
              ((UserQuestionException)localObject1).confirmed();
            }
            catch (IOException localIOException3)
            {
              Exceptions.printStackTrace(localIOException3);
            }
          }
        }
        else
        {
          localObject1 = new Runnable()
          {
            private CloneableEditor.DoInitialize doInit;
            boolean inAWT;
            boolean finished;
            
            public void run()
            {
              synchronized (this)
              {
                inAWT = true;
                notifyAll();
                if (finished) {
                  return;
                }
              }
              try
              {
                doQuestion();
              }
              finally
              {
                synchronized (this)
                {
                  finished = true;
                  notifyAll();
                }
              }
            }
            
            private void doQuestion()
            {
              UserQuestionException localUserQuestionException = (UserQuestionException)localThrowable.getCause();
              NotifyDescriptor.Confirmation localConfirmation = new NotifyDescriptor.Confirmation(localUserQuestionException.getLocalizedMessage(), 0);
              
              localConfirmation.setOptions(new Object[] { NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION });
              CloneableEditor.access$002(true);
              Object localObject = DialogDisplayer.getDefault().notify(localConfirmation);
              CloneableEditor.access$002(false);
              if (NotifyDescriptor.OK_OPTION.equals(localObject)) {
                doInit.confirmed = true;
              } else {}
            }
            
            public synchronized boolean awaitAWT()
              throws InterruptedException
            {
              if (!inAWT) {
                wait(10000L);
              }
              return inAWT;
            }
            
            public synchronized void waitRest()
              throws InterruptedException
            {
              while ((inAWT) && (!finished)) {
                wait();
              }
            }
          };
          try
          {
            SwingUtilities.invokeLater((Runnable)localObject1);
            if (((1Query)localObject1).awaitAWT()) {
              ((1Query)localObject1).waitRest();
            } else {
              confirmed = true;
            }
            synchronized (localObject1)
            {
              finished = true;
            }
          }
          catch (InterruptedException localInterruptedException1)
          {
            Exceptions.printStackTrace(localInterruptedException1);
          }
        }
        if (confirmed)
        {
          CloneableEditor.access$502(this$0, false);
          localObject1 = (UserQuestionException)localThrowable.getCause();
          try
          {
            ((UserQuestionException)localObject1).confirmed();
          }
          catch (IOException localIOException1)
          {
            Exceptions.printStackTrace(localIOException1);
          }
          localTask = CloneableEditor.access$300(this$0).prepareDocument();
          assert (localTask != null) : "Failed to get prepareTask";
          localTask.waitFinished();
        }
        else
        {
          CloneableEditor.access$502(this$0, true);
          synchronized (this)
          {
            notifyAll();
          }
          CloneableEditor.access$1102(this$0, false);
          SwingUtilities.invokeLater(new Runnable()
          {
            public void run()
            {
              this$0.close();
            }
          });
          return Integer.MAX_VALUE;
        }
      }
    }
    else if (((localThrowable instanceof CloneableEditorSupport.DelegateIOExc)) && 
      ((localThrowable.getCause() instanceof UserQuestionException)))
    {
      ??? = (UserQuestionException)localThrowable.getCause();
      try
      {
        ((UserQuestionException)???).confirmed()
1 2 3 4 5 6 7 8 9 10 11 12

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