Open a dialog with single choice list

@param title
@param list
@param listener
16537
public void dialog(final int title, int list, DialogInterface.OnClickListener listener) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
        builder.setTitle(title)
                .setItems(list, listener);
        builder.create().show();
    }
1251646
function dialogAlert(text, title) {
    title = title || '&nbsp';
    $('#alert').html(text.replace('\n', '<br>'));
    $dialogAlert.dialog('option', 'title', title);
    alertOpen = true;
    $dialogRpc.dialog('close');
    $dialogAlert.dialog('close');
    $dialogServicemessage.dialog('close');
    $dialogAlert.dialog('open');
}
639590
public void addListener(final WebAppListener listener) {
		NullArgumentException.validateNotNull(listener, "Listener");
		NullArgumentException.validateNotNull(listener.getListenerClass(),
				"Listener class");
		if (!listeners.contains(listener)) {
			listeners.add(listener);
		}
	}
1184619
private OnMultiChoiceClickListener createListItemListener() {
        return new OnMultiChoiceClickListener() {

            @Override
            public void onClick(final DialogInterface dialog, final int which,
                                final boolean isChecked) {
                if (isChecked) {
                    selectedIndices.add(which);
                } else {
                    selectedIndices.remove(which);
                }
            }

        };
    }
1082514
public static void openDialog(
        String title,
        String hookUri,
        List<String> uploadedFiles,
        final CloseHandler<PopupPanel> closeHandler) {

        if (hookUri.startsWith("#")) {
            List<CmsUUID> resourceIds = new ArrayList<CmsUUID>();
            if (uploadedFiles != null) {
                for (String id : uploadedFiles) {
                    resourceIds.add(new CmsUUID(id));
                }

            }
            CmsEmbeddedDialogHandler handler = new CmsEmbeddedDialogHandler(new I_CmsActionHandler() {

                public void leavePage(String targetUri) {

                    // TODO Auto-generated method stub

                }

                public void onSiteOrProjectChange(String sitePath, String serverLink) {

                    // TODO Auto-generated method stub

                }

                public void refreshResource(CmsUUID structureId) {

                    closeHandler.onClose(null);
                }
            });
            String dialogId = hookUri.substring(1);
            handler.openDialog(dialogId, CmsGwtConstants.CONTEXT_TYPE_FILE_TABLE, resourceIds);

        } else {
            Map<String, String> parameters = new HashMap<String, String>();
            parameters.put(I_CmsUploadConstants.PARAM_RESOURCES, Joiner.on(",").join(uploadedFiles));
            CmsPopup popup = CmsFrameDialog.showFrameDialog(
                title,
                CmsCoreProvider.get().link(hookUri),
                parameters,
                closeHandler);
            popup.setHeight(DIALOG_HEIGHT);
            popup.setWidth(CmsPopup.DEFAULT_WIDTH);
            popup.center();
        }
    }
914479
def select_option_dialog(windowTitle, optionList):
    

    class OptionFrame(wx.Frame):
        selectedOption = None

        def __init__(self, windowTitle, optionList):
            wx.Frame.__init__(self, None, -1, windowTitle, size=(250, 200))
            panel = wx.Panel(self, -1)
            listBox = wx.ListBox(panel, -1, (20, 20), (80, 120), optionList, wx.LB_SINGLE)
            listBox.SetSelection(0)
            self.Bind(wx.EVT_LISTBOX_DCLICK, self.doubleclick)
            self.optionList = optionList

        def doubleclick(self, event):
            index = event.GetSelection()
            value = self.optionList[index]
            OptionFrame.selectedOption = (index, value)
            self.Close()

    app = wx.PySimpleApp()
    OptionFrame(windowTitle, optionList).Show()
    app.MainLoop()

    return OptionFrame.selectedOption
313346
public void add(List list) {
	if (values == null) values = new LinkedList();
	values.add(list);
    }
