当前位置: 首页>>代码示例>>Java>>正文


Java RadioGroup类代码示例

本文整理汇总了Java中org.apache.wicket.markup.html.form.RadioGroup的典型用法代码示例。如果您正苦于以下问题:Java RadioGroup类的具体用法?Java RadioGroup怎么用?Java RadioGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RadioGroup类属于org.apache.wicket.markup.html.form包,在下文中一共展示了RadioGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAndAddRepoConfigDockerSection

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
@Override
public void createAndAddRepoConfigDockerSection(Form form, RepoDescriptor repoDescriptor, boolean isCreate) {
    WebMarkupContainer dockerSection = new WebMarkupContainer("dockerSupportSection");
    dockerSection.add(new TitledBorderBehavior("fieldset-border", "Docker"));
    dockerSection.add(new DisabledAddonBehavior(AddonType.DOCKER));
    dockerSection.add(new StyledCheckbox("enableDockerSupport").setTitle("Enable Docker Support").setEnabled(false));
    dockerSection.add(new SchemaHelpBubble("enableDockerSupport.help"));
    Label label = new Label("dockerRepoUrlLabel", "");
    label.setVisible(false);
    dockerSection.add(label);

    if (repoDescriptor instanceof LocalRepoDescriptor) {
        final RadioGroup dockerApiVersion = new RadioGroup("dockerApiVersion");
        dockerApiVersion.add(new Radio<>("v1", Model.of(DockerApiVersion.V1)));
        dockerApiVersion.add(new HelpBubble("v1.help", "Support Docker V1 API"));
        dockerApiVersion.add(new Radio<>("v2", Model.of(DockerApiVersion.V2)));
        dockerApiVersion.add(new HelpBubble("v2.help", "Support Docker V2 API"));
        dockerSection.add(dockerApiVersion);
    } else if (repoDescriptor instanceof RemoteRepoDescriptor) {
        dockerSection.add(new StyledCheckbox("dockerTokenAuthentication").setTitle("Enable Token Authentication").setEnabled(false));
        dockerSection.add(new SchemaHelpBubble("dockerTokenAuthentication.help"));
    }
    form.add(dockerSection);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:25,代码来源:WicketAddonsImpl.java

示例2: ItemsForm

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
public ItemsForm(String markupId, IModel<List<String>> discoItems) {
    super(markupId);

    radioGroup = new RadioGroup<String>("radioGroup", new Model<>());
    radioGroup.add(new ListView<String>("radioView", discoItems) {
        @Override
        protected void populateItem(ListItem<String> listItem) {
            listItem.add(new Radio<>("radioItem", listItem.getModel()));
            listItem.add(new Label("radioLabel", listItem.getModelObject()));
        }
    });
    this.add(radioGroup);

    this.add(new AjaxButton("connectBtn") {
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            String domain = radioGroup.getDefaultModelObjectAsString();
            if (null != domain && !domain.trim().isEmpty()) {
                String path = "";
                if (domain.contains("root")) {
                    path = "/iaas";
                } else if (domain.contains("gateway")) {
                    path = "/compute";
                }
                try {
                    setResponsePage(new BrowserPage(Model.of(new XmppURI(domain, path))));
                } catch (URISyntaxException e) {
                    logger.error("Failed to parse xmpp uri. entity: " + domain + ", resource: " + path);
                }
            } else {
                target.appendJavaScript("alert('Please select a value from the radio group!');");
            }
        }
    });
}
 
开发者ID:citlab,项目名称:Intercloud,代码行数:36,代码来源:DiscoverItemsPage.java

