View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: ConversionRulesPageInfo.java
13   * Created: 2009-10-01
14   * Author: kpietak
15   * $Id$
16   */
17  
18  package pl.edu.agh.cast.importer.wizard.util;
19  
20  import pl.edu.agh.cast.importer.wizard.page.AbstractConversionRulesSelectionPage;
21  
22  /**
23   * Class which holds information fetched from <code>pl.edu.agh.cast.importer.wizard.rulespage</code> extension point
24   * element.
25   * 
26   * @author AGH CAST Team
27   */
28  public class ConversionRulesPageInfo implements Comparable<ConversionRulesPageInfo> {
29  
30  	private String id;
31  
32  	private String name;
33  
34  	private String description;
35  
36  	private AbstractConversionRulesSelectionPage page;
37  
38  	/**
39  	 * Constructor.
40  	 * 
41  	 * @param id
42  	 *            extension id
43  	 * @param name
44  	 *            conversion rules page localized name
45  	 * @param description
46  	 *            conversion rules page localized description
47  	 * @param page
48  	 *            conversion rules page instance
49  	 */
50  	public ConversionRulesPageInfo(String id, String name, String description, AbstractConversionRulesSelectionPage page) {
51  		this.id = id;
52  		this.name = name;
53  		this.description = description;
54  		this.page = page;
55  	}
56  
57  	public String getId() {
58  		return id;
59  	}
60  
61  	public String getName() {
62  		return name;
63  	}
64  
65  	public String getDescription() {
66  		return description;
67  	}
68  
69  	public AbstractConversionRulesSelectionPage getPage() {
70  		return page;
71  	}
72  
73  	/**
74  	 * {@inheritDoc}
75  	 * 
76  	 * @see java.lang.Comparable#compareTo(java.lang.Object)
77  	 */
78  	@Override
79  	public int compareTo(ConversionRulesPageInfo that) {
80  		if (this == that) {
81  			return 0;
82  		}
83  		if (that == null) {
84  			return 1;
85  		}
86  		return name.compareTo(that.getName());
87  	}
88  
89  }