com.vaadin.icons.VaadinIcons Java Examples

The following examples show how to use com.vaadin.icons.VaadinIcons. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TaskComponentFactoryImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public AbstractComponent createEndDatePopupField(SimpleTask task) {
    if (task.getEnddate() == null) {
        Div divHint = new Div().setCSSClass("nonValue");
        divHint.appendText(VaadinIcons.TIME_BACKWARD.getHtml());
        divHint.appendChild(new Span().appendText(UserUIContext.getMessage(GenericI18Enum.OPT_UNDEFINED)).setCSSClass("hide"));
        return new MetaFieldBuilder().withCaption(divHint.write())
                .withDescription(UserUIContext.getMessage(ShellI18nEnum.OPT_UPGRADE_PRO_INTRO,
                        UserUIContext.getMessage(GenericI18Enum.FORM_END_DATE))).build();
    } else {
        return new MetaFieldBuilder().withCaption(String.format(" %s %s", VaadinIcons.TIME_BACKWARD.getHtml(),
                UserUIContext.formatDate(task.getEnddate())))
                .withDescription(UserUIContext.getMessage(ShellI18nEnum.OPT_UPGRADE_PRO_INTRO,
                        UserUIContext.getMessage(GenericI18Enum.FORM_END_DATE))).build();
    }
}
 
Example #2
Source File: DocumentMenuItemFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Override
public void createOverviewPage(final VerticalLayout panelContent, final String pageId) {
	final ResponsiveRow grid = RowUtil.createGridLayout(panelContent);

	createButtonLink(grid,DOCUMENT_ACTIVITY_TEXT, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTACTIVITY.toString(), pageId), DOCUMENT_ACTIVITIES);

	createButtonLink(grid,PERSON_REFERENCES, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.PERSONREFERENCES.toString(), pageId), PERSON_REFERENCES);

	createButtonLink(grid,DOCUMENT_DETAILS, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTDETAILS.toString(), pageId), DOCUMENT_DETAILS);

	createButtonLink(grid,DOCUMENT_DATA, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTDATA.toString(), pageId), COMPLETE_DOCUMENT_AS_TEXT);

	createButtonLink(grid,DOCUMENT_REFERENCES, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTREFERENCES.toString(), pageId), DOCUMENT_REFERENCES);

	createButtonLink(grid,DOCUMENT_DECISION, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTDECISION.toString(), pageId), DOCUMENT_DECISIONS);

	createButtonLink(grid,DOCUMENT_ATTACHEMENTS, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTATTACHMENTS.toString(), pageId), ATTACHEMENTS);
}
 
Example #3
Source File: GovernmentBodyMenuItemFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Override
public void createOverviewPage(final VerticalLayout panelContent, final String pageId) {
	final ResponsiveRow grid = RowUtil.createGridLayout(panelContent);

	createButtonLink(grid,HEADCOUNT_CHART, VaadinIcons.GROUP,
			new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, GovernmentBodyPageMode.HEADCOUNT.toString(), pageId), "Desc.");
	
	createButtonLink(grid,INCOME, VaadinIcons.GROUP,
			new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, GovernmentBodyPageMode.INCOME.toString(), pageId), "Desc.");

	createButtonLink(grid,EXPENDITURE, VaadinIcons.GROUP,
			new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, GovernmentBodyPageMode.EXPENDITURE.toString(), pageId), "Desc");
	
	createButtonLink(grid,PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP,
			new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId), "View history of page visit for this page.");

}
 
Example #4
Source File: VersionReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
protected void onPreviewItem() {
    activityComponent.loadActivities("" + beanItem.getId());
    dateInfoComp.displayEntryDateTime(beanItem);

    if (tagViewComponent != null) {
        tagViewComponent.display(ProjectTypeConstants.VERSION, beanItem.getId());
    }

    if (versionTimeLogComp != null) {
        versionTimeLogComp.displayTime(beanItem);
    }

    if (StatusI18nEnum.Open.name().equals(beanItem.getStatus())) {
        removeLayoutStyleName(WebThemes.LINK_COMPLETED);
        quickActionStatusBtn.setCaption(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLOSE));
        quickActionStatusBtn.setIcon(VaadinIcons.ARCHIVE);
    } else {
        addLayoutStyleName(WebThemes.LINK_COMPLETED);
        quickActionStatusBtn.setCaption(UserUIContext.getMessage(GenericI18Enum.BUTTON_REOPEN));
        quickActionStatusBtn.setIcon(VaadinIcons.CLIPBOARD);
    }
}
 
