customizeAuthorPopUpMenu

Post here questions and problems related to oXygen frameworks/document types.
vishwavaranasi
Posts: 168
Joined: Fri Feb 28, 2020 4:02 pm

customizeAuthorPopUpMenu

Post by vishwavaranasi »

Hello Team , We have our oxygen plugin implemented with Menu , and the overridden as

@Override
public void customizeAuthorPopUpMenu(JPopupMenu popup,
AuthorAccess authorAccess) {
// Add our custom action
popup.add(CustomAction);
}

for Custom Menu , how do i change the Background color of Menu option on select for example
image.png
on select "Welcome" by default the bg color is blue , wanted to change that , please help me here.

and also for javax swing components how can we handle the style sheets ? as like web apps , i Know this is something related to java , was just checking is there anything samples already that oxygenxml has?


Thanks,
vishwa
You do not have the required permissions to view the files attached to this post.
Thanks,
vishwa
Radu
Posts: 9469
Joined: Fri Jul 09, 2004 5:18 pm

Re: customizeAuthorPopUpMenu

Post by Radu »

Hi,

The Oxygen desktop's user interface is built using Java Swing components, so it cannot be customized as a web page using HTML and CSS.
Maybe what you want can be done something like this:

Code: Select all

          public void customizeAuthorPopUpMenu(JPopupMenu popUp, AuthorAccess authorAccess) {
            JMenuItem menuItem = new JMenuItem(CustomAction);
            menuItem.setOpaque(true);
            menuItem.setBackground(Color.RED);
            menuItem.setForeground(Color.WHITE);
            popUp.add(menuItem);
          }
but I would advise you against customizing the colors for menu items, Oxygen has multiple possible color schemes (see Preferences->"Appearance") and your custom chosen colors may not look good with a certain color theme, for example with our "Graphite" color scheme.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply