Returns input listener that can be added to scene2d actor. When mouse button is pressed on that actor,
menu will be displayed
@param mouseButton from {@link Buttons}
548435
public InputListener getDefaultInputListener (final int mouseButton) {
		if (defaultInputListener == null) {
			defaultInputListener = new InputListener() {
				@Override
				public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
					return true;
				}

				@Override
				public void touchUp (InputEvent event, float x, float y, int pointer, int button) {
					if (event.getButton() == mouseButton)
						showMenu(event.getStage(), event.getStageX(), event.getStageY());
				}
			};
		}

		return defaultInputListener;
	}
235565
public void setMenuButtonImage(MenuButton button, Drawable drawable) {
        switch (button) {
            case MID:
                mMidBtn.setImageDrawable(drawable);
                break;
            case LEFT:
                mLeftBtn.setImageDrawable(drawable);
                break;
            case RIGHT:
                mRightBtn.setImageDrawable(drawable);
                break;
        }
    }
1013209
private JButton getBtnOK() {
		if (btnOK == null) {
			btnOK = new JButton();
			btnOK.setText(Constant.messages.getString("all.button.ok"));
			btnOK.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
			btnOK.addActionListener(new java.awt.event.ActionListener() { 
				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) { 
				    FilterChangeUserAgentDialog.this.dispose();
				    exitCode = JOptionPane.OK_OPTION;

				}
			});
		}
		return btnOK;
	}
346930
public void addButton(final AbstractButton button) {
        WidgetUtils.setDefaultButtonStyle(button);
        final EmptyBorder baseBorder =
                new EmptyBorder(WidgetUtils.BORDER_WIDE_WIDTH - 1, 9, WidgetUtils.BORDER_WIDE_WIDTH - 1, 9);
        if (getComponentCount() == 0) {
            button.setBorder(baseBorder);
        } else {
            final Component lastComponent = getComponent(getComponentCount() - 1);
            if (lastComponent instanceof AbstractButton) {
                // previous component was also a button - add a line on the left
                // side
                final Border outsideBorder = new MatteBorder(0, 1, 0, 0, WidgetUtils.BG_COLOR_LESS_BRIGHT);
                button.setBorder(new CompoundBorder(outsideBorder, baseBorder));
            } else {
                button.setBorder(baseBorder);
            }
        }
        button.setOpaque(false);
        _buttons.add(button);

        add(button);
    }
180463
public void mousePressed (MouseEvent e)
    {
        // ignore mouse presses if we're not responsive
        if (!isResponsive()) {
            return;
        }

        if (e.getButton() == MouseEvent.BUTTON1) {
            if (_hobject instanceof Sprite) {
                handleSpritePressed((Sprite)_hobject, e.getX(), e.getY());
                return;
            } else if (_hobject instanceof SceneObject) {
                handleObjectPressed((SceneObject)_hobject, e.getX(), e.getY());
                return;
            }
        }
        // if not button1, or _hobject not Sprite or SceneObject...
        handleMousePressed(_hobject, e);
    }
1073069
public static void toggleButton(Button button) {

        if (isButtonPressed(button)) {
            button.removeStyleName(OpenCmsTheme.BUTTON_PRESSED);
        } else {
            button.addStyleName(OpenCmsTheme.BUTTON_PRESSED);
        }
    }
827447
private void canvasClick(int x, int y)
    {
        //always called listeners
        for (CanvasClickListener listener : canvasClickAlwaysListeners)
            listener.canvasClicked(x, y);
        //selected listener by toggle buttons
        for (JToggleButton button : canvasClickToggleListeners.keySet())
        {
            if (button.isSelected())
                canvasClickToggleListeners.get(button).canvasClicked(x, y);
        }
        
        /*if (lookupButton.isSelected())
        {
            if (proc.getAreaTree() != null)
            {
                Area node = proc.getAreaTree().getAreaAt(x, y);
                if (node != null)
                {
                    showAreaInTree(node);
                    showAreaInLogicalTree(node);
                }
            }
            //lookupButton.setSelected(false);
        }
        if (boxLookupButton.isSelected())
        {
            Box node = proc.getPage().getBoxAt(x, y);
            if (node != null)
                showBoxInTree(node);
            //boxLookupButton.setSelected(false);
        }
        if (sepLookupButton.isSelected())
        {
            showSeparatorAt(x, y);
        }
        if (extractButton.isSelected())
        {
            AreaNode node = proc.getAreaTree().getAreaAt(x, y);
            if (node != null)
            {
                proc.getExtractor().findArticleBounds(node);
                try {
                    PrintStream exs = new PrintStream(new FileOutputStream("test/extract.html"));
                    proc.getExtractor().dumpTo(exs);
                    exs.close();
                } catch (java.io.IOException e) {
                    System.err.println("Output failed: " + e.getMessage());
                }
                
                //String s = ex.getDescriptionX(node, 2);
                //System.out.println("Extracted: " + s);
            }
            extractButton.setSelected(false);
        }*/
    }