Example #5
Source File: VerticalTabsheet.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
public void setNavigatorVisibility(boolean visibility) {
    if (!visibility) {
        navigatorContainer.setWidth(MIN_SIZE);
        this.hideTabsCaption();

        navigatorContainer.setComponentAlignment(toggleHideButton, Alignment.MIDDLE_CENTER);
        toggleHideButton.setIcon(VaadinIcons.ANGLE_DOUBLE_RIGHT);
        toggleHideButton.setStyleName(WebThemes.BUTTON_ICON_ONLY + " expand-button");
        toggleHideButton.addStyleName("toggle-button");
        toggleHideButton.setDescription(UserUIContext.getMessage(ShellI18nEnum.ACTION_EXPAND_MENU));
        toggleHideButton.setWidth("65px");
        toggleHideButton.setCaption("");
    } else {
        navigatorContainer.setWidth(MAX_SIZE);
        this.showTabsCaption();

        toggleHideButton.setStyleName(WebThemes.BUTTON_ICON_ONLY + " closed-button");
        toggleHideButton.addStyleName("toggle-button");
        toggleHideButton.setIcon(VaadinIcons.CLOSE_SMALL);
        toggleHideButton.setWidth(MAX_SIZE);
        toggleHideButton.setDescription(UserUIContext.getMessage(ShellI18nEnum.ACTION_COLLAPSE_MENU));
        navigatorContainer.setComponentAlignment(toggleHideButton, Alignment.MIDDLE_CENTER);
    }
}
 
Example #6
Source File: ProjectRoleSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public ComponentContainer constructBody() {
    MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
    basicSearchBody.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    basicSearchBody.addComponent(new Label(UserUIContext.getMessage(GenericI18Enum.FORM_NAME) + ":"));
    nameField = new MTextField().withPlaceholder(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
            .withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
    basicSearchBody.addComponent(nameField);

    MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
            .withIcon(VaadinIcons.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
            .withClickShortcut(ShortcutAction.KeyCode.ENTER);
    basicSearchBody.addComponent(searchBtn);

    MButton clearBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
            .withStyleName(WebThemes.BUTTON_OPTION);
    basicSearchBody.addComponent(clearBtn);
    return basicSearchBody;
}
 
Example #7
Source File: TicketRelationComp.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
public TicketRelationComp(SimpleTicketRelation ticketRelation) {
    buildTicketLink(ticketRelation);
    this.addComponent(titleLinkLbl);
    this.addStyleName("editable-field");
    // TODO: may check the permission here?
    buttonControls = new MHorizontalLayout().withStyleName("toggle").withSpacing(false);
    MButton unlinkBtn = new MButton("", clickEvent -> {
        ConfirmDialogExt.show(UI.getCurrent(), UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_TITLE,
                AppUI.getSiteName()),
                UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_SINGLE_ITEM_MESSAGE),
                UserUIContext.getMessage(GenericI18Enum.ACTION_YES),
                UserUIContext.getMessage(GenericI18Enum.ACTION_NO), confirmDialog -> {
                    TicketRelationExample ex = new TicketRelationExample();
                    ex.or().andTicketidEqualTo(ticketRelation.getTicketid()).andTickettypeEqualTo(ticketRelation.getTickettype());
                    ex.or().andTicketidEqualTo(ticketRelation.getTypeid()).andTickettypeEqualTo(ticketRelation.getType());

                    TicketRelationMapper ticketRelationMapper = AppContextUtil.getSpringBean(TicketRelationMapper.class);
                    ticketRelationMapper.deleteByExample(ex);
                    UIUtils.removeChildAssociate(TicketRelationComp.this, RemoveInlineComponentMarker.class);
                });
    }).withIcon(VaadinIcons.UNLINK).withStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP, ValoTheme.BUTTON_ICON_ONLY)
            .withDescription(UserUIContext.getMessage(TicketI18nEnum.OPT_REMOVE_RELATIONSHIP));
    buttonControls.with(unlinkBtn);
    this.addComponent(buttonControls);
}
 
