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


Java TextField.setEnabled方法代碼示例

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


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

示例1: initLayout

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<T> value, final List<PrismReferenceValue> values,
	final boolean required, Collection<Class<? extends O>> types) {

WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);

textWrapper.setOutputMarkupId(true);

TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(value));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
	private static final long serialVersionUID = 1L;

	@Override
	protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
	}
});
text.setRequired(required);
text.setEnabled(false);
textWrapper.add(text);

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

AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
	private static final long serialVersionUID = 1L;

	@Override
	public void onClick(AjaxRequestTarget target) {
		editValuePerformed(values, target);
	}
};
textWrapper.add(edit);
add(textWrapper);

      initButtons();
  }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:36,代碼來源:ValueChoosePanel.java

示例2: addPermissionTargetNameField

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void addPermissionTargetNameField(TitledBorder border) {
    TextField nameTf = new TextField("name");
    setDefaultFocusField(nameTf);
    border.add(nameTf);
    if (!isSystemAdmin() || !isCreate()) {
        nameTf.setEnabled(false);
    }
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:9,代碼來源:PermissionTargetCreateUpdatePanel.java

示例3: ProfilePanel

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public ProfilePanel(String id, Form form, ProfileModel profile) {
    super(id);
    this.form = form;
    setOutputMarkupId(true);

    setDefaultModel(new CompoundPropertyModel<>(profile));
    add(new CssClass("display:block"));

    WebMarkupContainer encryptedPasswordContainer = new WebMarkupContainer("encryptedPasswordContainer");
    add(encryptedPasswordContainer);
    encryptedPasswordLabel = new Label("encryptedPassword", HIDDEN_PASSWORD);
    encryptedPasswordLabel.setVisible(securityService.isPasswordEncryptionEnabled());
    encryptedPasswordContainer.add(encryptedPasswordLabel);
    encryptedPasswordContainer.add(
            new HelpBubble("encryptedPassword.help", new ResourceModel("encryptedPassword.help")));
    encryptedPasswordContainer.setVisible(!ConstantValues.uiHideEncryptedPassword.getBoolean());

    // Profile update fields are only displayed for users with permissions to do so
    final WebMarkupContainer updateFieldsContainer = new WebMarkupContainer("updateFieldsContainer");
    updateFieldsContainer.setVisible(authService.isUpdatableProfile());
    add(updateFieldsContainer);

    addPasswordFields(updateFieldsContainer);

    // Email
    TextField<String> emailTf = new TextField<>("email");
    emailTf.setEnabled(false);
    emailTf.add(EmailAddressValidator.getInstance());
    updateFieldsContainer.add(emailTf);
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:31,代碼來源:ProfilePanel.java

示例4: MoveAndCopyPathPanel

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public MoveAndCopyPathPanel(String id, IModel targetRepoModel, final MoveAndCopyBasePanel.OperationType opType) {
    super(id);
    this.opType = opType;
    init();
    add(new CssClass("advanced-search-panel"));

    TextField targetPathField = new TextField<>("targetPath", targetRepoModel);
    targetPathField.setOutputMarkupId(true);
    setPersistent(targetPathField);
    targetPathField.setEnabled(true);
    add(targetPathField);

    setVisible(false);
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:15,代碼來源:MoveAndCopyPathPanel.java

示例5: CustomerInfoEditPage

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public CustomerInfoEditPage(WebPage backPage, CustomerInfoDto user) {
    try {
        this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
        if (backPage == null) {
            throw new IllegalArgumentException();
        }
        if (user != null) {
            user.renew();
        }
        this.backPage = backPage;
        this.user = user;
        String nameCaption = null;
        CustomerInfoRenderer renderer = new CustomerInfoRenderer(this.user);
        this.name = renderer.getName();
        if (this.user == null) {
            nameCaption = "New Customer";
        } else {
            nameCaption = this.name;
        }
        this.companyID = renderer.getCompanyID();
        this.active = renderer.isActive();
        this.portalUser = renderer.getPortalUser();
        this.portalPassword = renderer.getPortalPass();

        Link<Void> backLink = new Link<Void>("back") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onClick() {
                setResponsePage(getBackPage());
            }
        };
        add(backLink);
        add(new FeedbackPanel("feedback"));

        Label userNameLabel = new Label("customerInfo", nameCaption);
        add(userNameLabel);

        Form<Void> form = new Form<Void>("form") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onSubmit() {
                processUpdate();
                PageUtil.setModelChanged(getBackPage());
                setResponsePage(getBackPage());
            }
        };
        add(form);

        TextField<String> nameField = new TextField<String>("name",
                new PropertyModel<String>(this, "name"), String.class);
        nameField.setEnabled(this.name.isEmpty());
        form.add(nameField);

        TextField<String> companyIDField = new TextField<String>("companyID",
                new PropertyModel<String>(this, "companyID"), String.class);
        form.add(companyIDField);

        CheckBox activeBox = new CheckBox("active", new PropertyModel<Boolean>(this, "active"));
        form.add(activeBox);

        TextField<String> portalUserField = new TextField<String>("portalUser",
                new PropertyModel<String>(this, "portalUser"), String.class);
        form.add(portalUserField);

        TextField<String> portalPasswordField = new TextField<String>("portalPassword",
                new PropertyModel<String>(this, "portalPassword"), String.class);
        form.add(portalPasswordField);

    } catch (Exception e) {
        throw ExceptionUtils.throwAsRuntime(e);
    }
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:75,代碼來源:CustomerInfoEditPage.java

示例6: VlanIdPoolEditPage

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public VlanIdPoolEditPage(WebPage backPage, VlanIdPoolDto pool) {
    try {
        this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
        this.pool = pool;
        this.backPage = backPage;
        if (pool != null) {
            range = pool.getConcatenatedIdRangesStr();
            name = pool.getName();
            this.purpose = DtoUtil.getString(pool,ATTR.PURPOSE);
            this.note = DtoUtil.getString(pool,ATTR.NOTE);
        }

        add(new FeedbackPanel("feedback"));

        Form<Void> backForm = new Form<Void>("backForm");
        add(backForm);
        Button backButton = new Button("back") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onSubmit() {
                setResponsePage(getBackPage());
            }
        };
        backForm.add(backButton);

        Form<Void> form = new Form<Void>("poolEditForm");
        add(form);

        Button processButton = new Button("process") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onSubmit() {
                processUpdate();
                PageUtil.setModelChanged(getBackPage());
                setResponsePage(getBackPage());
            }
        };
        form.add(processButton);

        Button deleteButton = new Button("delete") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onSubmit() {
                delete();
                PageUtil.setModelChanged(getBackPage());
                setResponsePage(getBackPage());
            }
        };
        form.add(deleteButton);

        TextField<String> rangeField = new TextField<String>("range", new PropertyModel<String>(this, "range"));
        rangeField.setRequired(true);
        rangeField.add(new IdRangeValidator());
        rangeField.setEnabled(pool == null);
        form.add(rangeField);
        TextField<String> nameField = new TextField<String>("name", new PropertyModel<String>(this, MPLSNMS_ATTR.NAME));
        nameField.setRequired(true);
        form.add(nameField);
        TextField<String> purposeField = new TextField<String>("purpose", new PropertyModel<String>(this, "purpose"));
        form.add(purposeField);
        TextArea<String> noteArea = new TextArea<String>("note", new PropertyModel<String>(this, "note"));
        form.add(noteArea);
    } catch (Exception e) {
        throw ExceptionUtils.throwAsRuntime(e);
    }
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:70,代碼來源:VlanIdPoolEditPage.java

