Skip to content

Commit

Permalink
gs-reactor, gs-carcolor: Simplify annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
fducroquet committed Oct 12, 2016
1 parent 7231d15 commit bd04f29
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 116 deletions.
Expand Up @@ -12,8 +12,6 @@ public class GSUserGuide extends GSDiv {

public GSUserGuide(Tag parent) {
super(parent, FlexDirection.COLUMN);
addStyle("flex-direction", "column");
addStyle("flex-wrap", "nowrap");
addStyle("justify-content", "center");

GSDiv gSection = new GSDiv(this, FlexDirection.COLUMN) {
Expand Down
Expand Up @@ -9,42 +9,27 @@
import org.genericsystem.reactor.gscomponents.GSDiv;
import org.genericsystem.reactor.gscomponents3.GSComposite.Content;
import org.genericsystem.reactor.gscomponents3.GSComposite.Footer;
import org.genericsystem.reactor.gscomponents3.GSComposite.Footer.FooterLabel;
import org.genericsystem.reactor.gscomponents3.GSComposite.Header;
import org.genericsystem.reactor.gscomponents3.GSComposite.Header.HeaderLabel;

@Style(name = "flex", value = "1 1 0%")
@Style(name = "overflow", value = "hidden")
@Style(path = GSDiv.class, name = "flex", value = "1 1 0%")
@Style(path = GSDiv.class, name = "overflow", value = "hidden")
@ReactorDependencies({ GSComposite.Content.class })
@FlexDirectionStyle(path = Content.class, value = FlexDirection.COLUMN)
@FlexDirectionStyle(path = Header.class, value = FlexDirection.COLUMN)
@FlexDirectionStyle(path = Footer.class, value = FlexDirection.COLUMN)
@ReactorDependencies(path = Content.class, value = Content.ContentLabel.class)
@ReactorDependencies(path = Header.class, value = HeaderLabel.class)
@ReactorDependencies(path = Footer.class, value = FooterLabel.class)
@ReactorDependencies(path = Content.class, value = GSLabelDisplayer.class)
@ReactorDependencies(path = Header.class, value = GSLabelDisplayer.class)
@ReactorDependencies(path = Footer.class, value = GSLabelDisplayer.class)
public abstract class GSComposite extends GSDiv {

@Style(name = "flex", value = "1 1 0%")
@Style(name = "overflow", value = "hidden")
public static class Content extends GSDiv {
public static class ContentLabel extends GSLabelDisplayer {

}
}

@Style(name = "flex", value = "1 1 0%")
@Style(name = "overflow", value = "hidden")
public static class Header extends GSDiv {
public static class HeaderLabel extends GSLabelDisplayer {

}
}

@Style(name = "flex", value = "1 1 0%")
@Style(name = "overflow", value = "hidden")
public static class Footer extends GSDiv {
public static class FooterLabel extends GSLabelDisplayer {

}
}
}
Expand Up @@ -14,7 +14,6 @@
import org.genericsystem.reactor.annotations.Select;
import org.genericsystem.reactor.annotations.SetText;
import org.genericsystem.reactor.annotations.Style;
import org.genericsystem.reactor.annotations.Style.ReverseFlexDirection;
import org.genericsystem.reactor.gscomponents.GSInputTextWithConversion;
import org.genericsystem.reactor.gscomponents2.GSInstanceBuilder.BuilderCell.BooleanHolderBuilder.CheckboxContainerBuildDiv.BooleanHolderBuilderInput;
import org.genericsystem.reactor.gscomponents2.GSInstanceBuilder.BuilderCell.HolderBuilder.HolderBuilderInput;
Expand All @@ -38,13 +37,12 @@
import javafx.beans.binding.Bindings;
import javafx.beans.value.ObservableValue;

@ReverseFlexDirection
@Style(path = GSInputTextWithConversion.class, name = "flex", value = "1")
@Style(path = GSInputTextWithConversion.class, name = "width", value = "100%")
@ReactorDependencies({ GSInputTextWithConversion.class, Content.class, ButtonDiv.class })
@ReactorDependencies(path = Content.class, value = { GSHolderBuilder.class, GSMultiCheckboxBuilder.class })
@ReactorDependencies(path = ButtonDiv.class, value = AddButton.class)
@ForEach(path = { Content.class }, value = ObservableListExtractor.ATTRIBUTES_OF_TYPE.class)
@ForEach(path = Content.class, value = ObservableListExtractor.ATTRIBUTES_OF_TYPE.class)
@Select(path = { Content.class, GSHolderBuilder.class }, value = NON_MULTICHECKBOX_SELECTOR_RELATION.class)
@Select(path = { Content.class, GSMultiCheckbox.class }, value = MULTICHECKBOX_SELECTOR_RELATION.class)
public class InstanceBuilder extends GSComposite implements GSBuilderDefaults {
Expand Down
Expand Up @@ -65,20 +65,15 @@
@Style(path = HeaderRow.class, name = "flex", value = "0.3")
@Style(path = ContentRow.class, name = "flex", value = "1")
@Style(path = HeaderRow.class, name = "color", value = "white")
@GenericValueBackgroundColor(path = { HeaderRow.class, GSValueComponents.class, Content.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { HeaderRow.class, GSValueComponents.class, Header.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { HeaderRow.class, Content.class, GSValueComponents.class, Content.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { HeaderRow.class, Content.class, GSValueComponents.class, Header.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { HeaderRow.class, GSValueComponents.class, GSDiv.class }, value = "#ea0084")
@ReactorDependencies({ HeaderRow.class, ContentRow.class })
@ReactorDependencies(path = HeaderRow.class, value = { GSValueComponents.class, Content.class })
@ReactorDependencies(path = { HeaderRow.class, Content.class }, value = GSValueComponents.class)
@ReactorDependencies(path = HeaderRow.class, value = { GSValueComponents.class, GSValueComponents.class })
@ReactorDependencies(path = ContentRow.class, value = { GSValueComponentsEditor.class, AttributeContent.class })
@ReactorDependencies(path = { ContentRow.class, GSValueComponentsEditor.class }, value = { Header.class, Content.class })
@ReactorDependencies(path = { ContentRow.class, Content.class }, value = { GSHoldersEditor.class, GSMultiCheckbox.class })
@ForEach(path = { HeaderRow.class, Content.class }, value = ObservableListExtractor.ATTRIBUTES_OF_INSTANCES.class)
@ForEach(path = { HeaderRow.class, Content.class, GSValueComponents.class, Content.class }, value = ObservableListExtractor.OTHER_COMPONENTS_2.class)
@ForEach(path = { ContentRow.class, GSValueComponents.class, Content.class }, value = ObservableListExtractor.OTHER_COMPONENTS_2.class)
@Select(path = { HeaderRow.class, GSValueComponents.class }, value = TYPE_SELECTOR.class)
@ForEach(path = { HeaderRow.class, GSValueComponents.class }, pos = { 0, 1 }, value = ObservableListExtractor.ATTRIBUTES_OF_INSTANCES.class)
@ForEach(path = { GSComposite.class, GSValueComponents.class, Content.class }, value = ObservableListExtractor.OTHER_COMPONENTS_2.class)
@Select(path = { HeaderRow.class, GSValueComponents.class }, pos = { 0, 0 }, value = TYPE_SELECTOR.class)
public class InstanceEditor extends Table implements SelectionDefaults {

@FlexDirectionStyle(FlexDirection.COLUMN)
Expand Down
Expand Up @@ -32,25 +32,20 @@
import org.genericsystem.reactor.model.ObservableListExtractor;
import org.genericsystem.reactor.model.ObservableValueSelector.TYPE_SELECTOR;

@Style(path = { HeaderRow.class, GSValueComponents.class }, name = "flex", value = "0.3")
@Style(path = { ContentRow.class, GSValueComponents.class }, name = "flex", value = "0.3")
@Style(path = ContentRow.class, name = "flex", value = "1")
@Style(path = { HeaderRow.class, GSValueComponents.class }, name = "color", value = "white")
@Style(path = { ContentRow.class, GSValueComponents.class }, name = "color", value = "white")
@GenericValueBackgroundColor(path = { HeaderRow.class, GSValueComponents.class, Content.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { HeaderRow.class, GSValueComponents.class, Header.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { ContentRow.class, GSValueComponents.class, Content.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { ContentRow.class, GSValueComponents.class, Header.class }, value = "#ea0084")
@Style(path = { GSComposite.class, GSValueComponents.class }, pos = { 0, 0 }, name = "flex", value = "0.3")
@Style(path = { GSComposite.class, GSValueComponents.class }, pos = { 1, 0 }, name = "flex", value = "0.3")
@Style(path = { GSComposite.class, GSValueComponents.class }, name = "color", value = "white")
@Style(path = { GSComposite.class, StepNavigator.class }, name = "flex", value = "")
@GenericValueBackgroundColor(path = { GSComposite.class, GSValueComponents.class, GSDiv.class }, value = "#ea0084")
@ReactorDependencies({ HeaderRow.class, ContentRow.class })
@ReactorDependencies(path = HeaderRow.class, value = { GSValueComponents.class, Content.class, StepNavigator.class })
@ReactorDependencies(path = { HeaderRow.class, Content.class }, value = GSValueComponentsEditor.class)
@ReactorDependencies(path = HeaderRow.class, value = { GSValueComponents.class, GSValueComponentsEditor.class, StepNavigator.class })
@ReactorDependencies(path = ContentRow.class, value = { GSValueComponents.class, AttributeContent.class, StepNavigator.class })
@ReactorDependencies(path = { ContentRow.class, Content.class }, value = { GSHoldersEditor.class, GSMultiCheckbox.class })
@ReactorDependencies(path = { HeaderRow.class, Content.class, GSValueComponentsEditor.class }, value = { Header.class, Content.class })
@ReactorDependencies(path = { HeaderRow.class, GSValueComponentsEditor.class }, value = { Header.class, Content.class })
@ForEach(path = ContentRow.class, value = ObservableListExtractor.ATTRIBUTES_OF_INSTANCES.class)
@ForEach(path = { ContentRow.class, AttributeContent.class }, value = ObservableListExtractor.NO_FOR_EACH.class)
@ForEach(path = { ContentRow.class, GSValueComponents.class, Content.class }, value = ObservableListExtractor.OTHER_COMPONENTS_2.class)
@Select(path = { HeaderRow.class, GSValueComponents.class }, value = TYPE_SELECTOR.class)
@Select(path = { HeaderRow.class, GSValueComponents.class }, pos = { 0, 0 }, value = TYPE_SELECTOR.class)
@Stepper(switchClass = ContentRow.class, headerClass = HeaderRow.class)
public class InstanceStepEditor extends Table implements SelectionDefaults, StepperDefaults {

Expand Down
Expand Up @@ -4,6 +4,7 @@

import org.genericsystem.reactor.htmltag.HtmlButton;
import org.genericsystem.reactor.htmltag.HtmlHyperLink;
import org.genericsystem.reactor.htmltag.HtmlLabel.GSLabelDisplayer;

import org.genericsystem.reactor.annotations.BindAction;
import org.genericsystem.reactor.annotations.BindSelection;
Expand All @@ -21,7 +22,6 @@
import org.genericsystem.reactor.gscomponents.GSDiv;
import org.genericsystem.reactor.gscomponents3.GSComposite.Content;
import org.genericsystem.reactor.gscomponents3.GSComposite.Header;
import org.genericsystem.reactor.gscomponents3.GSComposite.Header.HeaderLabel;
import org.genericsystem.reactor.gscomponents3.InstancesTable.ButtonDiv;
import org.genericsystem.reactor.gscomponents3.InstancesTable.GSHolders;
import org.genericsystem.reactor.gscomponents3.InstancesTable.GSValueComponents;
Expand All @@ -35,21 +35,17 @@
import org.genericsystem.reactor.model.ObservableValueSelector;

@BindSelection(ContentRow.class)
@GenericValueBackgroundColor(path = { HeaderRow.class, GSValueComponents.class, GSDiv.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { ContentRow.class, GSValueComponents.class, Header.class }, value = "#3393ff")
@Style(path = HeaderRow.class, name = "color", value = "white")
@GenericValueBackgroundColor(path = { HeaderRow.class, GSValueComponents.class, Content.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { HeaderRow.class, GSValueComponents.class, Header.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { HeaderRow.class, Content.class, GSValueComponents.class, Content.class }, value = "#ea0084")
@GenericValueBackgroundColor(path = { HeaderRow.class, Content.class, GSValueComponents.class, Header.class }, value = "#ea0084")
@Style(path = { ContentRow.class, GSValueComponents.class, Header.class, InstanceNameLink.class }, name = "color", value = "white")
@GenericValueBackgroundColor(path = { ContentRow.class, GSValueComponents.class, Header.class }, value = "#3393ff")
@Style(path = { ContentRow.class, GSValueComponents.class, Header.class }, name = "align-items", value = "flex-start")
@ReactorDependencies({ HeaderRow.class, InstanceBuilder.class, ContentRow.class })
@ReactorDependencies(path = HeaderRow.class, value = { GSValueComponents.class, Content.class, ButtonDiv.class })
@ReactorDependencies(path = { HeaderRow.class, Content.class }, value = GSValueComponents.class)
@ReactorDependencies(path = HeaderRow.class, value = { GSValueComponents.class, GSValueComponents.class, ButtonDiv.class })
@ReactorDependencies(path = ContentRow.class, value = { GSValueComponents.class, GSHolders.class, ButtonDiv.class })
@ReactorDependencies(path = { ContentRow.class, GSValueComponents.class, Header.class }, value = InstanceNameLink.class)
@ReactorDependencies(path = { ContentRow.class, ButtonDiv.class }, value = RemoveButton.class)
@ForEach(path = { HeaderRow.class, Content.class }, value = ObservableListExtractor.ATTRIBUTES_OF_TYPE.class)
@ForEach(path = { HeaderRow.class, GSValueComponents.class }, pos = { 0, 1 }, value = ObservableListExtractor.ATTRIBUTES_OF_TYPE.class)
@ForEach(path = ContentRow.class, value = ObservableListExtractor.SUBINSTANCES.class)
@ForEach(path = { ContentRow.class, GSHolders.class }, value = ObservableListExtractor.ATTRIBUTES_OF_INSTANCES.class)
@ForEach(path = { ContentRow.class, GSValueComponents.class, Content.class }, value = ObservableListExtractor.OTHER_COMPONENTS_2.class)
Expand All @@ -61,28 +57,23 @@ public static class HorizontalInstancesTable extends InstancesTable {

@GenericValueBackgroundColor(path = { GSValueComponents.class, Content.class }, value = "#e5ed00")
@ReactorDependencies(value = GSValueComponents.class)
@ReactorDependencies(path = { GSValueComponents.class, Header.class }, value = { HeaderLabel.class, GSCheckBoxDisplayer.class })
@ReactorDependencies(path = { GSValueComponents.class, Header.class }, value = { GSLabelDisplayer.class, GSCheckBoxDisplayer.class })
@ForEach(path = GSValueComponents.class, value = ObservableListExtractor.HOLDERS.class)
@ForEach(path = { GSValueComponents.class, Content.class }, value = ObservableListExtractor.OTHER_COMPONENTS_2.class)
@Select(path = { GSValueComponents.class, Header.class, HeaderLabel.class }, value = ObservableValueSelector.LABEL_DISPLAYER.class)
@Select(path = { GSValueComponents.class, Header.class, GSLabelDisplayer.class }, value = ObservableValueSelector.LABEL_DISPLAYER.class)
@Select(path = { GSValueComponents.class, Header.class, GSCheckBoxEditor.class }, value = ObservableValueSelector.CHECK_BOX_DISPLAYER.class)
public static class GSHolders extends GSComposite {
}

@FlexDirectionStyle(FlexDirection.ROW)
@Style(path = Content.class, name = "background-color", value = "#e5ed00")
@Style(path = Header.class, name = "background-color", value = "#e5ed00")
@Style(path = Header.class, name = "justify-content", value = "center")
@Style(path = Header.class, name = "align-items", value = "center")
@Style(path = Content.class, name = "justify-content", value = "center")
@Style(path = Content.class, name = "align-items", value = "center")
@Style(path = GSDiv.class, name = "background-color", value = "#e5ed00")
@Style(path = GSDiv.class, name = "justify-content", value = "center")
@Style(path = GSDiv.class, name = "align-items", value = "center")
@Style(path = GSDiv.class, name = "margin-right", value = "1px")
@Style(path = GSDiv.class, name = "margin-bottom", value = "1px")
@ForEach(path = Content.class, value = ObservableListExtractor.OTHER_COMPONENTS_1.class)
@Select(path = Header.class, value = ObservableValueSelector.STRICT_ATTRIBUTE_SELECTOR.class)
@ReactorDependencies({ Header.class, Content.class })
@Style(path = Header.class, name = "margin-right", value = "1px")
@Style(path = Header.class, name = "margin-bottom", value = "1px")
@Style(path = Content.class, name = "margin-right", value = "1px")
@Style(path = Content.class, name = "margin-bottom", value = "1px")
public static class GSValueComponents extends GSComposite {
}

Expand Down
Expand Up @@ -16,16 +16,16 @@

import javafx.beans.binding.Bindings;

@StyleClass("modal")
@ReactorDependencies(GSDiv.class)
@ReactorDependencies(path = GSDiv.class, value = HtmlHyperLink.class)
@Style(path = GSDiv.class, name = "max-width", value = "40%")
@StyleClass("modal")
@StyleClass(path = GSDiv.class, value = "modal-content")
@StyleClass(path = { GSDiv.class, HtmlHyperLink.class }, value = "close")
@Style(path = GSDiv.class, name = "max-width", value = "40%")
@Style(path = GSDiv.class, name = "padding", value = "10px")
@Style(path = GSDiv.class, name = "border-radius", value = "10px")
@Style(path = GSDiv.class, name = "background-color", value = "white")
@SelectModel(path = { GSDiv.class, GSDiv.class }, value = SELECTION_SELECTOR.class)
@StyleClass(path = { GSDiv.class, HtmlHyperLink.class }, value = "close")
@SetText(path = { GSDiv.class, HtmlHyperLink.class }, value = "×")
@BindAction(path = { GSDiv.class, HtmlHyperLink.class }, value = RESET_SELECTION.class)
public class Modal extends GSDiv implements SelectionDefaults {
Expand Down

0 comments on commit bd04f29

Please sign in to comment.