Example #8
Source File: ProjectSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public ComponentContainer constructBody() {
    MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);

    nameField = new MTextField().withPlaceholder(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
            .withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
    basicSearchBody.with(nameField).withAlign(nameField, Alignment.MIDDLE_CENTER);

    MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent ->
            callSearchAction()).withIcon(VaadinIcons.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
            .withClickShortcut(ShortcutAction.KeyCode.ENTER);
    basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);

    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR),
            clickEvent -> nameField.setValue("")).withStyleName(WebThemes.BUTTON_OPTION);
    basicSearchBody.with(cancelBtn).withAlign(cancelBtn, Alignment.MIDDLE_CENTER);

    MButton advancedSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADVANCED_SEARCH),
            clickEvent -> moveToAdvancedSearchLayout()).withStyleName(WebThemes.BUTTON_LINK);
    basicSearchBody.with(advancedSearchBtn).withAlign(advancedSearchBtn, Alignment.MIDDLE_CENTER);

    return basicSearchBody;
}
 
Example #9
Source File: MessageListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
protected SearchLayout<MessageSearchCriteria> createBasicSearchLayout() {
    return new BasicSearchLayout<MessageSearchCriteria>(MessageSearchPanel.this) {
        @Override
        public ComponentContainer constructBody() {
            nameField = new MTextField().withPlaceholder(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
                    .withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);

            MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
                    .withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.SEARCH)
                    .withClickShortcut(KeyCode.ENTER);
            return new MHorizontalLayout(nameField, searchBtn).withMargin(true).withAlign(nameField, Alignment.MIDDLE_LEFT);
        }

        @Override
        protected MessageSearchCriteria fillUpSearchCriteria() {
            MessageSearchCriteria criteria = new MessageSearchCriteria();
            criteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId()));
            criteria.setMessage(StringSearchField.and(nameField.getValue()));
            return criteria;
        }
    };
}
 
Example #10
Source File: AbstractView.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the top header actions for user context.
 */
private void createTopHeaderActionsForUserContext() {
	if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN) || UserContextUtil.allowRoleInSecurityContext(ROLE_USER)) {
		final Link userHomePageLink = pageLinkFactory.createUserHomeViewPageLink();
		topHeaderRightPanel.addComponent(userHomePageLink);
		topHeaderRightPanel.setComponentAlignment(userHomePageLink, Alignment.MIDDLE_RIGHT);

		final Button logoutButton = new Button(LOGOUT,VaadinIcons.SIGN_OUT);

		final LogoutRequest logoutRequest = new LogoutRequest();
		logoutRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
		logoutButton.addClickListener(new LogoutClickListener(logoutRequest));

		topHeaderRightPanel.addComponent(logoutButton);
		topHeaderRightPanel.setComponentAlignment(logoutButton, Alignment.MIDDLE_RIGHT);

	} else {
		final Link createRegisterPageLink = pageLinkFactory.createRegisterPageLink();
		topHeaderRightPanel.addComponent(createRegisterPageLink);
		topHeaderRightPanel.setComponentAlignment(createRegisterPageLink, Alignment.MIDDLE_RIGHT);

		final Link createLoginPageLink = pageLinkFactory.createLoginPageLink();
		topHeaderRightPanel.addComponent(createLoginPageLink);
		topHeaderRightPanel.setComponentAlignment(createLoginPageLink, Alignment.MIDDLE_RIGHT);
	}
}
 