754600
public void addListener( IDmListener listener ) {

		if( listener == null ) {
			this.logger.info( "An invalid DM listener failed to be added." );

		} else {
			synchronized( this.dmListeners ) {
				this.dmListeners.add( listener );
			}

			if( this.enableNotifications.get())
				listener.enableNotifications();

			this.logger.info( "The listener '" + listener.getId() + "' is now available in Roboconf's DM." );
		}

		listListeners();
	}
195001
private void initializeSelectionListener() {
        ChoiceMode choiceMode = adapter.getChoiceMode();

        if (choiceMode instanceof MultipleChoiceMode) {
            adapter.setOnItemClickListener(
                    new OnMultiChoiceClickListenerWrapper(multiChoiceListener, getDialog(), 0));
        } else if (choiceMode instanceof SingleChoiceMode) {
            adapter.setOnItemClickListener(
                    new OnItemClickListenerWrapper(singleChoiceListener, getDialog(), 0));
        } else {
            adapter.setOnItemClickListener(
                    new OnItemClickListenerWrapper(singleChoiceListener, getDialog(),
                            DialogInterface.BUTTON_POSITIVE));
        }
    }
818337
protected void showErrorDialog(String message, String title) {
		JOptionPane.showMessageDialog(this, message, title, JOptionPane.ERROR_MESSAGE);
	}
227209
public static void show(boolean manage, String deflt, IEventListener closeListener) {
        Map<String, Object> args = new HashMap<>();
        args.put("manage", manage);
        args.put("deflt", deflt);
        PopupDialog.show(RESOURCE_PREFIX + "layoutManager.fsp", args, true, true, true, closeListener);
    }
94617
public static void forEachAnnotations(Element currentElement, AnnotationFilter filter, AnnotationFoundListener listener) {
		final Elements elementUtils=BaseProcessor.elementUtils;
		List<? extends AnnotationMirror> annotationList = elementUtils.getAllAnnotationMirrors(currentElement);
		String annotationClassName;
		// boolean valid=true;

		for (AnnotationMirror annotation : annotationList) {
			Map<String, String> values = new HashMap<String, String>();
			annotationClassName = annotation.getAnnotationType().asElement().toString();

			if (filter != null && !filter.isAccepted(annotationClassName)) {
				continue;
			}

			values.clear();
			for (Entry<? extends ExecutableElement, ? extends AnnotationValue> annotationItem : elementUtils.getElementValuesWithDefaults(annotation).entrySet()) {
				String value = annotationItem.getValue().toString();
				if (value.startsWith("\"") && value.endsWith("\"")) {
					value = value.substring(1);
					value = value.substring(0, value.length() - 1);
				}
				values.put(annotationItem.getKey().getSimpleName().toString(), value);
			}

			if (listener != null) {
				listener.onAcceptAnnotation(currentElement, annotationClassName, values);
			}
		}				
	}
777223
public static JDialog newJDialog(@NonNull JOptionPane pane, String title)
	{
		return newJDialog(null, pane, title);
	}
554969
protected void onError(String title, String msg) {
        // override this to override default error handling behavior
        AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
        builder.setMessage(msg).setTitle(title);
        builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                dialog.dismiss();
            }
        });
        AlertDialog dialog = builder.create();
        dialog.show();
    }
395723
public void pollAllToList(List<T> retList) {
    while (head != null) {
      retList.add(head.element);
      head = head.after;
    }
    this.clear();
  }
1370380
public void setTitle(java.util.Collection<StringFilter> title) {
        if (title == null) {
            this.title = null;
            return;
        }

        this.title = new java.util.ArrayList<StringFilter>(title);
    }
651429
private ElementDescription chooseElement(List<ElementDescription> elements) {
		final ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(),
				new LabelProvider());
		dialog.setElements(elements.toArray());
		dialog.setTitle(MessageFormat.format(Messages.AbstractSarlScriptInteractiveSelector_3, getElementLabel()));
		dialog.setMessage(MessageFormat.format(Messages.AbstractSarlScriptInteractiveSelector_3,
				getElementLongLabel()));
		dialog.setMultipleSelection(false);
		final int result = dialog.open();
		if (result == Window.OK) {
			return (ElementDescription) dialog.getFirstResult();
		}
		return null;
	}