本文整理了Java中com.vaadin.ui.CheckBox.setId()
方法的一些代码示例,展示了CheckBox.setId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CheckBox.setId()
方法的具体详情如下:
包路径:com.vaadin.ui.CheckBox
类名称:CheckBox
方法名:setId
暂无
代码示例来源:origin: stackoverflow.com
for(int i=0;i<totalCB;i++){
CheckBox chB=new CheckBox(context);
...
chB.setId(i);
layout.add(...);// add checkbox to view
}
代码示例来源:origin: stackoverflow.com
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
LayoutInflater in = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = in.inflate(R.layout.inflator, null);
CheckBox c = (CheckBox) convertView.findViewById(R.id.checkBox);
c.setId(position);
return convertView;
代码示例来源:origin: stackoverflow.com
final TableRow tbRowGremio = new TableRow(contexto);
tbRowGremio.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));
tbRowGremio.setId((numeroFila));
LayoutInflater inflater = (LayoutInflater) contexto.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View lineaAPintar = inflater.inflate(R.layout.filalistagremios, null);
lineaAPintar.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
final CheckBox cbGremioActivo = (CheckBox) lineaAPintar.findViewById(R.id.cbGremioActivo);
cbGremioActivo.setId(numeroFila);
TextView tvGremio = (TextView) lineaAPintar.findViewById(R.id.tvGremio);
tvGremio.setText(gremioQueQuiereAnadir);
TextView tvComentario = (TextView) lineaAPintar.findViewById(R.id.tvComentario);
tvComentario.setText(etComentario.getText().toString());
tbRowGremio.addView(lineaAPintar);
tablaGremios.addView(tbRowGremio);
代码示例来源:origin: stackoverflow.com
CheckBox tvchkall = new CheckBox(ItemCodeRelease.this);
tvchkall.setId(101);
tvchkall.setOnClickListener(getOnClickDoSomething(tvchkall));
代码示例来源:origin: stackoverflow.com
final HashMap<Integer,Integer> myList=new HashMap<Integer, Integer>();
for(int i=1;i<=20;i++)
{
final CheckBox cb=new CheckBox(context);
cb.setId(i);
myList.put(i, 0);
final int pos=i;
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
if(cb.isChecked())
myList.put(pos, 1);// checkbox checked
else
myList.put(pos,0);//checkbox unchecked
}
});
}
代码示例来源:origin: stackoverflow.com
RelativeLayout rl=new RelativeLayout(CreateFuelOnlyInspectionActivity.this);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
int rlMarginTop_px = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, getResources().getDisplayMetrics());
lp.topMargin=rlMarginTop_px;
rl.setLayoutParams(lp);
CheckBox cb1;
RelativeLayout.LayoutParams cbParams1=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
for(int i=0;i<=6; i++){
cb1=new CheckBox(CreateFuelOnlyInspectionActivity.this);
cb1.setId(i);
cb1.setTag(""+i);
cb1.setLayoutParams(cbParams1);
cb1.setButtonDrawable(getResources().getDrawable(R.drawable.checkbox_selector));
rl.addView(cb1);
}
// enable view page here
代码示例来源:origin: stackoverflow.com
mUserProfile = mNavigationCallback.getUserProfile();
List<Contact> contacts = mUserProfile.getContacts();
for (Contact c : contacts) {
View view = View.inflate(getActivity(), R.layout.item_contact, null);
TextView tv = (TextView) view.findViewById(R.id.tvPhone);
tv.setText(c.getValue());
CheckBox cb = (CheckBox) view.findViewById(R.id.cbContactChecked);
cb.setChecked(c.isSelected)
cb.setId(generateViewId());
if (c.getType().equals("email")) {
llEmailContacts.addView(view);
}
if (c.getType().equals("phone")) {
llPhoneContacts.addView(view);
}
}
代码示例来源:origin: stackoverflow.com
public void onCreate(Bundle state) {
//Get your userProfile from state. If it is null, there was no state saved then get it like you //already do = mUserProfile = mNavigationCallback.getUserProfile();
List<Contact> contacts = mUserProfile.getContacts();
for (Contact c : contacts) {
View view = View.inflate(getActivity(), R.layout.item_contact, null);
TextView tv = (TextView) view.findViewById(R.id.tvPhone);
tv.setText(c.getValue());
CheckBox cb = (CheckBox) view.findViewById(R.id.cbContactChecked);
cb.setChecked(c.isSelected)
cb.setId(generateViewId());
if (c.getType().equals("email")) {
llEmailContacts.addView(view);
}
if (c.getType().equals("phone")) {
llPhoneContacts.addView(view);
}
}
}
代码示例来源:origin: eclipse/hawkbit
private CheckBox createTargetVisibleField() {
final CheckBox checkBox = new CheckBox();
checkBox.setId(UIComponentIdProvider.METADATA_TARGET_VISIBLE_ID);
checkBox.setCaption(i18n.getMessage("metadata.targetvisible"));
checkBox.addValueChangeListener(this::onCheckBoxChange);
return checkBox;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private CheckBox createTargetVisibleField() {
final CheckBox checkBox = new CheckBox();
checkBox.setId(UIComponentIdProvider.METADATA_TARGET_VISIBLE_ID);
checkBox.setCaption(i18n.getMessage("metadata.targetvisible"));
checkBox.addValueChangeListener(this::onCheckBoxChange);
return checkBox;
}
代码示例来源:origin: stackoverflow.com
mUserProfile = mNavigationCallback.getUserProfile();
List<Contact> contacts = mUserProfile.getContacts();
for (Contact c : contacts) {
View view = View.inflate(getActivity(), R.layout.item_contact, null);
TextView tv = (TextView) view.findViewById(R.id.tvPhone);
tv.setText(c.getValue());
CheckBox cb = (CheckBox) view.findViewById(R.id.cbContactChecked);
if (c.getViewId() == 0) {
c.setViewId(generateViewId());
}
cb.setId(c.getViewId());
cb.setTag(c);
Timber.d("setting CB: " + "ID :" + cb.getId() + " tag " + cb.getTag());
cb.setOnCheckedChangeListener(mOnCheckedChangeListener);
if (c.getType().equals("email")) {
llEmailContacts.addView(view);
}
if (c.getType().equals("phone")) {
llPhoneContacts.addView(view);
}
}
代码示例来源:origin: eclipse/hawkbit
private VerticalLayout initView() {
final Label label = new Label(i18n.getMessage("label.auto.assign.description"));
checkBox = new CheckBox(i18n.getMessage("label.auto.assign.enable"));
checkBox.setId(UIComponentIdProvider.DIST_SET_SELECT_ENABLE_ID);
checkBox.setImmediate(true);
checkBox.addValueChangeListener(this);
setTableEnabled(false);
final VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.addComponent(label);
verticalLayout.addComponent(checkBox);
verticalLayout.addComponent(dsTable);
return verticalLayout;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private VerticalLayout initView() {
final Label label = new Label(i18n.getMessage("label.auto.assign.description"));
checkBox = new CheckBox(i18n.getMessage("label.auto.assign.enable"));
checkBox.setId(UIComponentIdProvider.DIST_SET_SELECT_ENABLE_ID);
checkBox.setImmediate(true);
checkBox.addValueChangeListener(this);
setTableEnabled(false);
final VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.addComponent(label);
verticalLayout.addComponent(checkBox);
verticalLayout.addComponent(dsTable);
return verticalLayout;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private CheckBox enableMaintenanceWindowControl() {
final CheckBox enableMaintenanceWindow = new CheckBox(
getI18n().getMessage("caption.maintenancewindow.enabled"));
enableMaintenanceWindow.setId(UIComponentIdProvider.MAINTENANCE_WINDOW_ENABLED_ID);
enableMaintenanceWindow.addStyleName(ValoTheme.CHECKBOX_SMALL);
enableMaintenanceWindow.addStyleName("dist-window-maintenance-window-enable");
enableMaintenanceWindow.addValueChangeListener(event -> {
final Boolean isMaintenanceWindowEnabled = enableMaintenanceWindow.getValue();
maintenanceWindowLayout.setVisible(isMaintenanceWindowEnabled);
maintenanceWindowLayout.setEnabled(isMaintenanceWindowEnabled);
enableSaveButton(!isMaintenanceWindowEnabled);
maintenanceWindowLayout.clearAllControls();
});
return enableMaintenanceWindow;
}
代码示例来源:origin: eclipse/hawkbit
private CheckBox enableMaintenanceWindowControl() {
final CheckBox enableMaintenanceWindow = new CheckBox(
getI18n().getMessage("caption.maintenancewindow.enabled"));
enableMaintenanceWindow.setId(UIComponentIdProvider.MAINTENANCE_WINDOW_ENABLED_ID);
enableMaintenanceWindow.addStyleName(ValoTheme.CHECKBOX_SMALL);
enableMaintenanceWindow.addStyleName("dist-window-maintenance-window-enable");
enableMaintenanceWindow.addValueChangeListener(event -> {
final Boolean isMaintenanceWindowEnabled = enableMaintenanceWindow.getValue();
maintenanceWindowLayout.setVisible(isMaintenanceWindowEnabled);
maintenanceWindowLayout.setEnabled(isMaintenanceWindowEnabled);
enableSaveButton(!isMaintenanceWindowEnabled);
maintenanceWindowLayout.clearAllControls();
});
return enableMaintenanceWindow;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private CheckBox enableMaintenanceWindowControl() {
final CheckBox enableMaintenanceWindow = new CheckBox(
getI18n().getMessage("caption.maintenancewindow.enabled"));
enableMaintenanceWindow.setId(UIComponentIdProvider.MAINTENANCE_WINDOW_ENABLED_ID);
enableMaintenanceWindow.addStyleName(ValoTheme.CHECKBOX_SMALL);
enableMaintenanceWindow.addStyleName("dist-window-maintenance-window-enable");
enableMaintenanceWindow.addValueChangeListener(event -> {
final Boolean isMaintenanceWindowEnabled = enableMaintenanceWindow.getValue();
maintenanceWindowLayout.setVisible(isMaintenanceWindowEnabled);
maintenanceWindowLayout.setEnabled(isMaintenanceWindowEnabled);
enableSaveButton(!isMaintenanceWindowEnabled);
maintenanceWindowLayout.clearAllControls();
});
return enableMaintenanceWindow;
}
代码示例来源:origin: eclipse/hawkbit
private CheckBox enableMaintenanceWindowControl() {
final CheckBox enableMaintenanceWindow = new CheckBox(
getI18n().getMessage("caption.maintenancewindow.enabled"));
enableMaintenanceWindow.setId(UIComponentIdProvider.MAINTENANCE_WINDOW_ENABLED_ID);
enableMaintenanceWindow.addStyleName(ValoTheme.CHECKBOX_SMALL);
enableMaintenanceWindow.addStyleName("dist-window-maintenance-window-enable");
enableMaintenanceWindow.addValueChangeListener(event -> {
final Boolean isMaintenanceWindowEnabled = enableMaintenanceWindow.getValue();
maintenanceWindowLayout.setVisible(isMaintenanceWindowEnabled);
maintenanceWindowLayout.setEnabled(isMaintenanceWindowEnabled);
enableSaveButton(!isMaintenanceWindowEnabled);
maintenanceWindowLayout.clearAllControls();
});
return enableMaintenanceWindow;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private DurationConfigField(final String id) {
super(2, 2);
this.addStyleName("duration-config-field");
this.setSpacing(true);
this.setImmediate(true);
this.setColumnExpandRatio(1, 1.0F);
durationField.setId(id + ".field");
checkBox.setId(id + ".checkbox");
this.addComponent(checkBox, 0, 0);
this.setComponentAlignment(checkBox, Alignment.MIDDLE_LEFT);
this.addComponent(durationField, 1, 0);
this.setComponentAlignment(durationField, Alignment.MIDDLE_LEFT);
checkBox.addValueChangeListener(event -> checkBoxChange());
durationField.addValueChangeListener(event -> notifyConfigurationChanged());
}
代码示例来源:origin: eclipse/hawkbit
private DurationConfigField(final String id) {
super(2, 2);
this.addStyleName("duration-config-field");
this.setSpacing(true);
this.setImmediate(true);
this.setColumnExpandRatio(1, 1.0F);
durationField.setId(id + ".field");
checkBox.setId(id + ".checkbox");
this.addComponent(checkBox, 0, 0);
this.setComponentAlignment(checkBox, Alignment.MIDDLE_LEFT);
this.addComponent(durationField, 1, 0);
this.setComponentAlignment(durationField, Alignment.MIDDLE_LEFT);
checkBox.addValueChangeListener(event -> checkBoxChange());
durationField.addValueChangeListener(event -> notifyConfigurationChanged());
}
代码示例来源:origin: eclipse/hawkbit
@SuppressWarnings("unchecked")
private void addTargetTableForUpdate(final SoftwareModuleType swModuleType, final boolean mandatory) {
if (getTwinTables().getSelectedTableContainer() == null) {
return;
}
final Item saveTblitem = getTwinTables().getSelectedTableContainer().addItem(swModuleType.getId());
getTwinTables().getSourceTable().removeItem(swModuleType.getId());
saveTblitem.getItemProperty(DistributionSetTypeSoftwareModuleSelectLayout.getDistTypeName())
.setValue(swModuleType.getName());
final CheckBox mandatoryCheckbox = new CheckBox("", mandatory);
mandatoryCheckbox.setId(swModuleType.getName());
saveTblitem.getItemProperty(DistributionSetTypeSoftwareModuleSelectLayout.getDistTypeMandatory())
.setValue(mandatoryCheckbox);
final Item originalItem = originalSelectedTableContainer.addItem(swModuleType.getId());
originalItem.getItemProperty(DistributionSetTypeSoftwareModuleSelectLayout.getDistTypeName())
.setValue(swModuleType.getName());
originalItem.getItemProperty(DistributionSetTypeSoftwareModuleSelectLayout.getDistTypeMandatory())
.setValue(mandatoryCheckbox);
getWindow().updateAllComponents(mandatoryCheckbox);
}
内容来源于网络,如有侵权,请联系作者删除!