Example #11
Source File: AttachmentPanel.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
private void displayFileName(File file, final String fileName) {
    final MHorizontalLayout fileAttachmentLayout = new MHorizontalLayout().withFullWidth();
    MButton removeBtn = new MButton("", clickEvent -> {
        File tmpFile = fileStores.get(fileName);
        if (tmpFile != null) {
            tmpFile.delete();
        }
        fileStores.remove(fileName);
        AttachmentPanel.this.removeComponent(fileAttachmentLayout);
    }).withIcon(VaadinIcons.TRASH).withStyleName(WebThemes.BUTTON_ICON_ONLY);

    ELabel fileLbl = ELabel.html(fileName).withDescription(fileName).withStyleName(WebThemes.TEXT_ELLIPSIS);
    fileAttachmentLayout.with(ELabel.fontIcon(FileAssetsUtil.getFileIconResource(fileName)).withUndefinedWidth(),
            fileLbl, new ELabel(" - " + FileUtils.getVolumeDisplay(file.length()))
                    .withStyleName(WebThemes.META_INFO).withUndefinedWidth(), removeBtn).expand(fileLbl);
    this.addComponent(fileAttachmentLayout, 0);
}
 
Example #12
Source File: GeneralSettingViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
private void buildLanguageUpdatePanel() {
    FormContainer formContainer = new FormContainer();
    MHorizontalLayout layout = new MHorizontalLayout().withFullWidth().withMargin(new MarginInfo(true, false, true, false));
    MVerticalLayout leftPanel = new MVerticalLayout().withMargin(false);
    ELabel languageDownloadDesc = ELabel.html(UserUIContext.getMessage(ShellI18nEnum.OPT_LANGUAGE_DOWNLOAD)).withFullWidth();
    leftPanel.with(languageDownloadDesc).withWidth("250px");
    MVerticalLayout rightPanel = new MVerticalLayout().withMargin(false);
    MButton downloadBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_DOWNLOAD))
            .withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.DOWNLOAD);
    ServerConfiguration serverConfiguration = AppContextUtil.getSpringBean(ServerConfiguration.class);
    BrowserWindowOpener opener = new BrowserWindowOpener(serverConfiguration.getApiUrl("localization/translations"));
    opener.extend(downloadBtn);
    rightPanel.with(downloadBtn, new ELabel(UserUIContext.getMessage(ShellI18nEnum.OPT_UPDATE_LANGUAGE_INSTRUCTION))
            .withStyleName(WebThemes.META_INFO).withFullWidth());
    layout.with(leftPanel, rightPanel).expand(rightPanel);
    formContainer.addSection("Languages", layout);
    this.with(formContainer);
}
 
Example #13
Source File: ReadableTicketRowRenderer.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private Component buildStartdateComp(ProjectTicket ticket) {
    if (ticket.getStartDate() == null) {
        Div divHint = new Div().setCSSClass("nonValue");
        divHint.appendText(VaadinIcons.TIME_FORWARD.getHtml());
        divHint.appendChild(new Span().appendText(UserUIContext.getMessage(GenericI18Enum.OPT_UNDEFINED)).setCSSClass("hide"));
        return ELabel.html(divHint.write()).withDescription(UserUIContext.getMessage(GenericI18Enum.FORM_START_DATE))
                .withStyleName(WebThemes.META_INFO, WebThemes.MARGIN_LEFT_HALF);
    } else {
        Div startDateDiv = new Div().appendText(String.format(" %s %s", VaadinIcons.TIME_FORWARD.getHtml(),
                UserUIContext.formatDate(ticket.getStartDate())));
        return ELabel.html(startDateDiv.write()).withDescription(UserUIContext.getMessage(GenericI18Enum.FORM_START_DATE))
                .withStyleName(WebThemes.META_INFO, WebThemes.MARGIN_LEFT_HALF);
    }
}
 
Example #14
Source File: CountryMenuItemFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Override
public void createOverviewPage(final VerticalLayout panelContent) {
	final MenuBar menuBar = new MenuBar();
	panelContent.addComponent(menuBar);
	panelContent.setComponentAlignment(menuBar, Alignment.TOP_LEFT);
	panelContent.setExpandRatio(menuBar, ContentRatio.LARGE);

	addSourcesAndIndicatorsToMenu(menuBar.addItem("By Topic",VaadinIcons.LINE_CHART, null), getTopicIndicatorMap());
	menuBar.setAutoOpen(true);
}
 
