當前位置: 首頁>>代碼示例>>Java>>正文


Java TextField.setLabel方法代碼示例

本文整理匯總了Java中org.apache.wicket.markup.html.form.TextField.setLabel方法的典型用法代碼示例。如果您正苦於以下問題:Java TextField.setLabel方法的具體用法?Java TextField.setLabel怎麽用?Java TextField.setLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.wicket.markup.html.form.TextField的用法示例。


在下文中一共展示了TextField.setLabel方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: UserSearchPanel

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public UserSearchPanel(String id, IPageable pageable, AbstractUserDataProvider<User> dataProvider) {
	super(id);
	
	// Quick search
	add(new UserQuickSearchComponent("userQuickSearch"));
	
	// Search form
	Form<Void> form = new PageableSearchForm<Void>("form", pageable);
	
	TextField<String> searchInput = new TextField<String>("searchInput", dataProvider.getNameModel());
	searchInput.setLabel(new ResourceModel("user.portfolio.search.name"));
	searchInput.add(new LabelPlaceholderBehavior());
	form.add(searchInput);
	
	CheckBox active = new CheckBox("includeInactive", dataProvider.getIncludeInactivesModel());
	active.setLabel(new ResourceModel("user.portfolio.search.includeInactive"));
	form.add(active);
	
	add(form);
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:21,代碼來源:UserSearchPanel.java

示例2: createBody

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected Component createBody(String wicketId) {
	DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, AddUserPopupPanel.class);
	
	addUserForm = new Form<User>("addUserForm", getModel());
	body.add(addUserForm);
	
	TextField<String> userName = new RequiredTextField<String>("userName", BindingModel.of(addUserForm.getModel(), Bindings.user().userName()));
	userName.setLabel(new ResourceModel("widgets.modal.user.userName"));
	addUserForm.add(userName);
	
	TextField<String> firstName = new RequiredTextField<String>("firstName", BindingModel.of(addUserForm.getModel(), Bindings.user().firstName()));
	firstName.setLabel(new ResourceModel("widgets.modal.user.firstName"));
	addUserForm.add(firstName);
	
	TextField<String> lastName = new RequiredTextField<String>("lastName", BindingModel.of(addUserForm.getModel(), Bindings.user().lastName()));
	lastName.setLabel(new ResourceModel("widgets.modal.user.lastName"));
	addUserForm.add(lastName);
	
	EmailTextField email = new EmailTextField("email", BindingModel.of(addUserForm.getModel(), Bindings.user().email()));
	email.setRequired(true);
	email.setLabel(new ResourceModel("widgets.modal.user.email"));
	addUserForm.add(email);
	
	return body;
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:27,代碼來源:AddUserPopupPanel.java

示例3: onInitialize

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
    super.onInitialize();
    Label label = new Label("label", this.name);
    this.add(label);
    TextField<String> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name));
    field.setLabel(Model.of(name));
    field.add(StringValidator.maximumLength(255));
    TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
    this.add(field);
    this.add(feedback);
}
 
開發者ID:PkayJava,項目名稱:MBaaS,代碼行數:13,代碼來源:StringPanel.java

示例4: onInitialize

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
    super.onInitialize();
    Label label = new Label("label", this.name);
    this.add(label);
    TextField<Double> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name));
    field.add(RangeValidator.range(Double.MIN_VALUE, Double.MAX_VALUE));
    field.setType(Double.class);
    field.setLabel(Model.of(name));
    TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
    this.add(field);
    this.add(feedback);
}
 
開發者ID:PkayJava,項目名稱:MBaaS,代碼行數:14,代碼來源:DoublePanel.java

示例5: onInitialize

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
    super.onInitialize();
    Label label = new Label("label", this.name);
    this.add(label);
    TextField<Character> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name), Character.class);
    field.add(AttributeModifier.replace("maxlength", "1"));
    field.setType(Character.class);
    field.setLabel(Model.of(name));
    TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
    this.add(field);
    this.add(feedback);
}
 
開發者ID:PkayJava,項目名稱:MBaaS,代碼行數:14,代碼來源:CharacterPanel.java

