1.
Entirely new package sferyx.javascript.engine which emulates
a generic
javascript access to all document elements. (Component
Edition Enterprise only)
This will
work both on Visual editor and Preivew automatically reflecting
the state of the editor.
Now you
can easily access all document and form elements in a javascript
like manner.
Example
on accessing form elements:
JavaScriptEmulatorEngine jsEngine=new
JavaScriptEmulatorEngine(hTMLEditor1);
DocumentElement[]
elements=jsEngine.getDocument().forms[0].elements;
for(int i=0;i<elements.length;i++)
{
System.out.println("------Element Start---------");
System.out.print(elements[i]);
System.out.println("------Element End---------");
}
To access
easily the attributes as Strings you can now use directly
element.getAttributes() or element.getAttribute(attributeName)
Example on referencing the document elements by ID
JavaScriptEmulatorEngine jsEngine=new
JavaScriptEmulatorEngine(hTMLEditor1);
DocumentElement element=jsEngine.getDocument().getElementById("3246");
System.out.println("------Element
Start---------");
System.out.print(element);
System.out.println("------Element End---------");
Example
on referencing the document elements by ID and adding Mouse
listener to it.
JavaScriptEmulatorEngine jsEngine=new
JavaScriptEmulatorEngine(hTMLEditor1);
DocumentElement element=jsEngine.getDocument().getElementById("3246");
JComponent
component=SferyxUtilities.getJavaFormItemComponent(element,
hTMLEditor1);
System.out.println("Adding Mouse Listener to :"+component);
component.addMouseListener(this);
Example
on referencing the document elements by Tag Name
JavaScriptEmulatorEngine jsEngine=new
JavaScriptEmulatorEngine(hTMLEditor1);
DocumentElement[] elements=jsEngine.getDocument().getElementsByTagName("INPUT");
for(int i=0;i<elements.length;i++)
{
System.out.println("------Element Start---------");
System.out.print(elements[i]);
System.out.println("------Element End---------");
}
@See
ReferencingDocumentElements.java example for major details.
2. New utilitiy methods added in the SferyxUtility package
which eases accessing components through the document elements.
3. Fixes over the numbered/bulleted lists handling and deletion
etc.
4. Now Source code pane will also report document events
through addDocumentListener
5. Improvements over the paragraph styles: now styles
are preserved over different paragraphs when typing.
6. New examples included in the examples folder.
7. htmlEditor.setBrowsingInPreviewEnabled(true); -
(Component Edition Enterprise
only) will enable browsing in the preview mode.
Using this functionality the editor can be used
also like a browser.
8. boolean isBrowsingInPreviewEnabled() - returns the
state of the browsing features (Component
Edition Enterprise only)
9. htmlEditor.setVisualEditorFollowsPreview(true);
- will enable the visual editor to reflect changes in the preview.
Otherwise the initial page will be preserved. (Component
Edition Enterprise only)
10. boolean isVisualEditorFollowsPreview(); - returns
the state of the visual editor and the browsing (Component
Edition Enterprise only)
11. Preview mode only - new method: void setPreviewModeOnly(boolean
mode); - (Component Edition
Enterprise only) sets the editor in preview
mode only and defacto turns it in a browser component
12. htmlEditor.addFormElementsMouseListener(mouseListener);
- will forward mouse events fired on form elements to your mouse
listener. This will work both in preview and edit modes.
13. void removeFormElementMouseListener(); - allows
mouse listeners to be added to form components inside the HTML
document. This way easily can be tracked the user input inside
the form elements. Here is example of retrieving of the attributes:
@See the
new example ButtonListenersExample.java in the examples folder.
AttributeSet attribs=htmlEditor.getAttributesForComponent((Component)mouseEvent.getSource(),
htmlEditor.getSelectedEditorComponent());
This method allows to retrieve easily attributes such as name,
id, style etc.
@See the
new example ButtonListenersExample.java in the examples folder.
13.
setForcedSpanGeneration(true); will force generation
of span statements instead of font. In this case some extended
style attributes may be added to the generated content.
14. boolean isForsedSpanGeneration(); will return the
state of the span generation.
15. CSS no more throws exceptions under JRE 1.5
16. Paragraph Properties now works as expected
17. Enabled preview hyperlinkListener mode
- see the attached example for details
18. List deletion issue now fixed
19. Cursor does not disappear anymore after Shift+Enter
with jre 1.5
20. New methods:
public
void setSingleParagraphSpacing(boolean enabled);
public
boolean isSingleParagraphSpacing();
This will
cause single line spacing paragraph to be generated. Code
will include 0 top margin style attribute. This is introduced
to simulate the default MS Word behavior.
21.
HTML Source document does not generate changedEvents
during switching to the source tab. However events are reported
correctly when the document is being edited.
22. Initial doc entity by default now suppressed.
23. As-you-type spellchecker added to the traditional
one. (Component Edition Enterprise
only)
24. Now the & in hyperlinks are generated properly
following the XHMTL specification.
25. Custom tags handling (Component Edition
Enterprise only) Now the editor will try to
guess the various custom tags and provide the necessary visualization.
You can customize easily the rendering of custom tags using
style sheets.
This is
quite simple now and is sufficient to do the following:
<style>
my_tag
{background-color:red; }
</style>
<my_tag>
Some content here
</my_tag>
26. For custom empty tags you can specify (Component
Edition Enterprise only) your own rendering
components for each element, so you have the full control over
this.
See the
examples folder, custom tags folder - there are different examples:
CustomTagsExample.java
which uses MyCustomEmptyTag.java for rendering , also the sample-menu.xhml
shows how custom block tags can be rendered with style sheets.
27.
Now also you can reveal all paragraphs within the document
with reveal paragraphs button "¶"
28. Enhaced javascript engine, values of forms
elements are dynamically updated and reflected in the "value"
property.
29.
New package sferyx.administration.xmlcomponents (Component
Edition Enterprise only) Allows easy customization,
access and handling of custom xml tags.
30. Default: all block tags will be rendered as inline tags
(Component Edition Enterprise only)
- this will emulate span tags.
31. XML mode: all block tags will be rendered as blocks
(Component Edition Enterprise only)
- this will emulate rendering of xml documents inside
a browser
This can
be achieved by simply setting this method: CustomXMLTagsGrammarSpecification.setTreatAllBlockTagsAsBlocks(true);
- this is a static method and will affect all running HTMLEditor
instances.
32.
Mixed Mode (Component Edition Enterprise
only): in this mode you can indicate which tags
should be rendered as block and which as inline tags.
33. Improved style sheet support - support
for style ID
34.
Improved internationaisation support, imporved support
for different charsets and UTF.
35. Included support for all HTML/XHTML character entities
as follows:
36.
HTMLEditorOracleBean wrapper class for easier integration within
OracleForms
37.
Newly introduced methods for adding and retrieving content by
pieces for environments that do not allow large data chunks
to be exchanged with the editor like Oracle Forms:
Insert
operations
public void openContentBuffer()
public void appendContentToContentBuffer(String
content)
public void closeBufferAndInsert()
Retrieve operations
public int getBodyContentLenght()
for bodyContent only
public int getContentLenght() for entire
content
public String getBodyContentPortion(int
offset, int length) for bodyContent only
public String getContentPortion(int offset,
int length) for entire content
Sample code:
Here we insert some content:
--------------------------------------
htmlEditor.openContentBuffer();
htmlEditor.appendContentToContentBuffer("This
is ");
htmlEditor.appendContentToContentBuffer("some
sample content");
htmlEditor.appendContentToContentBuffer("
long engouh to be tested...");
Close the buffer and insert it in the editor
--------------------------------------
htmlEditor.closeBufferAndInsert();
Retrieve the content in small pieces
---------------------------------------
int length=htmlEditor.getBodyContentLenght();
int portionLength=5;
int i=0;
while(i+portionLength<length)
{
System.out.println(htmlEditor.getBodyContentPortion(i,portionLength<length-i?portionLength:length-i));
i=i+portionLength;
}
38. New
method public boolean isDocumentEdited() will tell
you whether the document has been changed or not
39. New
methods for setting up default paste operations:
public
void setPreferredPasteOperation(int preferredPasteOperation)
public int getPreferredPasteOperation()
You can switch between the default oprations as follows:
PASTE_FORMATTED_TEXT=0;
PASTE_PLAIN_TEXT=1;
PASTE_FORMATTED_PARAGRAPHS_WITHOUT_STYLE=2;
PASTE_FILTERED_FORMATTED_TEXT=3;
That means you can do the following:
setPreferredPasteOperation(HTMLEditor.PASTE_PLAIN_TEXT);
or simply
setPreferredPasteOperation(1);
40. setEnabled(true|false)
now works as expected - will disable/enable the whole editor
at once. This can be used like java bean property in visual
IDEs.
41. htmlEditor.setDocumentLenghtLimit(150, null); will
set the document lentght limit including the html tags will
display the default message.
or htmlEditor.setDocumentLenghtLimit(150, "You reached the limit");
will set the document lentght limit including the html
tags and will display custom message.
42. WebDAV publishing support for the applet edition.(Applet
Edition only) See <PARAM NAME="publishContentUsingWebDAV"
VALUE="true"> for details
43. Now
using WebDAV you can publish both content and images (Applet
Edition only) In order to enable
direct save to WebDav enabled server you will need to specify
the following parameters:
document.writeln('<PARAM
NAME="saveURL" VALUE="http://localhost/dav/test.htm">');
document.writeln('<PARAM NAME="useSaveAsSaveRemote" VALUE="true">');
document.writeln('<PARAM NAME="publishContentUsingWebDAV"
VALUE="true">');
document.writeln('<PARAM NAME="uploadedObjectsTranslationPath"
VALUE=http://localhost/dav/images">');
"saveURL"
- this is where the content of the page is placed. The file
name will be used as file name for saving in webDav. If you
need this to be set dinamically you can use also the following
javascript function: You can use this to set easily the save
location for different files like this:
if(window.document.htmleditor!=null)
{
window.document.htmleditor.start();
window.document.htmleditor.startVisualEditor();
window.document.htmleditor.setSaveLocation(https://yoursavelocationhere);
window.document.htmleditor.openLocation("
https://somelocation ");
}
Use setSaveLocation
*AFTER* the start() method in order to be sure it ovverrides
evetually the parameter setting. "uploadedObjectsTranslationPath"
will be used for to translate the uploaded images in server
side paths. Without it the images may not be translated properly.
It will be like the directory where the images are placed.
Make
sure you have granted the necessary writing privileges there.
44. Sferyx
EquationEditor if installed will work also in external window
mode for the Applet Edition.
45. The
RemoteFileBrowser will not cache its content anymore.(Applet
Edition only) Now the page will
be reloaded each time it is shown.
46. Sferyx
EquationEditor will be working properly also (Applet
Edition only) in Mozilla/FireFox
on Mac.
47. Resolved
some integration isses with ColdFusion file uploads.
48. Resolved
some issues related to caching uploaded images.
49. Added
a new javascript function which is called setSaveLocation(String
url_location) which allows the saveURL to be set dinamically
through javascript (Applet Edition
only).
You can
use this to set easily the save location for different files
like this:
if(window.document.htmleditor!=null)
{
window.document.htmleditor.start();
window.document.htmleditor.startVisualEditor();
window.document.htmleditor.setSaveLocation(https://yoursavelocationhere);
window.document.htmleditor.openLocation(" https://www.ridgefield.sdr.slb.com/Travel/Ridgefield/restaurants.html
");
}
50. Added
a new javascript functions setUploadedObjectsTranslationPath(String
urtl) and setExternalStyleSheetLocation(String urtl) which will
allow dynamic control of the translation path and the loaded
style sheets.
51. New
method: public void loadStyleDescriptionsFile(final String fileURL)
This method allows sample style descriptions to be loaded for
use in the dropdown combo box. That means the style description
will be displayed to the user instead of the style class names
which will result in more user friendly editing experience.
See the users manual for the file format
52. New
methods for handling document tree (Component
Edition only) :
public
void setSaveEntireDocumentTree(boolean saveEntrireDocTree)
Returns whether the entire document tree should be saved upon
saving. This means that all external objects can be moved
to a specific subfolder relative to the document path
public boolean getSaveEntireDocumentTree()
This method is used to set the folder name where all linked
objects should be moved upon save. This is used in conjuction
with saveEntireDocumentTree(). This will cause all linked
objects to be moved in a relative to the document folder which
will contain all external objects - images, link targets etc.
public
void setLinkedObjectsFolderName(String linkedObjectsFolderName)
This method is used to retrieve the folder name where all
linked objects should be moved upon save. This is used in
conjuction with setSaveEntireDocumentTree(). This will cause
all linked objects to be moved in a relative to the document
folder which will contain all external objects - images, link
targets etc.
public String getLinkedObjectsFolderName()
Will save the entire documnet tree in a relative folder under
the document path. All external objects will be copied to
that location. Default relative path is "images" - can be
changed using setLinkedObjectsFolderNAme(String name)
public boolean saveEntireDocumentTree() will save
the entire document tree as specified in the methods described
above.
53. Style
classes in the quick style dropdown on the toolbar will be ordered
alphabetically.
54. New style class comboboxes on each property dialog allows
easy access to the style classes for all document elements.
55. Greatly
enhanced memory management - now the memory management is
more effective, resulting in a faster performance and reduced
memory consumption.
56. Support
for editing of attributes of custom objects. Custom property
dialogs can be specified easily directly through the object
attributes inside the HTML page. If not specified, generic property
dialog is displayed allowing basic attribute editing.
57. Support
for edit time display of java applets and flash movies.
Flash movies and applets are recognized automatically through
the classid attribute and visual representation is displayed
accordingly.
58. Simplified
support for changing the editor icons. Now through setSharedIcon(String
icon name, Image icon) icons can be easily replaced
59. Popup
menu items now can be suppressed easily through applet parameters.
This way for the applet edition the popup menu can display only
desired items.
60. Improved
UTF-8 document handling - load & save - fixed several
issues with character conversion upon loading and saving. Now
all unicode documents should be handled proeprly.