JIDE 3.5.15

com.jidesoft.gantt
Class GanttChartPopupMenuInstaller

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by com.jidesoft.gantt.GanttChartPopupMenuInstaller
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener

public class GanttChartPopupMenuInstaller
extends MouseAdapter

GanttChartPopupMenuInstaller allows you to add a popup menu to GanttChart and customize it. To use it, you just need to call


 GanttChartPopupMenuInstaller installer = new GanttChartPopupMenuInstaller(ganttChart);
 
Or if you want to uninstall it, call

 GanttChartPopupMenuInstaller.getGanttChartPopupMenuInstaller(ganttChart).uninstallListeners();
 
However GanttchartPopupMenuInstaller has no menu items. You can use one of the existing GanttChartPopupMenuCustomizers to add more menu items or create your own GanttChartPopupMenuCustomizer to do it.


Field Summary
static String CLIENT_PROPERTY_POPUP_MENU_INSTALLER
          Client property used by GanttChart to provide its own GanttChartColumnPopupMenuCustomizer.
 
Constructor Summary
GanttChartPopupMenuInstaller(GanttChart<?,?> ganttChart)
          Creates a GanttChartColumnPopupMenuCustomizer.
 
Method Summary
 void addGanttChartPopupMenuCustomizer(GanttChartPopupMenuCustomizer customizer)
           
static void addSeparatorIfNecessary(JPopupMenu popup)
          Adds a separator to the popup menu if there are menu items on it already.
protected  JPopupMenu createPopupMenu()
           
protected  void customizeMenuItems(GanttChart<?,?> ganttChart, JPopupMenu popup, int clickingRow, Point p)
          Customizes the menu items for the popup menu.
 GanttChartPopupMenuCustomizer[] getGanttChartPopupMenuCustomizers()
           
static GanttChartPopupMenuInstaller getGanttChartPopupMenuInstaller(GanttChart<?,?> ganttChart)
          Gets the Searchable installed on the component.
 void installListeners()
          Installs the listeners needed in order to show the popup menu for the GanttChart.
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void removeTablePopupMenuCustomizer(GanttChartPopupMenuCustomizer customizer)
           
 void uninstallListeners()
          Uninstalls the listeners needed in order to show the popup menu for the GanttChart.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_PROPERTY_POPUP_MENU_INSTALLER

public static final String CLIENT_PROPERTY_POPUP_MENU_INSTALLER
Client property used by GanttChart to provide its own GanttChartColumnPopupMenuCustomizer.

See Also:
Constant Field Values
Constructor Detail

GanttChartPopupMenuInstaller

public GanttChartPopupMenuInstaller(GanttChart<?,?> ganttChart)
Creates a GanttChartColumnPopupMenuCustomizer.

Parameters:
ganttChart - the table.
Method Detail

addGanttChartPopupMenuCustomizer

public void addGanttChartPopupMenuCustomizer(GanttChartPopupMenuCustomizer customizer)

removeTablePopupMenuCustomizer

public void removeTablePopupMenuCustomizer(GanttChartPopupMenuCustomizer customizer)

getGanttChartPopupMenuCustomizers

public GanttChartPopupMenuCustomizer[] getGanttChartPopupMenuCustomizers()

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class MouseAdapter

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class MouseAdapter

createPopupMenu

protected JPopupMenu createPopupMenu()

customizeMenuItems

protected void customizeMenuItems(GanttChart<?,?> ganttChart,
                                  JPopupMenu popup,
                                  int clickingRow,
                                  Point p)
Customizes the menu items for the popup menu.

Parameters:
ganttChart - the ganttChart.
popup - the popup menu.
clickingRow - the row that user right clicks.
p - the point that user right clicks.

addSeparatorIfNecessary

public static void addSeparatorIfNecessary(JPopupMenu popup)
Adds a separator to the popup menu if there are menu items on it already.

Parameters:
popup - the popup menu.

installListeners

public void installListeners()
Installs the listeners needed in order to show the popup menu for the GanttChart.


uninstallListeners

public void uninstallListeners()
Uninstalls the listeners needed in order to show the popup menu for the GanttChart.


getGanttChartPopupMenuInstaller

public static GanttChartPopupMenuInstaller getGanttChartPopupMenuInstaller(GanttChart<?,?> ganttChart)
Gets the Searchable installed on the component. Null is no Searchable was installed.

Parameters:
ganttChart - the GanttChart
Returns:
the Searchable installed. Null is no Searchable was installed.

JIDE 3.5.15