示例7: initLayout

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<List<T>> chosenValues, final List<PrismReferenceValue> filterValues,
	final boolean required, final boolean multiselect) {

AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
	private static final long serialVersionUID = 1L;

	@Override
	public void onClick(AjaxRequestTarget target) {
		editValuePerformed(chosenValues.getObject(), filterValues, target, multiselect);
	}
};
edit.setOutputMarkupPlaceholderTag(true);
add(edit);

ListView<T> selectedRowsList = new ListView<T>(ID_SELECTED_ROWS, chosenValues) {

	@Override
	protected void populateItem(ListItem<T> item) {
		WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
		
		textWrapper.setOutputMarkupPlaceholderTag(true);

		TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(item.getModel())); //was value
		text.add(new AjaxFormComponentUpdatingBehavior("blur") {
			private static final long serialVersionUID = 1L;

			@Override
			protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
			}
		});
		text.setRequired(required);
		text.setEnabled(false);
		text.setOutputMarkupPlaceholderTag(true);
		textWrapper.add(text);

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

        initButtons(item, item);
        
        item.add(textWrapper);
	}
};
selectedRowsList.setReuseItems(true);
add(selectedRowsList);
  }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:48,代碼來源:MultiValueChoosePanel.java

示例8: initLayout

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<PrismContainerValue<ShadowAssociationType>> value, 
 		final List<PrismPropertyValue> values, final boolean required, Class<C> type) {


     WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);

     textWrapper.setOutputMarkupId(true);

     TextField<String> text = new TextField<>(ID_TEXT, createTextModel(value));
     text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;