示例6: onInitialize

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
    super.onInitialize();
    Label label = new Label("label", this.name);
    this.add(label);
    TextField<Long> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name));
    field.setLabel(Model.of(name));
    field.setType(Long.class);
    field.add(RangeValidator.range(Long.MIN_VALUE, Long.MAX_VALUE));
    TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
    this.add(field);
    this.add(feedback);
}
 
開發者ID:PkayJava,項目名稱:MBaaS,代碼行數:14,代碼來源:LongPanel.java

示例7: initComponents

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initComponents() {

    	getServiceForm().add(new CacheActivatedImage("logicalOnlineStorageServicePanelIcon",new ResourceModel("onlineStorage-icon").getObject()));
    	// Online help link
    	String completeHelpUrl = "";
    	try {
    		completeHelpUrl = new StringResourceModel("portal.designer.logical.service.online_manual.baseUrl", null).getString() 
        			+ new StringResourceModel("portal.designer.logical.service.online_manual." + getLogicalModelType(), null).getString();
    	} catch (Exception e) {
    		//do nothing
    	}
    	ExternalLink onlineHelpLink = new ExternalLink("onlineHelpLink", completeHelpUrl);
    	getServiceForm().add(onlineHelpLink);
    	if (completeHelpUrl.isEmpty()) {
    		onlineHelpLink.setVisible(false);
    	}
    	
        // FUNCTIONNAL PARAMETERS
        RequiredTextField<String> label = new RequiredTextField<String>("label");
        label.setLabel(new StringResourceModel("portal.designer.service.storage.label",null));
        label.add(new PropertyValidator<>());
        getServiceForm().add(label);

        TextField<String> serviceName = new TextField<String>("serviceName");
        serviceName.setLabel(new StringResourceModel("portal.designer.service.storage.name", null));
        serviceName.add(new PropertyValidator<>());
        getServiceForm().add(serviceName);

        TextField storageCapacityMb = new TextField("storageCapacityMb");
        storageCapacityMb.setLabel(new StringResourceModel("portal.designer.service.storage.storageCapacityMb",null));
        storageCapacityMb.add(new AttributeModifier("class","small"));
        storageCapacityMb.add(new PropertyValidator<>());
        getServiceForm().add(storageCapacityMb);

    }
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:36,代碼來源:LogicalOnlineStorageServicePanel.java

示例8: initComponents

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initComponents() {
	 getServiceForm().add(new CacheActivatedImage("logicalRelationnalDatabasePanelIcon",new ResourceModel("onlinedatabase.icon").getObject()));
	// Online help link
	String completeHelpUrl = "";
	try {
		completeHelpUrl = new StringResourceModel("portal.designer.logical.service.online_manual.baseUrl", null).getString() 
    			+ new StringResourceModel("portal.designer.logical.service.online_manual.relationaldatabase", null).getString();
	} catch (Exception e) {
		//do nothing
	}
	ExternalLink onlineHelpLink = new ExternalLink("onlineHelpLink", completeHelpUrl);
	getServiceForm().add(onlineHelpLink);
	if (completeHelpUrl.isEmpty()) {
		onlineHelpLink.setVisible(false);
	}
	
    // FUNCTIONNAL PARAMETERS
    final RequiredTextField<String> label = new RequiredTextField<String>("label");
    label.setLabel(new StringResourceModel("portal.designer.service.reldb.label",null));
    label.add(new PropertyValidator<>());
    getServiceForm().add(label);

    TextField<String> serviceName = new TextField<String>("serviceName");
    serviceName.setLabel(new StringResourceModel("portal.designer.service.reldb.serviceName",null));
    serviceName.add(new PropertyValidator<>());
    getServiceForm().add(serviceName);

    DropDownChoice<LogicalRelationalServiceSqlDialectEnum> sqlVersion = new DropDownChoice<LogicalRelationalServiceSqlDialectEnum>("sqlVersion", Arrays.asList(LogicalRelationalServiceSqlDialectEnum.values()));
    sqlVersion.setLabel(new StringResourceModel("portal.designer.service.reldb.sqlVersion",null));
    sqlVersion.add(new PropertyValidator<>());
    getServiceForm().add(sqlVersion);


    // SLO
    TextField capacityMo = new TextField("capacityMo");
    capacityMo.setLabel(new StringResourceModel("portal.designer.service.reldb.capacityMo",null));
    capacityMo.add(new AttributeModifier("class","small"));
    capacityMo.add(new PropertyValidator<>());
    getServiceForm().add(capacityMo);
}
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:41,代碼來源:LogicalRelationalDatabasePanel.java

