| Buy  | Documentation  | About us  | Contact us  | Site Map

Sferyx JSyndrome HTMLEditor Component Edition

 

//Using the built in functions to remove unwanted menus, menu items and toolbar buttons. This operation can be executed easily directly from the visual environment of the IDE used for development 
sferyx.administration.editors.HTMLEditor hTMLEditor1 = new sferyx.administration.editors.HTMLEditor();

hTMLEditor1.setRemovedMenuItems("openLocationMenuItem, printFileMenuItem, closeFileMenuItem");
hTMLEditor1.setRemovedMenus("menuTools, menuHelp");
hTMLEditor1.setRemovedToolbarItems("fontUnderlineButton,fontItalicButton, fontBoldButton, alignRightButton,fontsList");

//
Check the users manual for the full list of the names of the menus, menu items and toolbars  

//Example showing removing of menus and menu items
//We get the main menu bar and then we can freely customize its aspect according to swing specs.
//You can see the javadoc documentation for major details on customizing menus
//packages javax.swing.JMenu, javax.swing.JMenuBar, javax.swing.JMenuItem
//Using the approach described below you can customize even the text, icons on the menus and the menu items.

sferyx.administration.editors.HTMLEditor hTMLEditor1 = new sferyx.administration.editors.HTMLEditor();

//We want to remove the Edit menu
JMenuBar mainMenu=hTMLEditor1.getJMenuBar(); // We get the main menu bar
JMenu editMenu=mainMenu.getMenu(1); //gets the Edit menu -- it is located at index 1
mainMenu.remove(editMenu);//removes the Edit menu

//We want to remove also the Window menu -- since we have removed the edit the indexes are shifted with one
JMenu tableMenu=mainMenu.getMenu(6); //gets the Window menu -- now it is located at index 6
mainMenu.remove(tableMenu); //removes the Window menu


//We want to remove the Open Location menu item from the File menu
JMenu fileMenu=mainMenu.getMenu(0); //gets the File menu -- now it is located at index 0
fileMenu.remove(2); //removes the Open Location menu item located at index 2