org.eclipse.pde.core_3.7.1.v20120103_r372

oString() : null);
    } else {
      super.restoreProperty(name, oldValue, newValue);
    }
  }
  
  public void setDescription(String description)
    throws CoreException
  {
    ensureModelEditable();
    Object oldValue = this.description;
    this.description = description;
    firePropertyChanged("p_desc", oldValue, description);
  }
  
  protected void parse(Node node)
  {
    url = getNodeAttribute(node, "url");
    Node firstChild = node.getFirstChild();
    if (firstChild != null) {
      description = getNormalizedText(firstChild.getNodeValue());
    }
  }
  
  public void write(String indent, PrintWriter writer)
  {
    String indent2 = indent + "   ";
    String desc = description != null ? getWritableString(description.trim()) : null;
    writer.println();
    writer.print(indent + "<" + getTag());
    if (url != null) {
      writer.print(" url=\"" + getWritableString(url) + "\"");
    }
    writer.println(">");
    if (desc != null) {
      writer.println(indent2 + desc);
    }
    writer.println(indent + "</" + getTag() + ">");
  }
  
  public boolean isEmpty()
  {
    if (url != null) {
      return false;
    }
    String desc = description != null ? description.trim() : null;
    if ((desc != null) && (desc.length() > 0)) {
      return false;
    }
    return true;
  }
  
  public String toString()
  {
    switch (index)
    {
    case 0: 
      return PDECoreMessages.FeatureInfo_description;
    case 2: 
      return PDECoreMessages.FeatureInfo_license;
    case 1: 
      return PDECoreMessages.FeatureInfo_copyright;
    }
    return super.toString();
  }
}

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

import java.io.PrintWriter;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.internal.core.ifeature.IFeatureInstallHandler;
import org.w3c.dom.Node;

public class FeatureInstallHandler
  extends FeatureObject
  implements IFeatureInstallHandler
{
  private static final long serialVersionUID = 1L;
  private String fLibrary;
  private String fHandlerName;
  
  public String getLibrary()
  {
    return fLibrary;
  }
  
  public String getHandlerName()
  {
    return fHandlerName;
  }
  
  public void setLibrary(String library)
    throws CoreException
  {
    ensureModelEditable();
    Object oldValue = fLibrary;
    fLibrary = library;
    firePropertyChanged("library", oldValue, library);
  }
  
  public void setHandlerName(String handlerName)
    throws CoreException
  {
    ensureModelEditable();
    Object oldValue = fHandlerName;
    fHandlerName = handlerName;
    firePropertyChanged("handlerName", oldValue, handlerName);
  }
  
  public void restoreProperty(String name, Object oldValue, Object newValue)
    throws CoreException
  {
    if (name.equals("library")) {
      setLibrary((String)newValue);
    } else if (name.equals("handlerName")) {
      setHandlerName((String)newValue);
    } else {
      super.restoreProperty(name, oldValue, newValue);
    }
  }
  
  protected void parse(Node node)
  {
    fLibrary = getNodeAttribute(node, "library");
    fHandlerName = getNodeAttribute(node, "handler");
  }
  
  public void write(String indent, PrintWriter writer)
  {
    writer.print(indent + "<install-handler");
    if (fLibrary != null) {
      writer.print(" library=\"" + fLibrary + "\"");
    }
    if (fHandlerName != null) {
      writer.print(" handler=\"" + fHandlerName + "\"");
    }
    writer.println("/>");
  }
}

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