@Override
         protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
         }
     });
     text.setRequired(required);
     text.setEnabled(false);
     textWrapper.add(text);

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

     AjaxLink edit = new AjaxLink(ID_EDIT) {
private static final long serialVersionUID = 1L;

@Override
         public void onClick(AjaxRequestTarget target) {
             editValuePerformed(target);
         }
     };
     edit.add(new VisibleEnableBehaviour() {
     	private static final long serialVersionUID = 1L;
     	
         @Override
         public boolean isVisible() {
             return model.getObject().isEmpty();
         }
     });
     textWrapper.add(edit);
     add(textWrapper);

     initDialog(type, values);

 }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:47,代碼來源:AssociationValueChoicePanel.java

示例9: RepoConfigCreateUpdatePanel

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
protected RepoConfigCreateUpdatePanel(CreateUpdateAction action, final E repoDescriptor,
        CachingDescriptorHelper cachingDescriptorHelper) {
    super(action, repoDescriptor);

    this.cachingDescriptorHelper = cachingDescriptorHelper;
    form.setOutputMarkupId(true);
    add(new CssClass("repo-config"));
    setWidth(650);
    TitledBorder repoConfigBorder = new TitledBorder("repoConfigBorder");
    TextField<String> repoKeyField = new TextField<>("key");
    setDefaultFocusField(repoKeyField);

    boolean create = isCreate();
    repoKeyField.setEnabled(create);// don't allow key update
    if (create) {
        repoKeyField.add(new NameValidator("Invalid repository key '%s'."));
        repoKeyField.add(new XsdNCNameValidator("Invalid repository key '%s'."));
        repoKeyField.add(new UniqueXmlIdValidator(cachingDescriptorHelper.getModelMutableDescriptor()));
        repoKeyField.add(new ReservedPathPrefixValidator());
        // we don't use a delay since it causes an error when the panel is closed while the focus is on the repo
        // key field
        repoKeyField.add(new OnKeyUpUpdatingBehavior(0) {
            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                // TODO: [by sy] send an event to interested components? (nuget panel)
            }
        });
    }

    repoConfigBorder.add(repoKeyField);
    repoConfigBorder.add(new SchemaHelpBubble("key.help"));

    repoConfigBorder.add(new RepoTabbedPanel("repoConfigTabbedPanel", getConfigurationTabs()));

    form.add(repoConfigBorder);

    // Cancel button
    form.add(getCloseLink());

    // Submit button
    TitledAjaxSubmitLink submit = createSubmitButton();
    form.add(submit);
    form.add(new DefaultButtonBehavior(submit));

    // test button (when relevant)
    TitledAjaxSubmitLink test = createTestButton();
    form.add(test);
    form.add(new DefaultButtonBehavior(test));

    add(form);

    bindHeightTo("modalScroll");
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:54,代碼來源:RepoConfigCreateUpdatePanel.java

