Java Code Examples for com.vaadin.ui.CheckBox

The following are top voted examples for showing how to use com.vaadin.ui.CheckBox. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: hawkbit   File: RepositoryConfigurationView.java   Source Code and License 7 votes vote down vote up
@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();
    }
}
 
Example 2
Project: metl   File: EditDeduperPanel.java   Source Code and License 7 votes vote down vote up
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;
}
 
Example 3
Project: metl   File: EditMergerPanel.java   Source Code and License 7 votes vote down vote up
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;

}
 
Example 4
Project: holon-vaadin7   File: DefaultItemListing.java   Source Code and License 6 votes vote down vote up
@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);
}
 
Example 5
Project: easybinder   File: BuildAndBindTest.java   Source Code and License 6 votes vote down vote up
@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();
}
 
Example 6
Project: osc-core   File: SummaryLayout.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 7
Project: HomeWire-Server   File: StatisticView.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 8
Project: hawkbit   File: DistributionSetSelectWindow.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 9
Project: hawkbit   File: CreateUpdateDistSetTypeLayout.java   Source Code and License 6 votes vote down vote up
@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);
}
 
Example 10
Project: metl   File: EditReleasePackageDialog.java   Source Code and License 6 votes vote down vote up
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();
    }
}
 
Example 11
Project: metl   File: EditDataDiffPanel.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 12
Project: metl   File: EditRdbmsWriterPanel.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 13
Project: Plugins   File: SparqlUpdateVaadinDialog.java   Source Code and License 6 votes vote down vote up
@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);
}
 
Example 14
Project: Plugins   File: RenamerVaadinDialog.java   Source Code and License 6 votes vote down vote up
@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);
}
 
Example 15
Project: Plugins   File: FilesFilterVaadinDialog.java   Source Code and License 6 votes vote down vote up
@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);
}
 
Example 16
Project: Plugins   File: VirtuosoLoaderVaadinDialog.java   Source Code and License 6 votes vote down vote up
@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);
}
 
Example 17
Project: Plugins   File: SparqlConstructVaadinDialog.java   Source Code and License 6 votes vote down vote up
@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);
}
 
Example 18
Project: primecloud-controller   File: ServiceButtonsTop.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 19
Project: abstractform   File: TestVaadinBuilder.java   Source Code and License 6 votes vote down vote up
@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));

}
 
Example 20
Project: abstractform   File: TestVaadinBuilder.java   Source Code and License 6 votes vote down vote up
@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));

}
 
Example 21
Project: vaadin-security-template   File: LoginUI.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 22
Project: mycollab   File: TicketOverdueWidget.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 23
Project: mycollab   File: UserUnresolvedTicketWidget.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 24
Project: mycollab   File: ProjectOverdueTicketsWidget.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 25
Project: mycollab   File: ProjectUnresolvedTicketsWidget.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 26
Project: mycollab   File: VersionPreviewForm.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 27
Project: extacrm   File: ClientField.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 28
Project: konekti   File: UserApplicationCollectionField.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 29
Project: VaadinUtils   File: DayOfWeekCheckBoxes.java   Source Code and License 6 votes vote down vote up
/**
 * 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);
	}
}
 
Example 30
Project: VaadinUtils   File: DayOfWeekCheckBoxes.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 31
Project: VaadinUtils   File: DayOfWeekCheckBoxes.java   Source Code and License 6 votes vote down vote up
@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);
			}
		}
	}

}
 
Example 32
Project: scoutmaster   File: ContactView.java   Source Code and License 6 votes vote down vote up
@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);
	}
}
 
Example 33
Project: scoutmaster   File: OrganisationView.java   Source Code and License 6 votes vote down vote up
@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);
		}
	}
}
 
Example 34
Project: academ   File: ConsolidadoEvaluacion.java   Source Code and License 6 votes vote down vote up
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);

}
 
Example 35
Project: own-music-cloud   File: PlaylistView.java   Source Code and License 6 votes vote down vote up
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());
    }        
}
 
Example 36
Project: own-music-cloud   File: TracksView.java   Source Code and License 6 votes vote down vote up
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());
       }
}
 
Example 37
Project: own-music-cloud   File: ArtistView.java   Source Code and License 6 votes vote down vote up
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());
			}
		}
	}
}
 
Example 38
Project: holon-vaadin7   File: DefaultItemListing.java   Source Code and License 5 votes vote down vote up
@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;
}
 
Example 39
Project: esup-ecandidat   File: DroitProfilMembreCommWindow.java   Source Code and License 5 votes vote down vote up
/**
 * 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);
}
 
Example 40
Project: osc-core   File: BaseDeploymentSpecWindow.java   Source Code and License 5 votes vote down vote up
protected CheckBox getSharedCheckBox() {
    this.shared = new CheckBox("Shared");
    this.shared.setValue(true);
    this.shared.setImmediate(true);

    return this.shared;
}