import java.io.PrintWriter;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.core.runtime.Status;
import org.eclipse.pde.core.IModelChangeProvider;
import org.eclipse.pde.core.ModelChangedEvent;
import org.eclipse.pde.internal.core.PDECoreMessages;
import org.eclipse.pde.internal.core.ifeature.IFeature;
import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
import org.eclipse.pde.internal.core.ifeature.IFeatureObject;
import org.eclipse.pde.internal.core.util.PDEXMLHelper;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public abstract class FeatureObject
  extends PlatformObject
  implements IFeatureObject
{
  private static final long serialVersionUID = 1L;
  transient IFeatureModel model;
  transient IFeatureObject parent;
  protected String label;
  boolean inTheModel;
  
  void setInTheModel(boolean value)
  {
    inTheModel = value;
  }
  
  public boolean isInTheModel()
  {
    return inTheModel;
  }
  
  protected void ensureModelEditable()
    throws CoreException
  {
    if (!model.isEditable()) {
      throwCoreException(PDECoreMessages.FeatureObject_readOnlyChange);
    }
  }
  
  protected void firePropertyChanged(String property, Object oldValue, Object newValue)
  {
    firePropertyChanged(this, property, oldValue, newValue);
  }
  
  protected void firePropertyChanged(IFeatureObject object, String property, Object oldValue, Object newValue)
  {
    if (model.isEditable())
    {
      IModelChangeProvider provider = model;
      provider.fireModelObjectChanged(object, property, oldValue, newValue);
    }
  }
  
  protected void fireStructureChanged(IFeatureObject child, int changeType)
  {
    fireStructureChanged(new IFeatureObject[] { child }, changeType);
  }
  
  protected void fireStructureChanged(IFeatureObject[] children, int changeType)
  {
    IFeatureModel model = getModel();
    if (model.isEditable())
    {
      IModelChangeProvider provider = model;
      provider.fireModelChanged(new ModelChangedEvent(provider, changeType, children, null));
    }
  }
  
  public IFeature getFeature()
  {
    return model.getFeature();
  }
  
  public String getLabel()
  {
    return label;
  }
  
  public String getTranslatableLabel()
  {
    if (label == null) {
      return "";
    }
    return model.getResourceString(label);
  }
  
  public IFeatureModel getModel()
  {
    return model;
  }
  
  String getNodeAttribute(Node node, String name)
  {
    Node attribute = node.getAttributes().getNamedItem(name);
    if (attribute != null) {
      return attribute.getNodeValue();
    }
    return null;
  }
  
  int getIntegerAttribute(Node node, String name)
  {
    String value = getNodeAttribute(node, name);
    if (value != null) {
      try
      {
        return Integer.parseInt(value);
      }
      catch (NumberFormatException localNumberFormatException) {}
    }
    return 0;
  }
  
  boolean getBooleanAttribute(Node node, String name)
  {
    String value = getNodeAttribute(node, name);
    if (value != null) {
      return value.equalsIgnoreCase("true");
    }
    return false;
  }
  
  protected String getNormalizedText(String source)
  {
    String result = source.replace('\t', ' ');
    result = result.trim();
    
    return result;
  }
  
  public IFeatureObject getParent()
  {
    return parent;
  }
  
  protected void parse(Node node)
  {
    label = getNodeAttribute(node, "label");
  }
  
  protected void reset()
  {
    label = null;
  }
  
  public void setLabel(String newLabel)
    throws CoreException
  {
    ensureModelEditable();
    Object oldValue = label;
    label = newLabel;
    firePropertyChanged("label", oldValue, newLabel);
  }
  
  protected void throwCoreException(String message)
    throws CoreException
  {
    Status status = new Status(4, "org.eclipse.pde.core", 0, message, null);
    CoreException ce = new CoreException(status);
    ce.fillInStackTrace();
    throw ce;
  }
  
  public void restoreProperty(String name, Object oldValue, Object newValue)
    throws CoreException
  {
    if (name.equals("label")) {
      setLabel(newValue != null ? newValue.toString() : null);
    }
  }
  
  public void write(String indent, PrintWriter writer) {}
  
  public void setModel(IFeatureModel model)
  {
    this.model = model;
  }
  
  public void setParent(IFeatureObject parent)
  {
    this.parent = parent;
  }
  
  protected String getWritableString(String source)
  {
    return PDEXMLHelper.getWritableString(source);
  }
}

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

import java.io.PrintWriter;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.core.plugin.IFragment;
import org.eclipse.pde.core.plugin.IFragmentModel;
import org.eclipse.pde.core.plugin.IPluginBase;
import org.eclipse.pde.core.plugin.IPluginModel;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.plugin.ModelEntry;
import org.eclipse.pde.core.plugin.PluginRegistry;
import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin;
import org.w3c.dom.Node;

