Java 类com.vaadin.ui.CheckBox 实例源码

项目:metl    文件:EditDeduperPanel.java   
protected CheckBox createAttributeCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        @Override
        public void valueChange(ValueChangeEvent event) {
            ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        }
    });
    checkBox.setReadOnly(readOnly);
    return checkBox;
}
项目:metl    文件:EditMergerPanel.java   
private CheckBox createCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        }
    });
    checkBox.setReadOnly(readOnly);
    return checkBox;

}
项目:holon-vaadin7    文件:DefaultItemListing.java   
@SuppressWarnings("unchecked")
@Override
public Field<?> buildAndBind(Object propertyId) throws BindException {
    // If property is a Property, try to render Field using UIContext
    if (propertyId != null && Property.class.isAssignableFrom(propertyId.getClass())) {
        Field<?> field = renderField((P) propertyId).map((f) -> {
            setupField((P) propertyId, f);
            if (f instanceof CheckBox)
                f.setCaption(null);
            bind(f, propertyId);
            return f;
        }).orElse(null);
        if (field != null) {
            return field;
        }
    }
    return super.buildAndBind(propertyId);
}
项目:easybinder    文件:BuildAndBindTest.java   
@SuppressWarnings("unchecked")
@BeforeClass
public static void setup() {
    binder.buildAndBind("flightId");

    form.airline = (TextField) binder.getFieldForProperty("flightId.airline").get();
    form.flightNumber = (TextField) binder.getFieldForProperty("flightId.flightNumber").get();
    form.flightSuffix = (TextField) binder.getFieldForProperty("flightId.flightSuffix").get();
    form.date = (DateField) binder.getFieldForProperty("flightId.date").get();
    form.legType = (AbstractSingleSelect<LegType>) binder.getFieldForProperty("flightId.legType").get();
    form.sbt = (DateTimeField) binder.getFieldForProperty("sbt").get();
    form.ebt = (DateTimeField) binder.getFieldForProperty("ebt").get();
    form.abt = (DateTimeField) binder.getFieldForProperty("abt").get();
    form.gate = (TextField) binder.getFieldForProperty("gate").get();
    form.canceled = (CheckBox) binder.getFieldForProperty("canceled").get();
}
项目:osc-core    文件:SummaryLayout.java   
@SuppressWarnings("serial")
private CheckBox createCheckBox() {
    this.checkbox = new CheckBox(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_INCLUDE_DB));
    this.checkbox.setImmediate(true);
    this.checkbox.setValue(false);
    this.checkbox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (SummaryLayout.this.checkbox.getValue()) {
                SummaryLayout.this.download
                        .setCaption(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_BUNDLE));
            } else {
                SummaryLayout.this.download
                        .setCaption(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_LOG));
            }
        }
    });
    return this.checkbox;
}
项目:HomeWire-Server    文件:StatisticView.java   
private Component createSensorList() {
  VerticalLayout listLayout = new VerticalLayout();
  //listLayout.setWidth(25, Unit.PERCENTAGE);

  deviceSetupService.getSensorDtosGroupedByType().forEach((groupName, sensorDTOS) -> {
    VerticalLayout sensorList = new VerticalLayout();

    sensorDTOS.forEach(sensorDTO -> {
      CheckBox c = new CheckBox(sensorDTO.getName());

      c.addValueChangeListener(event -> {
        updateChart(sensorDTO.getType() + sensorDTO.getDevId(),
            (Boolean) event.getProperty().getValue());
      });

      sensorList.addComponent(c);
    });

    Panel typePanel = new Panel(groupName.substring(0, 1).toUpperCase() + groupName.substring(1));
    typePanel.setContent(sensorList);
    listLayout.addComponent(typePanel);
  });

  return listLayout;
}
项目:hawkbit    文件:RepositoryConfigurationView.java   
@Override
public void valueChange(final ValueChangeEvent event) {

    if (!(event.getProperty() instanceof CheckBox)) {
        return;
    }

    notifyConfigurationChanged();

    final CheckBox checkBox = (CheckBox) event.getProperty();
    BooleanConfigurationItem configurationItem;

    if (actionAutocloseCheckBox.equals(checkBox)) {
        configurationItem = actionAutocloseConfigurationItem;
    } else {
        return;
    }

    if (checkBox.getValue()) {
        configurationItem.configEnable();
    } else {
        configurationItem.configDisable();
    }
}
项目:hawkbit    文件:DistributionSetSelectWindow.java   
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;
}
项目:hawkbit    文件:CreateUpdateDistSetTypeLayout.java   
@SuppressWarnings("unchecked")
private void addTargetTableforUpdate(final SoftwareModuleType swModuleType, final boolean mandatory) {

    if (selectedTableContainer == null) {
        return;
    }
    final Item saveTblitem = selectedTableContainer.addItem(swModuleType.getId());
    sourceTable.removeItem(swModuleType.getId());
    saveTblitem.getItemProperty(DIST_TYPE_NAME).setValue(swModuleType.getName());
    final CheckBox mandatoryCheckbox = new CheckBox("", mandatory);
    mandatoryCheckbox.setId(swModuleType.getName());
    saveTblitem.getItemProperty(DIST_TYPE_MANDATORY).setValue(mandatoryCheckbox);

    final Item originalItem = originalSelectedTableContainer.addItem(swModuleType.getId());
    originalItem.getItemProperty(DIST_TYPE_NAME).setValue(swModuleType.getName());
    originalItem.getItemProperty(DIST_TYPE_MANDATORY).setValue(mandatoryCheckbox);

    window.updateAllComponents(mandatoryCheckbox);
}
项目:metl    文件:EditReleasePackageDialog.java   
protected void save() {
    if (isNotBlank(nameField.getValue()) && isNotBlank(versionLabelField.getValue())) {
        releasePackage.setName(nameField.getValue());
        releasePackage.setVersionLabel(versionLabelField.getValue());
        releasePackage.setReleaseDate(releaseDateField.getValue());
        configurationService.save(releasePackage);

        configurationService.deleteReleasePackageProjectVersionsForReleasePackage(releasePackage.getId());
        for (CheckBox projectCheckbox : projectCheckboxes) {
            if (projectCheckbox.getValue() == true) {
                String projectId = (String) projectCheckbox.getData();
                OptionGroup optionGroup = projectVersionOptionGroups.get(projectId);
                String projectVersionId = (String) optionGroup.getValue();
                Rppv rppv = new Rppv(releasePackage.getId(), projectVersionId);
                configurationService.save(rppv);
            }
        }

        listener.updated(releasePackage);
        close();
    }
}
项目:metl    文件:EditDataDiffPanel.java   
protected CheckBox createEntityCheckBox(final EntitySettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            ComponentEntitySetting setting = component.getSingleEntitySetting(settings.getEntityId(), key);

            String oldValue = setting == null ? Boolean.TRUE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentEntitySetting(settings.getEntityId(), component.getId(), key, Boolean.TRUE.toString());
                component.addEntitySetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        }
    });
    checkBox.setReadOnly(readOnly);
    return checkBox;
}
项目:metl    文件:EditRdbmsWriterPanel.java   
private CheckBox createCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    if (!readOnly) {
        checkBox.addValueChangeListener((event) -> {
            ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.TRUE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        });
    }
    checkBox.setReadOnly(readOnly);
    return checkBox;
}
项目:Plugins    文件:SparqlUpdateVaadinDialog.java   
@Override
protected void buildDialogLayout() {
    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    checkPerGraph = new CheckBox(ctx.tr("sparqlUpdate.dialog.perGraph"));
    checkPerGraph.setWidth("100%");
    mainLayout.addComponent(checkPerGraph);
    mainLayout.setExpandRatio(checkPerGraph, 0.0f);

    txtQuery = new TextArea(ctx.tr("sparqlUpdate.dialog.query"));
    txtQuery.setSizeFull();
    txtQuery.setRequired(true);
    txtQuery.addValidator(createSparqlUpdateQueryValidator());
    txtQuery.setImmediate(true);
    mainLayout.addComponent(txtQuery);
    mainLayout.setExpandRatio(txtQuery, 1.0f);

    setCompositionRoot(mainLayout);
}
项目:Plugins    文件:RenamerVaadinDialog.java   
@Override
protected void buildDialogLayout() {

    final VerticalLayout layout = new VerticalLayout();
    layout.setWidth("100%");
    layout.setHeight("-1px");
    layout.setSpacing(true);
    layout.setMargin(true);

    txtPattern = new TextField(ctx.tr("renamer.dialog.regExp"));
    txtPattern.setWidth("100%");
    layout.addComponent(txtPattern);

    txtValue = new TextField(ctx.tr("renamer.dialog.replaceWith"));
    txtValue.setWidth("100%");
    layout.addComponent(txtValue);

    checkUseAdvanced = new CheckBox(ctx.tr("renamer.dialog.advancedMode"));
    checkUseAdvanced.setWidth("100%");
    checkUseAdvanced.setDescription(ctx.tr("renamer.dialog.advancedMode.desc"));
    layout.addComponent(checkUseAdvanced);

    setCompositionRoot(layout);
}
项目:Plugins    文件:FilesFilterVaadinDialog.java   
@Override
protected void buildDialogLayout() {
    setSizeFull();

    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setImmediate(false);
    mainLayout.setWidth("100%");
    mainLayout.setHeight("-1px");
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    txtObject = new TextField(ctx.tr("filesFilter.dialog.value"));
    txtObject.setWidth("100%");
    txtObject.setRequired(true);
    mainLayout.addComponent(txtObject);

    checkUseRegExp = new CheckBox(ctx.tr("filesFilter.dialog.regexp"));
    checkUseRegExp.setDescription(ctx.tr("filesFilter.dialog.regexp.desc"));
    mainLayout.addComponent(checkUseRegExp);

    setCompositionRoot(mainLayout);
}
项目:Plugins    文件:VirtuosoLoaderVaadinDialog.java   
@Override
protected void buildDialogLayout() {
    FormLayout mainLayout = new FormLayout();

    // top-level component properties
    setWidth("100%");
    setHeight("100%");

    final PasswordField passwordField = new PasswordField(PASSWORD_LABEL, password);
    passwordField.setWidth("100%");

    mainLayout.addComponent(createTextField(VIRTUOSO_URL_LABEL, virtuosoUrl));
    mainLayout.addComponent(createTextField(USERNAME_LABEL, username));
    mainLayout.addComponent(passwordField);
    mainLayout.addComponent(new CheckBox(CLEAR_DESTINATION_GRAPH_LABEL, clearDestinationGraph));
    mainLayout.addComponent(createTextField(LOAD_DIRECTORY_PATH_LABEL, loadDirectoryPath));
    mainLayout.addComponent(new CheckBox(INCLUDE_SUBDIRECTORIES_LABEL, includeSubdirectories));
    mainLayout.addComponent(createTextField(LOAD_FILE_PATTERN_LABEL, loadFilePattern));
    mainLayout.addComponent(createTextField(TARGET_CONTEXT_LABEL, targetContext));
    mainLayout.addComponent(createTextField(STATUS_UPDATE_INTERVAL_LABEL, statusUpdateInterval));
    mainLayout.addComponent(createTextField(THREAD_COUNT_LABEL, threadCount));
    mainLayout.addComponent(new CheckBox(SKIP_ON_ERROR_LABEL, skipOnError));

    setCompositionRoot(mainLayout);
}
项目:Plugins    文件:SparqlConstructVaadinDialog.java   
@Override
protected void buildDialogLayout() {
    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    checkPerGraph = new CheckBox(ctx.tr("SparqlConstructVaadinDialog.perGraphMode"));
    checkPerGraph.setWidth("100%");
    mainLayout.addComponent(checkPerGraph);
    mainLayout.setExpandRatio(checkPerGraph, 0.0f);

    txtQuery = new TextArea(ctx.tr("SparqlConstructVaadinDialog.constructQuery"));
    txtQuery.setSizeFull();
    txtQuery.setRequired(true);
    txtQuery.addValidator(createSparqlQueryValidator());
    txtQuery.setImmediate(true);
    mainLayout.addComponent(txtQuery);
    mainLayout.setExpandRatio(txtQuery, 1.0f);

    setCompositionRoot(mainLayout);
}
项目:primecloud-controller    文件:ServiceButtonsTop.java   
private void stopAllButtonClick(ClickEvent event) {
    // ダイアログの表示オプション
    HorizontalLayout optionLayout = new HorizontalLayout();
    final CheckBox checkBox = new CheckBox(ViewMessages.getMessage("IUI-000033"), false);
    checkBox.setImmediate(true);
    optionLayout.addComponent(checkBox);

    // 確認ダイアログを表示
    String message = ViewMessages.getMessage("IUI-000010");
    DialogConfirm dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message,
            Buttons.OKCancelConfirm, optionLayout);
    dialog.setCallback(new DialogConfirm.Callback() {
        @Override
        public void onDialogResult(Result result) {
            if (result != Result.OK) {
                return;
            }

            boolean stopInstance = (Boolean) checkBox.getValue();
            stopAll(stopInstance);
        }
    });
    getApplication().getMainWindow().addWindow(dialog);
}
项目:abstractform    文件:TestVaadinBuilder.java   
@Test
public void testBuilder() {
    Form form = new SampleForm();
    VaadinFormToolkit toolkit = new VaadinFormToolkit();
    VaadinFormInstance instance = toolkit.buildForm(form);
    assertNotNull(instance);
    Component component = instance.getImplementation();
    assertThat(component, instanceOf(VerticalLayout.class));

    Component cifCode = instance.getComponentById("fCif");
    assertThat(cifCode, instanceOf(TextField.class));

    Component active = instance.getComponentById("fActive");
    assertThat(active, instanceOf(CheckBox.class));

}
项目:abstractform    文件:TestVaadinBuilder.java   
@Test
public void testServiceLoader() throws ServiceNotFoundException {
    FormToolkit<Component> toolkit = FormService.getInstance().getFormToolkit(Component.class);

    Form form = new SampleForm();
    VaadinFormInstance instance = (VaadinFormInstance) toolkit.buildForm(form);
    assertNotNull(instance);
    Component component = instance.getImplementation();
    assertThat(component, instanceOf(VerticalLayout.class));

    Component cifCode = instance.getComponentById("fCif");
    assertThat(cifCode, instanceOf(TextField.class));

    Component active = instance.getComponentById("fActive");
    assertThat(active, instanceOf(CheckBox.class));

}
项目:vaadin-security-template    文件:LoginUI.java   
private Component buildLoginForm() {
    final VerticalLayout loginPanel = new VerticalLayout();
    loginPanel.setSizeUndefined();
    loginPanel.setSpacing(true);
    Responsive.makeResponsive(loginPanel);
    loginPanel.addStyleName("login-panel");

    loginPanel.addComponent(buildLabels());
    loginPanel.addComponent(buildFields());

    CheckBox rememberMe = new CheckBox("Remember me", true);
    rememberMe.setTabIndex(3);

    loginPanel.addComponent(rememberMe);
    return loginPanel;
}
项目:mycollab    文件:TicketOverdueWidget.java   
public TicketOverdueWidget() {
    super(UserUIContext.getMessage(TicketI18nEnum.VAL_OVERDUE_TICKETS) + " (0)", new CssLayout());

    final CheckBox myItemsOnly = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
    myItemsOnly.addValueChangeListener(valueChangeEvent -> {
        if (searchCriteria != null) {
            boolean selectMyItemsOnly = myItemsOnly.getValue();
            if (selectMyItemsOnly) {
                searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername()));
            } else {
                searchCriteria.setAssignUser(null);
            }
            ticketOverdueComponent.setSearchCriteria(searchCriteria);
        }
    });

    this.addHeaderElement(myItemsOnly);

    ticketOverdueComponent = new TicketOverduePagedList();
    bodyContent.addComponent(ticketOverdueComponent);
}
项目:mycollab    文件:UserUnresolvedTicketWidget.java   
public UserUnresolvedTicketWidget() {
    super("", new CssLayout());
    this.setWidth("100%");
    final CheckBox myItemsSelection = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
    myItemsSelection.addValueChangeListener(valueChangeEvent -> {
        boolean isMyItemsOption = myItemsSelection.getValue();
        if (searchCriteria != null) {
            if (isMyItemsOption) {
                searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername()));
            } else {
                searchCriteria.setAssignUser(null);
            }
            updateSearchResult();
        }
    });
    ticketList = new DefaultBeanPagedList<ProjectTicketService, ProjectTicketSearchCriteria, ProjectTicket>
            (AppContextUtil.getSpringBean(ProjectTicketService.class), new TicketRowDisplayHandler(true), 10) {
        @Override
        protected String stringWhenEmptyList() {
            return UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_TICKET);
        }
    };
    this.addHeaderElement(myItemsSelection);
    this.bodyContent.addComponent(ticketList);
}
项目:mycollab    文件:ProjectOverdueTicketsWidget.java   
public ProjectOverdueTicketsWidget() {
    super(String.format("%s (0)", UserUIContext.getMessage(TicketI18nEnum.VAL_OVERDUE_TICKETS)), new CssLayout());
    this.setWidth("100%");

    final CheckBox myItemsSelection = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
    myItemsSelection.addValueChangeListener(valueChangeEvent -> {
        boolean isMyItemsOption = myItemsSelection.getValue();
        if (isMyItemsOption) {
            searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername()));
        } else {
            searchCriteria.setAssignUser(null);
        }
        updateSearchResult();
    });

    ticketList = new DefaultBeanPagedList(AppContextUtil.getSpringBean(ProjectTicketService.class),
            new TicketRowDisplayHandler(false), 10) {
        @Override
        protected String stringWhenEmptyList() {
            return UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_OVERDUE_TICKET);
        }
    };
    this.addHeaderElement(myItemsSelection);
    bodyContent.addComponent(ticketList);
}
项目:mycollab    文件:ProjectUnresolvedTicketsWidget.java   
public ProjectUnresolvedTicketsWidget() {
    super("", new CssLayout());
    this.setWidth("100%");
    final CheckBox myItemsSelection = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
    myItemsSelection.addValueChangeListener(valueChangeEvent -> {
        boolean isMyItemsOption = myItemsSelection.getValue();
        if (isMyItemsOption) {
            searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername()));
        } else {
            searchCriteria.setAssignUser(null);
        }
        updateSearchResult();
    });
    taskList = new DefaultBeanPagedList(AppContextUtil.getSpringBean(ProjectTicketService.class),
            new TicketRowDisplayHandler(false), 10) {
        @Override
        protected String stringWhenEmptyList() {
            return UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_TICKET);
        }
    };
    addHeaderElement(myItemsSelection);
    bodyContent.addComponent(taskList);
}
项目:mycollab    文件:VersionPreviewForm.java   
BugsComp(Version beanItem) {
    withMargin(false).withFullWidth();
    MHorizontalLayout header = new MHorizontalLayout();

    final CheckBox openSelection = new BugStatusCheckbox(StatusI18nEnum.Open, true);
    CheckBox reOpenSelection = new BugStatusCheckbox(StatusI18nEnum.ReOpen, true);
    CheckBox verifiedSelection = new BugStatusCheckbox(StatusI18nEnum.Verified, true);
    CheckBox resolvedSelection = new BugStatusCheckbox(StatusI18nEnum.Resolved, true);

    Label spacingLbl1 = new Label("");

    header.with(openSelection, reOpenSelection, verifiedSelection, resolvedSelection, spacingLbl1).alignAll(Alignment.MIDDLE_LEFT);

    bugList = new DefaultBeanPagedList<>(AppContextUtil.getSpringBean(BugService.class), new BugRowRenderer());
    bugList.setMargin(new MarginInfo(true, true, true, false));
    bugList.setControlStyle("");

    searchCriteria = new BugSearchCriteria();
    searchCriteria.setProjectId(new NumberSearchField(CurrentProjectVariables.getProjectId()));
    searchCriteria.setVersionids(new SetSearchField<>(beanItem.getId()));
    searchCriteria.setStatuses(new SetSearchField<>(StatusI18nEnum.Open.name(), StatusI18nEnum.ReOpen.name(),
            StatusI18nEnum.Verified.name(), StatusI18nEnum.Resolved.name()));
    updateSearchStatus();

    this.with(header, bugList);
}
项目:extacrm    文件:ClientField.java   
@Override
public Component getPopupComponent() {
    final VerticalLayout layout = new VerticalLayout();
    layout.setSizeUndefined();
    layout.setMargin(true);

    final boolean isLegalEntity = getValue() != null && getValue() instanceof LegalEntity;
    final CheckBox isLegalEntityField = new CheckBox("Клиент Юр.лицо", isLegalEntity);
    isLegalEntityField.setDescription("Отметте флаг, если клиент является юр.лицом");
    isLegalEntityField.addValueChangeListener(event -> {
        final Boolean isLE = isLegalEntityField.getValue();
        if (getValue() != null)
            if (!isLE && getValue() instanceof LegalEntity
                    || isLE && getValue() instanceof Person)
                setValue(null);
        makePopup(layout, isLE);
    });
    layout.addComponent(isLegalEntityField);

    makePopup(layout, isLegalEntity);

    return layout;
}
项目:konekti    文件:UserApplicationCollectionField.java   
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {

    CheckBox assignmentColumn = new CheckBox();
    assignmentColumn.setImmediate(true);

    final Application applicationItem = (Application) itemId;

    assignmentColumn.setValue(containsApp(applicationItem));

    assignmentColumn.addListener(new ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            boolean assignmentValue = (Boolean) event.getProperty().getValue();

            if (assignmentValue)
                user.getApplications().add(applicationItem);
            else 
                user.getApplications().remove(getApp(applicationItem));

        }

    });

    return assignmentColumn;
}
项目:VaadinUtils    文件:DayOfWeekCheckBoxes.java   
/**
 * days of week as per DateTimeConstants mon = 1 , sun = 7
 */

