Beispiel #1
0
	  public virtual void installUI(JComponent paramJComponent)
	  {
		this.popupPanel = (JPopupPanel)paramJComponent;
		base.installUI(this.popupPanel);
		installDefaults();
		installComponents();
		installListeners();
	  }
Beispiel #2
0
		public virtual void eventDispatched(AWTEvent param1AWTEvent)
		{
		  bool @bool;
		  if (!(param1AWTEvent is MouseEvent))
		  {
			return;
		  }
		  MouseEvent mouseEvent = (MouseEvent)param1AWTEvent;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.awt.Component src = mouseEvent.getComponent();
		  Component src = mouseEvent.Component;
		  JPopupPanel jPopupPanel = (JPopupPanel)SwingUtilities.getAncestorOfClass(typeof(JPopupPanel), component);
		  if (jPopupPanel == null)
		  {
			CostOSRibbonApplicationMenuPopupPanel.CostOSApplicationMenuContainerPanel costOSApplicationMenuContainerPanel = (CostOSRibbonApplicationMenuPopupPanel.CostOSApplicationMenuContainerPanel)SwingUtilities.getAncestorOfClass(typeof(CostOSRibbonApplicationMenuPopupPanel.CostOSApplicationMenuContainerPanel), component);
			if (costOSApplicationMenuContainerPanel != null || param1AWTEvent.Source.ToString().ToLower().IndexOf("weight") != -1 || component is nomitech.common.laf.CostOSTitlePane)
			{
			  return;
			}
		  }
		  switch (mouseEvent.ID)
		  {
			case 501:
			  @bool = false;
			  if (component is JCommandButton)
			  {
				@bool = ((JCommandButton)component).PopupModel.PopupShowing;
			  }
			  if (!@bool && jPopupPanel != null)
			  {
				PopupPanelManager.defaultManager().hidePopups(jPopupPanel);
				return;
			  }
			  if (component is org.pushingpixels.flamingo.@internal.ui.ribbon.JRibbonTaskToggleButton)
			  {
				JRibbon jRibbon = (JRibbon)SwingUtilities.getAncestorOfClass(typeof(JRibbon), component);
				if (jRibbon != null && FlamingoUtilities.isShowingMinimizedRibbonInPopup(jRibbon))
				{
				  return;
				}
			  }
			  if (!@bool && SwingUtilities.getAncestorOfClass(typeof(javax.swing.plaf.basic.ComboPopup), component) == null)
			  {
				PopupPanelManager.defaultManager().hidePopups(component);
			  }
			  break;
			case 502:
			  if (SwingUtilities.getAncestorOfClass(typeof(javax.swing.plaf.basic.ComboPopup), component) != null)
			  {
				SwingUtilities.invokeLater(() =>
				{
				  PopupPanelManager.defaultManager().hidePopups(src);
				}});
			  break;
        protected internal virtual void processPopupAction()
        {
            bool @bool = false;

            if (this.commandButton is JCommandButton)
            {
                @bool = ((JCommandButton)this.commandButton).PopupModel.PopupShowing;
            }
            PopupPanelManager.defaultManager().hidePopups(this.commandButton);
            if (!(this.commandButton is JCommandButton))
            {
                return;
            }
            if (@bool)
            {
                return;
            }
            JCommandButton     jCommandButton     = (JCommandButton)this.commandButton;
            PopupPanelCallback popupPanelCallback = jCommandButton.PopupCallback;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.pushingpixels.flamingo.api.common.popup.JPopupPanel popupPanel = (popupPanelCallback != null) ? popupPanelCallback.getPopupPanel(jCommandButton) : null;
            JPopupPanel popupPanel = (popupPanelCallback != null) ? popupPanelCallback.getPopupPanel(jCommandButton) : null;

            if (jPopupPanel != null)
            {
                jPopupPanel.applyComponentOrientation(jCommandButton.ComponentOrientation);
                SwingUtilities.invokeLater(() =>
                {
                    if (CostOSRibbonApplicationMenuButtonUI.this.commandButton == null || popupPanel == null)
                    {
                        return;
                    }
                    if (!CostOSRibbonApplicationMenuButtonUI.this.commandButton.Showing)
                    {
                        return;
                    }
                    popupPanel.doLayout();
                    int i = 0;
                    int j = 0;
                    JPopupPanel.PopupPanelCustomizer popupPanelCustomizer = popupPanel.Customizer;
                    bool @bool          = CostOSRibbonApplicationMenuButtonUI.this.commandButton.ComponentOrientation.LeftToRight;
                    Dimension dimension = popupPanel.PreferredSize;
                    if (popupPanelCustomizer == null)
                    {
                        switch (CostOSRibbonApplicationMenuButtonUI.null.$SwitchMap$org$pushingpixels$flamingo$api$common$JCommandButton$CommandButtonPopupOrientationKind[((JCommandButton)CostOSRibbonApplicationMenuButtonUI.this.commandButton).PopupOrientationKind.ordinal()])
                        {