public class FeaturePlugin
  extends FeatureData
  implements IFeaturePlugin
{
  private static final long serialVersionUID = 1L;
  private boolean fFragment;
  private String fVersion;
  private boolean fUnpack = true;
  
  protected void reset()
  {
    super.reset();
    fVersion = null;
    fFragment = false;
  }
  
  public boolean isFragment()
  {
    return fFragment;
  }
  
  public IPluginBase getPluginBase()
  {
    if (id == null) {
      return null;
    }
    String version = getVersion();
    IPluginModelBase model = null;
    if ((version == null) || (version.equals("0.0.0")))
    {
      model = PluginRegistry.findModel(id);
    }
    else
    {
      ModelEntry entry = PluginRegistry.findEntry(id);
      if (entry != null)
      {
        IPluginModelBase[] bases = entry.getActiveModels();
        for (int i = 0; i < bases.length; i++) {
          if (bases[i].getPluginBase().getVersion().equals(version))
          {
            model = bases[i];
            break;
          }
        }
      }
    }
    if ((fFragment) && ((model instanceof IFragmentModel))) {
      return model.getPluginBase();
    }
    if ((!fFragment) && ((model instanceof IPluginModel))) {
      return model.getPluginBase();
    }
    return null;
  }
  
  public String getVersion()
  {
    return fVersion;
  }
  
  public boolean isUnpack()
  {
    return fUnpack;
  }
  
  public void setVersion(String version)
    throws CoreException
  {
    ensureModelEditable();
    Object oldValue = fVersion;
    fVersion = version;
    firePropertyChanged(this, "version", oldValue, version);
  }
  
  public void setUnpack(boolean unpack)
    throws CoreException
  {
    ensureModelEditable();
    boolean oldValue = fUnpack;
    fUnpack = unpack;
    firePropertyChanged(this, "unpack", new Boolean(oldValue), new Boolean(unpack));
  }
  
  public void restoreProperty(String name, Object oldValue, Object newValue)
    throws CoreException
  {
    if (name.equals("version")) {
      setVersion(newValue != null ? newValue.toString() : null);
    } else {
      super.restoreProperty(name, oldValue, newValue);
    }
  }
  
  public void setFragment(boolean fragment)
    throws CoreException
  {
    ensureModelEditable();
    fFragment = fragment;
  }
  
  protected void parse(Node node)
  {
    super.parse(node);
    fVersion = getNodeAttribute(node, "version");
    String f = getNodeAttribute(node, "fragment");
    if ((f != null) && (f.equalsIgnoreCase("true"))) {
      fFragment = true;
    }
    String unpack = getNodeAttribute(node, "unpack");
    if ((unpack != null) && (unpack.equalsIgnoreCase("false"))) {
      fUnpack = false;
    }
  }
  
  public void loadFrom(IPluginBase plugin)
  {
    id = plugin.getId();
    label = plugin.getTranslatedName();
    fVersion = plugin.getVersion();
    fFragment = (plugin instanceof IFragment);
  }
  
  public void write(String indent, PrintWriter writer)
  {
    writer.print(indent + "<plugin");
    String indent2 = indent + "   " + "   ";
    writeAttributes(indent2, writer);
    if (getVersion() != null)
    {
      writer.println();
      writer.print(indent2 + "version=\"" + getVersion() + "\"");
    }
    if (isFragment())
    {
      writer.println();
      writer.print(indent2 + "fragment=\"true\"");
    }
    if (!isUnpack())
    {
      writer.println();
      writer.print(indent2 + "unpack=\"false\"");
    }
    writer.println("/>");
  }
  
  public String getLabel()
  {
    IPluginBase pluginBase = getPluginBase();
    if (pluginBase != null) {
      return pluginBase.getTranslatedName();
    }
    String name = super.getLabel();
    if (name == null) {
      name = getId();
    }
    return name;
  }
  
  public String toString()
  {
    return getLabel();
  }
}

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