示例3: getComponentsToDecorateWithCSS

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
private static List<? extends Component> getComponentsToDecorateWithCSS(FormComponent<?> formComponent) {
	if (formComponent.getParent().getMetaData(FORM_GROUP) != null) {
		return ImmutableList.of(formComponent.getParent());
	} else if (formComponent instanceof RadioGroup) {
		return collect(formComponent, Radio.class);
	} else if (formComponent instanceof CheckGroup) {
		return collect(formComponent, Check.class);
	} else {
		return ImmutableList.of(formComponent);
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:12,代码来源:FormErrorDecoratorListener.java

示例4: PollAnswerForm

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
PollAnswerForm(String id, IModel<RoomPollAnswer> model) {
	super(id, model);
	add(feedback);
	add(new Label("user", user));
	add(new Label("roomPoll.question"));
	add(typeBool.add(new RadioGroup<Boolean>("answer").setRequired(true)
				.add(new Radio<>("true", Model.of(Boolean.TRUE))).add(new Radio<>("false", Model.of(Boolean.FALSE)))
		).setOutputMarkupPlaceholderTag(true).setVisible(false));
	add(typeInt.add(new DropDownChoice<>("pointList", answers).setRequired(true))
			.setOutputMarkupPlaceholderTag(true).setVisible(false));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:12,代码来源:VoteDialog.java

示例5: getGroup

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected RadioGroup<T> getGroup() {
    RadioGroup<T> group = this.group;
    if (group == null) {
        group = findParent(RadioGroup.class);
        if (group == null) {
            throw new WicketRuntimeException(
                    "Radio component [" +
                            getPath() +
                            "] cannot find its parent RadioGroup. All Radio components must be a child of or below in the hierarchy of a RadioGroup component.");
        }
    }
    return group;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:15,代码来源:StyledRadio.java

示例6: isChecked

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
private boolean isChecked() {
    final RadioGroup<T> group = getGroup();
    if (group.hasRawInput()) {
        String rawInput = group.getRawInput();
        if (rawInput != null && rawInput.equals(radio.getValue())) {
            return true;
        }
    } else if (group.getModelComparator().compare(group, getDefaultModelObject())) {
        return true;
    }
    return false;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:13,代码来源:StyledRadio.java

示例7: addRadioButtons

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
private void addRadioButtons()
{
    radioGroup = new RadioGroup( "searchOptions", new PropertyModel( this, "selectedRadioButton" ) );
    AjaxFormComponentUpdatingBehavior ajaxRadioUpdater = new AjaxFormChoiceComponentUpdatingBehavior()
    {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;


        @Override
        protected void onUpdate( final AjaxRequestTarget target )
        {
            processRadioButton( target );
        }
    };
    radioGroup.add( ajaxRadioUpdater );
    add( radioGroup );
    Radio userRb = new Radio( "userRb", new Model( USERS ) );
    radioGroup.add( userRb );
    Radio roleRb = new Radio( "roleRb", new Model( ROLES ) );
    radioGroup.add( roleRb );
    Radio adminRoleRb = new Radio( "adminRoleRb", new Model( ADMIN_ROLES ) );
    radioGroup.add( adminRoleRb );
    Radio ouRb = new Radio( "ouRb", new Model( OUS ) );
    radioGroup.add( ouRb );
    Radio permRb = new Radio( "permRb", new Model( PERMS ) );
    radioGroup.add( permRb );
    radioGroup.setOutputMarkupId( true );
    radioGroup.setRenderBodyOnly( false );

    userformsearchfields.add( radioGroup );
    selectedRadioButton = USERS;

    addRoleSearchModal( roleRb );
    addAdminRoleSearchModal( adminRoleRb );
    addOUSearchModal( ouRb );
    addPermSearchModal( permRb );
}
 
开发者ID:apache,项目名称:directory-fortress-commander,代码行数:39,代码来源:UserListPanel.java

示例8: onInitialize

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
@Override
public void onInitialize() {
	super.onInitialize();
			
	//points/percentage entry
	RadioGroup<Integer> gradeEntry = new RadioGroup<>("gradeEntry", new PropertyModel<Integer>(model, "gradebookInformation.gradeType"));
	gradeEntry.add(new Radio<>("points", new Model<>(1)));
	gradeEntry.add(new Radio<>("percentages", new Model<>(2)));
	add(gradeEntry);
	
}
 
开发者ID:steveswinsburg,项目名称:gradebookNG,代码行数:12,代码来源:SettingsGradeEntryPanel.java

示例9: isRadioChecked

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
/**
 * Returns true if the given checkbox is checked. Works whether or not
 * the form has been submitted.
 */
public static boolean isRadioChecked(Radio<?> radio) {
    Form<?> form = radio.findParent(Form.class);
    RadioGroup<?> radioGroup = radio.findParent(RadioGroup.class);
    if (form != null && form.isSubmitted()) {
        // After form post
        return Strings.isEqual(radioGroup.getInput(), radio.getValue());
    } else {
        // Initial display, before the form is posted
        Object o1 = radioGroup.getDefaultModelObject();
        return o1 != null && o1.equals(radio.getDefaultModelObject());
    }

}
 
开发者ID:jkrasnay,项目名称:panelized,代码行数:18,代码来源:WicketUtils.java

示例10: RadioGroupPanel

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
/**
 * @param id
 * @param model
 * @param labelString
 */
public RadioGroupPanel(final String id, final String groupName, final IModel<T> model)
{
  super(id);
  radioGroup = new RadioGroup<T>("radioGroup", model) {
    /**
     * @see org.apache.wicket.markup.html.form.RadioGroup#wantOnSelectionChangedNotifications()
     */
    @Override
    protected boolean wantOnSelectionChangedNotifications()
    {
      return RadioGroupPanel.this.wantOnSelectionChangedNotifications();
    }

    /**
     * @see org.apache.wicket.markup.html.form.RadioGroup#onSelectionChanged(java.lang.Object)
     */
    @Override
    protected void onSelectionChanged(final Object newSelection)
    {
      RadioGroupPanel.this.onSelectionChanged(newSelection);
    }
  };
  add(radioGroup);
  radioGroup.add(repeater = new RepeatingView("repeater"));
  setRenderBodyOnly(true);
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:32,代码来源:RadioGroupPanel.java

示例11: initLayout

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM);
    add(mainForm);

    final WebMarkupContainer input = new WebMarkupContainer(ID_INPUT);
    input.setOutputMarkupId(true);
    mainForm.add(input);

    final WebMarkupContainer buttonBar = new WebMarkupContainer(ID_BUTTON_BAR);
    buttonBar.setOutputMarkupId(true);
    mainForm.add(buttonBar);

    final IModel<Integer> groupModel = new Model<Integer>(INPUT_FILE);
    RadioGroup importRadioGroup = new RadioGroup(ID_IMPORT_RADIO_GROUP, groupModel);
    importRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            target.add(input);
            target.add(buttonBar);
        }
    });
    mainForm.add(importRadioGroup);

    Radio fileRadio = new Radio(ID_FILE_RADIO, new Model(INPUT_FILE), importRadioGroup);
    importRadioGroup.add(fileRadio);

    Radio xmlRadio = new Radio(ID_XML_RADIO, new Model(INPUT_XML), importRadioGroup);
    importRadioGroup.add(xmlRadio);

    WebMarkupContainer inputAce = new WebMarkupContainer(ID_INPUT_ACE);
    addVisibileForInputType(inputAce, INPUT_XML, groupModel);
    input.add(inputAce);

 	
    AceEditor aceEditor = new AceEditor(ID_ACE_EDITOR, xmlEditorModel);
    aceEditor.setOutputMarkupId(true);
    inputAce.add(aceEditor);

    WebMarkupContainer inputFileLabel = new WebMarkupContainer(ID_INPUT_FILE_LABEL);
    addVisibileForInputType(inputFileLabel, INPUT_FILE, groupModel);
    input.add(inputFileLabel);

    WebMarkupContainer inputFile = new WebMarkupContainer(ID_INPUT_FILE);
    addVisibileForInputType(inputFile, INPUT_FILE, groupModel);
    input.add(inputFile);

    FileUploadField fileInput = new FileUploadField(ID_FILE_INPUT);
    inputFile.add(fileInput);

    initButtons(buttonBar, groupModel);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:53,代码来源:PageNewReport.java

示例12: isChoice

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
private static boolean isChoice(Component component) {
	return (component instanceof RadioChoice) ||
			(component instanceof CheckBoxMultipleChoice) || (component instanceof RadioGroup) ||
			(component instanceof CheckGroup);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:6,代码来源:FormComponentChangeAjaxEventBehavior.java

示例13: createAppForm

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
private void createAppForm() {

        appForm = new Form<>("appForm", new CompoundPropertyModel<>(new FirstApplicationReleaseInfos()));

        TextField<String> appLabel = new TextField<>("appLabel");
        appLabel.setLabel(WicketUtils.getStringResourceModel(this, "portal.application.label.label"));

        appLabel.add(new AbstractValidator<String>() {
            @Override
            protected void onValidate(IValidatable<String> iValidatable) {
                if(!parentPage.isApplicationLabelUnique(iValidatable.getValue())) {
                    error(iValidatable);
                }
            }

            @Override
            protected String resourceKey() {
                return "portal.application.label.non.unique";
            }

            @Override
            protected Map<String, Object> variablesMap(IValidatable<String> stringIValidatable) {
                Map<String, Object> map = super.variablesMap(stringIValidatable);
                map.put("label", stringIValidatable.getValue());
                return map;
            }
        });
        appLabel.add(new PropertyValidator<>());
        appForm.add(appLabel);

        TextField<String> appCode = new TextField<>("appCode");
        appCode.setLabel(WicketUtils.getStringResourceModel(this, "portal.application.code.label"));
        appCode.add(new PropertyValidator<>());
        appForm.add(appCode);

        TextArea<String> appDescription = new TextArea<>("appDescription");
        appDescription.setLabel(WicketUtils.getStringResourceModel(this, "portal.application.description.label"));
        appDescription.add(new PropertyValidator<>());
        appForm.add(appDescription);

        RadioGroup<Boolean> appVisibility = new RadioGroup<>("appPublic");
        appVisibility.add(new Radio<Boolean>("appVisibilityRadioGroup-public", new Model<>(Boolean.TRUE)));
        appVisibility.add(new Radio<Boolean>("appVisibilityRadioGroup-private", new Model<>(Boolean.FALSE)));
        appVisibility.add(new PropertyValidator<>());
        appForm.add(appVisibility);
        appForm.add(new CacheActivatedImage("imageHelp.visibilityField", new ResourceModel("image.help").getObject()));

        TextField<String> members = new TextField<>("members");
        members.add(new PropertyValidator<>());
        appForm.add(members);
        appForm.add(new CacheActivatedImage("imageHelp.membersField", new ResourceModel("image.help").getObject()));

        releaseFiedsetPanel = new ReleaseFieldsetPanel("releaseFieldsetPanel", parentPage, manageApplicationRelease);
        appForm.add(releaseFiedsetPanel);

        createFormButtons(appForm);

        // set default visibility to private
        appForm.getModelObject().setAppPublic(Boolean.FALSE);

        add(appForm);
    }
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:63,代码来源:ApplicationCreatePanel.java

示例14: setGroup

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
public StyledRadio setGroup(RadioGroup<T> group) {
    this.group = group;
    return this;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:5,代码来源:StyledRadio.java

示例15: initLayout

import org.apache.wicket.markup.html.form.RadioGroup; //导入依赖的package包/类
private void initLayout() {
    Form mainForm = new com.evolveum.midpoint.web.component.form.Form(ID_MAIN_FORM);
    add(mainForm);

    final WebMarkupContainer input = new WebMarkupContainer(ID_INPUT);
    input.setOutputMarkupId(true);
    mainForm.add(input);

    final WebMarkupContainer buttonBar = new WebMarkupContainer(ID_BUTTON_BAR);
    buttonBar.setOutputMarkupId(true);
    mainForm.add(buttonBar);

    final IModel<Integer> groupModel = new Model<Integer>(INPUT_FILE);
    RadioGroup importRadioGroup = new RadioGroup(ID_IMPORT_RADIO_GROUP, groupModel);
    importRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            target.add(input);
            target.add(buttonBar);
        }
    });
    mainForm.add(importRadioGroup);

    Radio fileRadio = new Radio(ID_FILE_RADIO, new Model(INPUT_FILE), importRadioGroup);
    importRadioGroup.add(fileRadio);

    Radio xmlRadio = new Radio(ID_XML_RADIO, new Model(INPUT_XML), importRadioGroup);
    importRadioGroup.add(xmlRadio);

    WebMarkupContainer inputAce = new WebMarkupContainer(ID_INPUT_ACE);
    addVisibileForInputType(inputAce, INPUT_XML, groupModel);
    input.add(inputAce);


    AceEditor aceEditor = new AceEditor(ID_ACE_EDITOR, xmlEditorModel);
    aceEditor.setOutputMarkupId(true);
    inputAce.add(aceEditor);

    WebMarkupContainer inputFileLabel = new WebMarkupContainer(ID_INPUT_FILE_LABEL);
    addVisibileForInputType(inputFileLabel, INPUT_FILE, groupModel);
    input.add(inputFileLabel);

    WebMarkupContainer inputFile = new WebMarkupContainer(ID_INPUT_FILE);
    addVisibileForInputType(inputFile, INPUT_FILE, groupModel);
    input.add(inputFile);

    FileUploadField fileInput = new FileUploadField(ID_FILE_INPUT);
    inputFile.add(fileInput);

    initButtons(buttonBar, groupModel);
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:53,代码来源:PageNewReport.java


注:本文中的org.apache.wicket.markup.html.form.RadioGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。