Пример #1
0
 public void actionPerformed(ActionEvent param1ActionEvent)
 {
     SwingUtilities.invokeLater(() =>
     {
         CostOSRibbonUI.null.this.this$0.scrollAndRevealTaskToggleButton(taskToggleButton);
         CostOSRibbonUI.null.this.this$0.ribbon.SelectedTask = task;
         if (CostOSRibbonUI.null.this.this$0.ribbon.Minimized)
         {
             if (true.Equals(CostOSRibbonUI.null.this.this$0.ribbon.getClientProperty("ribbon.internal.justMinimized")))
             {
                 CostOSRibbonUI.null.this.this$0.ribbon.putClientProperty("ribbon.internal.justMinimized", null);
                 return;
             }
             System.Collections.IList list = PopupPanelManager.defaultManager().ShownPath;
             if (list.size() > 0)
             {
                 foreach (PopupPanelManager.PopupInfo popupInfo in list)
                 {
                     if (popupInfo.PopupOriginator == taskToggleButton)
                     {
                         PopupPanelManager.defaultManager().hidePopups(null);
                         return;
                     }
                 }
             }
             PopupPanelManager.defaultManager().hidePopups(null);
             CostOSRibbonUI.null.this.this$0.ribbon.remove(CostOSRibbonUI.null.this.this$0.bandScrollablePanel);
             int i         = (((BasicRibbonUI.BandHostPanel) this.this$1.this$0.bandScrollablePanel.View).PreferredSize).height;
             Insets insets = CostOSRibbonUI.null.this.this$0.ribbon.Insets;
             i            += insets.top + insets.bottom;
             AbstractRibbonBand abstractRibbonBand = (CostOSRibbonUI.null.this.this$0.ribbon.SelectedTask.BandCount > 0) ? CostOSRibbonUI.null.this.this$0.ribbon.SelectedTask.getBand(0) : null;
             if (abstractRibbonBand != null)
             {
                 Insets insets1 = abstractRibbonBand.Insets;
                 i += insets1.top + insets1.bottom;
             }
             CostOSRibbonUI.OfficeBandHostPopupPanel officeBandHostPopupPanel = new CostOSRibbonUI.OfficeBandHostPopupPanel(CostOSRibbonUI.null.this.this$0.bandScrollablePanel, new Dimension(CostOSRibbonUI.null.this.this$0.ribbon.Width, i));
             int j = (this.this$1.this$0.ribbon.LocationOnScreen).x;
             int k = (this.this$1.this$0.ribbon.LocationOnScreen).y + CostOSRibbonUI.null.this.this$0.ribbon.Height;
             Rectangle rectangle = CostOSRibbonUI.null.this.this$0.ribbon.GraphicsConfiguration.Bounds;
             int m = (officeBandHostPopupPanel.PreferredSize).width;
             if (j + m > rectangle.x + rectangle.width)
             {
                 j = rectangle.x + rectangle.width - m;
             }
             int n = (officeBandHostPopupPanel.PreferredSize).height;
             if (k + n > rectangle.y + rectangle.height)
             {
                 k = rectangle.y + rectangle.height - n;
             }
             officeBandHostPopupPanel.PreferredSize = new Dimension(CostOSRibbonUI.null.this.this$0.ribbon.Width, i);
             Popup popup = PopupFactory.SharedInstance.getPopup(taskToggleButton, officeBandHostPopupPanel, j, k);
             PopupPanelManager.PopupListener popupListener = new PopupListenerAnonymousInnerClass(this);
             PopupPanelManager.defaultManager().addPopupListener(popupListener);
             PopupPanelManager.defaultManager().addPopup(taskToggleButton, popup, officeBandHostPopupPanel);
         }
     });
 }
Пример #2
0
	  protected internal static void initiliazeGlobalListeners()
	  {
		if (popupPanelManagerListener != null)
		{
		  return;
		}
		popupPanelManagerListener = new PopupPanelEscapeDismisser();
		PopupPanelManager.defaultManager().addPopupListener(popupPanelManagerListener);
		new WindowTracker();
	  }
        protected internal virtual void installComponents()
        {
            base.installComponents();
            PopupPanelManager.defaultManager().addPopupListener(this);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton appMenuButton = (org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton)this.commandButton;
            JRibbonApplicationMenuButton appMenuButton = (JRibbonApplicationMenuButton)this.commandButton;

            jRibbonApplicationMenuButton.PopupCallback = new PopupPanelCallbackAnonymousInnerClass(this, appMenuButton);
        }
Пример #4
0
		public virtual void popupHidden(PopupPanelManager.PopupEvent param1PopupEvent)
		{
		  PopupPanelManager popupPanelManager = PopupPanelManager.defaultManager();
		  System.Collections.IList list = popupPanelManager.ShownPath;
		  if (this.lastPathSelected.Count != 0 && list.Count == 0)
		  {
			ungrabWindow();
		  }
		  this.lastPathSelected = list;
		}
Пример #5
0
		public WindowTracker()
		{
		  PopupPanelManager popupPanelManager = PopupPanelManager.defaultManager();
		  popupPanelManager.addPopupListener(this);
		  this.lastPathSelected = popupPanelManager.ShownPath;
		  if (this.lastPathSelected.Count != 0)
		  {
			grabWindow(this.lastPathSelected);
		  }
		}
Пример #6
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;
Пример #7
0
                public void popupHidden(PopupPanelManager.PopupEvent param3PopupEvent)
                {
                    JComponent jComponent = param3PopupEvent.PopupOriginator;

                    if (jComponent is JRibbonTaskToggleButton)
                    {
                        CostOSRibbonUI.null.this.this$0.ribbon.add(CostOSRibbonUI.null.this.this$0.bandScrollablePanel);
                        PopupPanelManager.defaultManager().removePopupListener(this);
                        CostOSRibbonUI.null.this.this$0.ribbon.revalidate();
                        CostOSRibbonUI.null.this.this$0.ribbon.doLayout();
                        CostOSRibbonUI.null.this.this$0.ribbon.repaint();
                    }
                }
        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()])
                        {
 protected internal virtual void uninstallComponents()
 {
     PopupPanelManager.defaultManager().removePopupListener(this);
 }