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


Java EnumChoiceRenderer类代码示例

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


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

示例1: initViewSelector

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
private void initViewSelector(WebMarkupContainer headerPanel){
    DropDownChoice<AssignmentViewType> viewSelect = new DropDownChoice(ID_VIEW_TYPE, viewModel,
            Model.ofList(viewTypeList != null && viewTypeList.size() > 0 ?
                    viewTypeList : createAssignableTypesList()),
            new EnumChoiceRenderer<AssignmentViewType>(this));
    viewSelect.add(new OnChangeAjaxBehavior() {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            if (AssignmentViewType.USER_TYPE.equals(viewSelect.getModelObject())){
                initUserViewSelectionPopup(createStringResource("AssignmentCatalogPanel.selectAssignmentsUserOwner"),
                        target);
            } else {
                searchModel.reset();
                AssignmentCatalogPanel.this.addOrReplaceSearchPanel(getHeaderPanel());
                AssignmentCatalogPanel.this.addOrReplaceLayout(target, getCatalogItemsPanelContainer(), getPageBase());
                target.add(getCatalogItemsPanelContainer());
                target.add(getHeaderPanel());
            }
        }
    });
    viewSelect.setOutputMarkupId(true);
    headerPanel.add(viewSelect);

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:27,代码来源:AssignmentCatalogPanel.java