Example #15
Source File: AccountSettingBreadcrumb.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public void gotoRoleEdit(final Role role) {
    removeAllComponents();
    this.addComponent(ELabel.html(VaadinIcons.HOME.getHtml()));
    this.addComponent(ELabel.html(VaadinIcons.ANGLE_RIGHT.getHtml()));
    this.addComponent(new MButton(UserUIContext.getMessage(RoleI18nEnum.LIST), new GotoRoleListListener()).withStyleName(WebThemes.BUTTON_LINK));
    this.addComponent(ELabel.html(VaadinIcons.ANGLE_RIGHT.getHtml()));
    this.addComponent(generateBreadcrumbLink(role.getRolename(),
            clickEvent -> EventBusFactory.getInstance().post(new RoleEvent.GotoRead(this, role.getId()))));
    this.addComponent(ELabel.html(VaadinIcons.ANGLE_RIGHT.getHtml()));
    this.addComponent(new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_EDIT)).withStyleName(WebThemes.BUTTON_LINK));
    AppUI.addFragment("account/role/edit/" + UrlEncodeDecoder.encode(role.getId()),
            UserUIContext.getMessage(GenericI18Enum.BROWSER_EDIT_ITEM_TITLE, UserUIContext.getMessage(RoleI18nEnum.SINGLE), role.getRolename()));
}
 
Example #16
Source File: BugComponentFactoryImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public AbstractComponent createEndDatePopupField(SimpleBug bug) {
    if (bug.getEnddate() == null) {
        Div divHint = new Div().setCSSClass("nonValue");
        divHint.appendText(VaadinIcons.TIME_BACKWARD.getHtml());
        divHint.appendChild(new Span().appendText(UserUIContext.getMessage(GenericI18Enum.OPT_UNDEFINED)).setCSSClass("hide"));
        return new MetaFieldBuilder().withCaption(divHint.write()).withDescription(UserUIContext.getMessage
                (GenericI18Enum.FORM_END_DATE)).build();
    } else {
        return new MetaFieldBuilder().withCaption(String.format("%s %s", VaadinIcons.TIME_BACKWARD.getHtml(),
                UserUIContext.formatPrettyTime(bug.getEnddate()))).withDescription(UserUIContext.getMessage
                (GenericI18Enum.FORM_END_DATE)).build();
    }
}
 
Example #17
Source File: BugComponentFactoryImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public AbstractComponent createStartDatePopupField(SimpleBug bug) {
    if (bug.getStartdate() == null) {
        Div divHint = new Div().setCSSClass("nonValue");
        divHint.appendText(VaadinIcons.TIME_FORWARD.getHtml());
        divHint.appendChild(new Span().appendText(UserUIContext.getMessage(GenericI18Enum.OPT_UNDEFINED)).setCSSClass("hide"));
        return new MetaFieldBuilder().withCaption(divHint.write()).withDescription(UserUIContext.getMessage
                (GenericI18Enum.FORM_START_DATE)).build();
    } else {
        return new MetaFieldBuilder().withCaption(String.format("%s %s", VaadinIcons.TIME_FORWARD.getHtml(),
                UserUIContext.formatPrettyTime(bug.getStartdate()))).withDescription(UserUIContext.getMessage
                (GenericI18Enum.FORM_START_DATE)).build();
    }
}
 
Example #18
Source File: BugComponentFactoryImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public AbstractComponent createDeadlinePopupField(SimpleBug bug) {
    if (bug.getDueDateRoundPlusOne() == null) {
        Div divHint = new Div().setCSSClass("nonValue");
        divHint.appendText(VaadinIcons.CLOCK.getHtml());
        divHint.appendChild(new Span().appendText(UserUIContext.getMessage(GenericI18Enum.OPT_UNDEFINED)).setCSSClass("hide"));
        return new MetaFieldBuilder().withCaption(divHint.write()).withDescription(UserUIContext.getMessage
                (GenericI18Enum.FORM_DUE_DATE)).build();
    } else {
        return new MetaFieldBuilder().withCaption(String.format("%s %s", VaadinIcons.CLOCK.getHtml(),
                UserUIContext.formatPrettyTime(bug.getDueDateRoundPlusOne()))).withDescription(UserUIContext.getMessage
                (GenericI18Enum.FORM_DUE_DATE)).build();
    }
}
 
