Triggered when jBox opens
502019
function ()
    {
      // Add key events
      jQuery(document).on('keyup.jBox-Image-' + this.id, function (ev) {
        (ev.keyCode == 37) && this.showImage('prev');
        (ev.keyCode == 39) && this.showImage('next');
      }.bind(this));

      // Load the image from the attached element
      this.showImage('open');
    }
1244960
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Create content pane
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 1", "[]", "[grow]unrelated[]"));
        setContentPane(contentPane);

        // Combobox
        JComboBox comboBox = new JComboBox();
        contentPane.add(comboBox, "grow");
        comboBox.addItem("First");
        comboBox.addItem("Second");
        comboBox.addItem("Third");
        comboBox.addItemListener(this);

        // Panels
        cardContainer = new JPanel(new CardLayout());
        cardContainer.setBorder(new EmptyBorder(30, 30, 30, 30));
        cardContainer.add(new Card(), "First");
        cardContainer.add(new Card(), "Second");
        cardContainer.add(new Card(), "Third");
        contentPane.add(new JScrollPane(cardContainer));

        // Apply button
        contentPane.add(applyButton, "align right");

        // Set size
        pack();
        Dimension size = getSize();
//		size.width += 100;
//		setMinimumSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);
    }
736622
def __buttonEvent(event):
    
    global  boxRoot, __widgetTexts, __replyButtonText
    __replyButtonText = __widgetTexts[event.widget]
    boxRoot.quit()
1222180
protected void setActiveCheckBox(CheckBox box) {

        m_selected = box;
        if (m_listener != null) {
            m_listener.onSelect(box);
        }
    }
434594
function() {
            
            if(true === this.get('hoverActivated')) {
                    this.on('mouseover', this._onMouseOver, this, true);        
                    this.on('mouseout', this._onMouseOut, this, true);         
            }
            
            this.on('click', this._onClick, this, true);
            this.on('keydown', this._onKeydown, this, true);
            
            // set this._opening and this._closing before open/close operations begin
            
            this.on('panelOpen', function(){this._opening = true;}, this, true);
            this.on('panelClose', function(){this._closing = true;}, this, true);
            
            // This makes sure that this._fixTabindexes is called after a change has
            // fully completed
            
            this.on('afterPanelClose', function(){
                this._closing = false;
                if(!this._closing && !this._opening) {
                    this._fixTabIndexes();
                }
            }, this, true);
            this.on('afterPanelOpen', function(){
                this._opening = false;
                if(!this._closing && !this._opening) {
                    this._fixTabIndexes();
                }
            }, this, true);
            
            /*
            This is needed when the hrefs are removed from links
            to be able to still hit enter to follow the link
            We only do this when we have ARIA support
            */
            
            if(this._ARIACapable) {
                this.on('keypress', function(ev){
                    var eCurrentPanel = YUD.getAncestorByClassName(YUE.getTarget(ev), this.CLASSES.PANEL);
                    var keyCode = YUE.getCharCode(ev);
                    if(keyCode === 13) {
                        this._onClick(eCurrentPanel.firstChild);
                        return false;
                    }
                });
            }    
        }
794367
def on_show_mainframe(self, event):
        
        self.parent.Enable()
        self.parent.Show()
        self.parent.Raise()
819387
function (justVisible, triggerOnSelectAll) {
            var justVisible = typeof justVisible === 'undefined' ? true : justVisible;
            var allCheckboxes = $("li input[type='checkbox']:enabled", this.$ul);
            var visibleCheckboxes = allCheckboxes.filter(":visible");
            var allCheckboxesCount = allCheckboxes.length;
            var visibleCheckboxesCount = visibleCheckboxes.length;

            if(justVisible) {
                visibleCheckboxes.prop('checked', true);
                $("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").addClass(this.options.selectedClass);
            }
            else {
                allCheckboxes.prop('checked', true);
                $("li:not(.divider):not(.disabled)", this.$ul).addClass(this.options.selectedClass);
            }

            if (allCheckboxesCount === visibleCheckboxesCount || justVisible === false) {
                $("option:enabled", this.$select).prop('selected', true);
            }
            else {
                var values = visibleCheckboxes.map(function() {
                    return $(this).val();
                }).get();

                $("option:enabled", this.$select).filter(function(index) {
                    return $.inArray($(this).val(), values) !== -1;
                }).prop('selected', true);
            }

            if (triggerOnSelectAll) {
                this.options.onSelectAll();
            }
        }
858166
protected void trigger(GwtEvent<?> e, Function callback, Element element) {
    trigger(e, callback, element, eventBus);
  }
