本文整理匯總了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);
}