Example #19
Source File: ReportBreadcrumb.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public void gotoWeeklyTimingReport() {
    removeAllComponents();
    this.addComponent(ELabel.html(VaadinIcons.HOME.getHtml()));
    this.addComponent(ELabel.html(VaadinIcons.ANGLE_RIGHT.getHtml()));
    this.addComponent(new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.VIEW_REPORTS), new GotoReportsListener()).withStyleName(WebThemes.BUTTON_LINK));
    this.addComponent(ELabel.html(VaadinIcons.ANGLE_RIGHT.getHtml()));
    this.addComponent(new MButton(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_HOURS_SPENT)).withStyleName(WebThemes.BUTTON_LINK));
}
 
Example #20
Source File: SubSetSelector.java    From viritin with Apache License 2.0 5 votes vote down vote up
/**
 * Generates the tool cell content in the listing of selected items. By
 * default contains button to remove selection. Overridden implementation
 * can add other stuff there as well, like edit button.
 *
 * @param entity the entity for which the cell content is created
 * @return the content (String or Component)
 */
protected Object getToolColumnContent(final ET entity) {
    Button button = new Button(VaadinIcons.MINUS);
    button.setDescription("Removes the selection from the list");
    button.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    button.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            removeSelectedOption(entity);
        }
    });
    button.setStyleName(ValoTheme.BUTTON_SMALL);
    return button;

}
 
Example #21
Source File: BugSeverityComboBox.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public BugSeverityComboBox() {
    super(BugSeverity.class, OptionI18nEnum.bug_severities);
    setWidth(WebThemes.FORM_CONTROL_WIDTH);
    setItemIconGenerator((IconGenerator<BugSeverity>) severity -> VaadinIcons.STAR);
    setStyleGenerator((StyleGenerator<BugSeverity>) severity -> {
        if (severity != null) {
            return "bug-severity-" + severity.toString().toLowerCase();
        } else {
            return null;
        }
    });
    setValue(Major);
}
 
Example #22
Source File: GNMITools.java    From anx with Apache License 2.0 5 votes vote down vote up
Component createComponent() {
    HorizontalLayout gnmiTools = new HorizontalLayout();
    gnmiTools.setSizeUndefined();
    gnmiTools.setDefaultComponentAlignment(Alignment.BOTTOM_LEFT);

    TextField interval = new TextField("GNMI Interval", "change");
    interval.setWidth("100px");
    interval.setIcon(VaadinIcons.DASHBOARD);

    TextField port = new TextField("GNMI Port", "57400");
    port.setWidth("75px");

    path = new TextField("GNMI Path");
    path.setWidth("300px");

    try (NetconfSession session = view.client.createSession()) {
        XMLElement grpc = session.getConfig(Netconf.Datastore.RUNNING,
                Arrays.asList(new XMLElement(NS_EMS, "grpc"))).getOrEmpty(NS_EMS, "grpc");
        port.setValue(grpc.getTextOrDefault("port", "57400"));
    } catch (NetconfException e) {}

    Button subscribe = new Button("GNMI Subscribe", VaadinIcons.PIE_BAR_CHART);
    subscribe.addClickListener(x -> {
        showSubscribe(Integer.parseInt(port.getValue()), path.getValue(), interval.getValue());
    });

    gnmiTools.addComponents(interval, port, path, subscribe);
    return gnmiTools;
}
 
Example #23
Source File: FormControlsGenerator.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public static <T> ComponentContainer generateEditFormControls(final AdvancedEditBeanForm<T> editForm, boolean
        isSaveBtnVisible, boolean isSaveAndNewBtnVisible, boolean isCancelBtnVisible) {
    MHorizontalLayout layout = new MHorizontalLayout();

    if (isCancelBtnVisible) {
        MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> editForm.fireCancelForm())
                .withStyleName(WebThemes.BUTTON_OPTION);
        layout.addComponent(cancelBtn);
    }

    if (isSaveAndNewBtnVisible) {
        MButton saveAndNewBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE_NEW), clickEvent -> {
            if (editForm.validateForm()) {
                editForm.fireSaveAndNewForm();
            }
        }).withIcon(VaadinIcons.CLIPBOARD_CROSS).withStyleName(WebThemes.BUTTON_ACTION);
        if (!isSaveBtnVisible) {
            saveAndNewBtn.withClickShortcut(KeyCode.ENTER);
        }
        layout.addComponent(saveAndNewBtn);
    }

    if (isSaveBtnVisible) {
        MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> {
            if (editForm.validateForm()) {
                editForm.fireSaveForm();
            }
        }).withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION)
                .withClickShortcut(KeyCode.ENTER);
        layout.addComponent(saveBtn);
    }

    return layout;
}
 