64052
def focusInEvent(self, event):
        """"""
        show_status = getattr(self.lineEdit(), 'show_status_icon', None)
        if show_status:
            show_status()
        QComboBox.focusInEvent(self, event)
677005
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Create content pane
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 1", "[]", "[]related[]unrelated[]unrelated[]"));
        setContentPane(contentPane);

        // Checkbox to enable the tabbed pane
        JCheckBox tabbedPaneEnabledCheckBox = new JCheckBox("Enable tabbed pane");
        tabbedPaneEnabledCheckBox.setSelected(true);
        contentPane.add(tabbedPaneEnabledCheckBox);
        JCheckBox firstTabEnabledCheckBox = new JCheckBox("Enable first tab");
        firstTabEnabledCheckBox.setSelected(false);
        contentPane.add(firstTabEnabledCheckBox);

        // Tabbed pane
        final JTabbedPane tabbedPane = new JTabbedPane();
        contentPane.add(tabbedPane, "grow");

        // Create tabs
        CompositeReadableProperty<Boolean> tabbedPaneResultsProperty = new CompositeReadableProperty<Boolean>();
        for (int i = 0; i < 3; i++) {
            CompositeReadableProperty<Boolean> tabResultsProperty = new CompositeReadableProperty<Boolean>();
            tabbedPane.add("Tab " + i, createTabContent(tabResultsProperty));
            tabbedPaneResultsProperty.addProperty(installTabValidation(tabbedPane, i, tabResultsProperty));
            tabbedPane.setTitleAt(i, "Tab");
        }

        // Enable tabbed pane only if checkbox is selected
        read(new JToggleButtonSelectedProperty(tabbedPaneEnabledCheckBox)) //
                .write(new ComponentEnabledProperty(tabbedPane));

        // Enable first tab only if checkbox is selected
        read(new JToggleButtonSelectedProperty(firstTabEnabledCheckBox)) //
                .write(new WritableProperty<Boolean>() {
                    @Override
                    public void setValue(Boolean value) {
                        if (tabbedPane.getTabCount() > 0) {
                            tabbedPane.setEnabledAt(0, (value != null) && value);
                        }
                    }
                });

        // Install global validator
        installGlobalValidation(tabbedPaneResultsProperty, applyButton);

        // Apply button
        contentPane.add(applyButton, "align right");

        // Set size
        pack();
        Dimension size = getSize();
        size.width += 100;
        setMinimumSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);
    }
84188
private void jCheckBoxUseDefaultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxUseDefaultActionPerformed
        
    	if(jCheckBoxUseDefault.isSelected()){
    		pref.put(DisposableOBDAPreferences.USE_DEAFAULT, "true");
    		cmdFontFamily.setEnabled(false);
    	}else{
    		pref.put(DisposableOBDAPreferences.USE_DEAFAULT, "false");
    		cmdFontFamily.setEnabled(true);
    	}
    	
    }
61760
public void enableStart() {
    EventTarget targ = (EventTarget) element;
    targ.addEventListener(SVGConstants.SVG_EVENT_MOUSEDOWN, this, false);
  }
887988
public void setAjaxStartEvent(ISliderAjaxEvent ajaxStartEvent)
	{
		this.ajaxEvents.put(SliderAjaxEvent.ajaxStartEvent, ajaxStartEvent);
		setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxStartEvent));
	}
