Skip to content

Commit

Permalink
Syntax improvements for richtext APIs, e.g. for chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
klehmann committed Jan 5, 2021
1 parent edb75c2 commit 892dd22
Show file tree
Hide file tree
Showing 17 changed files with 577 additions and 438 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,11 @@ public Object call(Session session) throws Exception {
}

//now we create formatted richtext content
RichTextBuilder rtBuilder = note.createRichTextItem("Body");
try {
try (RichTextBuilder rtBuilder = note.createRichTextItem("Body");) {
rtBuilder.addText("Hello World.",
new TextStyle("MyStyle").setAlign(Justify.RIGHT),
new FontStyle().setBold(true));
}
finally {
rtBuilder.close();
}

NotesItem itm = note.getFirstItem("Body");
Assert.assertNotNull(itm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,11 @@ public Object call(Session session) throws Exception {
}

//now we create formatted richtext content
RichTextBuilder rtBuilder = note.createRichTextItem("Body");
try {
try (RichTextBuilder rtBuilder = note.createRichTextItem("Body");) {
rtBuilder.addText("Hello World.",
new TextStyle("MyStyle").setAlign(Justify.RIGHT),
new FontStyle().setBold(true));
}
finally {
rtBuilder.close();
}

NotesItem itm = note.getFirstItem("Body");
Assert.assertNotNull(itm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6430,7 +6430,7 @@ public int getCurrentRecordTotalLength() {
}

@Override
public void copyCurrentRecordTo(ICompoundText ct) {
public void copyCurrentRecordTo(ICompoundText<?> ct) {
if (ct.isRecycled())
throw new NotesError(0, "ICompoundText already recycled");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public void restoreCurrentRecordPosition(RichTextNavPosition pos) {
}

@Override
public void copyCurrentRecordTo(ICompoundText target) {
public void copyCurrentRecordTo(ICompoundText<?> target) {
if (m_currentCDRecord==null)
throw new IllegalStateException("Current CD record is null");

Expand Down
Loading

0 comments on commit 892dd22

Please sign in to comment.