示例10: HttpRepoBasicPanel

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public HttpRepoBasicPanel(String id, final HttpRepoDescriptor repoDescriptor) {
    super(id);
    add(new CssClass("advanced-remote-repo"));

    HttpRepoGeneralSettingsPanel generalSettings = new HttpRepoGeneralSettingsPanel("generalSettings");
    add(generalSettings);

    // url
    TextField<String> urlField = new TextField<>("url");
    urlField.add(new UriValidator("http", "https"));
    generalSettings.add(urlField);
    generalSettings.add(new SchemaHelpBubble("url.help"));

    final TextField<Integer> maxUniqueSnapshots = new TextField<>("maxUniqueSnapshots", Integer.class);
    maxUniqueSnapshots.setEnabled(repoDescriptor.isHandleSnapshots());
    maxUniqueSnapshots.setRequired(true);
    maxUniqueSnapshots.setOutputMarkupId(true);
    add(maxUniqueSnapshots);
    add(new SchemaHelpBubble("maxUniqueSnapshots.help"));

    // checksumPolicyType
    ChecksumPolicyType[] checksumPolicies = ChecksumPolicyType.values();
    DropDownChoice<ChecksumPolicyType> checksumPoliciesDC = new DropDownChoice<>(
            "checksumPolicyType", Arrays.asList(checksumPolicies));
    checksumPoliciesDC.setChoiceRenderer(new ChecksumPolicyChoiceRenderer());
    add(checksumPoliciesDC);
    add(new SchemaHelpBubble("remoteRepoChecksumPolicyType.help", "checksumPolicyType"));

    // checkboxes
    add(new StyledCheckbox("handleReleases"));
    add(new SchemaHelpBubble("handleReleases.help"));

    StyledCheckbox handleSnapshots = new StyledCheckbox("handleSnapshots");
    handleSnapshots.add(new AjaxFormComponentUpdatingBehavior("onclick") {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            maxUniqueSnapshots.setEnabled(repoDescriptor.isHandleSnapshots());
            if (!repoDescriptor.isHandleSnapshots()) {
                maxUniqueSnapshots.setModelObject(0);
            }
            target.add(maxUniqueSnapshots);
        }
    });
    add(handleSnapshots);
    add(new SchemaHelpBubble("handleSnapshots.help"));

    add(new StyledCheckbox("blackedOut"));
    add(new SchemaHelpBubble("blackedOut.help"));

    add(new StyledCheckbox("offline"));
    add(new SchemaHelpBubble("offline.help"));

    add(new StyledCheckbox("shareConfiguration"));
    add(new SchemaHelpBubble("shareConfiguration.help"));
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:56,代碼來源:HttpRepoBasicPanel.java

示例11: getFormInput

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected Component getFormInput(String wicketID, IModel<E> model) {
    TextField field = new TextField(wicketID, new toStringModel(model));
    field.setEnabled(false);
    return field;
}
 
開發者ID:TDC-Netdesign,項目名稱:ManagedProperties,代碼行數:7,代碼來源:UnknownTypeFragment.java

示例12: newBugReportForm

import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private Form<Void> newBugReportForm(Throwable t) {
	final Form<Void> form = new Form<Void>("form") {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onSubmit() {
			try {
				reportIssue(report);

				// set thank you message and return to home page
				setResponsePage(
						getApplication().getHomePage(),
						new PageParameters().set(MESSAGE_PARAM, getString("success.message")).set(LEVEL_PARAM,
								FeedbackMessage.SUCCESS));
			} catch (NotificationException e) {
				String message = getString("fail.message");
				logger.error(message, e);
				getPage().error(message);
			}
		}
	};

	TextField<String> userNameField = new TextField<>("userName", new PropertyModel<String>(ErrorPage.this, "userName"));
	TextField<String> userMailField = new TextField<>("userMail", new PropertyModel<String>(ErrorPage.this, "userMail"));
	UQSession session = UQSession.get();
	if (session != null && session.isAuthenticated()) {
		this.userName = session.getLoggedInUser().getFullName();
		this.userMail = session.getLoggedInUser().getMail();
		if (!session.getLoggedInUser().hasAnyRoles(Role.Administrator)) {
			userNameField.setEnabled(false);
			userMailField.setEnabled(false);
		}
	}
	form.add(userNameField);
	form.add(userMailField);
	TextArea<String> description = new TextArea<>("report", new PropertyModel<String>(ErrorPage.this, "report"));
	description.add(new TinyMceBehavior(DefaultTinyMCESettings.get()));
	form.add(description);
	Button btnStacktraceShow = new Button("stacktrace.show");
	btnStacktraceShow.setVisible(canSeeStackTrace(t));
	Label stackTrace = new Label("stacktrace.text", t != null ? Model.of(getStackTraceForOutput(t)) : Model.of(""));
	WebMarkupContainer stackTraceContainer = new WebMarkupContainer("stacktrace.container");
	stackTraceContainer.add(stackTrace);
	stackTraceContainer.setVisible(canSeeStackTrace(t));
	form.add(stackTraceContainer);
	form.add(btnStacktraceShow);
	return form;
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:49,代碼來源:ErrorPage.java


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