Commit 70661716 authored by helene ortiz's avatar helene ortiz
Browse files

No commit message

No commit message
parent d0b8a191
......@@ -30,10 +30,16 @@ import fr.ill.ics.nscclient.dataprovider.ServantDatabase;
public class AtomicCommandWrapper extends CommandWrapper implements Controller {
private ServerAtomicCommandBox serverAtomicCommandBox;
private int servantId;
private String type;
private String name;
public AtomicCommandWrapper(ServerAtomicCommandBox serverAtomicCommandBox) {
super(serverAtomicCommandBox);
this.serverAtomicCommandBox = serverAtomicCommandBox;
servantId = CommandDatabase.getInstance().getServantIdForCommand(serverAtomicCommandBox.getCommandID());
type = ServantDatabase.getInstance().getServantType(servantId);
name = ServantDatabase.getInstance().getServantName(servantId);
}
public void unregister() {
......@@ -44,13 +50,11 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller {
}
public String getName() {
int servantId = CommandDatabase.getInstance().getServantIdForCommand(serverAtomicCommandBox.getCommandID());
return ServantDatabase.getInstance().getServantName(servantId);
return name;
}
public String getType() {
int servantId = CommandDatabase.getInstance().getServantIdForCommand(serverAtomicCommandBox.getCommandID());
return ServantDatabase.getInstance().getServantType(servantId);
return type;
}
public Set getCommandNames() {
......@@ -77,7 +81,7 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller {
}
public int getServantId() {
return CommandDatabase.getInstance().getServantIdForCommand(serverAtomicCommandBox.getCommandID());
return servantId;
}
public boolean isSettings() {
......
......@@ -73,6 +73,8 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
protected boolean showSettingPropertyMessage = true;
private String name;
/**
*
* @param id
......@@ -83,6 +85,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
this.containerId = containerId;
this.isCommandBox = isCommandBox;
this.name = PropertyDatabase.getInstance().getPropertyName(id);
maxLength = getDefaultMaxLength();
......@@ -206,7 +209,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
}
public String getName() {
return PropertyDatabase.getInstance().getPropertyName(id);
return name;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment