1 package org.simantics.scl.compiler.commands;
3 import java.util.Collection;
5 public class CommandSessionImportEntry implements Comparable<CommandSessionImportEntry> {
6 public String moduleName;
7 public String localName;
9 public boolean persistent;
10 public boolean hasError;
11 public boolean disabled;
13 public CommandSessionImportEntry(String moduleName, String localName,
15 this.moduleName = moduleName;
16 this.localName = localName;
17 this.persistent = persistent;
20 public CommandSessionImportEntry(String moduleName, String localName) {
21 this.moduleName = moduleName;
22 this.localName = localName;
25 public CommandSessionImportEntry(String moduleName) {
29 public void addTo(Collection<CommandSessionImportEntry> entries) {
30 for(CommandSessionImportEntry entry : entries)
31 if(entry.moduleName.equals(moduleName) && entry.localName.equals(localName)) {
32 entry.persistent |= persistent;
33 entry.disabled &= disabled;
40 public int compareTo(CommandSessionImportEntry o) {
41 int cmp = moduleName.compareTo(o.moduleName);
44 return localName.compareTo(o.localName);
47 public String getStatusString() {
48 StringBuilder b = new StringBuilder();
52 b.append("persistent");
66 b.append("has errors");