Commit bb735aa2 authored by legoc's avatar legoc

Added lineIndex in setForLoopType event

parent 6312b174
...@@ -235,8 +235,8 @@ public abstract class CommandWrapper implements IServerCommand, ICommandBoxEvent ...@@ -235,8 +235,8 @@ public abstract class CommandWrapper implements IServerCommand, ICommandBoxEvent
} }
@Override @Override
public void onSetForLoopType(ForLoopType type) { public void onSetForLoopType(ForLoopType type, int lineIndex) {
commandBoxSyncListener.onSetForLoopType(type); commandBoxSyncListener.onSetForLoopType(type, lineIndex);
} }
@Override @Override
......
...@@ -33,7 +33,7 @@ public interface ICommandBoxSyncEventListener { ...@@ -33,7 +33,7 @@ public interface ICommandBoxSyncEventListener {
void onSetValue(String value); void onSetValue(String value);
void onSetExpression(String value); void onSetExpression(String value);
void onSetForLoopType(ForLoopType type); void onSetForLoopType(ForLoopType type, int lineIndex);
void onSetForLoopValues(int lineIndex, String value); void onSetForLoopValues(int lineIndex, String value);
void onSetForLoopVariableName(int lineIndex, String value); void onSetForLoopVariableName(int lineIndex, String value);
void onSetForLoopStartValue(int lineIndex, double value); void onSetForLoopStartValue(int lineIndex, double value);
......
...@@ -29,7 +29,7 @@ public interface ServerCommandBoxSyncListener { ...@@ -29,7 +29,7 @@ public interface ServerCommandBoxSyncListener {
void onSetPropertyName(String value); void onSetPropertyName(String value);
void onSetValue(String value); void onSetValue(String value);
void onSetExpression(String value); void onSetExpression(String value);
void onSetForLoopType(ForLoopType type); void onSetForLoopType(ForLoopType type, int lineIndex);
void onSetForLoopValues(int lineIndex, String value); void onSetForLoopValues(int lineIndex, String value);
void onSetForLoopVariableName(int lineIndex, String value); void onSetForLoopVariableName(int lineIndex, String value);
void onSetForLoopStartValue(int lineIndex, double value); void onSetForLoopStartValue(int lineIndex, double value);
......
...@@ -151,7 +151,7 @@ public class CommandZoneSyncEventClient { ...@@ -151,7 +151,7 @@ public class CommandZoneSyncEventClient {
Iterator<ICommandBoxSyncEventListener> it = listeners.iterator(); Iterator<ICommandBoxSyncEventListener> it = listeners.iterator();
while (it.hasNext()) { while (it.hasNext()) {
it.next().onSetForLoopType(event.getForLoopType()); it.next().onSetForLoopType(event.getForLoopType(), event.getLineIndex());
} }
} }
} }
......
...@@ -293,7 +293,7 @@ public class CommandZoneSyncEventNotifier { ...@@ -293,7 +293,7 @@ public class CommandZoneSyncEventNotifier {
// Notify only if it is the same client that was the originator of the request. // Notify only if it is the same client that was the originator of the request.
if (request.getClientID() != getClientID()) { if (request.getClientID() != getClientID()) {
CommandZoneRequests.ForLoopType.Type forLoopType = request.getType(); CommandZoneRequests.ForLoopType.Type forLoopType = request.getType();
return new SetForLoopType(request.getCommandBoxID(), (forLoopType == CommandZoneRequests.ForLoopType.Type.VALUES ? ForLoopType.VALUES : ForLoopType.RANGE)); return new SetForLoopType(request.getCommandBoxID(), request.getLineIndex(), (forLoopType == CommandZoneRequests.ForLoopType.Type.VALUES ? ForLoopType.VALUES : ForLoopType.RANGE));
} }
} }
else if (type == CommandZoneRequests.Message.Type.SetVariableName) { else if (type == CommandZoneRequests.Message.Type.SetVariableName) {
......
...@@ -23,15 +23,21 @@ import fr.ill.ics.nscclient.command.CommandZoneAccessor.ForLoopType; ...@@ -23,15 +23,21 @@ import fr.ill.ics.nscclient.command.CommandZoneAccessor.ForLoopType;
public class SetForLoopType extends CommandBoxSyncEvent { public class SetForLoopType extends CommandBoxSyncEvent {
private ForLoopType forLoopType; private ForLoopType forLoopType;
private int lineIndex;
public SetForLoopType(int commandBoxId, ForLoopType forLoopType) { public SetForLoopType(int commandBoxId, int lineIndex, ForLoopType forLoopType) {
super(commandBoxId); super(commandBoxId);
this.forLoopType = forLoopType; this.forLoopType = forLoopType;
this.lineIndex = lineIndex;
} }
public ForLoopType getForLoopType() { public ForLoopType getForLoopType() {
return forLoopType; return forLoopType;
} }
public int getLineIndex() {
return lineIndex;
}
} }
\ No newline at end of file
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