示例9: initLayout

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize, String textSize, final boolean required,
	final boolean markAsRequired) {
      WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
      add(labelContainer);

      Label l = new Label(ID_LABEL, label);
      if (StringUtils.isNotEmpty(labelSize)) {
          labelContainer.add(AttributeAppender.prepend("class", labelSize));
      }
      labelContainer.add(l);

      Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
      tooltipLabel.add(new AttributeAppender("data-original-title", new AbstractReadOnlyModel<String>() {

          @Override
          public String getObject() {
              return getString(tooltipKey);
          }
      }));
      tooltipLabel.add(new InfoTooltipBehavior(isTooltipInModal));
      tooltipLabel.add(new VisibleEnableBehaviour(){

          @Override
          public boolean isVisible() {
              return tooltipKey != null;
          }
      });
      tooltipLabel.setOutputMarkupId(true);
      tooltipLabel.setOutputMarkupPlaceholderTag(true);
      labelContainer.add(tooltipLabel);

WebMarkupContainer requiredContainer = new WebMarkupContainer(ID_REQUIRED);
requiredContainer.add(new VisibleEnableBehaviour() {
	@Override
	public boolean isVisible() {
		return markAsRequired;
	}
});
labelContainer.add(requiredContainer);

WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
      if (StringUtils.isNotEmpty(textSize)) {
          textWrapper.add(AttributeAppender.prepend("class", textSize));
      }
      add(textWrapper);

      TextField text = createText(getModel(), label, required);
      text.setLabel(label);
      textWrapper.add(text);

      FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ContainerFeedbackMessageFilter(this));
      feedback.setOutputMarkupId(true);
      textWrapper.add(feedback);
  }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:55,代碼來源:TextFormGroup.java