Example #24
Source File: PageLinkFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Override
public Link addPartyPageLink(final ViewRiksdagenParty data) {
	final Link pageLink = new Link(PARTY + data.getPartyName(),
			new ExternalResource(PAGE_PREFIX + UserViews.PARTY_VIEW_NAME + PAGE_SEPARATOR
					+ data.getPartyId()));
	pageLink.setId(ViewAction.VISIT_PARTY_VIEW.name() + PAGE_SEPARATOR
			+ data.getPartyId());
	pageLink.setIcon(VaadinIcons.GROUP);
	return pageLink;
}
 
Example #25
Source File: ProjectAssetsUtil.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public static VaadinIcons getPhaseIcon(String status) {
    if (MilestoneStatus.Closed.name().equals(status)) {
        return VaadinIcons.MINUS_CIRCLE;
    } else if (MilestoneStatus.Future.name().equals(status)) {
        return VaadinIcons.CLOCK;
    } else {
        return VaadinIcons.SPINNER;
    }
}
 
Example #26
Source File: ContactInfoChangeWindow.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initUI() {
    MVerticalLayout mainLayout = new MVerticalLayout().withMargin(true).withFullWidth();

    GridFormLayoutHelper passInfo = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);

    passInfo.addComponent(txtWorkPhone, UserUIContext.getMessage(UserI18nEnum.FORM_WORK_PHONE), 0, 0);
    passInfo.addComponent(txtHomePhone, UserUIContext.getMessage(UserI18nEnum.FORM_HOME_PHONE), 0, 1);
    passInfo.addComponent(txtFaceBook, "Facebook", 0, 2);
    passInfo.addComponent(txtTwitter, "Twitter", 0, 3);
    passInfo.addComponent(txtSkype, "Skype", 0, 4);

    txtWorkPhone.setValue(MoreObjects.firstNonNull(user.getWorkphone(), ""));
    txtHomePhone.setValue(MoreObjects.firstNonNull(user.getHomephone(), ""));
    txtFaceBook.setValue(MoreObjects.firstNonNull(user.getFacebookaccount(), ""));
    txtTwitter.setValue(MoreObjects.firstNonNull(user.getTwitteraccount(), ""));
    txtSkype.setValue(MoreObjects.firstNonNull(user.getSkypecontact(), ""));
    mainLayout.addComponent(passInfo.getLayout());
    mainLayout.setComponentAlignment(passInfo.getLayout(), Alignment.TOP_LEFT);

    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);

    MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> changeUserInfo())
            .withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION).withClickShortcut(KeyCode.ENTER);

    MHorizontalLayout hlayoutControls = new MHorizontalLayout(cancelBtn, saveBtn);
    mainLayout.with(hlayoutControls).withAlign(hlayoutControls, Alignment.MIDDLE_RIGHT);
    this.setContent(mainLayout);
}
 
Example #27
Source File: ProjectSearchPanel.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected Component buildExtraControls() {
    if (UserUIContext.canBeYes(RolePermissionCollections.CREATE_NEW_PROJECT)) {
        return new MButton(UserUIContext.getMessage(ProjectI18nEnum.NEW),
                clickEvent -> UI.getCurrent().addWindow(ViewManager.getCacheComponent(AbstractProjectAddWindow.class)))
                .withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.PLUS);
    }

    return null;
}
 
