Sferyx LogoSferyx Internet Based Systems
 

HTML EDITOR COMPONENT

User Manual
Oracle Forms
SWT / Eclipse
JavaFX manual
XML features
FAQ
Download
Screenshots
Licensing & Prices

HTML EDITOR APPLET

User Manual
FAQ
Drupal Integration
SAKAI Integration
IBM Lotus Notes
Download
Screenshots
Licensing & Prices

PDF GENERATOR

User Manual
Oracle Forms
Licensing & Prices

EQUATION/MATHML EDITOR

User Manual
FAQ
Download
Screenshots
Licensing & Prices

PDFEXPORT ADD-ON

User Manual
On-line store
Customers
Contacts


Sferyx JSyndrome HTML Editor Component Edition


Custom XML Tags Integration Manual

1. Custom XML tags are supported - how can I use them? 

You can create easily your own grammar specification for handling custom tags or turn on the automatic grammar builder which will inspect the document and create automatically the grammar for you. This can be done the following way:

htmlEditor.setXMLMode(true);

for manual tag handling see question #3 below.

2. How can I provide my own property dialogs for my custom XML tags and associate action with them?

This is illustrated in the example provided in the demo version in the folder examples/custom tags . You can provide your own component which responds to actions and displays custom dialogs. This is fully customizable behavior.
You can consider a code for creating custom components like the example below - you can easily assign any kind of action, dialogs etc. The components created this way will be displayed inside the editor through the registered custom using the method registerEmptyCustomXMLTagComponentRepresentation which can be found in   sferyx.administration.editors.CustomXMLTagsGrammarSpecification, see the example in question #3 below

public class MyCustomEmptyTag extends
sferyx.administration.xmlcomponents.GenericEmptyXMLTagComponent
{

public MyCustomEmptyTag()
{
}

public Component getComponent()
{

Element elem=getElement();
JButton component=new JButton("This is my custom tag: "+elem.getAttributes().getAttribute(StyleConstants.NameAttribute).toString());
component.setUI(new javax.swing.plaf.basic.BasicButtonUI());
component.setOpaque(true);
component.setBackground(Color.yellow);
component.setBorderPainted(false);
component.setForeground(Color.blue);

// We can add listeners here and whatever we want. We can add easily icons etc.
component.setEnabled(true);
component.addActionListener(new MyCustomEmptyTag.MyActionListener());
return component;

}

class MyActionListener implements ActionListener
{

public void actionPerformed(java.awt.event.ActionEvent actionEvent)
{

JOptionPane.showMessageDialog(null,"You clicked on the custom tag!");

}

}

}

 

3. How can I create my own custom XML grammar?

You can manually specify for each tag how to be handled - block, inline or empty tags. Additionally you can manage the rendering of the block and inline tags through style sheets and/or associate custom components and actions to the empty tags.

sferyx.administration.editors.CustomXMLTagsGrammarSpecification.registerCustomXMLTag("my_empty_tag",true); - will register empty tag

sferyx.administration.editors.CustomXMLTagsGrammarSpecification.registerCustomXMLTag("my_custom_block_tag",false);
- will register block tag

sferyx.administration.editors.CustomXMLTagsGrammarSpecification.registerEmptyCustomXMLTagComponentRepresentation
("my_empty_tag","MyCustomEmptyTag");
- will associate the class MyCustomEmptyTag with the <my_emtpy_tag>. Additionally you can add actions to MyCustomEmptyTag component. You can find the entire example in the examples/custom tags folder in the demo version.

sferyx.administration.editors.CustomXMLTagsGrammarSpecification.registerCustomXMLTagRenderingType("my_custom_block_tag",
CustomXMLTagsGrammarSpecification.INLINE_TAG)
- this will cause the <my_custom_block_tag> to be rendered as inline tag while the following method call

CustomXMLTagsGrammarSpecification.setTreatAllBlockTagsAsBlocks(true); will cause all block tags to be rendered automatically as blocks.


4. How can I provide custom rendering for my XML tags?

Custom rendering for block tags can be easily provided through style sheet definition for the relative tag name or html class or id. For empty tags you can provide full components to be used inside the document and also add entirely interactive functionalities with this.

You can define a custom class for rendering of empty tags like this:

sferyx.administration.editors.CustomXMLTagsGrammarSpecification.registerEmptyCustomXMLTagComponentRepresentation
("my_empty_tag","MyCustomEmptyTag");

where my_empty_tag is the tag name and MYCustomEmptyTag is the full classname for the rendering component to be used


Our Services and assistance

All Sferyx products are assured with continuous e-mail support. With the retail products is included in the price 30 days startup support. Additionally, you can purchase annual support subscription tickets from our web store.

Sferyx offers also a wide range of customization services for its products in order to satisfy any customer requirement. We can adapt our products to fit the customer needs and any kind of integration requirements. We execute also express developments, customization under request, development of new features on demand. You can request a quote at sales@sferyx.com or support@sferyx.com indicating your requirements and the terms of delivery.

 

 


Copyright 2002-2009 Sferyx Srl. All rights reserved. Sferyx and the Sferyx logo are registered trademarks of Sferyx Srl. http://www.sferyx.com