Example usage for javax.swing.text JTextComponent setComponentPopupMenu

List of usage examples for javax.swing.text JTextComponent setComponentPopupMenu

Introduction

In this page you can find the example usage for javax.swing.text JTextComponent setComponentPopupMenu.

Prototype

@BeanProperty(preferred = true, description = "Popup to show")
public void setComponentPopupMenu(JPopupMenu popup) 

Source Link

Document

Sets the JPopupMenu for this JComponent.

Usage

From source file:net.pandoragames.far.ui.swing.component.UndoHistoryPopupMenu.java

/**
 * Creates a new UndoHistoryPopupMenu and wires it as component popup menu to the
 * specified text component. The text component must already been registerd with an 
 * {@link net.pandoragames.far.ui.swing.component.UndoHistory UndoHistory}.
 * @param config application configuration
 * @param componentRepository shared components
 * @param component previously registered with an <code>UndoHistory</code>
 * @return UndoHistoryPopupMenu the menu that has bee created.
 *//*from  ww  w. ja  v  a2s .  co m*/
public static UndoHistoryPopupMenu createPopUpMenu(SwingConfig config, ComponentRepository componentRepository,
        JTextComponent component) {
    UndoHistoryPopupMenu popup = new UndoHistoryPopupMenu(config, componentRepository, component);
    component.setComponentPopupMenu(popup);
    return popup;
}