Page 1 of 1

customizeAuthorPopUpMenu

Posted: Mon Apr 04, 2022 8:38 am
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

Re: customizeAuthorPopUpMenu

Posted: Mon Apr 04, 2022 9:45 am
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