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


Java Radio类代码示例

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


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

示例1: createAndAddRepoConfigDockerSection

import org.apache.wicket.markup.html.form.Radio; //导入依赖的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: add

import org.apache.wicket.markup.html.form.Radio; //导入依赖的package包/类
public Radio<T> add(final Model<T> model, final String labelString, final String tooltip)
{
  final WebMarkupContainer cont = new WebMarkupContainer(repeater.newChildId());
  repeater.add(cont);
  final Radio<T> radio = new Radio<T>("radio", model, radioGroup);
  if (autosubmit == true) {
    radio.add(AttributeModifier.replace("onchange", "javascript:submit();"));
  }
  cont.add(radio);
  final Label label = new Label("label", labelString);
  label.add(AttributeModifier.replace("for", radio.setOutputMarkupId(true).getMarkupId()));
  label.setRenderBodyOnly(true);
  cont.add(label);
  if (tooltip != null) {
    WicketUtils.addTooltip(label, tooltip);
  }
  return radio;
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:19,代码来源:RadioGroupPanel.java

示例3: ItemsForm

import org.apache.wicket.markup.html.form.Radio; //导入依赖的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

示例4: getComponentsToDecorateWithCSS

import org.apache.wicket.markup.html.form.Radio; //导入依赖的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

示例5: PollAnswerForm

import org.apache.wicket.markup.html.form.Radio; //导入依赖的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

示例6: init

import org.apache.wicket.markup.html.form.Radio; //导入依赖的package包/类
protected void init() {
    super.add(ResourcePackage.forJavaScript(StyledRadio.class));
    super.add(new CssClass("styled-checkbox"));

    radio = new Radio<>("radio", new DelegatedModel<T>(this));
    radio.setOutputMarkupId(true);
    add(radio);

    button = new RadioButton("button");
    add(button);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:12,代码来源:StyledRadio.java

示例7: addRadioButtons

import org.apache.wicket.markup.html.form.Radio; //导入依赖的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.Radio; //导入依赖的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: RadioButtonPanel

import org.apache.wicket.markup.html.form.Radio; //导入依赖的package包/类
public RadioButtonPanel(String id, IModel<T> valueModel, IModel<String> labelModel) {

        super(id);

        setLabel(labelModel);

        radio = new Radio<T>("field", valueModel) {
            @Override
            public boolean isEnabled() {
                return RadioButtonPanel.this.isEnabled();
            }
        };
        add(radio);

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

示例10: isRadioChecked

import org.apache.wicket.markup.html.form.Radio; //导入依赖的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

示例11: RadioButtonLabelPanel

import org.apache.wicket.markup.html.form.Radio; //导入依赖的package包/类
public RadioButtonLabelPanel(final String id, final IModel<T> model, final String label)
{
  super(id);
  radioButton = new Radio<T>("radioButton", model);
  add(radioButton);
  final Model<String> labelModel = new Model<String>(label);
  radioButton.setLabel(labelModel);
  // I18n key must be implemented as Model not as String because in constructor (before adding this component to parent) a warning will be
  // logged for using getString(String).
  add(new Label("label", labelModel).add(AttributeModifier.replace("for", radioButton.getMarkupId())));
  setRenderBodyOnly(true);
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:13,代码来源:RadioButtonLabelPanel.java

示例12: addChoice

import org.apache.wicket.markup.html.form.Radio; //导入依赖的package包/类
private void addChoice(String id) {
	searchTypeField.add(new Radio(id, new Model(id)) {
		@Override
		public String getValue() {
			return super.getId();
		}

		protected boolean getStatelessHint() {
			return true;
		}
	});
	searchTypeField.add(new Label("lbl_" + id, new StringResourceModel(
			"searchType." + id, this, null)));
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:15,代码来源:SearchFormPanel.java

示例13: initLayout

import org.apache.wicket.markup.html.form.Radio; //导入依赖的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

示例14: ConditionalInputBehavior

import org.apache.wicket.markup.html.form.Radio; //导入依赖的package包/类
public ConditionalInputBehavior(Radio<?> enableOption, ConditionalInputAction action) {
	this((Component)enableOption, action);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:4,代码来源:ConditionalInputBehavior.java

示例15: createAppForm

import org.apache.wicket.markup.html.form.Radio; //导入依赖的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


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