示例2: initLayout

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
private void initLayout(final Component component){

        TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), UserReportDto.F_NAME),
                createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
        add(name);

        TextFormGroup description = new TextFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), UserReportDto.F_DESCRIPTION),
                createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
        add(description);

        IModel choices = WebComponentUtil.createReadonlyModelFromEnum(ExportType.class);
        IChoiceRenderer renderer = new EnumChoiceRenderer();
        DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new
                PropertyModel<ExportType>(getModel(), UserReportDto.F_EXPORT_TYPE), choices, renderer,
                createStringResource("UserReportConfigPanel.exportFileType"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
        add(exportType);

        DateFormGroup dateFrom = new DateFormGroup(ID_DATE_FROM, new PropertyModel<XMLGregorianCalendar>(getModel(), UserReportDto.F_FROM_GREG),
                createStringResource("UserReportConfigPanel.dateFrom"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
        add(dateFrom);

        DateFormGroup dateTo = new DateFormGroup(ID_DATE_TO, new PropertyModel<XMLGregorianCalendar>(getModel(), UserReportDto.F_TO_GREG),
                createStringResource("UserReportConfigPanel.dateTo"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
        add(dateTo);
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:26,代码来源:UserReportConfigPanel.java

示例3: initAdvanced

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
private void initAdvanced(Form mainForm) {
        CheckBox runUntilNodeDown = new CheckBox(ID_RUN_UNTIL_NODW_DOWN, new PropertyModel<Boolean>(model,
                TaskAddDto.F_RUN_UNTIL_NODW_DOWN));
        mainForm.add(runUntilNodeDown);

        final IModel<Boolean> createSuspendedCheck = new PropertyModel<>(model, TaskAddDto.F_SUSPENDED_STATE);
        CheckBox createSuspended = new CheckBox(ID_CREATE_SUSPENDED, createSuspendedCheck);
        mainForm.add(createSuspended);

        DropDownChoice threadStop = new DropDownChoice<>(ID_THREAD_STOP, new Model<ThreadStopActionType>() {

            @Override
            public ThreadStopActionType getObject() {
                TaskAddDto dto = model.getObject();
//				if (dto.getThreadStop() == null) {
//					if (!dto.getRunUntilNodeDown()) {
//						dto.setThreadStop(ThreadStopActionType.RESTART);
//					} else {
//						dto.setThreadStop(ThreadStopActionType.CLOSE);
//					}
//				}
                return dto.getThreadStop();
            }

            @Override
            public void setObject(ThreadStopActionType object) {
                model.getObject().setThreadStop(object);
            }
        }, WebComponentUtil.createReadonlyModelFromEnum(ThreadStopActionType.class),
                new EnumChoiceRenderer<ThreadStopActionType>(PageTaskAdd.this));
        mainForm.add(threadStop);

        mainForm.add(new TsaValidator(runUntilNodeDown, threadStop));

        DropDownChoice misfire = new DropDownChoice<>(ID_MISFIRE_ACTION, new PropertyModel<MisfireActionType>(
                model, TaskAddDto.F_MISFIRE_ACTION), WebComponentUtil.createReadonlyModelFromEnum(MisfireActionType.class),
                new EnumChoiceRenderer<MisfireActionType>(PageTaskAdd.this));
        mainForm.add(misfire);
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:40,代码来源:PageTaskAdd.java

示例4: initLayout

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
protected void initLayout() {
    TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), ID_NAME),
            createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
    add(name);

    TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION,
            new PropertyModel<String>(getModel(), ID_DESCRIPTION),
            createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    add(description);

    IModel choices = WebComponentUtil.createReadonlyModelFromEnum(ExportType.class);
    IChoiceRenderer renderer = new EnumChoiceRenderer();
    DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new PropertyModel<ExportType>(getModel(), ReportDto.F_EXPORT_TYPE), choices, renderer,
            createStringResource("ReportType.export"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
    add(exportType);

    TextFormGroup virtualizerKickOn = null;
    DropDownFormGroup virtualizer = new DropDownFormGroup(ID_VIRTUALIZER, new PropertyModel<String>(getModel(), ReportDto.F_VIRTUALIZER),
            createVirtualizerListModel(), new ChoiceRenderer<String>(),
            createStringResource("ReportType.virtualizer"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    //virtualizer.add(new VirtualizerAjaxFormUpdatingBehaviour(virtualizerKickOn));
    add(virtualizer);

    virtualizerKickOn = new TextFormGroup(ID_VIRTUALIZER_KICKON, new PropertyModel<String>(getModel(), ReportDto.F_VIRTUALIZER_KICKON),
            createStringResource("ReportType.virtualizerKickOn"), ID_LABEL_SIZE, "col-md-4", false);
    add(virtualizerKickOn);

    TextFormGroup maxPages = new TextFormGroup(ID_MAXPAGES, new PropertyModel<String>(getModel(), ReportDto.F_MAXPAGES),
            createStringResource("ReportType.maxPages"), ID_LABEL_SIZE, "col-md-4", false);
    add(maxPages);

    TextFormGroup timeout = new TextFormGroup(ID_TIMEOUT, new PropertyModel<String>(getModel(), ReportDto.F_TIMEOUT),
            createStringResource("ReportType.timeout"), ID_LABEL_SIZE, "col-md-4", false);
    add(timeout);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:36,代码来源:ReportConfigurationPanel.java

示例5: initComponents

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
private void initComponents() {
      initContainers();
      
   //Select middlewareProfile choice
middlewareProfileSelect = new DropDownChoice<>("middlewareProfileSelect",
                                                           new Model<MiddlewareProfile>(),
                                                           getMiddlewareProfileList(), 
                                                           new ProfileChoiceRenderer(this, new EnumChoiceRenderer<MiddlewareProfile.MiddlewareProfileStatus>(this)));
      middlewareProfileSelect.setNullValid(false);
      middlewareProfileSelect.setRequired(true);
      middlewareProfileSelect.setDefaultModelObject(MiddlewareProfile.getDefault());
      middlewareProfileContainer.add(middlewareProfileSelect);
  }
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:14,代码来源:ReleaseOverrideProfilePanel.java

示例6: initLayout

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
protected void initLayout() {
    TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), ID_NAME),
            createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
    add(name);

    TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION,
            new PropertyModel<String>(getModel(), ID_DESCRIPTION),
            createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    add(description);

    IModel choices = WebComponentUtil.createReadonlyValueModelFromEnum(ExportType.class, e -> e != ExportType.JXL);
    IChoiceRenderer renderer = new EnumChoiceRenderer();
    DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new PropertyModel<ExportType>(getModel(), ReportDto.F_EXPORT_TYPE), choices, renderer,
            createStringResource("ReportType.export"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
    add(exportType);

    TextFormGroup virtualizerKickOn = null;
    DropDownFormGroup virtualizer = new DropDownFormGroup(ID_VIRTUALIZER, new PropertyModel<String>(getModel(), ReportDto.F_VIRTUALIZER),
            createVirtualizerListModel(), new ChoiceRenderer<String>(),
            createStringResource("ReportType.virtualizer"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    //virtualizer.add(new VirtualizerAjaxFormUpdatingBehaviour(virtualizerKickOn));
    add(virtualizer);

    virtualizerKickOn = new TextFormGroup(ID_VIRTUALIZER_KICKON, new PropertyModel<String>(getModel(), ReportDto.F_VIRTUALIZER_KICKON),
            createStringResource("ReportType.virtualizerKickOn"), ID_LABEL_SIZE, "col-md-4", false);
    add(virtualizerKickOn);

    TextFormGroup maxPages = new TextFormGroup(ID_MAXPAGES, new PropertyModel<String>(getModel(), ReportDto.F_MAXPAGES),
            createStringResource("ReportType.maxPages"), ID_LABEL_SIZE, "col-md-4", false);
    add(maxPages);

    TextFormGroup timeout = new TextFormGroup(ID_TIMEOUT, new PropertyModel<String>(getModel(), ReportDto.F_TIMEOUT),
            createStringResource("ReportType.timeout"), ID_LABEL_SIZE, "col-md-4", false);
    add(timeout);
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:36,代码来源:ReportConfigurationPanel.java

示例7: initViewSelector

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
private void initViewSelector(WebMarkupContainer headerPanel){
    DropDownChoice<AssignmentViewType> viewSelect = new DropDownChoice(ID_VIEW_TYPE, viewTypeModel,
            Model.ofList(getRoleCatalogStorage().getShoppingCartConfigurationDto().getViewTypeList()),
            new EnumChoiceRenderer<AssignmentViewType>(this));
    viewSelect.add(new OnChangeAjaxBehavior() {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            initProvider();
            searchModel.reset();

            target.add(getContentPanel());
            target.add(getHeaderPanel());
        }
    });
    viewSelect.add(new VisibleEnableBehaviour(){
        private static final long serialVersionUID = 1L;

        @Override
        public boolean isEnabled(){
            return getRoleCatalogStorage().getAssignmentsUserOwner() == null;
        }
    });
    viewSelect.setOutputMarkupId(true);
    headerPanel.add(viewSelect);

}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:29,代码来源:PageAssignmentShoppingKart.java

示例8: initBasicInfoLayout

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
private void initBasicInfoLayout() {
	
	final TextField nameField = new TextField(ID_NAME, new PropertyModel<>(getModel(), CertDefinitionDto.F_NAME));
	nameField.add(new VisibleEnableBehaviour() {
		@Override
		public boolean isEnabled() {
			return true;
		}
	});
	add(nameField);

	final TextArea descriptionField = new TextArea(ID_DESCRIPTION, new PropertyModel<>(getModel(), CertDefinitionDto.F_DESCRIPTION));
	descriptionField.add(new VisibleEnableBehaviour() {
		@Override
		public boolean isEnabled() {
			return true;
		}
	});
	add(descriptionField);

	final WebMarkupContainer ownerRefChooser = createOwnerRefChooser(ID_OWNER_REF_CHOOSER);
	ownerRefChooser.setOutputMarkupId(true);
	add(ownerRefChooser);

	DropDownChoice remediation = new DropDownChoice<>(ID_REMEDIATION, new Model<AccessCertificationRemediationStyleType>() {

		@Override
		public AccessCertificationRemediationStyleType getObject() {
			return getModel().getObject().getRemediationStyle();
		}

		@Override
		public void setObject(AccessCertificationRemediationStyleType object) {
			getModel().getObject().setRemediationStyle(object);
		}
	}, WebComponentUtil.createReadonlyModelFromEnum(AccessCertificationRemediationStyleType.class),
			new EnumChoiceRenderer<>(this));
	add(remediation);

	DropDownChoice outcomeStrategy =
			new DropDownChoice<>(ID_OUTCOME_STRATEGY,
					new PropertyModel<>(getModel(), CertDefinitionDto.F_OUTCOME_STRATEGY),
					WebComponentUtil.createReadonlyModelFromEnum(AccessCertificationCaseOutcomeStrategyType.class),
					new EnumChoiceRenderer<>(this));
	add(outcomeStrategy);

	add(WebComponentUtil.createHelp(ID_OUTCOME_STRATEGY_HELP));

	Label stopReviewOn = new Label(ID_STOP_REVIEW_ON, new AbstractReadOnlyModel<String>() {
		@Override
		public String getObject() {
			List<AccessCertificationResponseType> stopOn = getModel().getObject().getStopReviewOn();
			return CertMiscUtil.getStopReviewOnText(stopOn, getPageBase());
		}
	});
	add(stopReviewOn);

	//        add(new Label(ID_REVIEW_STAGE_CAMPAIGNS, new PropertyModel<>(getModel(), CertDefinitionDto.F_NUMBER_OF_STAGES)));
	//        add(new Label(ID_CAMPAIGNS_TOTAL, new PropertyModel<>(getModel(), CertDefinitionDto.F_NUMBER_OF_STAGES)));
	add(new Label(ID_LAST_STARTED, new PropertyModel<>(getModel(), CertDefinitionDto.F_LAST_STARTED)));
	add(new Label(ID_LAST_CLOSED, new PropertyModel<>(getModel(), CertDefinitionDto.F_LAST_CLOSED)));
	add(WebComponentUtil.createHelp(ID_LAST_STARTED_HELP));
	add(WebComponentUtil.createHelp(ID_LAST_CLOSED_HELP));
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:65,代码来源:DefinitionBasicPanel.java

示例9: initLayout

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
protected void initLayout(){

        ChooseTypePanel<ValuePolicyType> passPolicyChoosePanel = new ChooseTypePanel<ValuePolicyType>(ID_GLOBAL_PASSWORD_POLICY_CHOOSER,
                new PropertyModel<ObjectViewDto<ValuePolicyType>>(getModel(), SystemConfigurationDto.F_PASSWORD_POLICY));

        ChooseTypePanel<SecurityPolicyType> securityPolicyChoosePanel = new ChooseTypePanel<SecurityPolicyType>(ID_GLOBAL_SECURITY_POLICY_CHOOSER,
                new PropertyModel<ObjectViewDto<SecurityPolicyType>>(getModel(), SystemConfigurationDto.F_SECURITY_POLICY));
        add(passPolicyChoosePanel);
        add(securityPolicyChoosePanel);

        ObjectPolicyConfigurationEditor objectPolicyEditor = new ObjectPolicyConfigurationEditor(ID_OBJECT_POLICY_EDITOR,
                new PropertyModel<List<ObjectPolicyConfigurationTypeDto>>(getModel(), SystemConfigurationDto.F_OBJECT_POLICY_LIST));
        add(objectPolicyEditor);

        DropDownChoice<AEPlevel> aepLevel = new DropDownChoice<>(ID_GLOBAL_AEP,
                new PropertyModel<AEPlevel>(getModel(), SystemConfigurationDto.F_AEP_LEVEL),
                WebComponentUtil.createReadonlyModelFromEnum(AEPlevel.class),
                new EnumChoiceRenderer<AEPlevel>(SystemConfigPanel.this));
        aepLevel.setOutputMarkupId(true);
        if(aepLevel.getModel().getObject() == null){
            aepLevel.getModel().setObject(null);
        }
        aepLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
        add(aepLevel);
        

        TextField<String> auditRecordsField = WebComponentUtil.createAjaxTextField(ID_CLEANUP_AUDIT_RECORDS, new PropertyModel<String>(getModel(), SystemConfigurationDto.F_AUDIT_CLEANUP));
        
        TextField<String> closedTasksField = WebComponentUtil.createAjaxTextField(ID_CLEANUP_CLOSED_TASKS, new PropertyModel<String>(getModel(), SystemConfigurationDto.F_TASK_CLEANUP));
        
        add(auditRecordsField);
        add(closedTasksField);

        createTooltip(ID_CLEANUP_AUDIT_RECORDS_TOOLTIP);
        createTooltip(ID_CLEANUP_CLOSED_TASKS_TOOLTIP);

        
        CheckBox experimentalCodeCheck = WebComponentUtil.createAjaxCheckBox(ID_EXPERIMENTAL_CODE_CHECKBOX, new PropertyModel<Boolean>(getModel(), SystemConfigurationDto.F_ENABLE_EXPERIMENTAL_CODE));
        add(experimentalCodeCheck);
       
    
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:43,代码来源:SystemConfigPanel.java

示例10: initLayout

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
private void initLayout(PageSystemConfiguration parentPage) {

		WebMarkupContainer profilingEnabledNote = new WebMarkupContainer(ID_PROFILING_ENABLED_NOTE);
		profilingEnabledNote.setVisible(!parentPage.getMidpointConfiguration().isProfilingEnabled());
		add(profilingEnabledNote);

        //Entry-Exit profiling init
        DropDownChoice<ProfilingLevel> profilingLevel = new DropDownChoice<>("profilingLevel",
                new PropertyModel<ProfilingLevel>(getModel(), "profilingLevel"),
                WebComponentUtil.createReadonlyModelFromEnum(ProfilingLevel.class),
                new EnumChoiceRenderer<ProfilingLevel>(this));
        profilingLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
        add(profilingLevel);

        DropDownChoice<String> profilingAppender = new DropDownChoice<>("profilingAppender",
                new PropertyModel<String>(getModel(), "profilingAppender"), createAppendersListModel());
        profilingAppender.setNullValid(true);
        profilingAppender.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
        add(profilingAppender);

        //Subsystem and general profiling init
        CheckBox requestFilter = WebComponentUtil.createAjaxCheckBox("requestFilter", new PropertyModel<Boolean>(getModel(), "requestFilter"));
        
        CheckBox performanceStatistics = WebComponentUtil.createAjaxCheckBox("performanceStatistics", new PropertyModel<Boolean>(getModel(), "performanceStatistics"));
        CheckBox subsystemModel = WebComponentUtil.createAjaxCheckBox("subsystemModel", new PropertyModel<Boolean>(getModel(), "subsystemModel"));
        CheckBox subsystemRepository = WebComponentUtil.createAjaxCheckBox("subsystemRepository", new PropertyModel<Boolean>(getModel(), "subsystemRepository"));
        CheckBox subsystemProvisioning = WebComponentUtil.createAjaxCheckBox("subsystemProvisioning", new PropertyModel<Boolean>(getModel(), "subsystemProvisioning"));
        //CheckBox subsystemUcf = WebComponentUtil.createAjaxCheckBox("subsystemUcf", new PropertyModel<Boolean>(getModel(), "subsystemUcf"));
        CheckBox subsystemResourceObjectChangeListener = WebComponentUtil.createAjaxCheckBox("subsystemSynchronizationService", new PropertyModel<Boolean>(getModel(), "subsystemSynchronizationService"));
        CheckBox subsystemTaskManager = WebComponentUtil.createAjaxCheckBox("subsystemTaskManager", new PropertyModel<Boolean>(getModel(), "subsystemTaskManager"));
        CheckBox subsystemWorkflow = WebComponentUtil.createAjaxCheckBox("subsystemWorkflow", new PropertyModel<Boolean>(getModel(), "subsystemWorkflow"));
        add(requestFilter);
        add(performanceStatistics);
        add(subsystemModel);
        add(subsystemRepository);
        add(subsystemProvisioning);
        //add(subsystemUcf);
        add(subsystemResourceObjectChangeListener);
        add(subsystemTaskManager);
        add(subsystemWorkflow);

        TextField<Integer> dumpInterval = WebComponentUtil.createAjaxTextField("dumpInterval", new PropertyModel<Integer>(getModel(),
                "dumpInterval"));
        add(dumpInterval);

        Label dumpIntervalTooltip = new Label(ID_DUMP_INTERVAL_TOOLTIP);
        dumpIntervalTooltip.add(new InfoTooltipBehavior());
        add(dumpIntervalTooltip);
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:50,代码来源:ProfilingConfigPanel.java

示例11: initLayout

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

	TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION,
			new PropertyModel<String>(model,
					MultiplicityPolicyConstraintType.F_DESCRIPTION.getLocalPart()),
			createStringResource("multiplicityContainer.label.description"), ID_LABEL_SIZE,
			ID_INPUT_SIZE);
	form.add(description);

	DropDownFormGroup enforcement = new DropDownFormGroup<>(ID_ENFORCEMENT,
			new PropertyModel<PolicyConstraintEnforcementType>(model,
					MultiplicityPolicyConstraintType.F_ENFORCEMENT.getLocalPart()),
			WebComponentUtil.createReadonlyModelFromEnum(PolicyConstraintEnforcementType.class),
			new EnumChoiceRenderer<PolicyConstraintEnforcementType>(),
			createStringResource("multiplicityContainer.label.enforcement"), ID_LABEL_SIZE, ID_INPUT_SIZE,
			false);
	form.add(enforcement);

	WebMarkupContainer multiplicityContainer = new WebMarkupContainer(ID_MULTIPLICITY_CONTAINER);
	multiplicityContainer.setOutputMarkupId(true);
	form.add(multiplicityContainer);

	TextField multiplicity = new TextField<>(ID_MULTIPLICITY, new PropertyModel<String>(model,
			MultiplicityPolicyConstraintType.F_MULTIPLICITY.getLocalPart()));
	multiplicity.add(prepareMultiplicityValidator());
	multiplicity.add(new VisibleEnableBehaviour() {

		@Override
		public boolean isEnabled() {
			return !unbounded;
		}
	});
	multiplicityContainer.add(multiplicity);

	CheckBox multiplicityUnbounded = new CheckBox(ID_MULTIPLICITY_UNBOUND,
			new PropertyModel<Boolean>(this, MULTIPLICITY_UNBOUNDED));
	multiplicityUnbounded.add(new OnChangeAjaxBehavior() {

		@Override
		protected void onUpdate(AjaxRequestTarget target) {
			model.getObject().setMultiplicity(MULTIPLICITY_UNBOUNDED);
			target.add(getMultiplicityContainer());
		}
	});
	multiplicityContainer.add(multiplicityUnbounded);

	initButtons(form);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:52,代码来源:MultiplicityPolicyPanel.java

示例12: EnumDropDownMultipleChoice

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
public <C extends Collection<E>> EnumDropDownMultipleChoice(String id, IModel<C> collectionModel, Supplier<? extends C> collectionSupplier, IModel<? extends List<? extends E>> choicesModel) {
	this(id, collectionModel, collectionSupplier, choicesModel, new EnumChoiceRenderer<E>());
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:4,代码来源:EnumDropDownMultipleChoice.java

示例13: ProjectDetailPanel

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
public ProjectDetailPanel(String id, IModel<Project> aModel)
{
    super(id);
    
    projectModel = aModel;
    
    Form<Project> form = new Form<>("form", CompoundPropertyModel.of(aModel));
    add(form);
    
    TextField<String> projectNameTextField = new TextField<>("name");
    projectNameTextField.setRequired(true);
    projectNameTextField.add(new ProjectExistsValidator());
    projectNameTextField.add(new ProjectNameValidator());
    form.add(projectNameTextField);

    // If we run in development mode, then also show the ID of the project
    form.add(idLabel = new Label("id"));
    idLabel.setVisible(RuntimeConfigurationType.DEVELOPMENT
            .equals(getApplication().getConfigurationType()));

    form.add(new TextArea<String>("description").setOutputMarkupId(true));
    
    DropDownChoice<ScriptDirection> scriptDirection = new DropDownChoice<>("scriptDirection");
    scriptDirection.setChoiceRenderer(new EnumChoiceRenderer<>(this));
    scriptDirection.setChoices(Arrays.asList(ScriptDirection.values()));
    form.add(scriptDirection);
    
    form.add(new CheckBox("disableExport"));
    
    form.add(makeProjectTypeChoice());
    
    form.add(new LambdaAjaxButton<>("save", this::actionSave));
    form.add(new LambdaAjaxLink("cancel", this::actionCancel));
    form.add(new LambdaAjaxLink("delete", this::actionDelete).onConfigure((_this) -> 
        _this.setEnabled(projectModel.getObject() != null && 
                projectModel.getObject().getId() > 0 )));

    IModel<String> projectNameModel = PropertyModel.of(projectModel, "name");
    add(deleteProjectDialog = new ChallengeResponseDialog("deleteProjectDialog",
            new StringResourceModel("DeleteProjectDialog.title", this),
            new StringResourceModel("DeleteProjectDialog.text", this)
                    .setModel(projectModel).setParameters(projectNameModel),
            projectNameModel));
    deleteProjectDialog.setConfirmAction((target) -> {
        try {
            projectService.removeProject(projectModel.getObject());
            projectModel.setObject(null);
            target.add(getPage());
        }
        catch (IOException e) {
            LOG.error("Unable to remove project :" + ExceptionUtils.getRootCauseMessage(e));
            error("Unable to remove project " + ":" + ExceptionUtils.getRootCauseMessage(e));
            target.addChildren(getPage(), IFeedback.class);
        }
    });
}
 
开发者ID:webanno,项目名称:webanno,代码行数:57,代码来源:ProjectDetailPanel.java

示例14: initBasicInfoLayout

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

		final TextField nameField = new TextField(ID_NAME, new PropertyModel<>(getModel(), CertDefinitionDto.F_NAME));
		nameField.add(new VisibleEnableBehaviour() {
			@Override
			public boolean isEnabled() {
				return true;
			}
		});
		add(nameField);

		final TextArea descriptionField = new TextArea(ID_DESCRIPTION, new PropertyModel<>(getModel(), CertDefinitionDto.F_DESCRIPTION));
		descriptionField.add(new VisibleEnableBehaviour() {
			@Override
			public boolean isEnabled() {
				return true;
			}
		});
		add(descriptionField);

		final WebMarkupContainer ownerRefChooser = createOwnerRefChooser(ID_OWNER_REF_CHOOSER);
		ownerRefChooser.setOutputMarkupId(true);
		add(ownerRefChooser);

		DropDownChoice remediation = new DropDownChoice<>(ID_REMEDIATION, new Model<AccessCertificationRemediationStyleType>() {

			@Override
			public AccessCertificationRemediationStyleType getObject() {
				return getModel().getObject().getRemediationStyle();
			}

			@Override
			public void setObject(AccessCertificationRemediationStyleType object) {
				getModel().getObject().setRemediationStyle(object);
			}
		}, WebComponentUtil.createReadonlyModelFromEnum(AccessCertificationRemediationStyleType.class),
				new EnumChoiceRenderer<>(this));
		add(remediation);

		DropDownChoice outcomeStrategy =
				new DropDownChoice<>(ID_OUTCOME_STRATEGY,
						new PropertyModel<>(getModel(), CertDefinitionDto.F_OUTCOME_STRATEGY),
						WebComponentUtil.createReadonlyModelFromEnum(AccessCertificationCaseOutcomeStrategyType.class),
						new EnumChoiceRenderer<>(this));
		add(outcomeStrategy);

		add(WebComponentUtil.createHelp(ID_OUTCOME_STRATEGY_HELP));

		Label stopReviewOn = new Label(ID_STOP_REVIEW_ON, new AbstractReadOnlyModel<String>() {
			@Override
			public String getObject() {
				List<AccessCertificationResponseType> stopOn = getModel().getObject().getStopReviewOn();
				return CertMiscUtil.getStopReviewOnText(stopOn, getPageBase());
			}
		});
		add(stopReviewOn);

		//        add(new Label(ID_REVIEW_STAGE_CAMPAIGNS, new PropertyModel<>(getModel(), CertDefinitionDto.F_NUMBER_OF_STAGES)));
		//        add(new Label(ID_CAMPAIGNS_TOTAL, new PropertyModel<>(getModel(), CertDefinitionDto.F_NUMBER_OF_STAGES)));
		add(new Label(ID_LAST_STARTED, new PropertyModel<>(getModel(), CertDefinitionDto.F_LAST_STARTED)));
		add(new Label(ID_LAST_CLOSED, new PropertyModel<>(getModel(), CertDefinitionDto.F_LAST_CLOSED)));
		add(WebComponentUtil.createHelp(ID_LAST_STARTED_HELP));
		add(WebComponentUtil.createHelp(ID_LAST_CLOSED_HELP));
	}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:65,代码来源:DefinitionBasicPanel.java

示例15: initLayout

import org.apache.wicket.markup.html.form.EnumChoiceRenderer; //导入依赖的package包/类
private void initLayout(PageSystemConfiguration parentPage) {

		WebMarkupContainer profilingEnabledNote = new WebMarkupContainer(ID_PROFILING_ENABLED_NOTE);
		profilingEnabledNote.setVisible(!parentPage.getMidpointConfiguration().isProfilingEnabled());
		add(profilingEnabledNote);

        //Entry-Exit profiling init
        DropDownChoice<ProfilingLevel> profilingLevel = new DropDownChoice<>("profilingLevel",
                new PropertyModel<ProfilingLevel>(getModel(), "profilingLevel"),
                WebComponentUtil.createReadonlyModelFromEnum(ProfilingLevel.class),
                new EnumChoiceRenderer<ProfilingLevel>(this));
        profilingLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
        add(profilingLevel);

        DropDownChoice<String> profilingAppender = new DropDownChoice<>("profilingAppender",
                new PropertyModel<String>(getModel(), "profilingAppender"), createAppendersListModel());
        profilingAppender.setNullValid(true);
        profilingAppender.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
        add(profilingAppender);

        //Subsystem and general profiling init
        CheckBox requestFilter = WebComponentUtil.createAjaxCheckBox("requestFilter", new PropertyModel<Boolean>(getModel(), "requestFilter"));

        CheckBox performanceStatistics = WebComponentUtil.createAjaxCheckBox("performanceStatistics", new PropertyModel<Boolean>(getModel(), "performanceStatistics"));
        CheckBox subsystemModel = WebComponentUtil.createAjaxCheckBox("subsystemModel", new PropertyModel<Boolean>(getModel(), "subsystemModel"));
        CheckBox subsystemRepository = WebComponentUtil.createAjaxCheckBox("subsystemRepository", new PropertyModel<Boolean>(getModel(), "subsystemRepository"));
        CheckBox subsystemProvisioning = WebComponentUtil.createAjaxCheckBox("subsystemProvisioning", new PropertyModel<Boolean>(getModel(), "subsystemProvisioning"));
        //CheckBox subsystemUcf = WebComponentUtil.createAjaxCheckBox("subsystemUcf", new PropertyModel<Boolean>(getModel(), "subsystemUcf"));
        CheckBox subsystemResourceObjectChangeListener = WebComponentUtil.createAjaxCheckBox("subsystemSynchronizationService", new PropertyModel<Boolean>(getModel(), "subsystemSynchronizationService"));
        CheckBox subsystemTaskManager = WebComponentUtil.createAjaxCheckBox("subsystemTaskManager", new PropertyModel<Boolean>(getModel(), "subsystemTaskManager"));
        CheckBox subsystemWorkflow = WebComponentUtil.createAjaxCheckBox("subsystemWorkflow", new PropertyModel<Boolean>(getModel(), "subsystemWorkflow"));
        add(requestFilter);
        add(performanceStatistics);
        add(subsystemModel);
        add(subsystemRepository);
        add(subsystemProvisioning);
        //add(subsystemUcf);
        add(subsystemResourceObjectChangeListener);
        add(subsystemTaskManager);
        add(subsystemWorkflow);

        TextField<Integer> dumpInterval = WebComponentUtil.createAjaxTextField("dumpInterval", new PropertyModel<Integer>(getModel(),
                "dumpInterval"));
        add(dumpInterval);

        Label dumpIntervalTooltip = new Label(ID_DUMP_INTERVAL_TOOLTIP);
        dumpIntervalTooltip.add(new InfoTooltipBehavior());
        add(dumpIntervalTooltip);
    }
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:50,代码来源:ProfilingConfigPanel.java


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