Example #28
Source File: BugReadViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void displayEntryPeople(SimpleBug bug) {
    this.removeAllComponents();
    this.withMargin(false);

    Label peopleInfoHeader = ELabel.html(VaadinIcons.USER.getHtml() + " " + UserUIContext.getMessage(ProjectCommonI18nEnum.SUB_INFO_PEOPLE));
    peopleInfoHeader.setStyleName("info-hdr");
    this.addComponent(peopleInfoHeader);

    GridLayout layout = new GridLayout(2, 2);
    layout.setSpacing(true);
    layout.setWidth("100%");
    layout.setMargin(new MarginInfo(false, false, false, true));

    ELabel createdLbl = new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_CREATED_PEOPLE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth();
    layout.addComponent(createdLbl, 0, 0);

    String createdUserName = bug.getCreateduser();
    String createdUserAvatarId = bug.getLoguserAvatarId();
    String createdUserDisplayName = bug.getLoguserFullName();

    ProjectMemberLink createdUserLink = new ProjectMemberLink(createdUserName, createdUserAvatarId, createdUserDisplayName);
    layout.addComponent(createdUserLink, 1, 0);
    layout.setColumnExpandRatio(1, 1.0f);

    ELabel assigneeLbl = new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_ASSIGN_PEOPLE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth();
    layout.addComponent(assigneeLbl, 0, 1);
    String assignUserName = bug.getAssignuser();
    String assignUserAvatarId = bug.getAssignUserAvatarId();
    String assignUserDisplayName = bug.getAssignuserFullName();

    ProjectMemberLink assignUserLink = new ProjectMemberLink(assignUserName, assignUserAvatarId, assignUserDisplayName);
    layout.addComponent(assignUserLink, 1, 1);

    this.addComponent(layout);
}
 
Example #29
Source File: TaskPreviewForm.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected HasValue<?> onCreateField(final Object propertyId) {
    SimpleTask beanItem = attachForm.getBean();
    if (Task.Field.assignuser.equalTo(propertyId)) {
        return new ProjectUserFormLinkField(beanItem.getProjectid(), beanItem.getAssignuser(),
                beanItem.getAssignUserAvatarId(), beanItem.getAssignUserFullName());
    } else if (Task.Field.milestoneid.equalTo(propertyId)) {
        return new ProjectItemViewField(ProjectTypeConstants.MILESTONE, beanItem.getMilestoneid(), beanItem.getMilestoneName());
    } else if ("section-attachments".equals(propertyId)) {
        return new ProjectFormAttachmentDisplayField(beanItem.getProjectid(), ProjectTypeConstants.TASK, beanItem.getId());
    } else if (SimpleTask.Field.components.equalTo(propertyId)) {
        return new ComponentsViewField();
    } else if (SimpleTask.Field.affectedVersions.equalTo(propertyId)) {
        return new VersionsViewField();
    } else if (Task.Field.priority.equalTo(propertyId)) {
        if (StringUtils.isNotBlank(beanItem.getPriority())) {
            VaadinIcons fontPriority = ProjectAssetsManager.getPriority(beanItem.getPriority());
            String priorityLbl = fontPriority.getHtml() + " " + UserUIContext.getMessage(Priority.class, beanItem.getPriority());
            StyleViewField field = new StyleViewField(priorityLbl);
            field.addStyleName("priority-" + beanItem.getPriority().toLowerCase());
            return field;
        }
    } else if (Task.Field.isestimated.equalTo(propertyId)) {
        return new BooleanViewField();
    } else if (Task.Field.description.equalTo(propertyId)) {
        return new RichTextViewField();
    } else if ("section-subTickets".equals(propertyId)) {
        return new SubTicketsComp(ProjectTicket.buildTicketByTask(beanItem));
    } else if (Task.Field.status.equalTo(propertyId)) {
        return new I18nFormViewField(StatusI18nEnum.class).withStyleName(WebThemes.FIELD_NOTE);
    }
    return null;
}
 
Example #30
Source File: MessageListViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected Component buildExtraControls() {
    return new MButton(UserUIContext.getMessage(MessageI18nEnum.NEW),
            clickEvent -> {
                if (!isAddingMessage) createAddMessageLayout();
            })
            .withIcon(VaadinIcons.PLUS).withStyleName(WebThemes.BUTTON_ACTION)
            .withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MESSAGES));
}