1274111
public void onClick(Widget widget) {

        if (widget == m_rbHue) {
            if (m_colorMode != CmsSliderBar.HUE) {
                m_colorMode = CmsSliderBar.HUE;
                m_slidermap.setColorSelectMode(CmsSliderBar.HUE);
                m_sliderbar.setColorSelectMode(CmsSliderBar.HUE);
                m_slidermap.setOverlayOpacity(100);
                m_sliderbar.setLayerOpacity(100, CmsSliderBar.COLORBAR_D);
            }

            try {
                CmsColor color = new CmsColor();
                color.setHSV(m_hue, 100, 100);
                m_slidermap.setOverlayColor("#" + color.getHex());
            } catch (Exception e) {
                // do something.
            }

            m_sliderbar.setSliderPosition(256 - (int)((new Integer(m_hue).floatValue() / 360) * 256));
            m_slidermap.setSliderPosition(
                (int)((new Integer(m_saturation).floatValue() / 100) * 256),
                256 - (int)((new Integer(m_brightness).floatValue() / 100) * 256));
        } else if (widget == m_rbSaturation) {
            if (m_colorMode != CmsSliderBar.SATURATIN) {
                m_colorMode = CmsSliderBar.SATURATIN;
                m_slidermap.setColorSelectMode(CmsSliderBar.SATURATIN);
                m_sliderbar.setColorSelectMode(CmsSliderBar.SATURATIN);
                m_slidermap.setOverlayColor("transparent");
                m_sliderbar.setLayerOpacity(100, CmsSliderBar.COLORBAR_D);
            }

            try {
                CmsColor color = new CmsColor();
                color.setHSV(m_hue, 100, m_brightness);
                m_sliderbar.setLayerColor("#" + color.getHex(), CmsSliderBar.COLORBAR_D);
            } catch (Exception e) {
                // do something.
            }

            m_slidermap.setOverlayOpacity(100 - m_saturation);

            m_sliderbar.setSliderPosition(256 - (int)((new Integer(m_saturation).floatValue() / 100) * 256));
            m_slidermap.setSliderPosition(
                (int)((new Integer(m_hue).floatValue() / 360) * 256),
                256 - (int)((new Integer(m_brightness).floatValue() / 100) * 256));
        } else if (widget == m_rbBrightness) {
            if (m_colorMode != CmsSliderBar.BRIGHTNESS) {
                m_colorMode = CmsSliderBar.BRIGHTNESS;
                m_slidermap.setColorSelectMode(CmsSliderBar.BRIGHTNESS);
                m_sliderbar.setColorSelectMode(CmsSliderBar.BRIGHTNESS);
                m_slidermap.setUnderlayColor("#000000");
                m_slidermap.setOverlayColor("transparent");
                m_sliderbar.setLayerOpacity(100, CmsSliderBar.COLORBAR_D);
            }

            try {
                CmsColor color = new CmsColor();
                color.setHSV(m_hue, m_saturation, 100);
                m_sliderbar.setLayerColor("#" + color.getHex(), CmsSliderBar.COLORBAR_D);
            } catch (Exception e) {
                // do something.
            }

            m_slidermap.setOverlayOpacity(m_brightness);

            m_sliderbar.setSliderPosition(256 - (int)((new Integer(m_brightness).floatValue() / 100) * 256));
            m_slidermap.setSliderPosition(
                (int)((new Integer(m_hue).floatValue() / 360) * 256),
                256 - (int)((new Integer(m_saturation).floatValue() / 100) * 256));
        } else if (widget == m_rbRed) {
            if (m_colorMode != CmsSliderBar.RED) {
                m_colorMode = CmsSliderBar.RED;
                m_slidermap.setColorSelectMode(CmsSliderBar.RED);
                m_sliderbar.setColorSelectMode(CmsSliderBar.RED);
            }
            m_slidermap.setOverlayOpacity(percentOf(m_red, 100));

            m_sliderbar.setSliderPosition(256 - m_red);
            m_slidermap.setSliderPosition(m_blue, 256 - m_green);
        } else if (widget == m_rbGreen) {
            if (m_colorMode != CmsSliderBar.GREEN) {
                m_colorMode = CmsSliderBar.GREEN;
                m_slidermap.setColorSelectMode(CmsSliderBar.GREEN);
                m_sliderbar.setColorSelectMode(CmsSliderBar.GREEN);
            }

            m_slidermap.setOverlayOpacity(percentOf(m_green, 100));

            m_sliderbar.setSliderPosition(256 - m_green);
            m_slidermap.setSliderPosition(m_blue, 256 - m_red);
        } else if (widget == m_rbBlue) {
            if (m_colorMode != CmsSliderBar.BLUE) {
                m_colorMode = CmsSliderBar.BLUE;
                m_slidermap.setColorSelectMode(CmsSliderBar.BLUE);
                m_sliderbar.setColorSelectMode(CmsSliderBar.BLUE);
            }

            m_slidermap.setOverlayOpacity(percentOf(m_blue, 100));

            m_sliderbar.setSliderPosition(256 - m_blue);
            m_slidermap.setSliderPosition(m_red, 256 - m_green);
        }

        if ((m_colorMode == CmsSliderBar.RED)
            || (m_colorMode == CmsSliderBar.GREEN)
            || (m_colorMode == CmsSliderBar.BLUE)) {
            int x = 0;
            int y = 0;

            if (m_colorMode == CmsSliderBar.RED) {
                x = m_blue;
                y = m_green;
            }

            if (m_colorMode == CmsSliderBar.GREEN) {
                x = m_blue;
                y = m_red;
            }

            if (m_colorMode == CmsSliderBar.BLUE) {
                x = m_red;
                y = m_green;
            }

            int horzPer = (int)((new Float(x).floatValue() / 256) * 100);
            int vertPer = (int)((new Float(y).floatValue() / 256) * 100);
            int horzPerRev = (int)(((256 - new Float(x).floatValue()) / 256) * 100);
            int vertPerRev = (int)(((256 - new Float(y).floatValue()) / 256) * 100);

            if (vertPerRev > horzPerRev) {
                m_sliderbar.setLayerOpacity(horzPerRev, CmsSliderBar.COLORBAR_D);
            } else {
                m_sliderbar.setLayerOpacity(vertPerRev, CmsSliderBar.COLORBAR_D);
            }
            if (vertPerRev > horzPer) {
                m_sliderbar.setLayerOpacity(horzPer, CmsSliderBar.COLORBAR_C);
            } else {
                m_sliderbar.setLayerOpacity(vertPerRev, CmsSliderBar.COLORBAR_C);
            }
            if (vertPer > horzPer) {
                m_sliderbar.setLayerOpacity(horzPer, CmsSliderBar.COLORBAR_B);
            } else {
                m_sliderbar.setLayerOpacity(vertPer, CmsSliderBar.COLORBAR_B);
            }
            if (vertPer > horzPerRev) {
                m_sliderbar.setLayerOpacity(horzPerRev, CmsSliderBar.COLORBAR_A);
            } else {
                m_sliderbar.setLayerOpacity(vertPer, CmsSliderBar.COLORBAR_A);
            }
        }
    }
