Skip to content

Commit a42f06b

Browse files
committed
Merge branch 'develop'
2 parents 3f9cf06 + a847612 commit a42f06b

File tree

6 files changed

+49
-6
lines changed

6 files changed

+49
-6
lines changed

docgen/parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"title" : "Venus (Fugerit Document Generation Framework)",
33
"name": "Venus",
4-
"version" : "0.5.7",
5-
"date" : "09/12/2022",
4+
"version" : "0.5.8",
5+
"date" : "10/12/2022",
66
"organization" : {
77
"name" : "Fugerit Org",
88
"url" : "https://www.fugerit.org"

docgen/release-notes.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
0.5.7 (2022-12-09)
1+
0.5.8 (2022-12-10)
2+
------------------
3+
+ Added support for border width in simpletable module
4+
5+
0.5.7 (2022-12-09)
26
------------------
37
+ Updated fj-core version to 0.8.4
48
+ Updated fj-bom version to 0.2.3

fj-doc-lib-simpletable/src/main/java/org/fugerit/java/doc/lib/simpletable/model/SimpleCell.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
public class SimpleCell {
44

5+
public static final int BORDER_WIDTH_UNSET = -1;
6+
57
private String content;
8+
9+
private int borderWidth;
610

711
public String getContent() {
812
return content;
@@ -12,9 +16,24 @@ public void setContent(String content) {
1216
this.content = content;
1317
}
1418

19+
public int getBorderWidth() {
20+
return borderWidth;
21+
}
22+
23+
public void setBorderWidth(int borderWidth) {
24+
this.borderWidth = borderWidth;
25+
}
26+
1527
public SimpleCell(String content) {
1628
super();
1729
this.content = content;
30+
this.borderWidth = BORDER_WIDTH_UNSET;
31+
}
32+
33+
public SimpleCell(String content, int borderWidth) {
34+
super();
35+
this.content = content;
36+
this.borderWidth = borderWidth;
1837
}
1938

2039
}

fj-doc-lib-simpletable/src/main/java/org/fugerit/java/doc/lib/simpletable/model/SimpleTable.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ public class SimpleTable {
99

1010
public static final String ATT_NAME = "simpleTableModel";
1111

12+
public static final String DEFAULT_SHEET_NAME = "Table";
13+
14+
public static final int DEFAULT_BORDER_WIDTH = 0;
15+
1216
private String columns;
1317

1418
private String sheetName;
1519

1620
private String colwidths;
21+
22+
private int defaultBorderWidth;
1723

1824
private List<SimpleRow> rows;
1925

@@ -32,11 +38,17 @@ public SimpleTable( String colwidths ) {
3238
this.rows = new ArrayList<SimpleRow>();
3339
this.columns = String.valueOf( colwidths.split( ";" ).length );
3440
this.colwidths = colwidths;
35-
this.sheetName = "decodifica";
41+
this.sheetName = DEFAULT_SHEET_NAME;
42+
this.defaultBorderWidth = DEFAULT_BORDER_WIDTH;
3643
}
3744

3845
public void addRow( SimpleRow row ) {
3946
this.getRows().add( row );
47+
for ( SimpleCell cell : row.getCells() ) {
48+
if ( cell.getBorderWidth() == SimpleCell.BORDER_WIDTH_UNSET ) {
49+
cell.setBorderWidth( this.defaultBorderWidth );
50+
}
51+
}
4052
}
4153

4254
public String getColumns() {
@@ -55,5 +67,12 @@ public void setSheetName(String sheetName) {
5567
this.sheetName = sheetName;
5668
}
5769

58-
70+
public int getDefaultBorderWidth() {
71+
return defaultBorderWidth;
72+
}
73+
74+
public void setDefaultBorderWidth(int defaultBorderWidth) {
75+
this.defaultBorderWidth = defaultBorderWidth;
76+
}
77+
5978
}

fj-doc-lib-simpletable/src/main/resources/fj_doc_lib_simpletable/template/simple_table.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<#list simpleTableModel.rows as simpleRow>
2121
<row header="${simpleRow.head}">
2222
<#list simpleRow.cells as simpleCell>
23-
<cell <#if (simpleRow.head == 'true') > align="center" </#if> border-width="0"><para <#if (simpleRow.head == 'true') > style="bold" </#if> ><#if (simpleCell.content)??>${simpleCell.content}</#if></para></cell>
23+
<cell <#if (simpleRow.head == 'true') > align="center" </#if> border-width="${simpleCell.borderWidth}"><para <#if (simpleRow.head == 'true') > style="bold" </#if> ><#if (simpleCell.content)??>${simpleCell.content}</#if></para></cell>
2424
</#list>
2525
</row>
2626
</#list>

fj-doc-sample/src/test/java/test/org/fugerit/java/doc/sample/simpletable/TestSimpleTable.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public void init() throws ConfigException {
3939
@Test
4040
public void testSimpleTable01() {
4141
SimpleTable simpleTableModel = SimpleTableFacade.newTable( 30, 30, 40 );
42+
simpleTableModel.setDefaultBorderWidth( 1 );
4243
SimpleRow headerRow = new SimpleRow( BooleanUtils.BOOLEAN_TRUE );
4344
headerRow.addCell( "Name" );
4445
headerRow.addCell( "Surname" );

0 commit comments

Comments
 (0)