本文整理汇总了Java中com.vaadin.ui.Link类的典型用法代码示例。如果您正苦于以下问题:Java Link类的具体用法?Java Link怎么用?Java Link使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Link类属于com.vaadin.ui包,在下文中一共展示了Link类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enter
import com.vaadin.ui.Link; //导入依赖的package包/类
@Override
public void enter(ViewChangeEvent event) {
pageHelper.setErrorHandler(this);
this.removeAllComponents();
// Get application
int appId = Integer.parseInt(event.getParameters());
Application app = pageHelper.getApp(appId);
// Header
this.addComponent(new PageHeader(app, "Endpoints"));
// Add endpoints links
app.endpoints().asList().stream()
.forEach(endpointUrl -> this.addComponent(new Link(endpointUrl+".json", new ExternalResource(endpointUrl+".json"), "_blank", 0, 0, BorderStyle.DEFAULT)));
}
示例2: SourceView
import com.vaadin.ui.Link; //导入依赖的package包/类
public SourceView() {
Label caption = new Label("Sources");
caption.addStyleName(DSTheme.LABEL_HUGE);
addComponents(caption);
List<Link> linkList = new ArrayList<Link>();
Link aidedd = new Link("AideDD", new ExternalResource("http://www.aidedd.org/"));
linkList.add(aidedd);
Link gemmaline = new Link("Gemmaline", new ExternalResource("http://www.gemmaline.com/faerun/"));
linkList.add(gemmaline);
Link frwiki = new Link("Wiki des royaumes oubliés",
new ExternalResource("https://fr.wikipedia.org/wiki/Portail:Royaumes_oubli%C3%A9s"));
linkList.add(frwiki);
for (Link link : linkList) {
link.setTargetName("_blank");
addComponent(link);
}
}
示例3: saveConfigurationButtonsLayout
import com.vaadin.ui.Link; //导入依赖的package包/类
private HorizontalLayout saveConfigurationButtonsLayout() {
final HorizontalLayout hlayout = new HorizontalLayout();
hlayout.setSpacing(true);
saveConfigurationBtn = SPUIComponentProvider.getButton(UIComponentIdProvider.SYSTEM_CONFIGURATION_SAVE, "", "",
"", true, FontAwesome.SAVE, SPUIButtonStyleSmallNoBorder.class);
saveConfigurationBtn.setEnabled(false);
saveConfigurationBtn.setDescription(i18n.getMessage("configuration.savebutton.tooltip"));
saveConfigurationBtn.addClickListener(event -> saveConfiguration());
hlayout.addComponent(saveConfigurationBtn);
undoConfigurationBtn = SPUIComponentProvider.getButton(UIComponentIdProvider.SYSTEM_CONFIGURATION_CANCEL, "",
"", "", true, FontAwesome.UNDO, SPUIButtonStyleSmallNoBorder.class);
undoConfigurationBtn.setEnabled(false);
undoConfigurationBtn.setDescription(i18n.getMessage("configuration.cancellbutton.tooltip"));
undoConfigurationBtn.addClickListener(event -> undoConfiguration());
hlayout.addComponent(undoConfigurationBtn);
final Link linkToSystemConfigHelp = SPUIComponentProvider
.getHelpLink(uiProperties.getLinks().getDocumentation().getSystemConfigurationView());
hlayout.addComponent(linkToSystemConfigHelp);
return hlayout;
}
示例4: MenuView
import com.vaadin.ui.Link; //导入依赖的package包/类
public MenuView() {
setMargin(true);
setSpacing(true);
Label header = new Label("GridStack Vaadin add-on");
header.addStyleName(ValoTheme.LABEL_H1);
addComponent(header);
addComponents(
createNavigation(SimpleView.class, SimpleView.VIEW_NAME, "Simple example"),
createNavigation(TestView.class, TestView.VIEW_NAME, "Test it"),
createNavigation(SplitView.class, SplitView.VIEW_NAME, "List demo")
);
addComponent(new Link(
"GridStack Vaadin add-on project page on GitHub",
new ExternalResource("https://github.com/alump/GridStack")));
addComponent(new Link(
"This project is based on gridstack.js JavaScript library, written by Pavel Reznikov",
new ExternalResource("https://github.com/troolee/gridstack.js")));
}
示例5: getOverviewComponent
import com.vaadin.ui.Link; //导入依赖的package包/类
public Component getOverviewComponent(final Attachment attachment, final RelatedContentComponent parent) {
// If the attachment has no description, overview link is link to actual page
// instead of showing popup with details.
if(attachment.getDescription() != null && !"".equals(attachment.getDescription())) {
Button attachmentLink = new Button(attachment.getName());
attachmentLink.addStyleName(Reindeer.BUTTON_LINK);
attachmentLink.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
parent.showAttachmentDetail(attachment);
}
});
return attachmentLink;
} else {
return new Link(attachment.getName(), new ExternalResource(attachment.getUrl()));
}
}
示例6: getDetailComponent
import com.vaadin.ui.Link; //导入依赖的package包/类
public Component getDetailComponent(Attachment attachment) {
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setSpacing(true);
verticalLayout.setMargin(true);
verticalLayout.addComponent(new Label(attachment.getDescription()));
HorizontalLayout linkLayout = new HorizontalLayout();
linkLayout.setSpacing(true);
verticalLayout.addComponent(linkLayout);
// Icon
linkLayout.addComponent(new Embedded(null, Images.RELATED_CONTENT_URL));
// Link
Link link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl()));
link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK);
linkLayout.addComponent(link);
return verticalLayout;
}
示例7: init
import com.vaadin.ui.Link; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
addTwitterButton();
addFacebookButton();
addLinkedInButton();
addGitHubButton();
addTwitterNativeButton();
layout.addComponent(new Link("Add-on at Vaadin Directory", new ExternalResource("http://vaadin.com/addon/oauth-popup-add-on")));
layout.addComponent(new Link("Source code at GitHub", new ExternalResource("https://github.com/ahn/vaadin-oauthpopup")));
}
示例8: drawPush
import com.vaadin.ui.Link; //导入依赖的package包/类
private void drawPush(final UserProfile profile) {
final String remote = remoteName(profile);
String url = githubLinkFromOrigin(repo.getRemote(remote));
layout.addComponent(new Link(url, new ExternalResource(url)));
Button b = new Button("Push to GitHub");
b.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
try {
gitPush(profile.getToken().getToken(), remote);
} catch (GitAPIException e) {
Notification.show(e.getMessage(), Notification.Type.ERROR_MESSAGE);
e.printStackTrace();
}
}
});
layout.addComponent(b);
}
示例9: Deployer
import com.vaadin.ui.Link; //导入依赖的package包/类
Deployer(String pathToWar, String paasApiUri, Link linkToApp, Button buttonLinkToApp
, String apiLocation, User user, Button deployButton){
super(apiLocation);
//System.out.println("apiLocation in Deployer: " + apiLocation);
//System.out.println("apiLocation in CoapsCaller: " + getApiLocation());
this.deployButton = deployButton;
this.user = user;
this.linkToApp = linkToApp;
this.buttonLinkToApp = buttonLinkToApp;
this.pathToWar = pathToWar;
this.paasApiUri = paasApiUri;
File file = new File(pathToWar);
warName = file.getName();
warLocation = file.getParentFile().getAbsolutePath();
appName = warName.replace(".war", "");
deployLocation = "/home/ubuntu/delpoyedprojects";
memory = "512";
Date today = new Date();
date = new SimpleDateFormat("yyyy-MM-dd").format(today);
}
示例10: AboutView
import com.vaadin.ui.Link; //导入依赖的package包/类
public AboutView() {
setCaption(Messages.getString("aboutTitle")); //$NON-NLS-1$
setModal(true);
setResizable(false);
center();
VerticalLayout main = new VerticalLayout();
Resource logoResource = new ThemeResource("img/omc-logo.png"); //$NON-NLS-1$
Image appLogoImage = new Image("",logoResource); //$NON-NLS-1$
Label appLabel = new Label(appName + " v." + version); //$NON-NLS-1$
Label developerLabel = new Label(developer);
Link githubLink = new Link(github, new ExternalResource(github));
main.addComponents(appLogoImage, appLabel, developerLabel, githubLink);
main.setComponentAlignment(appLabel, Alignment.MIDDLE_CENTER);
main.setComponentAlignment(developerLabel, Alignment.MIDDLE_CENTER);
main.setComponentAlignment(githubLink, Alignment.MIDDLE_CENTER);
setContent(main);
}
示例11: filterTracksByArtistId
import com.vaadin.ui.Link; //导入依赖的package包/类
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());
}
}
}
}
示例12: ArchiveLayout
import com.vaadin.ui.Link; //导入依赖的package包/类
public ArchiveLayout(ArchiveServiceApi archiveService, GetJobsArchiveServiceApi getJobsArchiveService,
UpdateJobsArchiveServiceApi updateJobsArchiveService) {
super();
VerticalLayout downloadContainer = new VerticalLayout();
VerticalLayout archiveContainer = new VerticalLayout();
// Component to Archive Jobs
JobsArchiverPanel archiveConfigurator = new JobsArchiverPanel(this, archiveService,
getJobsArchiveService, updateJobsArchiveService);
archiveConfigurator.setSizeFull();
archiveContainer.addComponent(ViewUtil.createSubHeader("Archive Jobs/Alerts", null));
archiveContainer.addComponent(archiveConfigurator);
downloadContainer.addComponent(ViewUtil.createSubHeader("Download Archive", null));
// Component to download archive
this.archiveTable = new Table();
this.archiveTable.setSizeFull();
this.archiveTable.setPageLength(5);
this.archiveTable.setImmediate(true);
this.archiveTable.addContainerProperty("Name", String.class, null);
this.archiveTable.addContainerProperty("Date", Date.class, null);
this.archiveTable.addContainerProperty("Size", Long.class, null);
this.archiveTable.addContainerProperty("Download", Link.class, null);
this.archiveTable.addContainerProperty("Delete", Button.class, null);
buildArchivesTable();
Panel archiveTablePanel = new Panel();
archiveTablePanel.setContent(this.archiveTable);
addComponent(archiveContainer);
addComponent(archiveTablePanel);
}
示例13: generateMgrLink
import com.vaadin.ui.Link; //导入依赖的package包/类
public static Object generateMgrLink(String caption, String url) {
Link mgrLink = new Link();
mgrLink.setCaption(caption);
mgrLink.setResource(new ExternalResource(url));
mgrLink.setDescription("Click to go to application");
mgrLink.setTargetName("_blank");
return mgrLink;
}
示例14: createJobLink
import com.vaadin.ui.Link; //导入依赖的package包/类
private static Link createJobLink(String caption, Long lastJobId, ServerApi server) {
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put(JOB_ID_PARAM_KEY, lastJobId);
return createInternalLink(MainUI.VIEW_FRAGMENT_JOBS, paramMap, caption,
VmidcMessages.getString(VmidcMessages_.JOB_LINK_TOOLTIP), server);
}
示例15: createInternalLink
import com.vaadin.ui.Link; //导入依赖的package包/类
private static Link createInternalLink(String fragment, HashMap<String, Object> paramMap, String linkCaption,
String linkDescription, ServerApi server) {
String jobLinkUrl = createInternalUrl(fragment, paramMap, server);
if (jobLinkUrl == null) {
return null;
}
Link jobLink = new Link();
jobLink.setCaption(linkCaption);
jobLink.setDescription(linkDescription);
jobLink.setResource(new ExternalResource(jobLinkUrl));
return jobLink;
}