How to remove toolbar/menu items from the HTML Editor in Oracle Forms?

To remove toolbar/menu items from the HTML Editor in Oracle Forms you can use the provided methods as shown in the examoples below:

Remove toolbar items:

Declare
hArgs2 FBEAN.ARGLIST;
--Here we remove the unwanted toolbar items using arglist
hArgs2:= FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs2, 'newFileButton,openFileButton,saveFileButton');
FBean.Invoke('HTML_EDITOR',1, 'setRemovedToolbarItems',hArgs2);
End;

Remove menu items:

Declare
hArgs2 FBEAN.ARGLIST;
--Here we remove the unwanted menu items using arglist
hArgs2:= FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs2, 'openLocationMenuItem, printFileMenuItem, closeFileMenuItem');
FBean.Invoke('HTML_EDITOR',1, 'setRemovedMenuItems',hArgs2);
End;

Remove entire menus:

Declare
hArgs2 FBEAN.ARGLIST;
--Here we remove the unwanted menu items using arglist
hArgs2:= FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs2, 'menuTools, menuHelp');
FBean.Invoke('HTML_EDITOR',1, 'setRemovedMenus',hArgs2);
End;

Remove popup menu items:

Declare
hArgs2 FBEAN.ARGLIST;
--Here we remove the unwanted menu items using arglist
hArgs2:= FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs2, 'listPropertiesMenuItem,insertTableRowMenuItem');
FBean.Invoke('HTML_EDITOR',1, 'setRemovedPopupMenuItems',hArgs2);
End;

 

All the names of the toolbar and menu items can be found in the main user's manual or also here below:

The Sferyx JSyndrome HTMLEditor Component Edition offers zero efforts full customization of the user interface also directly from inside the IDE. Using the following methods you can remove menus, menu items or toolbar items in order to make the HTMLEditor bean fit your needs.

Removing menu items:

setRemovedMenuItems("openLocationMenuItem, printFileMenuItem, closeFileMenuItem,...") - Indicates which menu items should be removed from the menus. This list contains comma separated names of the menu items contained within the editor to be removed. This allows the full customization of the dropdown menus inside the main menu. The full list is:

File Menu

newFileMenuItem - new file menu item on the "File" menu
openFileMenuItem - open file menu item on the "File" menu
openLocationMenuItem - open location menu item on the "File" menu
closeFileMenuItem - close file menu item on the "File" menu
saveFileMenuItem - save file menu item on the "File" menu
saveasFileMenuItem - save remote file menu item on the "File" menu
printFileMenuItem - print file menu item on the "File" menu
exitFileMenuItem - close file menu item on the "File" menu

Edit Menu

copyMenuItem -copy menu item on the "Edit" menu
cutMenuItem - cut menu item on the "Edit" menu
pasteMenuItem - paste menu item on the "Edit" menu
copyFormattedTextMenuItem
- copy formatted text menu item on the "Edit" menu
pasteFormattedTextMenuItem- paste formatted text menu item on the "Edit" menu
selectAllMenuItem - select all menu item on the "Edit" menu
findMenuItem - find menu item on the "Edit" menu - professional version
replaceMenuItem - replace menu item on the "Edit" menu - professional version

Insert Menu

insertBreakMenuItem - insert break menu item on the "Insert" menu
insertParagraphMenuItem
- insert paragraph menu item on the "Insert" menu
insertSpaceMenuItem
- insert space menu item on the "Insert" menu
horizontalLineMenuItem
- insert horizontal line menu item on the "Insert" menu
insertDateMenuItem
- insert date menu item on the "Insert" menu
insertSymbolMenuItem
- insert symbol menu item on the "Insert" menu
insertFormFieldTextBoxMenuItem
- insert text box menu item on the "Insert -> Form" menu
insertFormFieldTextAreaMenuItem
- insert text area menu item on the "Insert -> Form" menu
insertFormFieldCheckBoxMenuItem
- insert check box menu item on the "Insert -> Form" menu
insertFormFieldRadioButtonMenuItem
- insert radio button menu item on the "Insert -> Form" menu
insertFormFieldDropDownMenuItem
- insert drop down menuitem on the "Insert -> Form" menu
insertFormFieldPushButtonMenuItem
- insert push button menu item on the "Insert -> Form" menu
insertFormFieldImageButtonMenuItem
- insert image button menu item on the "Insert -> Form" menu
insertInsertImageMenuItem
- insert image menu item on the "Insert" menu
insertInsertHyperlinkMenuItem
- insert hyperlink menu item on the "Insert " menu

Table Menu