import java.io.PrintWriter;
import java.util.Locale;
import java.util.Vector;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
import org.eclipse.pde.internal.core.ifeature.IFeatureModelFactory;
import org.eclipse.pde.internal.core.ifeature.IFeatureURL;
import org.eclipse.pde.internal.core.ifeature.IFeatureURLElement;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class FeatureURL
  extends FeatureObject
  implements IFeatureURL
{
  private static final long serialVersionUID = 1L;
  private IFeatureURLElement fUpdate;
  private Vector fDiscoveries = new Vector();
  
  public void addDiscovery(IFeatureURLElement discovery)
    throws CoreException
  {
    ensureModelEditable();
    fDiscoveries.add(discovery);
    ((FeatureURLElement)discovery).setInTheModel(true);
    fireStructureChanged(discovery, 1);
  }
  
  public void setUpdate(IFeatureURLElement update)
    throws CoreException
  {
    ensureModelEditable();
    if (fUpdate == update) {
      return;
    }
    if (fUpdate != null) {
      ((FeatureURLElement)fUpdate).setInTheModel(false);
    }
    IFeatureURLElement oldValue = fUpdate;
    fUpdate = update;
    if (oldValue != null) {
      fireStructureChanged(oldValue, 2);
    }
    if (update != null)
    {
      ((FeatureURLElement)update).setInTheModel(true);
      fireStructureChanged(update, 1);
    }
  }
  
  public IFeatureURLElement[] getDiscoveries()
  {
    return (IFeatureURLElement[])fDiscoveries.toArray(new IFeatureURLElement[fDiscoveries.size()]);
  }
  
  public IFeatureURLElement getUpdate()
  {
    return fUpdate;
  }
  
  protected void parse(Node node)
  {
    NodeList children = node.getChildNodes();
    for (int i = 0; i < children.getLength(); i++)
    {
      Node child = children.item(i);
      if (child.getNodeType() == 1)
      {
        String tag = child.getNodeName().toLowerCase(Locale.ENGLISH);
        int urlType = -1;
        if (tag.equals("update")) {
          urlType = 1;
        } else if (tag.equals("discovery")) {
          urlType = 2;
        }
        if (urlType != -1)
        {
          IFeatureURLElement element = getModel().getFactory().createURLElement(this, urlType);
          ((FeatureURLElement)element).parse(child);
          if (urlType == 1)
          {
            ((FeatureURLElement)element).setInTheModel(true);
            fUpdate = element;
          }
          else if (urlType == 2)
          {
            ((FeatureURLElement)element).setInTheModel(true);
            fDiscoveries.add(element);
          }
        }
      }
    }
  }
  
  public void removeDiscovery(IFeatureURLElement discovery)
    throws CoreException
  {
    ensureModelEditable();
    fDiscoveries.remove(discovery);
    ((FeatureURLElement)discovery).setInTheModel(false);
    fireStructureChanged(discovery, 2);
  }
  
  public void write(String indent, PrintWriter writer)
  {
    if ((fUpdate == null) && (fDiscoveries.size() <= 0)) {
      return;
    }
    writer.println();
    writer.println(indent + "<url>");
    String indent2 = indent + "   ";
    if (fUpdate != null) {
      fUpdate.write(indent2, writer);
    }
    for (int i = 0; i < fDiscoveries.size(); i++)
    {
      IFeatureURLElement element = (IFeatureURLElement)fDiscoveries.elementAt(i);
      element.write(indent2, writer);
    }
    writer.println(indent + "</url>");
  }
}

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

import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.internal.core.ifeature.IFeatureURLElement;
import org.w3c.dom.Node;

