org.eclipse.pde.ua.core_1.0.100.v20110516

16:47:30.474 INFO  jd.cli.Main - Decompiling org.eclipse.pde.ua.core_1.0.100.v20110516.jar
package org.eclipse.pde.internal.ua.core;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

public class Activator
  extends Plugin
{
  public static final String PLUGIN_ID = "org.eclipse.pde.ua.core";
  private static Activator plugin;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.Activator
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core;

import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;

public class CheatSheetUtil
{
  public static String parseElementText(Element element)
  {
    element.normalize();
    if (element.getChildNodes().getLength() > 0)
    {
      NodeList children = element.getChildNodes();
      StringBuffer buffer = new StringBuffer();
      for (int i = 0; i < children.getLength(); i++)
      {
        Node node = children.item(i);
        if (node.getNodeType() == 3)
        {
          buffer.append(((Text)node).getData());
        }
        else if (node.getNodeType() == 1)
        {
          Element subElement = (Element)node;
          
          buffer.append('<');
          
          buffer.append(subElement.getNodeName());
          
          String elementAttributeText = parseElementAttributes(subElement);
          if (elementAttributeText != null) {
            buffer.append(elementAttributeText);
          }
          String value = parseElementText(subElement);
          if (value.length() > 0)
          {
            buffer.append('>');
            
            buffer.append(value);
            
            buffer.append('<');
            buffer.append('/');
            buffer.append(subElement.getNodeName());
          }
          else
          {
            buffer.append('/');
          }
          buffer.append('>');
        }
      }
      return buffer.toString();
    }
    return "";
  }
  
  private static String parseElementAttributes(Element element)
  {
    if (!element.hasAttributes()) {
      return null;
    }
    StringBuffer buffer = new StringBuffer();
    
    NamedNodeMap attributeMap = element.getAttributes();
    for (int i = 0; i < attributeMap.getLength(); i++)
    {
      Node node = attributeMap.item(i);
      if (node.getNodeType() == 2)
      {
        Attr attribute = (Attr)node;
        
        buffer.append(' ');
        
        buffer.append(attribute.getName());
        
        buffer.append('=');
        
        buffer.append('"');
        
        buffer.append(attribute.getValue());
        
        buffer.append('"');
      }
    }
    return buffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.CheatSheetUtil
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.pde.internal.core.XMLPrintHandler;
import org.eclipse.pde.internal.core.util.PDETextHelper;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCS;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModelFactory;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSTaskObject;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

public class CompCS
  extends CompCSObject
  implements ICompCS
{
  private String fFieldName;
  private ICompCSTaskObject fFieldTaskObject;
  private static final long serialVersionUID = 1L;
  
  public CompCS(ICompCSModel model)
  {
    super(model, null);
    reset();
  }
  
  public List getChildren()
  {
    ArrayList list = new ArrayList();
    if (fFieldTaskObject != null) {
      list.add(fFieldTaskObject);
    }
    return list;
  }
  
  public String getName()
  {
    return fFieldName;
  }
  
  public int getType()
  {
    return 0;
  }
  
  protected void parseAttributes(Element element)
  {
    fFieldName = element.getAttribute("name").trim();
  }
  
  protected void parseElement(Element element)
  {
    String name = element.getNodeName();
    ICompCSModelFactory factory = getModel().getFactory();
    if (name.equals("task"))
    {
      fFieldTaskObject = factory.createCompCSTask(this);
      fFieldTaskObject.parse(element);
    }
    else if (name.equals("taskGroup"))
    {
      fFieldTaskObject = factory.createCompCSTaskGroup(this);
      fFieldTaskObject.parse(element);
    }
  }
  
  public void reset()
  {
    fFieldName = null;
    fFieldTaskObject = null;
  }
  
  public void write(String indent, PrintWriter writer)
  {
    try
    {
      XMLPrintHandler.printHead(writer, "UTF-8");
      super.write(indent, writer);
    }
    catch (IOException localIOException) {}
  }
  
  protected void writeAttributes(StringBuffer buffer)
  {
    if ((fFieldName != null) && (fFieldName.length() > 0)) {
      buffer.append(XMLPrintHandler.wrapAttribute("name", 
        PDETextHelper.translateWriteText(fFieldName.trim(), 
        DEFAULT_SUBSTITUTE_CHARS)));
    }
  }
  
  protected void writeElements(String indent, PrintWriter writer)
  {
    String newIndent = indent + "   ";
    if (fFieldTaskObject != null) {
      fFieldTaskObject.write(newIndent, writer);
    }
  }
  
  public String getFieldName()
  {
    return fFieldName;
  }
  
  public ICompCSTaskObject getFieldTaskObject()
  {
    return fFieldTaskObject;
  }
  
  public void setFieldName(String name)
  {
    String old = fFieldName;
    fFieldName = name;
    if (isEditable()) {
      firePropertyChanged("name", old, fFieldName);
    }
  }
  
  public void setFieldTaskObject(ICompCSTaskObject taskObject)
  {
    ICompCSObject old = fFieldTaskObject;
    fFieldTaskObject = taskObject;
    if (isEditable()) {
      fireStructureChanged(fFieldTaskObject, old);
    }
  }
  
  public String getElement()
  {
    return "compositeCheatsheet";
  }
  
  protected void parseText(Text text) {}
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCS
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.pde.internal.core.util.PDETextHelper;
import org.eclipse.pde.internal.ua.core.CheatSheetUtil;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSDataObject;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

public abstract class CompCSDataObject
  extends CompCSObject
  implements ICompCSDataObject
{
  private static final long serialVersionUID = 1L;
  private String fFieldContent;
  
  public CompCSDataObject(ICompCSModel model, ICompCSObject parent)
  {
    super(model, parent);
  }
  
  public List getChildren()
  {
    return new ArrayList();
  }
  
  public abstract String getElement();
  
  public String getName()
  {
    return fFieldContent;
  }
  
  public abstract int getType();
  
  protected void parseContent(Element element)
  {
    fFieldContent = CheatSheetUtil.parseElementText(element).trim();
  }
  
  protected void parseAttributes(Element element) {}
  
  protected void parseElement(Element element) {}
  
  protected void parseText(Text text) {}
  
  public void reset()
  {
    fFieldContent = null;
  }
  
  protected void writeAttributes(StringBuffer buffer) {}
  
  protected void writeElements(String indent, PrintWriter writer)
  {
    String newIndent = indent + "   ";
    if ((fFieldContent != null) && (fFieldContent.length() > 0)) {
      writer.write(newIndent + 
        PDETextHelper.translateWriteText(fFieldContent.trim(), 
        DEFAULT_TAG_EXCEPTIONS, DEFAULT_SUBSTITUTE_CHARS) + 
        "\n");
    }
  }
  
  public String getFieldContent()
  {
    return fFieldContent;
  }
  
  public void setFieldContent(String content)
  {
    String old = fFieldContent;
    fFieldContent = content;
    if (isEditable()) {
      firePropertyChanged(getElement(), old, fFieldContent);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSDataObject
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.pde.internal.core.XMLPrintHandler;
import org.eclipse.pde.internal.core.util.PDETextHelper;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSDependency;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

public class CompCSDependency
  extends CompCSObject
  implements ICompCSDependency
{
  private String fFieldTask;
  private static final long serialVersionUID = 1L;
  
  public CompCSDependency(ICompCSModel model, ICompCSObject parent)
  {
    super(model, parent);
    reset();
  }
  
  public List getChildren()
  {
    return new ArrayList();
  }
  
  public String getElement()
  {
    return "dependsOn";
  }
  
  public String getName()
  {
    return fFieldTask;
  }
  
  public int getType()
  {
    return 5;
  }
  
  protected void parseAttributes(Element element)
  {
    fFieldTask = element.getAttribute("task").trim();
  }
  
  protected void parseElement(Element element) {}
  
  public void reset()
  {
    fFieldTask = null;
  }
  
  protected void writeAttributes(StringBuffer buffer)
  {
    if ((fFieldTask != null) && (fFieldTask.length() > 0)) {
      buffer.append(XMLPrintHandler.wrapAttribute("task", 
        PDETextHelper.translateWriteText(fFieldTask.trim(), 
        DEFAULT_SUBSTITUTE_CHARS)));
    }
  }
  
  protected void writeElements(String indent, PrintWriter writer) {}
  
  public String getFieldTask()
  {
    return fFieldTask;
  }
  
  public void setFieldTask(String task)
  {
    String old = fFieldTask;
    fFieldTask = task;
    if (isEditable()) {
      firePropertyChanged("task", old, fFieldTask);
    }
  }
  
  protected void parseText(Text text) {}
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSDependency
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSIntro;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;

public class CompCSIntro
  extends CompCSDataObject
  implements ICompCSIntro
{
  private static final long serialVersionUID = 1L;
  
  public CompCSIntro(ICompCSModel model, ICompCSObject parent)
  {
    super(model, parent);
    reset();
  }
  
  public String getElement()
  {
    return "intro";
  }
  
  public int getType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSIntro
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.InputStream;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.core.ModelChangedEvent;
import org.eclipse.pde.internal.core.AbstractModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCS;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModelFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class CompCSModel
  extends AbstractModel
  implements ICompCSModel
{
  private ICompCSModelFactory fFactory;
  private ICompCS fCompCS;
  private static final long serialVersionUID = 1L;
  
  protected void updateTimeStamp() {}
  
  public ICompCS getCompCS()
  {
    if (fCompCS == null) {
      fCompCS = getFactory().createCompCS();
    }
    return fCompCS;
  }
  
  public ICompCSModelFactory getFactory()
  {
    if (fFactory == null) {
      fFactory = new CompCSModelFactory(this);
    }
    return fFactory;
  }
  
  public boolean isInSync()
  {
    return true;
  }
  
  public void load()
    throws CoreException
  {}
  
  /* Error */
  public void load(InputStream source, boolean outOfSync)
    throws CoreException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 129	org/eclipse/pde/internal/ua/core/cheatsheet/comp/CompCSModel:getSaxParser	()Ljavax/xml/parsers/SAXParser;
    //   4: astore_3
    //   5: new 65	org/eclipse/pde/internal/core/XMLDefaultHandler
    //   8: dup
    //   9: invokespecial 123	org/eclipse/pde/internal/core/XMLDefaultHandler:<init>	()V
    //   12: astore 4
    //   14: aload_3
    //   15: aload_1
    //   16: aload 4
    //   18: invokevirtual 119	javax/xml/parsers/SAXParser:parse	(Ljava/io/InputStream;Lorg/xml/sax/helpers/DefaultHandler;)V
    //   21: aload 4
    //   23: invokevirtual 124	org/eclipse/pde/internal/core/XMLDefaultHandler:isPrepared	()Z
    //   26: ifeq +62 -> 88
    //   29: aload_0
    //   30: aload 4
    //   32: invokevirtual 125	org/eclipse/pde/internal/core/XMLDefaultHandler:getDocument	()Lorg/w3c/dom/Document;
    //   35: invokespecial 132	org/eclipse/pde/internal/ua/core/cheatsheet/comp/CompCSModel:processDocument	(Lorg/w3c/dom/Document;)V
    //   38: aload_0
    //   39: iconst_1
    //   40: invokevirtual 126	org/eclipse/pde/internal/ua/core/cheatsheet/comp/CompCSModel:setLoaded	(Z)V
    //   43: goto +45 -> 88
    //   46: astore_3
    //   47: aload_0
    //   48: aload_3
    //   49: invokevirtual 128	org/eclipse/pde/internal/ua/core/cheatsheet/comp/CompCSModel:setException	(Ljava/lang/Exception;)V
    //   52: aload_3
    //   53: invokestatic 122	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   56: aload_1
    //   57: ifnull +43 -> 100
    //   60: aload_1
    //   61: invokevirtual 118	java/io/InputStream:close	()V
    //   64: goto +36 -> 100
    //   67: pop
    //   68: goto +32 -> 100
    //   71: astore 5
    //   73: aload_1
    //   74: ifnull +11 -> 85
    //   77: aload_1
    //   78: invokevirtual 118	java/io/InputStream:close	()V
    //   81: goto +4 -> 85
    //   84: pop
    //   85: aload 5
    //   87: athrow
    //   88: aload_1
    //   89: ifnull +11 -> 100
    //   92: aload_1
    //   93: invokevirtual 118	java/io/InputStream:close	()V
    //   96: goto +4 -> 100
    //   99: pop
    //   100: return
    // Line number table:
    //   Java source line #111	-> byte code offset #0
    //   Java source line #112	-> byte code offset #5
    //   Java source line #113	-> byte code offset #14
    //   Java source line #114	-> byte code offset #21
    //   Java source line #115	-> byte code offset #29
    //   Java source line #116	-> byte code offset #38
    //   Java source line #118	-> byte code offset #46
    //   Java source line #119	-> byte code offset #47
    //   Java source line #120	-> byte code offset #52
    //   Java source line #123	-> byte code offset #56
    //   Java source line #124	-> byte code offset #60
    //   Java source line #126	-> byte code offset #67
    //   Java source line #121	-> byte code offset #71
    //   Java source line #123	-> byte code offset #73
    //   Java source line #124	-> byte code offset #77
    //   Java source line #126	-> byte code offset #84
    //   Java source line #129	-> byte code offset #85
    //   Java source line #123	-> byte code offset #88
    //   Java source line #124	-> byte code offset #92
    //   Java source line #126	-> byte code offset #99
    //   Java source line #131	-> byte code offset #100
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	101	0	this	CompCSModel
    //   0	101	1	source	InputStream
    //   0	101	2	outOfSync	boolean
    //   4	11	3	parser	javax.xml.parsers.SAXParser
    //   46	7	3	e	Exception
    //   12	19	4	handler	org.eclipse.pde.internal.core.XMLDefaultHandler
    //   71	15	5	localObject	Object
    //   67	1	7	localIOException1	java.io.IOException
    //   84	1	8	localIOException2	java.io.IOException
    //   99	1	9	localIOException3	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   0	43	46	java/lang/Exception
    //   56	64	67	java/io/IOException
    //   0	56	71	finally
    //   73	81	84	java/io/IOException
    //   88	96	99	java/io/IOException
  }
  
  public void reload(InputStream source, boolean outOfSync)
    throws CoreException
  {
    load(source, outOfSync);
    fireModelChanged(new ModelChangedEvent(this, 
      99, new Object[] { fCompCS }, 
      null));
  }
  
  public boolean isEditable()
  {
    return false;
  }
  
  private void processDocument(Document doc)
  {
    Element rootNode = doc.getDocumentElement();
    if (fCompCS == null) {
      fCompCS = getFactory().createCompCS();
    } else {
      fCompCS.reset();
    }
    fCompCS.parse(rootNode);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSModel
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCS;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSDependency;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSIntro;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModelFactory;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSOnCompletion;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSParam;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSTask;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSTaskGroup;

public class CompCSModelFactory
  implements ICompCSModelFactory
{
  private ICompCSModel fModel;
  
  public CompCSModelFactory(ICompCSModel model)
  {
    fModel = model;
  }
  
  public ICompCS createCompCS()
  {
    return new CompCS(fModel);
  }
  
  public ICompCSDependency createCompCSDependency(ICompCSObject parent)
  {
    return new CompCSDependency(fModel, parent);
  }
  
  public ICompCSIntro createCompCSIntro(ICompCSObject parent)
  {
    return new CompCSIntro(fModel, parent);
  }
  
  public ICompCSOnCompletion createCompCSOnCompletion(ICompCSObject parent)
  {
    return new CompCSOnCompletion(fModel, parent);
  }
  
  public ICompCSParam createCompCSParam(ICompCSObject parent)
  {
    return new CompCSParam(fModel, parent);
  }
  
  public ICompCSTask createCompCSTask(ICompCSObject parent)
  {
    return new CompCSTask(fModel, parent);
  }
  
  public ICompCSTaskGroup createCompCSTaskGroup(ICompCSObject parent)
  {
    return new CompCSTaskGroup(fModel, parent);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSModelFactory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.pde.core.IModelChangeProvider;
import org.eclipse.pde.core.ModelChangedEvent;
import org.eclipse.pde.internal.core.XMLPrintHandler;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCS;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;

public abstract class CompCSObject
  extends PlatformObject
  implements ICompCSObject
{
  private static final long serialVersionUID = 1L;
  private transient ICompCSModel fModel;
  private transient ICompCSObject fParent;
  protected static final HashSet DEFAULT_TAG_EXCEPTIONS = new HashSet(12);
  protected static final HashMap DEFAULT_SUBSTITUTE_CHARS = new HashMap(5);
  
  static
  {
    DEFAULT_TAG_EXCEPTIONS.add("b");
    DEFAULT_TAG_EXCEPTIONS.add("/b");
    DEFAULT_TAG_EXCEPTIONS.add("br/");
    DEFAULT_TAG_EXCEPTIONS.add("p");
    DEFAULT_TAG_EXCEPTIONS.add("/p");
    DEFAULT_TAG_EXCEPTIONS.add("li");
    DEFAULT_TAG_EXCEPTIONS.add("/li");
    DEFAULT_TAG_EXCEPTIONS.add("a");
    DEFAULT_TAG_EXCEPTIONS.add("/a");
    DEFAULT_TAG_EXCEPTIONS.add("span");
    DEFAULT_TAG_EXCEPTIONS.add("/span");
    DEFAULT_TAG_EXCEPTIONS.add("img");
    
    DEFAULT_SUBSTITUTE_CHARS.put(new Character('&'), "&amp;");
    DEFAULT_SUBSTITUTE_CHARS.put(new Character('<'), "&lt;");
    DEFAULT_SUBSTITUTE_CHARS.put(new Character('>'), "&gt;");
    DEFAULT_SUBSTITUTE_CHARS.put(new Character('\''), "&apos;");
    DEFAULT_SUBSTITUTE_CHARS.put(new Character('"'), "&quot;");
  }
  
  public CompCSObject(ICompCSModel model, ICompCSObject parent)
  {
    fModel = model;
    fParent = parent;
  }
  
  public abstract List getChildren();
  
  public ICompCS getCompCS()
  {
    return fModel.getCompCS();
  }
  
  public ICompCSModel getModel()
  {
    return fModel;
  }
  
  public abstract String getName();
  
  public ICompCSObject getParent()
  {
    return fParent;
  }
  
  public abstract int getType();
  
  public void parse(Element element)
  {
    if (element.getNodeName().equals(getElement()))
    {
      parseAttributes(element);
      parseContent(element);
    }
  }
  
  public abstract void reset();
  
  public void setModel(ICompCSModel model)
  {
    fModel = model;
  }
  
  public void write(String indent, PrintWriter writer)
  {
    StringBuffer buffer = new StringBuffer();
    try
    {
      buffer.append(getElement());
      
      writeAttributes(buffer);
      
      XMLPrintHandler.printBeginElement(writer, buffer.toString(), 
        indent, false);
      
      writeElements(indent, writer);
      
      XMLPrintHandler.printEndElement(writer, getElement(), indent);
    }
    catch (IOException localIOException) {}
  }
  
  protected void firePropertyChanged(String property, Object oldValue, Object newValue)
  {
    firePropertyChanged(this, property, oldValue, newValue);
  }
  
  private void firePropertyChanged(ICompCSObject object, String property, Object oldValue, Object newValue)
  {
    if (fModel.isEditable())
    {
      IModelChangeProvider provider = fModel;
      provider.fireModelObjectChanged(object, property, oldValue, 
        newValue);
    }
  }
  
  protected void fireStructureChanged(ICompCSObject child, int changeType)
  {
    fireStructureChanged(new ICompCSObject[] { child }, changeType);
  }
  
  protected void fireStructureChanged(ICompCSObject newValue, ICompCSObject oldValue)
  {
    int changeType = -1;
    ICompCSObject object = null;
    if (newValue == null)
    {
      changeType = 2;
      object = oldValue;
    }
    else
    {
      changeType = 1;
      object = newValue;
    }
    fireStructureChanged(object, changeType);
  }
  
  private void fireStructureChanged(ICompCSObject[] children, int changeType)
  {
    if (fModel.isEditable())
    {
      IModelChangeProvider provider = fModel;
      provider.fireModelChanged(new ModelChangedEvent(provider, 
        changeType, children, null));
    }
  }
  
  protected boolean isEditable()
  {
    return getModel().isEditable();
  }
  
  protected abstract void parseAttributes(Element paramElement);
  
  protected void parseContent(Element element)
  {
    NodeList children = element.getChildNodes();
    for (int i = 0; i < children.getLength(); i++)
    {
      Node child = children.item(i);
      if (child.getNodeType() == 1) {
        parseElement((Element)child);
      } else if (child.getNodeType() == 3) {
        parseText((Text)child);
      }
    }
  }
  
  protected abstract void parseElement(Element paramElement);
  
  protected abstract void parseText(Text paramText);
  
  protected abstract void writeAttributes(StringBuffer paramStringBuffer);
  
  protected abstract void writeElements(String paramString, PrintWriter paramPrintWriter);
  
  public abstract String getElement();
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSObject
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSOnCompletion;

public class CompCSOnCompletion
  extends CompCSDataObject
  implements ICompCSOnCompletion
{
  private static final long serialVersionUID = 1L;
  
  public CompCSOnCompletion(ICompCSModel model, ICompCSObject parent)
  {
    super(model, parent);
    reset();
  }
  
  public String getElement()
  {
    return "onCompletion";
  }
  
  public int getType()
  {
    return 4;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSOnCompletion
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.pde.internal.core.XMLPrintHandler;
import org.eclipse.pde.internal.core.util.PDETextHelper;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSParam;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

public class CompCSParam
  extends CompCSObject
  implements ICompCSParam
{
  private String fFieldName;
  private String fFieldValue;
  private static final long serialVersionUID = 1L;
  
  public CompCSParam(ICompCSModel model, ICompCSObject parent)
  {
    super(model, parent);
    reset();
  }
  
  public List getChildren()
  {
    return new ArrayList();
  }
  
  public String getElement()
  {
    return "param";
  }
  
  public String getName()
  {
    return fFieldName;
  }
  
  public int getType()
  {
    return 6;
  }
  
  protected void parseAttributes(Element element)
  {
    fFieldName = element.getAttribute("name").trim();
    
    fFieldValue = element.getAttribute("value").trim();
  }
  
  protected void parseElement(Element element) {}
  
  public void reset()
  {
    fFieldName = null;
    fFieldValue = null;
  }
  
  protected void writeAttributes(StringBuffer buffer)
  {
    if ((fFieldName != null) && (fFieldName.length() > 0)) {
      buffer.append(XMLPrintHandler.wrapAttribute("name", 
        fFieldName));
    }
    if ((fFieldValue != null) && (fFieldValue.length() > 0)) {
      buffer.append(XMLPrintHandler.wrapAttribute("value", 
        PDETextHelper.translateWriteText(fFieldValue.trim(), 
        DEFAULT_SUBSTITUTE_CHARS)));
    }
  }
  
  protected void writeElements(String indent, PrintWriter writer) {}
  
  public String getFieldName()
  {
    return fFieldName;
  }
  
  public String getFieldValue()
  {
    return fFieldValue;
  }
  
  public void setFieldName(String name)
  {
    String old = fFieldName;
    fFieldName = name;
    if (isEditable()) {
      firePropertyChanged("name", old, fFieldName);
    }
  }
  
  public void setFieldValue(String value)
  {
    String old = fFieldValue;
    fFieldValue = value;
    if (isEditable()) {
      firePropertyChanged("value", old, fFieldValue);
    }
  }
  
  protected void parseText(Text text) {}
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSParam
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModelFactory;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSParam;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSTask;
import org.w3c.dom.Element;

public class CompCSTask
  extends CompCSTaskObject
  implements ICompCSTask
{
  private ArrayList fFieldParams;
  private static final long serialVersionUID = 1L;
  
  public CompCSTask(ICompCSModel model, ICompCSObject parent)
  {
    super(model, parent);
    reset();
  }
  
  public List getChildren()
  {
    return new ArrayList();
  }
  
  public String getName()
  {
    return fFieldName;
  }
  
  public int getType()
  {
    return 2;
  }
  
  public String getElement()
  {
    return "task";
  }
  
  protected void parseElement(Element element)
  {
    super.parseElement(element);
    String name = element.getNodeName();
    ICompCSModelFactory factory = getModel().getFactory();
    if (name.equals("param"))
    {
      ICompCSParam param = factory.createCompCSParam(this);
      fFieldParams.add(param);
      param.parse(element);
    }
  }
  
  public void addFieldParam(ICompCSParam param)
  {
    fFieldParams.add(param);
    if (isEditable()) {
      fireStructureChanged(param, 1);
    }
  }
  
  public ICompCSParam[] getFieldParams()
  {
    return (ICompCSParam[])fFieldParams
      .toArray(new ICompCSParam[fFieldParams.size()]);
  }
  
  public void removeFieldParam(ICompCSParam param)
  {
    fFieldParams.remove(param);
    if (isEditable()) {
      fireStructureChanged(param, 2);
    }
  }
  
  public void reset()
  {
    super.reset();
    
    fFieldParams = new ArrayList();
  }
  
  protected void writeElements(String indent, PrintWriter writer)
  {
    super.writeElements(indent, writer);
    String newIndent = indent + "   ";
    
    Iterator iterator = fFieldParams.iterator();
    while (iterator.hasNext())
    {
      ICompCSParam param = (ICompCSParam)iterator.next();
      param.write(newIndent, writer);
    }
  }
  
  public boolean hasFieldParams()
  {
    if (fFieldParams.isEmpty()) {
      return false;
    }
    return true;
  }
  
  public ICompCSParam getFieldParam(String name)
  {
    if (fFieldParams.isEmpty()) {
      return null;
    }
    ListIterator iterator = fFieldParams.listIterator();
    while (iterator.hasNext())
    {
      ICompCSParam parameter = (ICompCSParam)iterator.next();
      if (parameter.getFieldName().equals(name)) {
        return parameter;
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSTask
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModelFactory;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSTask;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSTaskGroup;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSTaskObject;
import org.w3c.dom.Element;

public class CompCSTaskGroup
  extends CompCSTaskObject
  implements ICompCSTaskGroup
{
  private ArrayList fFieldTaskObjects;
  private static final long serialVersionUID = 1L;
  
  public CompCSTaskGroup(ICompCSModel model, ICompCSObject parent)
  {
    super(model, parent);
    reset();
  }
  
  public List getChildren()
  {
    ArrayList list = new ArrayList();
    if (fFieldTaskObjects.size() > 0) {
      list.addAll(fFieldTaskObjects);
    }
    return list;
  }
  
  public String getName()
  {
    return fFieldName;
  }
  
  public int getType()
  {
    return 1;
  }
  
  public void reset()
  {
    super.reset();
    
    fFieldTaskObjects = new ArrayList();
  }
  
  public void addFieldTaskObject(ICompCSTaskObject taskObject)
  {
    fFieldTaskObjects.add(taskObject);
    if (isEditable()) {
      fireStructureChanged(taskObject, 1);
    }
  }
  
  public void addFieldTaskObject(int index, ICompCSTaskObject taskObject)
  {
    if (index < 0) {
      return;
    }
    if (index >= fFieldTaskObjects.size()) {
      fFieldTaskObjects.add(taskObject);
    } else {
      fFieldTaskObjects.add(index, taskObject);
    }
    if (isEditable()) {
      fireStructureChanged(taskObject, 1);
    }
  }
  
  public int getFieldTaskObjectCount()
  {
    return fFieldTaskObjects.size();
  }
  
  public ICompCSTaskObject[] getFieldTaskObjects()
  {
    return (ICompCSTaskObject[])fFieldTaskObjects
      .toArray(new ICompCSTaskObject[fFieldTaskObjects.size()]);
  }
  
  public boolean hasFieldTaskObjects()
  {
    if (fFieldTaskObjects.isEmpty()) {
      return false;
    }
    return true;
  }
  
  public int indexOfFieldTaskObject(ICompCSTaskObject taskObject)
  {
    return fFieldTaskObjects.indexOf(taskObject);
  }
  
  public boolean isFirstFieldTaskObject(ICompCSTaskObject taskObject)
  {
    int position = fFieldTaskObjects.indexOf(taskObject);
    if (position == 0) {
      return true;
    }
    return false;
  }
  
  public boolean isLastFieldTaskObject(ICompCSTaskObject taskObject)
  {
    int position = fFieldTaskObjects.indexOf(taskObject);
    int lastPosition = fFieldTaskObjects.size() - 1;
    if (position == lastPosition) {
      return true;
    }
    return false;
  }
  
  public void removeFieldTaskObject(ICompCSTaskObject taskObject)
  {
    fFieldTaskObjects.remove(taskObject);
    if (isEditable()) {
      fireStructureChanged(taskObject, 2);
    }
  }
  
  public void removeFieldTaskObject(int index)
  {
    if ((index < 0) || (index > fFieldTaskObjects.size() - 1)) {
      return;
    }
    ICompCSTaskObject taskObject = (ICompCSTaskObject)fFieldTaskObjects
      .remove(index);
    if (isEditable()) {
      fireStructureChanged(taskObject, 2);
    }
  }
  
  protected void parseElement(Element element)
  {
    super.parseElement(element);
    String name = element.getNodeName();
    ICompCSModelFactory factory = getModel().getFactory();
    if (name.equals("task"))
    {
      ICompCSTask task = factory.createCompCSTask(this);
      fFieldTaskObjects.add(task);
      task.parse(element);
    }
    else if (name.equals("taskGroup"))
    {
      ICompCSTaskGroup taskGroup = factory.createCompCSTaskGroup(this);
      fFieldTaskObjects.add(taskGroup);
      taskGroup.parse(element);
    }
  }
  
  protected void writeElements(String indent, PrintWriter writer)
  {
    super.writeElements(indent, writer);
    String newIndent = indent + "   ";
    
    Iterator iterator = fFieldTaskObjects.iterator();
    while (iterator.hasNext())
    {
      ICompCSTaskObject taskObject = (ICompCSTaskObject)iterator.next();
      taskObject.write(newIndent, writer);
    }
  }
  
  public String getElement()
  {
    return "taskGroup";
  }
  
  public ICompCSTaskObject getNextSibling(ICompCSTaskObject taskObject)
  {
    int position = fFieldTaskObjects.indexOf(taskObject);
    int lastIndex = fFieldTaskObjects.size() - 1;
    if ((position == -1) || (position == lastIndex)) {
      return null;
    }
    return (ICompCSTaskObject)fFieldTaskObjects.get(position + 1);
  }
  
  public ICompCSTaskObject getPreviousSibling(ICompCSTaskObject taskObject)
  {
    int position = fFieldTaskObjects.indexOf(taskObject);
    if ((position == -1) || (position == 0)) {
      return null;
    }
    return (ICompCSTaskObject)fFieldTaskObjects.get(position - 1);
  }
  
  public void moveFieldTaskObject(ICompCSTaskObject taskObject, int newRelativeIndex)
  {
    int currentIndex = indexOfFieldTaskObject(taskObject);
    if (currentIndex == -1) {
      return;
    }
    int newIndex = newRelativeIndex + currentIndex;
    if ((newIndex < 0) || (newIndex >= fFieldTaskObjects.size())) {
      return;
    }
    fFieldTaskObjects.remove(taskObject);
    
    fFieldTaskObjects.add(newIndex, taskObject);
    if (isEditable()) {
      fireStructureChanged(taskObject, 1);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.ua.core.cheatsheet.comp.CompCSTaskGroup
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.ua.core.cheatsheet.comp;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.pde.internal.core.XMLPrintHandler;
import org.eclipse.pde.internal.core.util.PDETextHelper;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSDependency;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSIntro;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModel;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSModelFactory;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSObject;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSOnCompletion;
import org.eclipse.pde.internal.ua.core.icheatsheet.comp.ICompCSTaskObject;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

public abstract class CompCSTaskObject
  extends CompCSObject
  implements ICompCSTaskObject
{
  private static final long serialVersionUID = 1L;
  protected String fFieldId;
  protected String fFieldKind;
  protected ICompCSIntro fFieldIntro;
  protected ICompCSOnCompletion fFieldOnCompletion;
  protected String fFieldName;
  protected boolean fFieldSkip;
  protected ArrayList fFieldDependencies;
  
  public CompCSTaskObject(ICompCSModel model, ICompCSObject parent)
  {
    super(model, parent);
  }
  
  public abstract List getChildren();
  
  public abstract String getName();
  
  public abstract int getType();
  
  public void reset()
  {
    fFieldId = null;
    fFieldKind = null;
    fFieldIntro = null;
    fFieldOnCompletion = null;
    fFieldName = null;
    fFieldSkip = false;
    fFieldDependencies = new ArrayList();
  }
  
  public void addFieldDependency(ICompCSDependency dependency)
  {
    fFieldDependencies.add(dependency);
    if (isEditable()) {
      fireStructureChanged(dependency, 1);
    }
  }
  
  public String getFieldId()
  {
    return fFieldId;
  }
  
  public ICompCSIntro getFieldIntro()
  {
    return fFieldIntro;
  }
  
  public String getFieldKind()
  {
    return fFieldKind;
  }
  
  public String getFieldName()
  {
    return fFieldName;
  }
  
  public ICompCSOnCompletion getFieldOnCompletion()
  {
    return fFieldOnCompletion;
  }
  
  public boolean getFieldSkip()
  {
    return fFieldSkip;
  }
  
  public void removeFieldDepedency(ICompCSDependency dependency)
  {
    fFieldDependencies.remove(dependency);
    if (isEditable()) {
      fireStructureChanged(dependency, 2);
    }
  }
  
  public void setFieldId(String id)
  {
    String old = fFieldId;
    fFieldId = id;
    if (isEditable()) {
      firePropertyChanged("id", old, fFieldId);
    }
  }
  
  public void setFieldIntro(IComp
1 2 3 4

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