Skip to content

Commit

Permalink
gs-reactor: New Tag GSH2 and css improvements carColorApp
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Lagarrigue committed Aug 19, 2016
1 parent 98d3a9e commit 1522eea
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public GSUserGuide(GSTag parent) {
};
new GSUl(this) {
{
setText("Global Tips");
setText("General Tips");
GSLi li1 = new GSLi(this);
GSLi li2 = new GSLi(this);
GSLi li3 = new GSLi(this);
GSLi li4 = new GSLi(this);
li1.setText("Use \"Add Button\" to add an entry in the cache");
li2.setText("Use the \"Remove Button\" to delete the entry in your cache");
li3.setText("Use \"Save Button\" to persist the cache");
li4.setText("Use \"Cancel Button\" to release the cache");
li1.setText("Click \"Add Button\" to add an entry in the cache");
li2.setText("Click the \"Remove Button\" to delete the entry in your cache");
li3.setText("Click \"Save Button\" to persist the cache");
li4.setText("Click \"Cancel Button\" to release the cache");

}
};
Expand All @@ -88,16 +88,20 @@ public GSUserGuide(GSTag parent) {
};
}
};

new GSButton(this) {
new GSSection(this, FlexDirection.ROW) {
{
setText("User Guide");
addStyleClass("buttonUser");
addStyle("flex", "1/3");
addStyle("justify-content", "center");
new GSButton(this) {
{
setText("User Guide");

bindAction(model -> {
gSection.getProperty(ReactorStatics.DISPLAY, model).setValue("flex");
});
addStyle("flex", "0 1 auto");

bindAction(model -> {
gSection.getProperty(ReactorStatics.DISPLAY, model).setValue("flex");
});
}
};
}
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.genericsystem.reactor.gs.GSSubcellDisplayer.GSSubcellEditor;
import org.genericsystem.reactor.gs.GSSubcellDisplayer.InstanceLinkTitleDisplayer;
import org.genericsystem.reactor.gs.GSSubcellDisplayer.InstanceTitleDisplayer;
import org.genericsystem.reactor.gstag.GSH1;
import org.genericsystem.reactor.gstag.GSH2;
import org.genericsystem.reactor.model.ObservableListExtractor;
import org.genericsystem.reactor.model.StringExtractor;

Expand Down Expand Up @@ -34,7 +34,7 @@ protected void header() {
addStyle("color", "red");
addStyle("justify-content", "center");
addStyle("align-items", "center");
new GSH1(this) {
new GSH2(this) {
{
setStringExtractor(StringExtractor.TYPE_INSTANCE_EXTRACTOR);
bindText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@ public GSHeader(GSTag parent, String string, GSTagConstructor tag1, String strin
if (tag1 != null) {
GSTag leftTag = tag1.build(this);
leftTag.setText(string1);
leftTag.addStyle("flex", "1");
} else {
GSTag leftTag = new GSSection(this, FlexDirection.COLUMN);
leftTag.addStyle("flex", "1");
}
new GenericH1Section(this, string) {
new GenericH2Section(this, string) {
{
addStyle("flex", "3");
addStyle("align-items", "center");
}
};
if (tag2 != null) {
GSTag rightTag = tag2.build(this);
rightTag.addStyle("flex", "1");
rightTag.setText(string2);
rightTag.addStyle("flex", "1");
} else {
GSTag rightTag = new GSSection(this, FlexDirection.COLUMN);
rightTag.addStyle("flex", "1");
Expand Down
17 changes: 10 additions & 7 deletions gs-reactor/src/main/java/org/genericsystem/reactor/gs/GSLogo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

import org.genericsystem.reactor.gstag.GSImg;

public class GSLogo extends GSImg {
public class GSLogo extends GSSection {

public GSLogo(GSTag parent) {
super(parent);
addAttribute("src", "logoTransp.png");
addAttribute("alt", "logo");
addStyle("height", "100%");
addStyle("flex", "0 1 auto");
super(parent, FlexDirection.ROW);
new GSImg(this) {
{
addAttribute("src", "logoTransp.png");
addAttribute("alt", "logo");
addStyle("height", "100%");
addStyle("flex", "0 1 auto");
}
};
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.genericsystem.reactor.HtmlDomNode;
import org.genericsystem.reactor.gstag.GSH1;
import org.genericsystem.reactor.gstag.GSH2;

public class GSSection extends GSTag {
private final FlexDirection direction;
Expand Down Expand Up @@ -61,4 +62,10 @@ public GenericH1Section(GSTag parent, String text) {
super(parent, FlexDirection.ROW, GSH1::new, text);
}
}

public static class GenericH2Section extends GenericRowWrapper {
public GenericH2Section(GSTag parent, String text) {
super(parent, FlexDirection.ROW, GSH2::new, text);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.genericsystem.reactor.gs.GSSubcellDisplayer.GSInstanceSubcellDisplayer;
import org.genericsystem.reactor.gs.GSSubcellDisplayer.LinkTitleDisplayer;
import org.genericsystem.reactor.gstag.GSButton;
import org.genericsystem.reactor.gstag.GSH1;
import org.genericsystem.reactor.gstag.GSH2;
import org.genericsystem.reactor.gstag.GSHyperLink;
import org.genericsystem.reactor.gstag.GSLabel;
import org.genericsystem.reactor.model.GenericModel;
Expand Down Expand Up @@ -41,7 +41,7 @@ protected void titleHeader() {
addStyle("margin-bottom", "1px");
addStyle("color", "red");
addStyle("justify-content", "center");
new GSH1(this) {
new GSH2(this) {
{
setStringExtractor(StringExtractor.MANAGEMENT);
bindText();
Expand Down
26 changes: 26 additions & 0 deletions gs-reactor/src/main/java/org/genericsystem/reactor/gstag/GSH2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.genericsystem.reactor.gstag;

import org.genericsystem.reactor.HtmlDomNode;
import org.genericsystem.reactor.gs.GSTag;

/**
* @author Nicolas Feybesse
*
*/
public class GSH2 extends GSTag {

public GSH2(GSTag parent) {
super(parent, "h2");
}

public GSH2(GSTag parent, String text) {
super(parent, "h2");
setText(text);
}

@Override
protected HtmlDomNode createNode(String parentId) {
return new HtmlDomNode(parentId);
}

}

0 comments on commit 1522eea

Please sign in to comment.