示例10: initLayout

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<String> label, final String labelSize, final String textSize,
                        final boolean required) {
    Label l = new Label(ID_LABEL, label);
    if (StringUtils.isNotEmpty(labelSize)) {
        l.add(AttributeAppender.prepend("class", labelSize));
    }
    add(l);

    ListView repeater = new ListView<T>(ID_REPEATER, getModel()) {

        @Override
        protected void populateItem(final ListItem<T> item) {
            WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
            textWrapper.add(AttributeAppender.prepend("class", new AbstractReadOnlyModel<String>() {

                @Override
                public String getObject() {
                    StringBuilder sb = new StringBuilder();
                    if (StringUtils.isNotEmpty(textSize)) {
                        sb.append(textSize).append(' ');
                    }
                    if (item.getIndex() > 0 && StringUtils.isNotEmpty(getOffsetClass())) {
                        sb.append(getOffsetClass()).append(' ');
                        sb.append(CLASS_MULTI_VALUE);
                    }

                    return sb.toString();
                }
            }));
            item.add(textWrapper);

            TextField text = new TextField(ID_TEXT, createTextModel(item.getModel()));
            text.add(new AjaxFormComponentUpdatingBehavior("blur") {
                @Override
                protected void onUpdate(AjaxRequestTarget target) {
                }
            });
            text.setRequired(required);
            text.add(AttributeAppender.replace("placeholder", label));
            text.setLabel(label);
            textWrapper.add(text);

            FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
            textWrapper.add(feedback);

            WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
            buttonGroup.add(AttributeAppender.append("class", new AbstractReadOnlyModel<String>() {

                @Override
                public String getObject() {
                    if (item.getIndex() > 0 && StringUtils.isNotEmpty(labelSize)) {
                        return CLASS_MULTI_VALUE;
                    }

                    return null;
                }
            }));
            item.add(buttonGroup);

            initButtons(buttonGroup, item);
        }
    };
    add(repeater);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:65,代碼來源:MultiValueTextFormGroup.java

示例11: createBody

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected Component createBody(String wicketId) {
	DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, EditUserPopupPanel.class);
	
	userEditForm = new Form<User>("userEditForm", getModel());
	body.add(userEditForm);
	
	TextField<String> userNameField = new RequiredTextField<String>("userName",
			BindingModel.of(getModel(), Bindings.user().userName()));
	userNameField.setLabel(new ResourceModel("user.username"));
	userEditForm.add(userNameField);
	
	TextField<String> firstNameField = new RequiredTextField<String>("firstName",
			BindingModel.of(getModel(), Bindings.user().firstName()));
	firstNameField.setLabel(new ResourceModel("user.firstname"));
	userEditForm.add(firstNameField);
	
	TextField<String> lastNameField = new RequiredTextField<String>("lastName",
			BindingModel.of(getModel(), Bindings.user().lastName()));
	lastNameField.setLabel(new ResourceModel("user.lastname"));
	userEditForm.add(lastNameField);
	
	TextField<String> emailField = new RequiredTextField<String>("email",
			BindingModel.of(getModel(), Bindings.user().email()));
	emailField.setLabel(new ResourceModel("user.email"));
	userEditForm.add(emailField);
	
	CheckBox activeCheckBox = new CheckBox("active", BindingModel.of(getModel(), Bindings.user().active()));
	activeCheckBox.setLabel(new ResourceModel("user.active"));
	userEditForm.add(activeCheckBox);
	
	TextField<String> phoneNumberField = new RequiredTextField<String>("phoneNumber",
			BindingModel.of(getModel(), Bindings.user().phoneNumber()));
	phoneNumberField.setLabel(new ResourceModel("user.phone"));
	userEditForm.add(phoneNumberField);
	
	TextField<String> gsmNumberField = new TextField<String>("gsmNumber",
			BindingModel.of(getModel(), Bindings.user().gsmNumber()));
	gsmNumberField.setLabel(new ResourceModel("user.phone"));
	userEditForm.add(gsmNumberField);
	
	TextField<String> faxNumberField = new TextField<String>("faxNumber",
			BindingModel.of(getModel(), Bindings.user().faxNumber()));
	faxNumberField.setLabel(new ResourceModel("user.phone"));
	userEditForm.add(faxNumberField);
	
	return body;
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:49,代碼來源:EditUserPopupPanel.java

示例12: createAppForm

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的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

示例13: initComponent

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initComponent() {

    	getServiceForm().add(new CacheActivatedImage("logicalSoapConsummerPanelIcon",new ResourceModel("webserviceconsumer.icon").getObject()));
    	// Online help link
    	String completeHelpUrl = "";
    	try {
    		completeHelpUrl = new StringResourceModel("portal.designer.logical.service.online_manual.baseUrl", null).getString() 
        			+ new StringResourceModel("portal.designer.logical.service.online_manual." + getLogicalModelType(), null).getString();
    	} catch (Exception e) {
    		//do nothing
    	}
    	ExternalLink onlineHelpLink = new ExternalLink("onlineHelpLink", completeHelpUrl);
    	getServiceForm().add(onlineHelpLink);
    	if (completeHelpUrl.isEmpty()) {
    		onlineHelpLink.setVisible(false);
    	}
    	
        // FUNCTIONNAL PARAMETERS
        RequiredTextField<String> label = new RequiredTextField<String>("label");
        label.setLabel(new StringResourceModel("portal.designer.service.wsc_soap.label",null));
        label.add(new PropertyValidator<>());
        getServiceForm().add(label);

        TextField<String> jndiPrefix = new TextField<String>("jndiPrefix");
        jndiPrefix.setLabel(new StringResourceModel("portal.designer.service.wsc_soap.jndiPrefix",null));
        jndiPrefix.add(new PropertyValidator<>());
        getServiceForm().add(jndiPrefix);

        DropDownChoice<LogicalSoapConsumer.SoapServiceDomainEnum> domain = new DropDownChoice<LogicalSoapConsumer.SoapServiceDomainEnum>("wsDomain", Arrays.asList(LogicalSoapConsumer.SoapServiceDomainEnum.values()));
        domain.setLabel(new StringResourceModel("portal.designer.service.wsc_soap.wsdomain",null));
        domain.add(new PropertyValidator<>());
        getServiceForm().add(domain);

        TextField<String> serviceProviderName = new TextField<String>("serviceProviderName");
        serviceProviderName.setLabel(new StringResourceModel("portal.designer.service.wsc_soap.serviceProviderName",null));
        serviceProviderName.add(new PropertyValidator<>());
        getServiceForm().add(serviceProviderName);

        TextField<String> serviceName = new TextField<String>("serviceName");
        serviceName.setLabel(new StringResourceModel("portal.designer.service.wsc_soap.serviceName",null));
        serviceName.add(new PropertyValidator<>());
        getServiceForm().add(serviceName);

        TextField serviceMinorVersion = new TextField("serviceMinorVersion");
        serviceMinorVersion.setLabel(new StringResourceModel("portal.designer.service.wsc_soap.serviceMinorVersion",null));
        serviceMinorVersion.add(new AttributeModifier("class","small"));
        serviceMinorVersion.add(new PropertyValidator<>());
        getServiceForm().add(serviceMinorVersion);

        TextField serviceMajorVersion = new TextField("serviceMajorVersion");
        serviceMajorVersion.setLabel(new StringResourceModel("portal.designer.service.wsc_soap.serviceMajorVersion",null));
        serviceMajorVersion.add(new AttributeModifier("class","small"));
        serviceMajorVersion.add(new PropertyValidator<>());
        getServiceForm().add(serviceMajorVersion);

    }
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:57,代碼來源:LogicalSoapConsumerPanel.java

示例14: initComponents

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initComponents() {

    	getServiceForm().add(new CacheActivatedImage("logicalWebGuiPanelIcon",new ResourceModel("webui.icon").getObject()));
    	// Online help link
    	String completeHelpUrl = "";
    	try {
    		completeHelpUrl = new StringResourceModel("portal.designer.logical.service.online_manual.baseUrl", null).getString() 
        			+ new StringResourceModel("portal.designer.logical.service.online_manual.webgui", null).getString();
    	} catch (Exception e) {
    		//do nothing
    	}
    	ExternalLink onlineHelpLink = new ExternalLink("onlineHelpLink", completeHelpUrl);
    	getServiceForm().add(onlineHelpLink);
    	if (completeHelpUrl.isEmpty()) {
    		onlineHelpLink.setVisible(false);
    	}
    	
        // FUNCTIONNAL PARAMETERS
        // Service label
        RequiredTextField<String> label = new RequiredTextField<String>("label");
        label.setLabel(new StringResourceModel("portal.designer.service.gui.label",null));
        label.add(new PropertyValidator<>());
        getServiceForm().add(label);

        // Service context root
        RequiredTextField<String> contextRoot = new RequiredTextField<String>("contextRoot.value");
        contextRoot.setLabel(new StringResourceModel("portal.designer.service.gui.contextroot",null));
        contextRoot.add(new PropertyValidator<>());
        getServiceForm().add(contextRoot);

        // Service stateful state
        CheckBox statefulCb = new CheckBox("stateful");
        statefulCb.setLabel(new StringResourceModel("portal.designer.service.gui.stateful",null));
        statefulCb.add(new PropertyValidator<>());
        getServiceForm().add(statefulCb);

        // SLO
        // Service secure state
        CheckBox secureCb = new CheckBox("secure");
//        secureCb.setEnabled(false);
        secureCb.setLabel(new StringResourceModel("portal.designer.service.gui.secure",null));
        secureCb.add(new AttributeAppender("title", new StringResourceModel("portal.designer.service.notAvailable", null), " "));
        secureCb.add(new PropertyValidator<>());
        getServiceForm().add(secureCb);

        // Service max number of sessions
        TextField maxNumberSessions = new TextField("maxNumberSessions");
        maxNumberSessions.setLabel(new StringResourceModel("portal.designer.service.gui.maxNumberSessions",null));
        maxNumberSessions.add(new AttributeModifier("class", "small"));
        maxNumberSessions.add(new PropertyValidator<>());
        getServiceForm().add(maxNumberSessions);

        // Service max request per seconds
        final TextField maxReqPerSeconds = new TextField("maxReqPerSeconds");
        maxReqPerSeconds.setLabel(new StringResourceModel("portal.designer.service.gui.maxReqPerSeconds",null));
        maxReqPerSeconds.add(new AttributeAppender("title", new StringResourceModel("portal.designer.service.notAvailable", null), " "));
        maxReqPerSeconds.add(new PropertyValidator<>());
        getServiceForm().add(maxReqPerSeconds);

    }
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:61,代碼來源:LogicalWebGuiServicePanel.java

示例15: initComponents

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initComponents() {

    	getServiceForm().add(new CacheActivatedImage("logicalconfig-icon",new ResourceModel("cfconfigservice.icon").getObject()));
    	// Online help link
    	String completeHelpUrl = "";
    	try {
    		completeHelpUrl = new StringResourceModel("portal.designer.logical.service.online_manual.baseUrl", null).getString() 
        			+ new StringResourceModel("portal.designer.logical.service.online_manual." + getLogicalModelType(), null).getString();
    	} catch (Exception e) {
    		//do nothing
    	}
    	ExternalLink onlineHelpLink = new ExternalLink("onlineHelpLink", completeHelpUrl);
    	ExternalLink onlineHelpLinkOverride = new ExternalLink("onlineHelpLinkOverride", completeHelpUrl);

    	if (completeHelpUrl.isEmpty()) {
    		onlineHelpLink.setVisible(false);
    		onlineHelpLinkOverride.setVisible(false);
    	}

    	// Creates 2 blocks only for good displaying : Read more... juste after description (not possible with span wicket:id=descriptionLabel).
    	WebMarkupContainer descriptionBlock = new WebMarkupContainer("descriptionBlock");
    	descriptionBlock.add(onlineHelpLink);
    	getServiceForm().add(descriptionBlock);
    	
    	WebMarkupContainer overrideDescriptionBlock = new WebMarkupContainer("overrideDescriptionBlock");
    	overrideDescriptionBlock.add(onlineHelpLinkOverride);
    	getServiceForm().add(overrideDescriptionBlock);

        if (configOverride) {
        	descriptionBlock.setVisible(false);
        } else {
        	overrideDescriptionBlock.setVisible(false);
        }

    	
        // FUNCTIONNAL PARAMETERS    
        RequiredTextField<String> label = new RequiredTextField<>("label");
        label.setLabel(new StringResourceModel("portal.designer.service.config.label",null));
        label.add(new PropertyValidator<>());
        getServiceForm().add(label);

        TextField<String> keyPrefix = new TextField<>("keyPrefix", String.class);
        keyPrefix.setConvertEmptyInputStringToNull(false);
        keyPrefix.setLabel(new StringResourceModel("portal.designer.service.config.keyPrefix", null));
        keyPrefix.add(new PropertyValidator<>());
        getServiceForm().add(keyPrefix);

        configSetContent = new CodeMirrorTextArea<>("configSetContent", readOnly && !configOverride);

        configSetContent.setLabel(new StringResourceModel("portal.designer.service.config.configSetContent", null));
        configSetContent.add(new PropertyValidator<>());
        getServiceForm().add(configSetContent);

        configSetContent.add(new ConfigDuplicateKeysValidator());
        configSetContent.add(new ConfigMaxSizeValidator());
        configSetContent.add(new ConfigMaxNumberKeysValidator());
        configSetContent.add(new InvalidCharsetValidator());

    }
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:60,代碼來源:LogicalConfigServicePanel.java


注:本文中的org.apache.wicket.markup.html.form.TextField.setLabel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。