insertTableMainMenuItem - insert table menu item on the "Table" menu
insertTableRowMainMenuItem
- insert table row menu item on the "Table" menu
insertTableColumnMainMenuItem
- insert table column menu item on the "Table" menu
deleteTableCellsItem
- delete table column menu item on the "Table" menu
selectTableMenuItem
- select table menu item on the "Table" menu
selectTableColumnMenuItem
- select table column menu item on the "Table" menu
selectTableRowMenuItem
- select table row menu item on the "Table" menu
selectTableCellMenuItem
- select table cell menu item on the "Table" menu
splitTableCellMenuItem
- split table cell menu item on the "Table" menu
mergeTableCellMenuItem
- merge table cell menu item on the "Table" menu
tablePropertiesMainMenuItem
- table properties menu item on the "Table" menu
tableCellPropertiesMainMenuItem
- table cell properties menu item on the "Table" menu

Window Menu

newWindowMenuItem - new window menu item on the "Window" menu

Format Menu

fontPropertiesMainMenuItem - font properties menu item on the "Format" menu
pagePropertiesMainMenuItem
- page properties menu item on the "Format" menu

upperCaseMenuItem - convert to upper case menu item
lowerCaseMenuItem  - convert to lower case menu item
titleCaseMenuItem - convert to title case menu item
sentenceCaseMenuItem - convert to sentence case menu item

 

View Menu

viewStatusBarMenuItem - view status bar menu item on the "View" menu
viewToolBarMenuItem
- view tool bar menu item on the "View" menu  - professional version 
viewSourceEditorMenuItem
- view source editor menu item on the "View" menu - professional version
viewPagePreviewMenuItem
- view preview menu item on the "View" menu  - professional version

Help Menu

aboutFileMenuItem - about menu item on the "Help" menu
 

Removing entire menus:

setRemovedMenus("menuTools, menuHelp,..") - Indicates which menus should be removed from the main menu bar. This list contains comma separated names of the menus contained within the editor's main menu bar to be removed. This allows the full customization of the menus inside the main menu bar. The full list of the menus is:

Main Menus:

menuFile - the File menu on the main menu bar - will remove the entire menu;
menuEdit
- the Edit menu on the main menu bar - will remove the entire menu; 
menuView
- the View menu on the main menu bar - will remove the entire menu;
menuInsert
- the Insert menu on the main menu bar - will remove the entire menu;
menuFormat
- the Format menu on the main menu bar - will remove the entire menu;
menuTools
- the Tools menu on the main menu bar - will remove the entire menu;
menuTable
- the Table menu on the main menu bar - will remove the entire menu;
menuWindow
- the Window menu on the main menu bar - will remove the entire menu;
menuHelp
- the Help menu on the main menu bar - will remove the entire menu;

Submenus:

menuInsertTable - the Insert menu inside the Table main menu - will remove the entire menu;
menuSelectTable
- the Select menu inside the Table main menu - will remove the entire menu;
menuPropertiesTable
- the Properties menu inside the Table main menu - will remove the entire menu;
menuForm
-  the Form menu inside the Insert main menu - will remove the entire menu;

Removing toolbar items:

setRemovedToolbarItems("fontUnderlineButton,fontItalicButton,alignRightButton,fontsList,...") - Indicates which toolbar items should be removed from the tool bars. This list contains comma separated names of the toolbar items contained within the editor's tool bars to be removed. This allows the full customization of the tool bars of the editor. The full list of the tool bar items is:

insertImageButton -  the insert image toolbar button;
tableBtn
-  the insert table toolbar button;
undoButton 
-  the undo toolbar button;
redoButton 
-  the redo toolbar button;
insertHyperlinkButton 
-  the insert hyperlink toolbar button;
increaseIndentButton 
-  the increase indent toolbar button;
decreaseIndentButton 
-  the decrease indent toolbar button;
fontSizeButton 
-  the font properties button;
setForegroundButton 
-  the font foreground toolbar button;
unorderedListButton 
-  the unordered list toolbar button;
orderedListButton  
-  the ordered list toolbar button;
newFileButton  
-  the new file toolbar button;
openFileButton 
-  the open file toolbar button;
saveFileButton  
-  the save file button;
printFileButton  
-  the print file button;
pasteButton  
-  the paste toolbar button;
copyButton  
-  the copy toolbar button;
cutButton  
-  the cut toolbar button;
alignRightButton  
-  the align right toolbar button;
alignCenterButton  
-  the align center toolbar button;
alignLeftButton  
-  the align left toolbar button;
fontUnderlineButton  
-  the font underline toolbar button;
fontStrikethroughButton-
the strikethrough toolbar button
fontItalicButton  
-  the font italic toolbar button;
fontBoldButton  
-  the font bold toolbar button;
fontStrikethroughButton - the strikethrough button on the toolbar.
copyFormattingButton - the copy formatting toolbar button;
fontsList  
-  the fonts list toolbar combo box;
fontSizes  
-  the font sizes toolbar combo box;
headingStyles - the headings toolbar combo box;

