-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.project.management;\r
-\r
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;\r
-import org.eclipse.equinox.p2.metadata.IVersionedId;\r
-import org.eclipse.equinox.p2.metadata.Version;\r
-import org.eclipse.equinox.p2.metadata.VersionedId;\r
-\r
-public class BundleInfo implements Comparable<BundleInfo>, IVersionedId {\r
-\r
- public static BundleInfo read(IInstallableUnit iu) {\r
- String name = iu.getProperty("org.eclipse.equinox.p2.name");\r
- String description = iu.getProperty("org.eclipse.equinox.p2.description");\r
- return new BundleInfo(iu, name, description);\r
- }\r
- \r
- public IVersionedId vid;\r
- public String name;\r
- public String description;\r
- \r
- public BundleInfo(String id, String version, String name, String description) {\r
- vid = new VersionedId(id, version);\r
- this.name = name;\r
- this.description = description;\r
- }\r
- \r
- public BundleInfo(IVersionedId vid, String name, String description) {\r
- this.vid = vid;\r
- this.name = name;\r
- this.description = description; \r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return name;\r
- }\r
- \r
- public String toVersionString() { \r
- return Version.emptyVersion.equals(vid.getVersion()) ? vid.getId() : vid.getId() + '/' + vid.getVersion().toString();\r
- }\r
- \r
- @Override\r
- public int compareTo(BundleInfo o) { \r
- return name.compareTo( o.name );\r
- }\r
-\r
- public String getId() {\r
- return vid.getId();\r
- }\r
-\r
- public void setId(IVersionedId vid) {\r
- this.vid = vid;\r
- }\r
-\r
- public Version getVersion() {\r
- return vid.getVersion();\r
- }\r
-\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- public void setDescription(String description) {\r
- this.description = description;\r
- }\r
-\r
- public String getName() {\r
- return name;\r
- }\r
-\r
- public void setName(String name) {\r
- this.name = name;\r
- }\r
- \r
- @Override\r
- public int hashCode() {\r
- return vid.hashCode();\r
- }\r
- \r
- @Override\r
- public boolean equals(Object obj) {\r
- return vid.equals(obj);\r
- }\r
- \r
-}\r
-\r
+/*******************************************************************************
+ * 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<BundleInfo>, 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);
+ }
+
+}
+