本文整理汇总了Java中com.vaadin.addon.touchkit.ui.NavigationButton类的典型用法代码示例。如果您正苦于以下问题:Java NavigationButton类的具体用法?Java NavigationButton怎么用?Java NavigationButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NavigationButton类属于com.vaadin.addon.touchkit.ui包,在下文中一共展示了NavigationButton类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AttachmentPreviewView
import com.vaadin.addon.touchkit.ui.NavigationButton; //导入依赖的package包/类
public AttachmentPreviewView() {
CssLayout imgWrap = new CssLayout();
imgWrap.setStyleName("image-wrap");
imgWrap.setSizeFull();
this.setStyleName("attachment-preview-view");
this.setSizeFull();
this.addComponent(imgWrap, "top: 0px left: 0px; z-index: 0;");
backBtn = new NavigationButton(UserUIContext.getMessage(GenericI18Enum.M_BUTTON_BACK));
backBtn.setStyleName("back-btn");
this.addComponent(backBtn, "top: 15px; left: 15px; z-index: 1;");
previewImage = new Image();
imgWrap.addComponent(previewImage);
}
示例2: AbstractSelectionCustomField
import com.vaadin.addon.touchkit.ui.NavigationButton; //导入依赖的package包/类
public AbstractSelectionCustomField(Class<? extends AbstractSelectionView<B>> targetSelectionView) {
try {
final AbstractSelectionView<B> selectionView = targetSelectionView.newInstance();
selectionView.setSelectionField(this);
navButton = new NavigationButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT), selectionView);
navButton.setTargetView(selectionView);
navButton.setWidth("100%");
navButton.addClickListener(navigationButtonClickEvent -> selectionView.load());
} catch (SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException e) {
throw new MyCollabException(e);
}
}
示例3: AbstractMobilePageView
import com.vaadin.addon.touchkit.ui.NavigationButton; //导入依赖的package包/类
public AbstractMobilePageView() {
if (this.getLeftComponent() != null && this.getLeftComponent() instanceof NavigationButton) {
this.getLeftComponent().setCaption(getBackTitle());
}
if (this.getLeftComponent() == null) {
this.setLeftComponent(new ELabel("").withWidth("72px"));
}
}
示例4: AbstractMobileMenuPageView
import com.vaadin.addon.touchkit.ui.NavigationButton; //导入依赖的package包/类
public AbstractMobileMenuPageView() {
super();
if (this.getLeftComponent() != null && this.getLeftComponent() instanceof NavigationButton) {
this.getLeftComponent().setCaption(UserUIContext.getMessage(GenericI18Enum.M_BUTTON_BACK));
}
buildNavigateMenu();
}
示例5: displayDashboard
import com.vaadin.addon.touchkit.ui.NavigationButton; //导入依赖的package包/类
@Override
public void displayDashboard() {
mainLayout.removeAllComponents();
SimpleProject currentProject = CurrentProjectVariables.getProject();
VerticalLayout projectInfo = new VerticalLayout();
projectInfo.setStyleName("project-info-layout");
projectInfo.setWidth("100%");
projectInfo.setDefaultComponentAlignment(Alignment.TOP_CENTER);
ELabel projectIcon = ELabel.fontIcon(FontAwesome.BUILDING_O).withStyleName("project-icon").withWidthUndefined();
projectInfo.addComponent(projectIcon);
ELabel projectName = new ELabel(currentProject.getName()).withFullWidth().withStyleName("project-name");
projectInfo.addComponent(projectName);
MHorizontalLayout metaInfo = new MHorizontalLayout();
Label projectMemberBtn = ELabel.html(FontAwesome.USERS.getHtml() + " " + currentProject.getNumActiveMembers())
.withDescription(UserUIContext.getMessage(ProjectMemberI18nEnum.OPT_ACTIVE_MEMBERS)).withStyleName(UIConstants.META_INFO);
metaInfo.addComponent(projectMemberBtn);
Label createdTimeLbl = ELabel.html(FontAwesome.CLOCK_O.getHtml() + " " + UserUIContext.formatPrettyTime
(currentProject.getCreatedtime())).withDescription(UserUIContext.getMessage(GenericI18Enum.FORM_CREATED_TIME))
.withStyleName(UIConstants.META_INFO);
metaInfo.addComponent(createdTimeLbl);
Label billableHoursLbl = ELabel.html(FontAwesome.MONEY.getHtml() + " " + NumberUtils.roundDouble(2, currentProject.getTotalBillableHours()))
.withDescription(UserUIContext.getMessage(TimeTrackingI18nEnum.OPT_BILLABLE_HOURS)).withStyleName(UIConstants.META_INFO);
metaInfo.addComponent(billableHoursLbl);
Label nonBillableHoursLbl = ELabel.html(FontAwesome.GIFT.getHtml() + " " + NumberUtils.roundDouble(2,
currentProject.getTotalNonBillableHours()))
.withDescription(UserUIContext.getMessage(TimeTrackingI18nEnum.OPT_NON_BILLABLE_HOURS)).withStyleName(UIConstants.META_INFO);
metaInfo.addComponent(nonBillableHoursLbl);
projectInfo.addComponent(metaInfo);
int openAssignments = currentProject.getNumOpenBugs() + currentProject.getNumOpenTasks() + currentProject.getNumOpenRisks();
int totalAssignments = currentProject.getNumBugs() + currentProject.getNumTasks() + currentProject.getNumRisks();
ELabel progressInfoLbl;
if (totalAssignments > 0) {
progressInfoLbl = new ELabel(UserUIContext.getMessage(ProjectI18nEnum.OPT_PROJECT_TICKET,
(totalAssignments - openAssignments), totalAssignments, (totalAssignments - openAssignments)
* 100 / totalAssignments)).withWidthUndefined().withStyleName(UIConstants.META_INFO);
} else {
progressInfoLbl = new ELabel(UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_TICKET)).withWidthUndefined().withStyleName
(UIConstants.META_INFO);
}
projectInfo.addComponent(progressInfoLbl);
mainLayout.addComponent(projectInfo);
VerticalComponentGroup btnGroup = new VerticalComponentGroup();
NavigationButton activityBtn = new NavigationButton(UserUIContext.getMessage(ProjectCommonI18nEnum.M_VIEW_PROJECT_ACTIVITIES));
activityBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance().post(
new ProjectEvent.MyProjectActivities(this, CurrentProjectVariables.getProjectId())));
btnGroup.addComponent(new NavigationButtonWrap(FontAwesome.INBOX, activityBtn));
NavigationButton messageBtn = new NavigationButton(UserUIContext.getMessage(MessageI18nEnum.LIST));
messageBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance().post(new MessageEvent.GotoList(this, null)));
btnGroup.addComponent(new NavigationButtonWrap(ProjectAssetsManager.getAsset(ProjectTypeConstants.MESSAGE), messageBtn));
NavigationButton milestoneBtn = new NavigationButton(UserUIContext.getMessage(MilestoneI18nEnum.LIST));
milestoneBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance().post(new MilestoneEvent.GotoList(this, null)));
btnGroup.addComponent(new NavigationButtonWrap(ProjectAssetsManager.getAsset(ProjectTypeConstants.MILESTONE), milestoneBtn));
NavigationButton taskBtn = new NavigationButton(UserUIContext.getMessage(TicketI18nEnum.LIST));
taskBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance().post(new TicketEvent.GotoDashboard(this, null)));
btnGroup.addComponent(new NavigationButtonWrap(ProjectAssetsManager.getAsset(ProjectTypeConstants.TICKET), taskBtn));
NavigationButton userBtn = new NavigationButton(UserUIContext.getMessage(ProjectMemberI18nEnum.LIST));
userBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoList(this, CurrentProjectVariables.getProjectId())));
btnGroup.addComponent(new NavigationButtonWrap(FontAwesome.USERS, userBtn));
mainLayout.addComponent(btnGroup);
}
示例6: NavigationButtonWrap
import com.vaadin.addon.touchkit.ui.NavigationButton; //导入依赖的package包/类
NavigationButtonWrap(FontAwesome icon, NavigationButton button) {
this.setStyleName("navigation-button-wrap");
ELabel iconLbl = ELabel.fontIcon(icon);
with(iconLbl, button).withAlign(iconLbl, Alignment.MIDDLE_LEFT).expand(button);
}