insertTableButton - insert table toolbar button
insertTableRowButton
- insert row toolbar button
insertTableColumnButton
- insert column toolbar button
deleteTableCellsButton
- delete table cells toolbar button
selectTableButton
- select table toolbar button
selectTableColumnButton
- select table column toolbar button
selectTableRowButton
- select table row toolbar button
selectTableCellButton
- select table cell toolbar button
splitTableCellButton
- split table cell toolbar button
mergeTableCellButton
- merge table cell toolbar button
tablePropertiesButton
- table properties toolbar button
tableCellPropertiesButton
- table cell properties toolbar button

styleClasses - the style classes toolbar combo box

showParagraphsButton - the button for revealing paragraphs
fontBackgroundButton - font background (text highlight) button
insertEquationButton -
the button for inserting mathematical equations through Sferyx EquationEditor

alignJustifyButton - the button for align justify paragraphs
superscriptButton -
the button for superscipt
subscriptButton -
the button for subscript
insertSymbolButton- 
the button for inserting symbols

tableToolbarSeparator- the separator between the table items
pasteToolbarSeparator-
the separator between the pasting items
undoToolbarSeparator-
the separator between the undo items
saveToolbarSeparator-
the separator between save items

printToolbarSeparator - the separator before the print item
fontToolbarSeparator -
the separator between formatting items
fontStyleToolbarSeparator - 
the separator before the style combo
alignmentToolbarSeparator -
the separator before the paragraph alignment items
listsToolbarSeparator-
the separator before the list items

zoomoutTextButton - the text zoom out button
zoominTextButton -
the text zoom in button
pdfExportButton -
the PDF export toolbar button when enabled

imageMapRectButton - the image map insert rectangle button
imageMapCircleButton -
the image map insert circle button
imageMapPolyButton -
the image map insert polygon button

replaceTextButton - replace text toolbar button
findTextButton -
find text toolbar button
bordersToolbarButton -
edit borders toolbar button

increaseFontSizeButton - the increase font size button
decreaseFontSizeButton - the decrease font size button
spellCheckerButton - the spellchecker button
spellCheckerAYTButton - the as-you-type spellchecker button
printPreviewButton - the print preview button
pageLayoutButton
- the page layout view button
saveasDocxButton - save as MS docx file button on the toolbar
openDocxButton - open MS docx file button on the toolbar

 

Removing items from the popup menu

setRemovedPopupMenuItems("listPropertiesMenuItem,insertTableRowMenuItem...") - Indicates which toolbar items should be removed from the main popup menu. This list contains comma separated names of the popup menu items contained within the editor's main popup bar to be removed. This allows the full customization of the tools inside the main popup menu. The full list of the items is:

listPropertiesMenuItem - list properties popup menu item, appears when the cursor is placed over a list
insertTableRowMenuItem - insert table row popup menu item
insertTableCellMenuItem - insert table cell popup menu item
insertTableMenuItem - insert table row popup menu item
imagePropertiesMenuItem - image properties popup menu item, appears when there is an image selected
imageButtonFieldPropertiesMenuItem - image button properties popup menu item, appears when there is an image button selected
formPropertiesMenuItem - form button properties popup menu item, appears when there is a form
buttonFieldPropertiesMenuItem - button properties popup menu item, appears when there is a button selected
radioButtonFieldPropertiesMenuItem - radio button properties popup menu item, appears when there is a radio button selected
checkBoxFieldPropertiesMenuItem - check box properties popup menu item, appears when there is a check box selected
textFieldPropertiesMenuItem - text field properties popup menu item, appears when there is a text field selected
textAreaFieldPropertiesMenuItem - text area properties popup menu item, appears when there is a text area selected
selectFieldPropertiesMenuItem - select(list) field properties popup menu item, appears when there is a select field(list) selected
tablePropertiesMenuItem - table properties popup menu item, appears when there is a table at the cursor position
tableCellPropertiesMenuItem - table cell properties popup menu item, appears when there is a table at the cursor position
pagePropertiesMenuItem - page properties popup menu item
mergeItem - merge table cells properties popup menu item, appears when there is a table at the cursor position
splitItem - split table cell properties popup menu item, appears when there is a table at the cursor position
hyperlinkPropertiesPopupMenuItem - hyperlink properties popup menu item
fontPropertiesMenuItem - font properties popup menu item
objectPropertiesMenuItem - object properties popup menu item
paragraphPropertiesPopupMenuItem - paragraph properties popup menu item
copyItem - copy formatted text popup menu item
copyPlainTextMenuItem - copy plain text popup menu item
pasteItem - paste formatted text popup menu item
copyPopupMenuItem - copy popup menu item
pastePopupMenuItem - paste popup menu item
cutPopupMenuItem - cut popup menu item
boldPopupMenuItem - bold popup menu item
italicPopupMenuItem - italic popup menu item
underlinePopupMenuItem - underline popup menu item
alignLeftPopupMenuItem - align left popup menu item
alignCenterPopupMenuItem - align center popup menu item
alignRightPopupMenuItem - align right popup menu item
insertParagraphPopupMenuItem - insert paragraph menu item
 
