X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Fmanagement%2FBundleInfo.java;fp=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Fmanagement%2FBundleInfo.java;h=6847515de41a0697d0639d19f1221b55bd55d5c2;hp=6df8dfad8c521eb012a0444f360bac3367d98332;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.project/src/org/simantics/project/management/BundleInfo.java b/bundles/org.simantics.project/src/org/simantics/project/management/BundleInfo.java index 6df8dfad8..6847515de 100644 --- a/bundles/org.simantics.project/src/org/simantics/project/management/BundleInfo.java +++ b/bundles/org.simantics.project/src/org/simantics/project/management/BundleInfo.java @@ -1,96 +1,96 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.project.management; - -import org.eclipse.equinox.p2.metadata.IInstallableUnit; -import org.eclipse.equinox.p2.metadata.IVersionedId; -import org.eclipse.equinox.p2.metadata.Version; -import org.eclipse.equinox.p2.metadata.VersionedId; - -public class BundleInfo implements Comparable, IVersionedId { - - public static BundleInfo read(IInstallableUnit iu) { - String name = iu.getProperty("org.eclipse.equinox.p2.name"); - String description = iu.getProperty("org.eclipse.equinox.p2.description"); - return new BundleInfo(iu, name, description); - } - - public IVersionedId vid; - public String name; - public String description; - - public BundleInfo(String id, String version, String name, String description) { - vid = new VersionedId(id, version); - this.name = name; - this.description = description; - } - - public BundleInfo(IVersionedId vid, String name, String description) { - this.vid = vid; - this.name = name; - this.description = description; - } - - @Override - public String toString() { - return name; - } - - public String toVersionString() { - return Version.emptyVersion.equals(vid.getVersion()) ? vid.getId() : vid.getId() + '/' + vid.getVersion().toString(); - } - - @Override - public int compareTo(BundleInfo o) { - return name.compareTo( o.name ); - } - - public String getId() { - return vid.getId(); - } - - public void setId(IVersionedId vid) { - this.vid = vid; - } - - public Version getVersion() { - return vid.getVersion(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public int hashCode() { - return vid.hashCode(); - } - - @Override - public boolean equals(Object obj) { - return vid.equals(obj); - } - -} - +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.project.management; + +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.IVersionedId; +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.metadata.VersionedId; + +public class BundleInfo implements Comparable, IVersionedId { + + public static BundleInfo read(IInstallableUnit iu) { + String name = iu.getProperty("org.eclipse.equinox.p2.name"); + String description = iu.getProperty("org.eclipse.equinox.p2.description"); + return new BundleInfo(iu, name, description); + } + + public IVersionedId vid; + public String name; + public String description; + + public BundleInfo(String id, String version, String name, String description) { + vid = new VersionedId(id, version); + this.name = name; + this.description = description; + } + + public BundleInfo(IVersionedId vid, String name, String description) { + this.vid = vid; + this.name = name; + this.description = description; + } + + @Override + public String toString() { + return name; + } + + public String toVersionString() { + return Version.emptyVersion.equals(vid.getVersion()) ? vid.getId() : vid.getId() + '/' + vid.getVersion().toString(); + } + + @Override + public int compareTo(BundleInfo o) { + return name.compareTo( o.name ); + } + + public String getId() { + return vid.getId(); + } + + public void setId(IVersionedId vid) { + this.vid = vid; + } + + public Version getVersion() { + return vid.getVersion(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public int hashCode() { + return vid.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return vid.equals(obj); + } + +} +