/******************************************************************************* | |
* Copyright (c) 2004-2008 Istvan Rath and Daniel Varro | |
* 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: | |
* Istvan Rath - initial API and implementation | |
*******************************************************************************/ | |
package org.eclipse.viatra2.treeeditor.wizard; | |
import java.util.Collection; | |
public class WizardModelContributor implements IWizardModelContributor { | |
String ID; | |
Collection<String> RequiredIDs; | |
Collection<String> ForbiddenIDs; | |
Collection<String> ContainedIDs; | |
String CategoryID; | |
String Name; | |
String Description; | |
String FileVTML; | |
String FileVPML; | |
String PluginID; | |
public WizardModelContributor(String id, Collection<String> rids, Collection<String> fids, | |
Collection<String> cids, String cid, String name, String desc, | |
String fvtml, String fvpml, String pid) | |
{ | |
ID = id; | |
RequiredIDs = rids; | |
ForbiddenIDs = fids; | |
ContainedIDs = cids; | |
CategoryID = cid; | |
Name = name; | |
Description = desc; | |
FileVPML = fvpml; | |
FileVTML = fvtml; | |
PluginID = pid; | |
} | |
public String getID() { | |
return ID; | |
} | |
public Collection<String> getRequiredIDs() { | |
return RequiredIDs; | |
} | |
public Collection<String> getForbiddenIDs() { | |
return ForbiddenIDs; | |
} | |
public Collection<String> getContainedIDs() { | |
return ContainedIDs; | |
} | |
public String getCategoryID() { | |
return CategoryID; | |
} | |
public String getName() { | |
return Name; | |
} | |
public String getDescription() { | |
return Description; | |
} | |
public String getFileVTML() { | |
return FileVTML; | |
} | |
public String getFileVPML() { | |
return FileVPML; | |
} | |
public String getPluginID() { | |
return PluginID; | |
} | |
public int compareTo(Object o) { | |
// sort according to dependency precedence | |
// FIXME: if there are dependency circles, that leads to chaos | |
IWizardModelContributor mc = (IWizardModelContributor)o; | |
// >0: this > mc | |
// 0: this = mc | |
// <0: this < mc | |
if (mc.getRequiredIDs().contains(this.getID())) | |
return -1; | |
if (this.getRequiredIDs().contains(mc.getID())) | |
return +1; | |
return 0; | |
} | |
} |