Creation of custom form items for invoking of editor's action command and controls

There is also this method for easier creation of custom buttons and items outside the editor and its integration into existing Oracle Forms applications:

public void executeHTMLEditorActionCommand(String actionCommand) - this allows to simulate button clicks and this way can be used to create your own buttons in the host application as they were editor's toolbar buttons. Here below is the list with commands which can be used:
 

in Oracle Forms to be used like this:

BEGIN
   CLEAR_CURRENT_DOCUMENT;
   hArgs := FBEAN.CREATE_ARGLIST;
   FBEAN.ADD_ARG(hArgs,'file-save');
END   fbean.Invoke(bean,1,'executeHTMLEditorActionCommand',hArgs);

This example will show the Save file dialog for saving the current content of the editor. Here below is the full list of commands which can be used:

"increase-indent" - increases the indent of the paragraph at the caret position
"decrease-indent" - decreases the indent of the paragraph at the caret position
"picture-properties" - shows the picture properties dialog box which allows change of the picture parameters at the caret position or does nothing if there is no picture.
"imagebutton-properties" - shows the image button form field properties dialog box which allows change of its parameters or does nothing if there is no image button.
"page-properties" - shows the page properties dialog box which allows change of the page parameters such as title, background etc.
"table-select" - selects the table at the caret position or does nothing if there is no table.
"table-row-select" - selects the table row at the caret position or does nothing if there is no table.
"design-table" - shows the design table popup of the toolbar.
"table-insert-row" - inserts new table row in the table at the caret position or does nothing if there is no table
"table-insert-column" - inserts new table column in the table at the caret position or does nothing if there is no table
"table-insert" - shows the insert table dialog which allows the selection of the number of rows and columns and inserts new table
"start-spellchecker" - starts the spellchecker and begins the check of the document.
"selectall-action" - selects the entire document.
"find-action" - shows the find/search dialog.
"replace-action" - shows the find/replace dialog.
"table-properties" - shows the table properties dialog which allows the customization of the table at the caret position or does nothing if there is no table
"cell-properties" - shows the table cell properties dialog which allows the customization of the selected table cells or does nothing if there is no table cells selected
"table-cell-merge" - merges the selected table cells and.
"table-cell-split" - splits the cell at the caret position into two cells horizontally.
"hyperlink-properties" - shows the hyperlink properties dialog and modifies or inserts new hyperlink on the selected text
"form-properties" - shows the form properties dialog for the form at the caret position or does nothing if there is no form.
"button-properties" - shows the button form field properties dialog for the form at the caret position or does nothing if there is no button form field.
"radiobutton-properties" - shows the radio button form field properties dialog for the form at the caret position or does nothing if there is no radio button form field.
"checkbox-properties" - shows the checkbox form field properties dialog for the form at the caret position or does nothing if there is no checkbox form field.
"textfield-properties" - shows the textfield form field properties dialog for the form at the caret position or does nothing if there is no textfield form field.
"textarea-properties" - shows the textarea form field properties dialog for the form at the caret position or does nothing if there is no textarea form field.
"selectfield-properties" - shows the select (dropdown menu or list) form field properties dialog for the form at the caret position or does nothing if there is no select (dropdown menu or list) form field.
"font-foreground" - sets the selected text's font foreground color visualizing the ColorChooser
"font-family" - sets the selected text's font family from the combobox on the toolbar
"font-size" - sets the font size
"insert-textfield" - inserts new textfield form field. If there is no form at the current caret position, creates new one.
"insert-textarea" - inserts new textarea form field. If there is no form at the current caret position, creates new one.
"insert-checkbox" - inserts new checkbox form field. If there is no form at the current caret position, creates new one.
"insert-radiobutton" - inserts new radiobutton form field. If there is no form at the current caret position, creates new one.
"insert-pushbutton" - inserts new pushbutton form field. If there is no form at the current caret position, creates new one.
"insert-select" - inserts new select (dropdown menu/list) form field. If there is no form at the current caret position, creates new one.
"insert-imagebutton" - inserts new imagebutton form field visualizing the file dialog to select the image URL. If there is no form at the current caret position, creates new one.
"insert-hr" - inserts new horizontal line <hr> at the caret position.
"insert-br" - inserts line break at the caret position.
"insert-p" - inserts new paragraph at the caret position.
"insert-space" - inserts white space at the caret position.
"insert-image" - inserts new image at the caret position, visualizing the file dialog.
"font-properties" - shows the font properties dialog.
"file-print" - shows the print dialog and prints out the current page.
"file-save" - saves the current page, visualizing the file dialog.
"file-open" - opens a new file showing the file dialog.
"location-open" - opens a new file (URL) showing open location dialog.
"file-new" - creates new empty file.
"file-exit" - exits from the editor, using System.exit() asking to save the changes
"help-about" - exits from the editor, using System.exit() asking to save the changes
"copy-action" - performs copy formatted text action and copies the selection as formatted paragraphs, ready to be pasted into tables.
"paste-action" - performs paste formatted text action.
"new-editor-window" - creates new editor frame
"text-uppercase" - convert text to uppercase
"text-lowercase" - convert text to lowercase
"text-titlecase" - convert text to title case
"text-sentencecase"  - convert text to sentence case
"increase-font"  - increase font size
"decrease-font" - descrease font size
"add-word-to-dictionary" - adds word to the custom dictionary
"edit-hotspot" - modifies image map hotspot
"image-map-rect" - inserts restangle image map hotspot
"image-map-circle" - inserts circle image map hotspot
"image-map-poly" - inserts polygon image map hotspot
"pdfexport" - exports document as PDF through the PDFExport plug-in
"zoomin-text" -increases the zoom of the page
"zoomout-text" - decreases the zoom of the page
"insert-equation" - inserts equation through the equation editor plug-in
"edit-equation" - edits equation through the equation editor plug-in
"strikethrough" - strikethough the selected text
"font-underline" - underline  the selected text
"subscript" - converts text to subscript
"superscript" - converts text to superscript
"preview-go-backward" - go back on the preview pane
"preview-go-forward" - go forward on the preview pane
"show-paragraphs" - shows the paragraphs inside the document
"file-save-docx" - saves the content of the editor as MS Word Docx file.
"file-save-mail"- saves the content of the editor as standard e-mail format and creates .eml file which can be opened in MS Outlook, Thunderbird etc.