323522
function WidgetButton() {
        this.addOutput("", LiteGraph.EVENT);
        this.addOutput("", "boolean");
        this.addProperty("text", "click me");
        this.addProperty("font_size", 30);
        this.addProperty("message", "");
        this.size = [164, 84];
        this.clicked = false;
    }
342615
private JButton getBtnCancel() {
		if (btnCancel == null) {
			btnCancel = new JButton();
			btnCancel.setText(Constant.messages.getString("alert.add.button.cancel"));
			btnCancel.setEnabled(true);
			btnCancel.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    
				    clearAndCloseDialog();
				}
			});

		}
		return btnCancel;
	}
1230868
public void mouseEntered(MouseEvent evt)
    {
        JLabel button = (JLabel)evt.getSource();
        oldBorder = button.getBorder();
        button.setBorder(ROLLOVER_BORDER);
    }
574281
public static MouseAdapter mouseReleased(@NonNull Consumer<MouseEvent> consumer) {
      return new MouseAdapter() {
         @Override
         public void mouseReleased(MouseEvent e) {
            consumer.accept(e);
            super.mouseReleased(e);
         }
      };
   }
1038349
protected JButton getBtnCancel() {
        if (btnCancel == null) {
            btnCancel = new JButton();
            btnCancel.setName("btnCancel");
            btnCancel.setText(Constant.messages.getString("all.button.cancel"));
            btnCancel.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {

                    exitResult = JOptionPane.CANCEL_OPTION;
                    AbstractParamDialog.this.setVisible(false);
                }
            });

        }
        return btnCancel;
    }
701418
function bindButton($button, factor){
            var zoomInterval;

            $button.bind("mousedown", function(e){
              e.preventDefault();
              e.stopPropagation();

              if( e.button != 0 ){
                return;
              }

              var doZoom = function(){
                var zoom = cyRef.zoom();
                var lvl = cyRef.zoom() * factor;

                if( lvl < options.minZoom ){
                  lvl = options.minZoom;
                }

                if( lvl > options.maxZoom ){
                  lvl = options.maxZoom;
                }

                if( (lvl == options.maxZoom && zoom == options.maxZoom) ||
                  (lvl == options.minZoom && zoom == options.minZoom)
                ){
                  return;
                }

                zoomTo(lvl);
              };

              startZooming();
              doZoom();
              zoomInterval = setInterval(doZoom, options.zoomDelay);

              return false;
            });

            windowBind("mouseup blur", function(){
              clearInterval(zoomInterval);
              endZooming();
            });
          }
846976
public void mousePressed (MouseEvent e)
    {
        // ignore if we're not enabled
        if (!isEnabled()) {
            return;
        }

        // keep track of the selected button
        _selectedButton = (JLabel)e.getSource();
        // if the selected button is already selected, ignore the click
        if (_selectedButton.getBorder() == SELECTED_BORDER) {
            _selectedButton = null;
        } else {
            _selectedButton.setBorder(SELECTED_BORDER);
            _selectedButton.repaint();
        }
    }
431522
private JButton getOkButton()
    {
        if (okButton == null)
        {
            okButton = new JButton();
            okButton.setText("Go!");
            okButton.addActionListener(new java.awt.event.ActionListener()
            {
                public void actionPerformed(java.awt.event.ActionEvent e)
                {
                    displayURL(urlText.getText());
                }
            });
        }
        return okButton;
    }
24610
def _paste_using_mouse_button_2(self):
        """"""
        focus = self.localDisplay.get_input_focus().focus
        xtest.fake_input(focus, X.ButtonPress, X.Button2)
        xtest.fake_input(focus, X.ButtonRelease, X.Button2)
        logger.debug("Mouse Button2 event sent.")
549763
public static MouseAdapter mouseClicked(@NonNull Consumer<MouseEvent> consumer) {
      return new MouseAdapter() {
         @Override
         public void mouseClicked(MouseEvent e) {
            consumer.accept(e);
            super.mouseClicked(e);
         }
      };
   }