package org.genericsystem.reactor.gscomponents;

import org.genericsystem.reactor.annotations.BindAction;
import org.genericsystem.reactor.annotations.Children;
import org.genericsystem.reactor.annotations.SetText;
import org.genericsystem.reactor.annotations.Stepper;
import org.genericsystem.reactor.annotations.Style;
import org.genericsystem.reactor.annotations.Style.FlexDirectionStyle;
import org.genericsystem.reactor.annotations.Style.ReverseFlexDirection;
import org.genericsystem.reactor.context.ContextAction.NEXT;
import org.genericsystem.reactor.context.ContextAction.PREVIOUS;
import org.genericsystem.reactor.gscomponents.HtmlTag.HtmlHyperLink;
import org.genericsystem.reactor.gscomponents.InstanceEditor.AttributeContent;
import org.genericsystem.reactor.gscomponents.InstanceEditor.AttributeEdition;
import org.genericsystem.reactor.gscomponents.InstanceEditor.InstanceName;
import org.genericsystem.reactor.gscomponents.InstanceEditor.ValueComponentsEditor;
import org.genericsystem.reactor.gscomponents.InstanceStepEditor.StepNavigator;
import org.genericsystem.reactor.gscomponents.InstancesTable.ValueComponents;

@Style(path = { Composite.class, StepNavigator.class }, name = "flex", value = "")
@Children(path = InstanceName.class, value = { ValueComponents.class, ValueComponentsEditor.class, StepNavigator.class })
@Children(path = AttributeEdition.class, value = { ValueComponents.class, AttributeContent.class, StepNavigator.class })
@Stepper(switchClass = AttributeEdition.class, headerClass = InstanceName.class)
public class InstanceStepEditor extends InstanceEditor {

	@FlexDirectionStyle(FlexDirection.ROW)
	public static class HorizontalInstanceStepEditor extends InstanceStepEditor {

	}

	@Children({ PrevLink.class, NextLink.class })
	@Style(name = "justify-content", value = "space-between")
	@ReverseFlexDirection
	public static class StepNavigator extends FlexDiv {
	}

	@SetText("<")
	@BindAction(PREVIOUS.class)
	public static class PrevLink extends HtmlHyperLink {
	}

	@SetText(">")
	@BindAction(NEXT.class)
	public static class NextLink extends HtmlHyperLink {
	}

}

@@ -144,24 +144,24 @@
 tations.
-Children
+BindText
 ;%0Aimport
@@ -199,23 +199,24 @@
 tations.
-SetText
+Children
 ;%0Aimport
@@ -258,19 +258,16 @@
 ons.Step
-per
 ;%0Aimport
@@ -493,34 +493,26 @@
 tor.
-context.ContextAction.NEXT
+annotations.Switch
 ;%0Aim
@@ -546,38 +546,28 @@
 tor.
-context.ContextAction.PREVIOUS
+annotations.Switcher
 ;%0Aim
@@ -1441,79 +1441,160 @@
 )%0A@S
-tepper(switchClass = AttributeEdition.class, headerClass = InstanceName
+witcher(InstanceName.class)%0A@Step(path = InstanceName.class, next = AttributeEdition.class)%0A@Step(path = AttributeEdition.class, next = AttributeEdition
 .cla
@@ -1971,146 +1971,361 @@
 %0A%0A%09@
-SetText(%22%3C%22)%0A%09@BindAction(PREVIOUS.class)%0A%09public static class PrevLink extends HtmlHyperLink %7B%0A%09%7D%0A%0A%09@SetText(%22%3E%22)%0A%09@BindAction(NEXT.class
+BindAction(Controller.PrevAction.class)%0A%09@BindText(Controller.PrevTextBinding.class)%0A%09@Switch(Controller.PrevSwitcher.class)%0A%09public static class PrevLink extends HtmlHyperLink %7B%0A%09%7D%0A%0A%09@BindAction(Controller.NextAction.class)%0A%09@BindText(Controller.NextTextBinding.class)%0A%09@Switch(Controller.NextSwitcher.class)%0A%09@Style(name = %22margin-top%22, value = %22auto%22
 )%0A%09p
@@ -2379,11 +2379,10 @@
 nk %7B%0A%09%7D%0A
-%0A
 %7D%0A

Use @Switcher rather than @Stepper in InstanceStepEditor