You can customize the editor's appearance also by using the various properties - you can see detailed examples here below:

To set various properties like singleParagraphSpacing, flowToolbarLayout or restrictedFontList, defaultInitialFont, defaultInitialFontSize see the example:

Declare
vString1 varchar2(32000);
Begin
FBean.Set_Property('HTMLEDITOR_AREA',1,'singleParagraphSpacing','true');
FBean.set_property('HTMLEDITOR_AREA',1,'flowToolbarLayout','true');
FBean.set_property('HTMLEDITOR_AREA',1,'restrictedFontList','Arial,Verdana');
FBean.set_property('HTMLEDITOR_AREA',1,'defaultInitialFont','Arial');
FBean.set_property('HTMLEDITOR_AREA',1,'defaultInitialFontSize','10');
End;


To set the focus outside the editor

Declare

Begin
FBean.Set_Property( 'HTMLEDITOR_AREA', 1, 'transferFocusOutside', 'true');
End;




To set the focus inside the editor

Declare

Begin
FBean.Set_Property( 'HTMLEDITOR_AREA', 1, 'transferFocusInside', 'true');
End;



To disable the editor you can use the following property:

Declare
Begin

FBean.set_property('HTMLEDITOR_AREA',1,'enabled','false');

End;

To enable the editor you can use the following property:

Declare

Begin

FBean.set_property('HTMLEDITOR_AREA',1,'enabled','true');
End;


To verify if the document has been edited:

Declare
vEdited boolean;
Begin

vEdited := FBean.Get_Bool_Property('HTMLEDITOR_AREA',1,'documentEdited');
if vEdited then
:block3.TEXT_AREA := 'documentEdited=true';
else
:block3.TEXT_AREA := 'documentEdited=false';
end if;

End;