Creates and returns a listener, which allows to close the dialog, when the corresponding
button is clicked.

@return The listener, which has been created, as an instance of the type {@link
OnClickListener}
765538
private OnClickListener createFinishButtonListener() {
        return new OnClickListener() {

            @Override
            public void onClick(final View v) {
                int selectedIndex = viewPager.getCurrentItem();

                if (notifyOnFinish(selectedIndex)) {
                    getDialog().dismiss();
                }
            }

        };
    }
778249
protected SendListener getSendListener()
   {
      if (tc.isEntryEnabled()) SibTr.entry(this, tc, "getSendListener");
      if (tc.isEntryEnabled()) SibTr.exit(this, tc, "getSendListener", sendListener);
      return sendListener;
   }
602836
protected FocusListener createFocusListener() {
        return new FocusAdapter() {

            @Override
            public void focusLost(FocusEvent e) {
                String textFieldValue = getKeyComponentText();
                boolean empty = "".equals(textFieldValue.trim());
                Object ref = LookupBinding.this.getValue();

                if (evaluateFocusLost(e)) {
                    // Revert if value isn't empty
                    if (revertValueOnFocusLost()) {
                        if (empty)
                            getValueModel().setValue(null);
                        else
                            valueModelChanged(LookupBinding.super.getValue());
                    }
                    // Create new referable if value isn't empty
                    else {
                        if (empty && (ref != null))
                            getValueModel().setValue(null);
                        else if (!empty && ((ref == null) || !textFieldValue.equals(getObjectLabel(ref))))
                            getValueModel().setValue(createFilterFromString(textFieldValue));

                    }
                }
            }
        };
    }
265063
public function getListenerInstance()
    {
        if (null !== $this->_listener && null === $this->listenerInstance) {
            $this->listenerInstance = new $this->_listener();
        }

        return $this->listenerInstance;
    }
41447
public CircuitBreakerBuilder listener(CircuitBreakerListener listener) {
        requireNonNull(listener, "listener");
        if (listeners.isEmpty()) {
            listeners = new ArrayList<>(3);
        }
        listeners.add(listener);
        return this;
    }
654427
public void setOnCloseListener(@NonNull final android.support.v7.widget.SearchView.OnCloseListener listener) {
        if (searchView != null) {
            searchView.setOnCloseListener(new SearchView.OnCloseListener() {
                @Override public boolean onClose() {
                    return listener.onClose();
                }
            });
        } else if (supportView != null) {
            supportView.setOnCloseListener(listener);
        } else {
            throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
        }
    }
404373
public ListenerContainer<NodeCacheListener> getListenable()
    {
        Preconditions.checkState(state.get() != State.CLOSED, "Closed");

        return listeners;
    }
358634
@Override
    public <T extends EventListener> T  createListener(Class<T> classToCreate) throws ServletException {        
        boolean valid = false;
        
        T listener = super.createListener(classToCreate);
        
        for (Class c : validListenerClasses) {
            if (c != null && c.isAssignableFrom(classToCreate)) {
                valid = true;
            }
        }
        
        if (!valid) {
            throw new IllegalArgumentException(nls.getString("exception.occurred.while.creating.listener.instance"));
        }
        
        return listener;
    }
969599
public java.util.List<ListenerDescription> getListenerDescriptions() {
        if (listenerDescriptions == null) {
            listenerDescriptions = new com.amazonaws.internal.SdkInternalList<ListenerDescription>();
        }
        return listenerDescriptions;
    }
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;
	}
663812
private OnClickListener createPreferenceInitialFragmentButtonListener() {
        return new OnClickListener() {

            @Override
            public void onClick(final View v) {
                Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
                intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT,
                        BehaviorPreferenceFragment.class.getName());

                SharedPreferences sharedPreferences =
                        PreferenceManager.getDefaultSharedPreferences(MainActivity.this);

                boolean useAlternativeTitleDefaultValue =
                        Boolean.valueOf(getString(R.string.use_alternative_title_preference_key));
                String useAlternativeTitleKey =
                        getString(R.string.use_alternative_title_preference_key);

                if (sharedPreferences
                        .getBoolean(useAlternativeTitleKey, useAlternativeTitleDefaultValue)) {
                    String titleDefaultValue =
                            getString(R.string.alternative_title_preference_default_value);
                    String titleKey = getString(R.string.alternative_title_preference_key);
                    String title = sharedPreferences.getString(titleKey, titleDefaultValue);
                    intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_TITLE, title);
                }

                startActivity(intent);
            }

        };
    }
710860
public BaseListener getNextEnabledListener()
    {
        if (m_nextListener == null)
            return null;
        if (m_nextListener.isEnabled())
            return m_nextListener;
        else
            return m_nextListener.getNextEnabledListener();
    }
954681
public static <T> Listener<T> createListenerToFire(Event<T> event) {
		return new Listener<T>() {
			@Override
			public void fire(T obj) {
				event.fire(obj);
			}
		};
	}
576449
public ChooserDialog withOnBackPressedListener(OnBackPressedListener listener) {
        if (this._onBackPressed instanceof defBackPressed) {
            ((defBackPressed) this._onBackPressed)._onBackPressed = listener;
        }
        return this;
    }
1006584
private OnMultiChoiceClickListener createMultiChoiceListener() {
        return new OnMultiChoiceClickListener() {

            @Override
            public void onClick(final DialogInterface dialog, final int position,
                                final boolean isChecked) {
                String text = getString(R.string.multi_choice_listener_selected_text);

                if (!isChecked) {
                    text = getString(R.string.multi_choice_listener_unselected_text);
                }

                if (toast != null) {
                    toast.cancel();
                }

                showToast(String.format(text, position));
            }

        };
    }
446644
private ArrayList getListener()
    {
        if (_listeners != null)
            return _listeners;
        synchronized (this) {
            if (_listeners != null)
                return _listeners;
            _listeners = new ArrayList();
        }
        return _listeners;
    }
1153329
public ListenerType<WebFragmentType<T>> getOrCreateListener()
   {
      List<Node> nodeList = childNode.get("listener");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ListenerTypeImpl<WebFragmentType<T>>(this, "listener", childNode, nodeList.get(0));
      }
      return createListener();
   }