public DayOfWeekCheckBoxes()
{
    setSpacing(true);
    setSizeFull();
    String days1[] = new String[] { "Mon", "Tue", "Wed", "Thur", "Fri", "Sat", "Sun" };
    int ctr = 1;
    for (String day : days1)
    {
        CheckBox dayCheck = new CheckBox(day);
        dayCheck.setData(ctr++);

        addComponent(dayCheck);
        boxes.add(dayCheck);
    }
}
项目:VaadinUtils    文件:DayOfWeekCheckBoxes.java   
@Override
public String getValue()
{
    String value = "";
    int i = 1;
    for (CheckBox box : boxes)
    {
        if (box.getValue())
        {
            if (value.length() > 0)
            {
                value += ",";
            }
            value += i;
        }
        i++;
    }
    return value;
}
项目:VaadinUtils    文件:DayOfWeekCheckBoxes.java   
@Override
public void setValue(String newValue) throws com.vaadin.data.Property.ReadOnlyException
{
    for (CheckBox box : boxes)
    {
        box.setValue(false);
    }
    if (newValue != null && newValue.length() > 0)
    {
        String[] values = newValue.split(",");
        for (String value : values)
        {
            int index = Integer.parseInt(value);
            if (index > 0)
            {
                boxes.get(index - 1).setValue(true);
            }
        }
    }

}
项目:scoutmaster    文件:ContactView.java   
@Override
public void valueChange(final ValueChangeEvent event)
{
    final CheckBox property = (CheckBox) event.getProperty();
    final Boolean value = property.getValue();

    if (property == ContactView.this.primaryPhone1 && value == true)
    {
        ContactView.this.primaryPhone2.setValue(false);
        ContactView.this.primaryPhone3.setValue(false);
    }
    else if (property == ContactView.this.primaryPhone2 && value == true)
    {
        ContactView.this.primaryPhone1.setValue(false);
        ContactView.this.primaryPhone3.setValue(false);
    }
    else if (property == ContactView.this.primaryPhone3 && value == true)
    {
        ContactView.this.primaryPhone2.setValue(false);
        ContactView.this.primaryPhone1.setValue(false);
    }
}
项目:scoutmaster    文件:OrganisationView.java   
@Override
public void valueChange(final ValueChangeEvent event)
{
    final CheckBox property = (CheckBox) event.getProperty();
    final Boolean value = property.getValue();
    if (value != null)
    {

        if (property == OrganisationView.this.primaryPhone1 && value == true)
        {
            OrganisationView.this.primaryPhone2.setValue(false);
            OrganisationView.this.primaryPhone3.setValue(false);
        }
        else if (property == OrganisationView.this.primaryPhone2 && value == true)
        {
            OrganisationView.this.primaryPhone1.setValue(false);
            OrganisationView.this.primaryPhone3.setValue(false);
        }
        else if (property == OrganisationView.this.primaryPhone3 && value == true)
        {
            OrganisationView.this.primaryPhone2.setValue(false);
            OrganisationView.this.primaryPhone1.setValue(false);
        }
    }
}
项目:academ    文件:ConsolidadoEvaluacion.java   
public void cargarColumnasPorRol(List<RolBO> roles)
{
    this.tablaConsolidado.addContainerProperty("Numeral", String.class, null);
    this.tablaConsolidado.setColumnWidth("Numeral", 60);
    this.tablaConsolidado.addContainerProperty("Tema", String.class, null);
    this.tablaConsolidado.setColumnWidth("Tema", 300);

    for (RolBO rolBO : roles) 
    {
        this.tablaConsolidado.addContainerProperty("Nivel de Conocimiento "+rolBO.getNombre(), String.class, null);
        this.tablaConsolidado.setColumnWidth("Nivel de Conocimiento "+rolBO.getNombre(), 60);
    }

    this.tablaConsolidado.addContainerProperty("Nivel de Conocimiento Resultante", ComboBox.class, null);
    this.tablaConsolidado.setColumnWidth("Nivel de Conocimiento Resultante", 150);
    this.tablaConsolidado.addContainerProperty("Seleccione", CheckBox.class, null);
    this.tablaConsolidado.setColumnWidth("Selecicone", 60);

}
项目:own-music-cloud    文件:PlaylistView.java   
private void createPlaylistView() {
    playlistLayout = new HorizontalLayout();
    playlistTable = new Table();
    playlistLayout.addComponent(playlistTable);
    playlistTable.setSelectable(true);
    playlistTable.addValueChangeListener(this);
    playlistTable.addContainerProperty(Messages.getString("PlaylistView.0"), CheckBox.class, null); //$NON-NLS-1$
    playlistTable.addContainerProperty(Messages.getString("PlaylistView.playList"), String.class,  null); //$NON-NLS-1$
    playlistTable.addContainerProperty(Messages.getString("PlaylistView.download"), Button.class, null); //$NON-NLS-1$

    for(Playlist playlist : playlistService.getAllPlaylists()) {
        Button downloadButton = new Button();
        downloadButton.addStyleName("download"); //$NON-NLS-1$
        downloadButton.setIcon(new ThemeResource("img/download.png")); //$NON-NLS-1$
        Button favouriteButton = new Button();
        playlistTable.addItem(new Object[] {new CheckBox(), playlist.getName(), playlist.getId(), 
                downloadButton, favouriteButton}, playlist.getId());
    }        
}
项目:own-music-cloud    文件:TracksView.java   
public void reloadTableData() {
    trackTable.removeAllItems();
    tracks = parser.parseTracks(trackService.getAllTracks());
       for(Track track : tracks) {
        if(track.getArtist() != null) {
            track.setArtist(parser.parseArtist(artistService.getArtistById(track.getArtist().getId())));
        }
        if(track.getAlbum() != null) {
            track.setAlbum(parser.parseAlbum(albumService.getAlbumById(track.getAlbum().getId())));
        }           
        DownoadLink downloadLink = new DownoadLink(track.getFile());
        String albumName = (track.getAlbum() != null && track.getAlbum().getName().length() > 0) ? track.getAlbum().getName() : "";  //$NON-NLS-1$
        RemoveLink removeLink = new RemoveLink(track.getFile());
        HorizontalLayout actionsView = new HorizontalLayout();
        actionsView.addComponents(downloadLink,removeLink);
        trackTable.addItem(new Object[] {new CheckBox(), track.getTitle(), track.getArtist().getName(),
                    albumName, actionsView}, track.getId());
       }
}
项目:own-music-cloud    文件:ArtistView.java   
private void filterTracksByArtistId(int artistId){
    if(artistId >= 0) {
        trackTable.removeAllItems();
        for(Track track : tracks) {
            if(track.getArtist().getId() == artistId){
                Link downloadLink = new Link(null, new ExternalResource(track.getFile().getAudioMp3UrlString()));
                downloadLink.setIcon(new ThemeResource("img/download.png")); //$NON-NLS-1$
                String albumTitle = ""; //$NON-NLS-1$
                if(track.getAlbum() != null && track.getAlbum().getName().length() > 0) {
                    track.getAlbum().getName();
                }
                trackTable.addItem(new Object[] {new CheckBox(), track.getTitle(),
                        albumTitle, downloadLink}, track.getId());
            }
        }
    }
}
项目:holon-vaadin7    文件:DefaultItemListing.java   
@SuppressWarnings("rawtypes")
@Override
protected <F extends Field> F build(String caption, Class<?> dataType, Class<F> fieldType)
        throws BindException {
    F field = super.build(caption, dataType, fieldType);
    if (field instanceof CheckBox) {
        field.setCaption(null);
    }
    return field;
}
项目:esup-ecandidat    文件:DroitProfilMembreCommWindow.java   
/**
 * Constructeur de la fenêtre de profil pour membre de commission
 */
public DroitProfilMembreCommWindow() {
    super(NomenclatureUtils.DROIT_PROFIL_COMMISSION);

    /*CheckBox idPresident pour les commissions*/
    cbIsPresident = new CheckBox(applicationContext.getMessage("droitprofilind.table.individu.isPres", null, Locale.getDefault()));
    cbIsPresident.setValue(false);
    addOption(cbIsPresident);
    setMinExpendRatio();
    setOptionLayoutWidth(150);
}
项目:osc-core    文件:BaseDeploymentSpecWindow.java   
protected CheckBox getSharedCheckBox() {
    this.shared = new CheckBox("Shared");
    this.shared.setValue(true);
    this.shared.setImmediate(true);

    return this.shared;
}