1224309
@Override
	public void actionPerformed(ActionEvent evt) {
		// Perform action...
		JFileChooser chooser = new JFileChooser();
		String txt = textField.getText();

		if ( config == null) {
			System.out.println("config == null, calling getWebStartConfig...");
			config = WebStartMain.getWebStartConfig();
		}
		if ( txt != null){
			chooser.setCurrentDirectory(new java.io.File(txt));
			config.setPdbFilePath(txt);

		}
		chooser.setDialogTitle("Choose directory that contains your PDB files");
		chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
		//
		// disable the "All files" option.
		//
		chooser.setAcceptAllFileFilterUsed(false);
		//


//		In response to a button click:
		int returnVal = chooser.showOpenDialog(null);
		if ( returnVal == JFileChooser.APPROVE_OPTION) {
			File file = chooser.getSelectedFile();
			textField.setText(file.getAbsolutePath());
			textField.repaint();
		}

	}
960821
protected void open() {

        m_oldValue = m_selectionInput.m_textbox.getValue();
        if (m_popup == null) {
            String title = org.opencms.gwt.client.Messages.get().key(
                org.opencms.gwt.client.Messages.GUI_GALLERY_SELECT_DIALOG_TITLE_0);
            m_popup = new CmsFramePopup(title, buildGalleryUrl());

            m_popup.setCloseHandler(new Runnable() {

                public void run() {

                    String textboxValue = m_selectionInput.m_textbox.getText();

                    if (!m_oldValue.equals(textboxValue)) {
                        m_selectionInput.m_textbox.setValue("", true);
                        m_selectionInput.m_textbox.setValue(textboxValue, true);
                    }

                    if (m_previewHandlerRegistration != null) {
                        m_previewHandlerRegistration.removeHandler();
                        m_previewHandlerRegistration = null;
                    }
                    m_selectionInput.m_textbox.setFocus(true);
                    m_selectionInput.m_textbox.setCursorPos(m_selectionInput.m_textbox.getText().length());
                }
            });
            m_popup.setModal(false);
            m_popup.setId(m_id);
            m_popup.setWidth(717);
            m_popup.getFrame().setSize("705px", "640px");
            m_popup.addDialogClose(new Command() {

                public void execute() {

                    close();

                }
            });
        } else {
            m_popup.getFrame().setUrl(buildGalleryUrl());
        }
        m_popup.setAutoHideEnabled(true);
        m_popup.center();
        if (m_previewHandlerRegistration == null) {
            m_previewHandlerRegistration = Event.addNativePreviewHandler(new CloseEventPreviewHandler());
        }
    }
732474
function initToolbar() {
        $('header').mouseover(function () {
            $('#toolbar').slideDown('fast');
        });
        $editbox.click(function () {
            window.setTimeout(function () {
                $('#toolbar').slideUp('fast');
            }, 500);
        });
        $preview.click(function () {
            window.setTimeout(function () {
                $('#toolbar').slideUp('fast');
            }, 500);
        });
    }