Tableoperations
Oxygen general issues.
-
- Posts: 27
- Joined: Tue Nov 17, 2009 10:16 pm
Tableoperations
Post by guna@ebscohost.com »
Hi,
we want to create xhtml table, where user needs ability to set
1) table Background color
2) row background color
3) Table header alignment (both horizontal and vertical)
4) Table row alignment(both horizontal and vertical)
5) cell padding
6) cell spacing
7) indentation
can you guide us , how to implement this functionality. as well us do provide us with information
we want to create xhtml table, where user needs ability to set
1) table Background color
2) row background color
3) Table header alignment (both horizontal and vertical)
4) Table row alignment(both horizontal and vertical)
5) cell padding
6) cell spacing
7) indentation
can you guide us , how to implement this functionality. as well us do provide us with information
-
- Posts: 9496
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Tableoperations
Hi,
You can create a new Author Operation which presents the user with a Java dialog in which he can choose all these settings.
After presenting the dialog you can use the information provided by the user to create an XML fragment with the table which will get inserted.
Then insert the XML fragment using the Author Document Controller.
As an example you can look at the ro.sync.ecss.extensions.docbook.table.InsertTableOperation operation.
The operation should look like:
Regards,
Radu
You can create a new Author Operation which presents the user with a Java dialog in which he can choose all these settings.
After presenting the dialog you can use the information provided by the user to create an XML fragment with the table which will get inserted.
Then insert the XML fragment using the Author Document Controller.
As an example you can look at the ro.sync.ecss.extensions.docbook.table.InsertTableOperation operation.
The operation should look like:
Code: Select all
/**
* @see ro.sync.ecss.extensions.api.AuthorOperation#doOperation(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)
*/
public void doOperation(AuthorAccess authorAccess, ArgumentsMap args)
throws IllegalArgumentException, AuthorOperationException {
// Object containing all information collected by the dialog from the user
HTMLTableInfo tableInfo = showTableInformationJDialogToUserAndCollectInformation();
if (tableInfo != null) {
StringBuffer tableXMLFragment = new StringBuffer();
tableXMLFragment.append("<table");
tableXMLFragment.append(" bgcolor='").append(tableInfo.bgColor).append("'");
tableXMLFragment.append(">");
tableXMLFragment.append("<caption>").append(tableInfo.title).append("</caption>");
for (int i = 0; i < tableInfo.numberOfRows; i++) {
tableXMLFragment.append("<tr");
tableXMLFragment.append(" bgcolor='").append(tableInfo.rowBgColor).append("'");
tableXMLFragment.append(" align='").append(tableInfo.rowAlign).append("'");
tableXMLFragment.append(">");
for (int j = 0; j < tableInfo.numberOfCells; j++) {
tableXMLFragment.append("<td/>");
}
tableXMLFragment.append("</tr>");
}
tableXMLFragment.append("</table>");
// Insert the table
authorAccess.getDocumentController().insertXMLFragment(
tableXMLFragment.toString(),
authorAccess.getEditorAccess().getCaretOffset());
} else {
// User canceled the operation
}
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service