public class FeatureURLElement
  extends FeatureObject
  implements IFeatureURLElement
{
  private static final long serialVersionUID = 1L;
  private int fElementType;
  private int fSiteType = 0;
  private URL fUrl;
  
  public FeatureURLElement(int elementType)
  {
    fElementType = elementType;
  }
  
  public FeatureURLElement(int elementType, URL url)
  {
    fElementType = elementType;
    fUrl = url;
  }
  
  public int getElementType()
  {
    return fElementType;
  }
  
  public URL getURL()
  {
    return fUrl;
  }
  
  public int getSiteType()
  {
    return fSiteType;
  }
  
  protected void parse(Node node)
  {
    super.parse(node);
    String urlName = getNodeAttribute(node, "url");
    try
    {
      if (urlName != null) {
        fUrl = new URL(urlName);
      }
    }
    catch (MalformedURLException localMalformedURLException) {}
    String typeName = getNodeAttribute(node, "type");
    if ((typeName != null) && (typeName.equals("web"))) {
      fSiteType = 1;
    }
  }
  
  public void setURL(URL url)
    throws CoreException
  {
    ensureModelEditable();
    Object oldValue = fUrl;
    fUrl = url;
    firePropertyChanged(this, "url", oldValue, url);
  }
  
  public void setSiteType(int type)
    throws CoreException
  {
    ensureModelEditable();
    Integer oldValue = new Integer(fSiteType);
    fSiteType = type;
    firePropertyChanged(this, "url", oldValue, new Integer(type));
  }
  
  public void restoreProperty(String name, Object oldValue, Object newValue)
    throws CoreException
  {
    if (name.equals("url")) {
      setURL((URL)newValue);
    } else if (name.equals("siteType")) {
      setSiteType(((Integer)newValue).intValue());
    } else {
      super.restoreProperty(name, oldValue, newValue);
    }
  }
  
  public String toString()
  {
    if (label != null) {
      return label;
    }
    if (fUrl != null) {
      return fUrl.toString();
    }
    return super.toString();
  }
  
  public void write(String indent, PrintWriter writer)
  {
    String tag = null;
    switch (fElementType)
    {
    case 1: 
      tag = "update";
      break;
    case 2: 
      tag = "discovery";
    }
    if (tag == null) {
      return;
    }
    writer.print(indent + "<" + tag);
    if ((label != null) && (label.length() > 0)) {
      writer.print(" label=\"" + getWritableString(label) + "\"");
    }
    if (fUrl != null) {
      writer.print(" url=\"" + getWritableString(fUrl.toString()) + "\"");
    }
    if (fSiteType == 1) {
      writer.print(" type=\"web\"");
    }
    writer.println("/>");
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.core.IIdentifiable;
import org.w3c.dom.Node;

public class IdentifiableObject
  extends FeatureObject
  implements IIdentifiable
{
  private static final long serialVersionUID = 1L;
  protected String id;
  
  public String getId()
  {
    return id;
  }
  
  protected void parse(Node node)
  {
    super.parse(node);
    id = getNodeAttribute(node, "id");
  }
  
  public void setId(String id)
    throws CoreException
  {
    ensureModelEditable();
    Object oldValue = this.id;
    this.id = id;
    firePropertyChanged(this, "id", oldValue, id);
  }
  
  public void restoreProperty(String name, Object oldValue, Object newValue)
    throws CoreException
  {
    if (name.equals("id")) {
      setId(newValue != null ? newValue.toString() : null);
    } else {
      super.restoreProperty(name, oldValue, newValue);
    }
  }
  
  protected void reset()
  {
    super.reset();
    id = null;
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.internal.core.ifeature.IVersionable;
import org.w3c.dom.Node;

public class VersionableObject
  extends IdentifiableObject
  implements IVersionable
{
  private static final long serialVersionUID = 1L;
  protected String version;
  
  public String getVersion()
  {
    return version;
  }
  
  protected void parse(Node node)
  {
    super.parse(node);
    version = getNodeAttribute(node, "version");
  }
  
  public void setVersion(String version)
    throws CoreException
  {
    ensureModelEditable();
    Object oldValue = this.version;
    this.version = version;
    firePropertyChanged(this, "version", oldValue, version);
  }
  
  public void restoreProperty(String name, Object oldValue, Object newValue)
    throws CoreException
  {
    if (name.equals("version")) {
      setVersion(newValue != null ? newValue.toString() : null);
    } else {
      super.restoreProperty(name, oldValue, newValue);
    }
  }
  
  protected void reset()
  {
    super.reset();
    version = null;
  }
}

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

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.pde.core.IEditableModel;
import org.eclipse.pde.core.IModelChangedEvent;
import org.eclipse.pde.internal.core.NLResourceHelper;
import org.eclipse.pde.internal.core.PDECore;

public class WorkspaceFeatureModel
  extends AbstractFeatureModel
  implements IEditableModel
{
  private static final long serialVersionUID = 1L;
  private boolean dirty;
  private IFile file;
  private boolean editable = true;
  
  public WorkspaceFeatureModel() {}
  
  public WorkspaceFeatureModel(IFile file)
  {
    setFile(file);
  }
  
  public void fireModelChanged(IModelChangedEvent event)
  {
    setDirty(event.getChangeType() != 99);
    super.fireModelChanged(event);
  }
  
  protected NLResourceHelper createNLResourceHelper()
  {
    try
    {
      if ((file == null) || (file.getLocation() == null)) {
        return null;
      }
      IPath path = file.getLocation().removeLastSegments(1);
      String installLocation = path.toOSString();
      if (!installLocation.startsWith("file:")) {
        installLocation = "file:" + installLocation;
      }
      URL url = new URL(installLocation + "/");
      String name = "feature";
      return new NLResourceHelper(name, new URL[] { url });
    }
    catch (MalformedURLException localMalformedURLException) {}
    return null;
  }
  
  public String getContents()
  {
    StringWriter swriter = new StringWriter();
    PrintWriter writer = new PrintWriter(swriter);
    setLoaded(true);
    save(writer);
    writer.flush();
    try
    {
      swriter.close();
    }
    catch (IOException e)
    {
      PDECore.logException(e);
    }
    return swriter.toString();
  }
  
  public IFile getFile()
  {
    return file;
  }
  
  public String getInstallLocation()
  {
    IPath path = file.getParent().getLocation();
    return path == null ? null : path.toOSString();
  }
  
  public IResource getUnderlyingResource()
  {
    return file;
  }
  
  public boolean isDirty()
  {
    return dirty;
  }
  
  public boolean isEditable()
  {
    return editable;
  }
  
  public boolean isInSync()
  {
    return isInSync(file.getLocation().toFile());
  }
  
  protected void updateTimeStamp()
  {
    updateTimeStamp(file.getLocation().toFile());
  }
  
  /* Error */
  public void load()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 208	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:file	Lorg/eclipse/core/resources/IFile;
    //   4: ifnonnull +4 -> 8
    //   7: return
    //   8: aload_0
    //   9: getfield 208	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:file	Lorg/eclipse/core/resources/IFile;
    //   12: invokeinterface 244 1 0
    //   17: ifeq +141 -> 158
    //   20: aconst_null
    //   21: astore_1
    //   22: new 100	java/io/BufferedInputStream
    //   25: dup
    //   26: aload_0
    //   27: getfield 208	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:file	Lorg/eclipse/core/resources/IFile;
    //   30: iconst_1
    //   31: invokeinterface 245 2 0
    //   36: invokespecial 210	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   39: astore_1
    //   40: aload_1
    //   41: invokevirtual 213	java/io/InputStream:available	()I
    //   44: ifle +12 -> 56
    //   47: aload_0
    //   48: aload_1
    //   49: iconst_0
    //   50: invokevirtual 239	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:load	(Ljava/io/InputStream;Z)V
    //   53: goto +84 -> 137
    //   56: aload_0
    //   57: iconst_1
    //   58: invokevirtual 236	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:setLoaded	(Z)V
    //   61: goto +76 -> 137
    //   64: astore_2
    //   65: aload_2
    //   66: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   69: aload_1
    //   70: ifnull +112 -> 182
    //   73: aload_1
    //   74: invokevirtual 214	java/io/InputStream:close	()V
    //   77: goto +105 -> 182
    //   80: astore 4
    //   82: aload 4
    //   84: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   87: goto +95 -> 182
    //   90: astore_2
    //   91: aload_2
    //   92: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   95: aload_1
    //   96: ifnull +86 -> 182
    //   99: aload_1
    //   100: invokevirtual 214	java/io/InputStream:close	()V
    //   103: goto +79 -> 182
    //   106: astore 4
    //   108: aload 4
    //   110: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   113: goto +69 -> 182
    //   116: astore_3
    //   117: aload_1
    //   118: ifnull +17 -> 135
    //   121: aload_1
    //   122: invokevirtual 214	java/io/InputStream:close	()V
    //   125: goto +10 -> 135
    //   128: astore 4
    //   130: aload 4
    //   132: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   135: aload_3
    //   136: athrow
    //   137: aload_1
    //   138: ifnull +44 -> 182
    //   141: aload_1
    //   142: invokevirtual 214	java/io/InputStream:close	()V
    //   145: goto +37 -> 182
    //   148: astore 4
    //   150: aload 4
    //   152: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   155: goto +27 -> 182
    //   158: aload_0
    //   159: new 119	org/eclipse/pde/internal/core/feature/Feature
    //   162: dup
    //   163: invokespecial 232	org/eclipse/pde/internal/core/feature/Feature:<init>	()V
    //   166: putfield 209	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:feature	Lorg/eclipse/pde/internal/core/feature/Feature;
    //   169: aload_0
    //   170: getfield 209	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:feature	Lorg/eclipse/pde/internal/core/feature/Feature;
    //   173: aload_0
    //   174: putfield 205	org/eclipse/pde/internal/core/feature/Feature:model	Lorg/eclipse/pde/internal/core/ifeature/IFeatureModel;
    //   177: aload_0
    //   178: iconst_1
    //   179: invokevirtual 236	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:setLoaded	(Z)V
    //   182: return
    // Line number table:
    //   Java source line #108	-> byte code offset #0
    //   Java source line #109	-> byte code offset #7
    //   Java source line #110	-> byte code offset #8
    //   Java source line #111	-> byte code offset #20
    //   Java source line #113	-> byte code offset #22
    //   Java source line #114	-> byte code offset #40
    //   Java source line #115	-> byte code offset #47
    //   Java source line #118	-> byte code offset #56
    //   Java source line #120	-> byte code offset #64
    //   Java source line #121	-> byte code offset #65
    //   Java source line #126	-> byte code offset #69
    //   Java source line #127	-> byte code offset #73
    //   Java source line #128	-> byte code offset #80
    //   Java source line #129	-> byte code offset #82
    //   Java source line #122	-> byte code offset #90
    //   Java source line #123	-> byte code offset #91
    //   Java source line #126	-> byte code offset #95
    //   Java source line #127	-> byte code offset #99
    //   Java source line #128	-> byte code offset #106
    //   Java source line #129	-> byte code offset #108
    //   Java source line #124	-> byte code offset #116
    //   Java source line #126	-> byte code offset #117
    //   Java source line #127	-> byte code offset #121
    //   Java source line #128	-> byte code offset #128
    //   Java source line #129	-> byte code offset #130
    //   Java source line #131	-> byte code offset #135
    //   Java source line #126	-> byte code offset #137
    //   Java source line #127	-> byte code offset #141
    //   Java source line #128	-> byte code offset #148
    //   Java source line #129	-> byte code offset #150
    //   Java source line #131	-> byte code offset #155
    //   Java source line #133	-> byte code offset #158
    //   Java source line #134	-> byte code offset #169
    //   Java source line #135	-> byte code offset #177
    //   Java source line #137	-> byte code offset #182
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	183	0	this	WorkspaceFeatureModel
    //   21	121	1	stream	java.io.InputStream
    //   64	2	2	e	org.eclipse.core.runtime.CoreException
    //   90	2	2	e	IOException
    //   116	20	3	localObject	Object
    //   80	3	4	e	IOException
    //   106	3	4	e	IOException
    //   128	3	4	e	IOException
    //   148	3	4	e	IOException
    // Exception table:
    //   from	to	target	type
    //   22	61	64	org/eclipse/core/runtime/CoreException
    //   69	77	80	java/io/IOException
    //   22	61	90	java/io/IOException
    //   95	103	106	java/io/IOException
    //   22	69	116	finally
    //   90	95	116	finally
    //   117	125	128	java/io/IOException
    //   137	145	148	java/io/IOException
  }
  
  /* Error */
  public void save()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 208	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:file	Lorg/eclipse/core/resources/IFile;
    //   4: ifnonnull +4 -> 8
    //   7: return
    //   8: aconst_null
    //   9: astore_1
    //   10: aload_0
    //   11: invokevirtual 241	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:getContents	()Ljava/lang/String;
    //   14: astore_2
    //   15: new 101	java/io/ByteArrayInputStream
    //   18: dup
    //   19: aload_2
    //   20: ldc 4
    //   22: invokevirtual 222	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   25: invokespecial 212	java/io/ByteArrayInputStream:<init>	([B)V
    //   28: astore_1
    //   29: aload_0
    //   30: getfield 208	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:file	Lorg/eclipse/core/resources/IFile;
    //   33: invokeinterface 244 1 0
    //   38: ifeq +19 -> 57
    //   41: aload_0
    //   42: getfield 208	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:file	Lorg/eclipse/core/resources/IFile;
    //   45: aload_1
    //   46: iconst_0
    //   47: iconst_0
    //   48: aconst_null
    //   49: invokeinterface 249 5 0
    //   54: goto +91 -> 145
    //   57: aload_0
    //   58: getfield 208	org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel:file	Lorg/eclipse/core/resources/IFile;
    //   61: aload_1
    //   62: iconst_0
    //   63: aconst_null
    //   64: invokeinterface 248 4 0
    //   69: goto +76 -> 145
    //   72: astore_2
    //   73: aload_2
    //   74: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   77: aload_1
    //   78: ifnull +85 -> 163
    //   81: aload_1
    //   82: invokevirtual 211	java/io/ByteArrayInputStream:close	()V
    //   85: goto +78 -> 163
    //   88: astore 4
    //   90: aload 4
    //   92: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   95: goto +68 -> 163
    //   98: astore_2
    //   99: aload_2
    //   100: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   103: aload_1
    //   104: ifnull +59 -> 163
    //   107: aload_1
    //   108: invokevirtual 211	java/io/ByteArrayInputStream:close	()V
    //   111: goto +52 -> 163
    //   114: astore 4
    //   116: aload 4
    //   118: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   121: goto +42 -> 163
    //   124: astore_3
    //   125: aload_1
    //   126: ifnull +17 -> 143
    //   129: aload_1
    //   130: invokevirtual 211	java/io/ByteArrayInputStream:close	()V
    //   133: goto +10 -> 143
    //   136: astore 4
    //   138: aload 4
    //   140: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   143: aload_3
    //   144: athrow
    //   145: aload_1
    //   146: ifnull +17 -> 163
    //   149: aload_1
    //   150: invokevirtual 211	java/io/ByteArrayInputStream:close	()V
    //   153: goto +10 -> 163
    //   156: astore 4
    //   158: aload 4
    //   160: invokestatic 229	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   163: return
    // Line number table:
    //   Java source line #140	-> byte code offset #0
    //   Java source line #141	-> byte code offset #7
    //   Java source line #142	-> byte code offset #8
    //   Java source line #144	-> byte code offset #10
    //   Java source line #145	-> byte code offset #15
    //   Java source line #146	-> byte code offset #29
    //   Java source line #147	-> byte code offset #41
    //   Java source line #149	-> byte code offset #57
    //   Java source line #151	-> byte code offset #72
    //   Java source line #152	-> byte code offset #73
    //   Java source line #157	-> byte code offset #77
    //   Java source line #158	-> byte code offset #81
    //   Java source line #159	-> byte code offset #88
    //   Java source line #160	-> byte code offset #90
    //   Java source line #153	-> byte code offset #98
    //   Java source line #154	-> byte code offset #99
    //   Java source line #157	-> byte code offset #103
    //   Java source line #158	-> byte code offset #107
    //   Java source line #159	-> byte code offset #114
    //   Java source line #160	-> byte code offset #116
    //   Java source line #155	-> byte code offset #124
    //   Java source line #157	-> byte code offset #125
    //   Java source line #158	-> byte code offset #129
    //   Java source line #159	-> byte code offset #136
    //   Java source line #160	-> byte code offset #138
    //   Java source line #162	-> byte code offset #143
    //   Java source line #157	-> byte code offset #145
    //   Java source line #158	-> byte code offset #149
    //   Java source line #159	-> byte code offset #156
    //   Java source line #160	-> byte code offset #158
    //   Java source line #163	-> byte code offset #163
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	164	0	this	WorkspaceFeatureModel
    //   9	141	1	stream	java.io.ByteArrayInputStream
    //   14	6	2	contents	String
    //   72	2	2	e	org.eclipse.core.runtime.CoreException
    //   98	2	2	e	IOException
    //   124	20	3	localObject	Object
    //   88	3	4	e	IOException
    //   114	3	4	e	IOException
    //   136	3	4	e	IOException
    //   156	3	4	e	IOException
    // Exception table:
    //   from	to	target	type
    //   10	69	72	org/eclipse/core/runtime/CoreException
    //   77	85	88	java/io/IOException
    //   10	69	98	java/io/IOException
    //   103	111	114	java/io/IOException
    //   10	77	124	finally
    //   98	103	124	finally
    //   125	133	136	java/io/IOException
    //   145	153	156	java/io/IOException
  }
  
  public void save(PrintWriter writer)
  {
    if (isLoaded())
    {
      writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
      
      feature.write("", writer);
    }
    setDirty(false);
  }
  
  public void setDirty(boolean dirty)
  {
    this.dirty = dirty;
  }
  
  public void setEditable(boolean newEditable)
  {
    editable = newEditable;
  }
  
  public void setFile(IFile newFile)
  {
    file = newFile;
  }
}

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

public abstract interface IBundle
{
  public abstract void setHeader(String paramString1, String paramString2);
  
  public abstract void renameHeader(String paramString1, String paramString2);
  
  public abstract String getHeader(String paramString);
  
  public abstract IManifestHeader getManifestHeader(String paramString);
  
  public abstract IBundleModel getModel();
  
  public abstract String getLocalization();
  
  public abstract void setLocalization(String paramString);
}

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

import org.eclipse.pde.core.plugin.IFragment;

public abstract interface IBundleFragment
  extends IBundlePluginBase, IFragment
{}

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

import org.eclipse.pde.core.plugin.IFragmentModel;

public abstract interface IBundleFragmentModel
  extends IBundlePluginModelBase, IFragmentModel
{}

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

import org.eclipse.pde.core.IModel;
import org.eclipse.pde.core.IModelChangeProvider;

public abstract interface IBundleModel
  extends IModel, IModelChangeProvider
{
  public abstract IBundle getBundle();
  
  public abstract String getInstallLocation();
  
  public abstract boolean isFragmentModel();
  
  public abstract IBundleModelFactory getFactory();
}

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

public abstract interface IBundleModelFactory
{
  public abstract IManifestHeader createHeader();
  
  public abstract IManifestHeader createHeader(String paramString1, String paramString2);
}

/* Location:
 * Qualifie
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd