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; ...@@ -30,10 +30,16 @@ import fr.ill.ics.nscclient.dataprovider.ServantDatabase;
public class AtomicCommandWrapper extends CommandWrapper implements Controller { public class AtomicCommandWrapper extends CommandWrapper implements Controller {
private ServerAtomicCommandBox serverAtomicCommandBox; private ServerAtomicCommandBox serverAtomicCommandBox;
private int servantId;
private String type;
private String name;
public AtomicCommandWrapper(ServerAtomicCommandBox serverAtomicCommandBox) { public AtomicCommandWrapper(ServerAtomicCommandBox serverAtomicCommandBox) {
super(serverAtomicCommandBox); super(serverAtomicCommandBox);
this.serverAtomicCommandBox = serverAtomicCommandBox; this.serverAtomicCommandBox = serverAtomicCommandBox;
servantId = CommandDatabase.getInstance().getServantIdForCommand(serverAtomicCommandBox.getCommandID());
type = ServantDatabase.getInstance().getServantType(servantId);
name = ServantDatabase.getInstance().getServantName(servantId);
} }
public void unregister() { public void unregister() {
...@@ -44,13 +50,11 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller { ...@@ -44,13 +50,11 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller {
} }
public String getName() { public String getName() {
int servantId = CommandDatabase.getInstance().getServantIdForCommand(serverAtomicCommandBox.getCommandID()); return name;
return ServantDatabase.getInstance().getServantName(servantId);
} }
public String getType() { public String getType() {
int servantId = CommandDatabase.getInstance().getServantIdForCommand(serverAtomicCommandBox.getCommandID()); return type;
return ServantDatabase.getInstance().getServantType(servantId);
} }
public Set getCommandNames() { public Set getCommandNames() {
...@@ -77,7 +81,7 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller { ...@@ -77,7 +81,7 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller {
} }
public int getServantId() { public int getServantId() {
return CommandDatabase.getInstance().getServantIdForCommand(serverAtomicCommandBox.getCommandID()); return servantId;
} }
public boolean isSettings() { public boolean isSettings() {
......
...@@ -73,6 +73,8 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand ...@@ -73,6 +73,8 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
protected boolean showSettingPropertyMessage = true; protected boolean showSettingPropertyMessage = true;
private String name;
/** /**
* *
* @param id * @param id
...@@ -83,6 +85,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand ...@@ -83,6 +85,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
this.containerId = containerId; this.containerId = containerId;
this.isCommandBox = isCommandBox; this.isCommandBox = isCommandBox;
this.name = PropertyDatabase.getInstance().getPropertyName(id);
maxLength = getDefaultMaxLength(); maxLength = getDefaultMaxLength();
...@@ -206,7 +209,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand ...@@ -206,7 +209,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
} }
public String getName() { 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