本文整理匯總了Java中org.apache.wicket.markup.html.form.DropDownChoice.setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java DropDownChoice.setEnabled方法的具體用法?Java DropDownChoice.setEnabled怎麽用?Java DropDownChoice.setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.form.DropDownChoice
的用法示例。
在下文中一共展示了DropDownChoice.setEnabled方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addExcludesPatternFields
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void addExcludesPatternFields(StringResourceModel helpMessage,
final List<CommonPathPattern> includesExcludesSuggestions) {
TextArea excludesTa = new TextArea("excludesPattern");
excludesTa.setEnabled(isSystemAdmin());
excludesTa.setOutputMarkupId(true);
add(excludesTa);
add(new HelpBubble("excludesHelp", helpMessage));
//Excludes suggestions
Model<CommonPathPattern> exclude = new Model<>();
DropDownChoice<CommonPathPattern> excludesSuggest = new DropDownChoice<>(
"excludesSuggest", exclude, includesExcludesSuggestions);
if (!includesExcludesSuggestions.isEmpty()) {
excludesSuggest.setDefaultModelObject(includesExcludesSuggestions.get(0));
}
excludesSuggest.add(new UpdatePatternsBehavior(exclude, excludesTa));
excludesSuggest.setEnabled(isSystemAdmin());
add(excludesSuggest);
}
示例2: DerivationTypeDropDownChoicePanel
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
public DerivationTypeDropDownChoicePanel(final String id, final int entryId, final SimulationTreeTableProvider<Object> simulationTreeTableProvider) {
super(id);
final Form<Void> layoutForm = new Form<Void>("layoutForm");
final DropDownChoice<DerivationType> derivationTypeDropDownChoice = new DropDownChoice<DerivationType>("derivationTypeDropDownChoice", Model.of(simulationTreeTableProvider.getDerivationTypeForEntry(entryId)), this.derivationTypes);
derivationTypeDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
simulationTreeTableProvider.setDerivationTypeForEntry(derivationTypeDropDownChoice.getModelObject(), entryId);
if (DerivationTypeDropDownChoicePanel.this.treeTable != null) {
target.add(DerivationTypeDropDownChoicePanel.this.treeTable);
} else {
target.add(DerivationTypeDropDownChoicePanel.this.getPage());
}
}
});
derivationTypeDropDownChoice.setEnabled(true);
layoutForm.add(derivationTypeDropDownChoice);
this.add(layoutForm);
}
示例3: createAndAddVcsConfigSection
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
@Override
public void createAndAddVcsConfigSection(Form form, RemoteRepoDescriptor repoDescriptor, boolean isCreate) {
WebMarkupContainer vcsSection = new WebMarkupContainer("vcsSupportSection");
vcsSection.add(new TitledBorderBehavior("fieldset-border", "Vcs"));
vcsSection.add(new DisabledAddonBehavior(AddonType.VCS));
vcsSection.add(new StyledCheckbox("enableVcsSupport").setTitle("Enable Vcs Support").setEnabled(false));
vcsSection.add(new DisabledAddonHelpBubble("enableVcsSupport.help", VCS));
DropDownChoice providerDropdown = new DropDownChoice("provider", Model.of(), Collections.emptyList());
providerDropdown.setEnabled(false);
providerDropdown.add(new DisabledAddonBehavior(AddonType.VCS));
vcsSection.add(providerDropdown);
vcsSection.add(new DisabledAddonHelpBubble("provider.help", VCS));
WebMarkupContainer downloadUrlField = new WebMarkupContainer("downloadUrlField");
downloadUrlField.setVisible(false);
downloadUrlField.add(new TextField("downloadUrl").setEnabled(false).setVisible(false));
downloadUrlField.add(new DisabledAddonHelpBubble("downloadUrl.help", VCS).setVisible(false));
vcsSection.add(downloadUrlField);
form.add(vcsSection);
}
示例4: addIncludesPatternFields
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void addIncludesPatternFields(StringResourceModel helpMessage,
final List<CommonPathPattern> includesExcludesSuggestions) {
TextArea includesTa = new TextArea("includesPattern");
includesTa.setEnabled(isSystemAdmin());
includesTa.setOutputMarkupId(true);
add(includesTa);
add(new HelpBubble("includesHelp", helpMessage));
Model<CommonPathPattern> include = new Model<>();
DropDownChoice<CommonPathPattern> includesSuggest = new DropDownChoice<>(
"includesSuggest", include, includesExcludesSuggestions);
if (!includesExcludesSuggestions.isEmpty()) {
includesSuggest.setDefaultModelObject(includesExcludesSuggestions.get(0));
}
includesSuggest.add(new UpdatePatternsBehavior(include, includesTa));
if (parent.isCreate()) {
includesSuggest.setDefaultModelObject(CommonPathPattern.ANY);
}
includesSuggest.setEnabled(isSystemAdmin());
add(includesSuggest);
}
示例5: getKeyPairContainer
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
@Override
public WebMarkupContainer getKeyPairContainer(String wicketId, String virtualRepoKey, boolean isCreate) {
WebMarkupContainer container = new WebMarkupContainer(wicketId);
DropDownChoice<Object> keyPairDropDown = new DropDownChoice<>("keyPair", Collections.emptyList());
keyPairDropDown.setEnabled(false);
keyPairDropDown.add(new DisabledAddonBehavior(WEBSTART));
container.add(keyPairDropDown);
container.add(new WebMarkupContainer("keyPairMessage"));
container.add(new DisabledAddonHelpBubble("keyPair.help", WEBSTART));
return container;
}
示例6: init
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
/**
* Init panel components
*/
private void init() {
TitledBorder border = new TitledBorder("mavenSettingsBorder");
addChoice("releases", true, false, false, false);
addChoice("snapshots", false, true, false, false);
addChoice("pluginReleases", true, false, true, false);
addChoice("pluginSnapshots", false, true, true, false);
final DropDownChoice mirrorDropDownChoice = new DropDownChoice<>("mirrorAnySelection",
new PropertyModel<T>(this, "mirrorAnySelection"), virtualRepoDescriptors);
mirrorDropDownChoice.setOutputMarkupId(true);
if (!virtualRepoDescriptors.isEmpty()) {
mirrorDropDownChoice.setDefaultModelObject(getDefaultChoice(false, false, false, true));
}
mirrorDropDownChoice.setEnabled(false);
form.add(mirrorDropDownChoice);
form.add(new HelpBubble("mirrorAnySelection.help", new ResourceModel("mirrorAnySelection.help")));
final StyledCheckbox mirrorAnyCheckbox =
new StyledCheckbox("mirrorAny", new PropertyModel<Boolean>(this, "mirrorAny"));
mirrorAnyCheckbox.setDefaultModelObject(Boolean.FALSE);
mirrorAnyCheckbox.add(new AjaxFormComponentUpdatingBehavior("onclick") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
mirrorDropDownChoice.setEnabled(mirrorAnyCheckbox.isChecked());
target.add(mirrorDropDownChoice);
}
});
form.add(mirrorAnyCheckbox);
TitledAjaxSubmitLink generateButton = getGenerateButton();
form.add(new DefaultButtonBehavior(generateButton));
border.add(form);
add(border);
add(generateButton);
}
示例7: rebuildAttendees
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void rebuildAttendees()
{
attendeesRepeater.removeAll();
for (final TeamEventAttendeeDO attendee : attendees) {
final WebMarkupContainer item = new WebMarkupContainer(attendeesRepeater.newChildId());
attendeesRepeater.add(item);
item.add(new AttendeeEditableLabel("editableLabel", Model.of(attendee), false));
final DropDownChoice<TeamAttendeeStatus> statusChoice = new DropDownChoice<TeamAttendeeStatus>("status",
new PropertyModel<TeamAttendeeStatus>(attendee, "status"), statusChoiceRenderer.getValues(), statusChoiceRenderer);
statusChoice.setEnabled(false);
item.add(statusChoice);
}
}
示例8: addWicketComponents
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void addWicketComponents() {
final DropDownChoice<String> exportChoice = new DropDownChoice<String>("exportType", new PropertyModel<String>(runtimeModel, "exportType"), typeList,
new ChoiceRenderer<String>() {
@Override
public Object getDisplayValue(String name) {
if (name.equals(ReportConstants.ETL_FORMAT)) {
return getString("Analysis.source");
} else {
return name;
}
}
});
exportChoice.add(new AjaxFormComponentUpdatingBehavior("onChange") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
String format = (String) getFormComponent().getConvertedInput();
if (ReportConstants.ETL_FORMAT.equals(format)) {
System.out.println("***** ETL selected");
//analysisPanel.setVisible(true);
} else {
System.out.println("***** " + format);
//analysisPanel.setVisible(false);
}
//target.add(analysisPanel);
}
});
exportChoice.setRequired(true);
add(exportChoice);
if (report.isAlarmType() || report.isIndicatorType() || report.isDisplayType()) {
exportChoice.setEnabled(false);
} else {
exportChoice.setRequired(true);
}
}
示例9: AttributeTypeDropDownChoicePanel
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
public AttributeTypeDropDownChoicePanel(final String id, final TypeTreeNode attribute, final boolean dropDownChoiceEnabled, final EventAttributeProvider dataProvider) {
super(id);
final Form<Void> layoutForm = new Form<Void>("layoutForm");
final List<AttributeTypeEnum> attributeTypes = new ArrayList<AttributeTypeEnum>();
if (attribute.getType() != null) {
switch (attribute.getType()) {
case DATE:
attributeTypes.add(AttributeTypeEnum.DATE);
attributeTypes.add(AttributeTypeEnum.STRING);
break;
case FLOAT:
attributeTypes.add(AttributeTypeEnum.FLOAT);
attributeTypes.add(AttributeTypeEnum.STRING);
break;
case INTEGER:
attributeTypes.add(AttributeTypeEnum.INTEGER);
attributeTypes.add(AttributeTypeEnum.FLOAT);
attributeTypes.add(AttributeTypeEnum.STRING);
break;
default:
attributeTypes.add(AttributeTypeEnum.STRING);
}
}
final DropDownChoice<AttributeTypeEnum> attributeTypeDropDownChoice = new DropDownChoice<AttributeTypeEnum>("attributeTypeDropDownChoice", new PropertyModel<AttributeTypeEnum>(this, "attributeType"), attributeTypes);
attributeTypeDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
attribute.setType(AttributeTypeDropDownChoicePanel.this.attributeType);
}
});
attributeTypeDropDownChoice.setEnabled(dropDownChoiceEnabled);
layoutForm.add(attributeTypeDropDownChoice);
this.add(layoutForm);
}
示例10: enableComponents
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void enableComponents(int monthlyType, Label mLabel, DropDownChoice minuteChoice, Label label, TextField<Integer> minuteText,
IntervalFieldPanel hoursPanel, IntervalFieldPanel monthsPanel,
DropDownChoice<Integer> noChoice, DropDownChoice<String> dayChoice,
Label everyLabel) {
if (ScheduleConstants.MONTHLY_GENERAL_TYPE == monthlyType) {
mLabel.setEnabled(true);
minuteChoice.setEnabled(true);
label.setEnabled(true);
minuteText.setEnabled(true);
hoursPanel.setEnabled(true);
daysPanel.setEnabled(true);
monthsPanel.setEnabled(true);
weekdaysPanel.setEnabled(true);
noChoice.setEnabled(false);
dayChoice.setEnabled(false);
everyLabel.setEnabled(false);
} else if (ScheduleConstants.MONTHLY_DAY_OF_WEEK_TYPE == monthlyType) {
mLabel.setEnabled(false);
minuteChoice.setEnabled(false);
label.setEnabled(false);
minuteText.setEnabled(false);
hoursPanel.setEnabled(false);
daysPanel.setEnabled(false);
monthsPanel.setEnabled(false);
weekdaysPanel.setEnabled(false);
noChoice.setEnabled(true);
dayChoice.setEnabled(true);
everyLabel.setEnabled(true);
} else {
mLabel.setEnabled(false);
minuteChoice.setEnabled(false);
label.setEnabled(false);
minuteText.setEnabled(false);
hoursPanel.setEnabled(false);
daysPanel.setEnabled(false);
monthsPanel.setEnabled(false);
weekdaysPanel.setEnabled(false);
noChoice.setEnabled(false);
dayChoice.setEnabled(false);
everyLabel.setEnabled(false);
}
}