List of usage examples for com.vaadin.ui Link setTargetName
public void setTargetName(String targetName)
From source file:com.peergreen.example.webconsole.extensions.NavigatorExtension.java
License:Open Source License
public NavigatorExtension() { setSizeFull();//from w w w . j ava 2 s.c o m setSpacing(true); setMargin(true); Link showCodeSource = new Link("Show code source", new ExternalResource(GitHubClassURL.getURL(NavigatorExtension.class))); showCodeSource.setTargetName("_blank"); addComponent(showCodeSource); setComponentAlignment(showCodeSource, Alignment.TOP_RIGHT); }
From source file:com.peergreen.example.webconsole.extensions.NotifierExtension.java
License:Open Source License
public NotifierExtension() { setSizeFull();/*from w w w . j a v a2 s . co m*/ setSpacing(true); setMargin(true); Link showCodeSource = new Link("Show code source", new ExternalResource(GitHubClassURL.getURL(NotifierExtension.class))); showCodeSource.setTargetName("_blank"); addComponent(showCodeSource); setComponentAlignment(showCodeSource, Alignment.TOP_RIGHT); }
From source file:com.peergreen.example.webconsole.extensions.SimpleExtension.java
License:Open Source License
public SimpleExtension() { setSizeFull();/*from w w w . j av a 2s. co m*/ setSpacing(true); setMargin(true); Link showCodeSource = new Link("Show code source", new ExternalResource(GitHubClassURL.getURL(SimpleExtension.class))); showCodeSource.setTargetName("_blank"); addComponent(showCodeSource); setComponentAlignment(showCodeSource, Alignment.TOP_RIGHT); }
From source file:com.peergreen.webconsole.scope.deployment.internal.components.DeployableWindow.java
License:Open Source License
public Component getContent() { FormLayout content = new FormLayout(); content.setSpacing(true);/* w w w.jav a 2 s .c om*/ content.setMargin(true); Label name = new Label(deployableEntry.getName()); name.setCaption("Name"); content.addComponent(name); Label uri = new Label(deployableEntry.getUri().toString()); uri.setCaption("URI"); content.addComponent(uri); VerticalLayout status = new VerticalLayout(); status.setCaption("Status"); content.addComponent(status); if (report == null) { // is not deployed yet status.addComponent(new Label("Ready to be deployed")); } else { if (report.getExceptions().size() == 0) { status.addComponent(new Label("<p style=\"color:#329932\">Deployed</p>", ContentMode.HTML)); } else { for (ArtifactError artifactError : report.getExceptions()) { for (ArtifactErrorDetail detail : artifactError.getDetails()) { ExceptionView exceptionView = new ExceptionView(detail); status.addComponent(exceptionView); } } } VerticalLayout endPointsLayout = new VerticalLayout(); for (Endpoint endpoint : report.getEndpoints()) { try { Link link = new Link(endpoint.getURI().toString(), new ExternalResource(endpoint.getURI().toURL())); link.setTargetName("_blank"); endPointsLayout.addComponent(link); } catch (MalformedURLException e) { endPointsLayout.addComponent(new Label(endpoint.getURI().toString())); } } if (endPointsLayout.getComponentCount() > 0) { content.addComponent(endPointsLayout); endPointsLayout.setCaption("End points"); } } return content; }
From source file:com.peergreen.webconsole.scope.deployment.internal.deployed.EndPointsHomeFrame.java
License:Open Source License
private void updateEndPoints() { removeAllItems();/*from w w w . j a v a2 s .c o m*/ int i = 0; for (URI uri : artifactModelManager.getDeployedRootURIs()) { VerticalLayout endPointsLayout = new VerticalLayout(); try { for (Endpoint endpoint : deploymentManager.getReport(uri.toString()).getEndpoints()) { Link link = new Link(endpoint.getURI().toString(), new ExternalResource(endpoint.getURI().toURL())); link.setTargetName("_blank"); endPointsLayout.addComponent(link); } } catch (ArtifactStatusReportException | MalformedURLException e) { e.printStackTrace(); } if (endPointsLayout.getComponentCount() > 0) { addItem(new Object[] { endPointsLayout, artifactModelManager.getArtifactModel(uri).getArtifact().name() }, i); i++; } } }
From source file:com.skysql.manager.ui.AboutSettings.java
License:Open Source License
/** * Reads the AboutRecord from the session and populates the panel layout. */// w w w.ja v a 2 s . c om AboutSettings(boolean extraInfo) { addStyleName("aboutTab"); setSizeFull(); setSpacing(true); setMargin(true); Label title = new Label("<h3>Welcome to MariaDB Manager<h3/>", ContentMode.HTML); title.setSizeUndefined(); addComponent(title); setComponentAlignment(title, Alignment.MIDDLE_CENTER); StringBuffer str = new StringBuffer(); str.append("<table border=0 cellspacing=3 cellpadding=3 summary=\"\">" + "<tr bgcolor=\"#ccccff\">" + "<th align=left>Component" + "<th align=left>Release"); if (extraInfo) { str.append("<th align=left>Version" + "<th align=left>Date"); } LinkedHashMap<String, Versions> versionsList = Versions.getVersionsList(); int i = 0; for (Versions component : versionsList.values()) { str.append(((i++ & 1) == 0) ? "<tr>" : "<tr bgcolor=\"#eeeeff\">"); str.append("<td><code>" + component.getName() + "</code><td>" + component.getRelease()); if (extraInfo) { str.append("<td>" + component.getVersion()); str.append("<td>" + (component.getDate() == null ? " " : component.getDate())); } } str.append("</table>"); ManagerUI.log(str.toString()); Label versionsLabel = new Label(str.toString(), ContentMode.HTML); versionsLabel.setSizeUndefined(); addComponent(versionsLabel); setComponentAlignment(versionsLabel, Alignment.MIDDLE_CENTER); if (extraInfo) { Label guiInfo = new Label("WebUI calling API " + APIrestful.apiVERSION + " @ " + APIrestful.getURI()); guiInfo.setSizeUndefined(); addComponent(guiInfo); setComponentAlignment(guiInfo, Alignment.MIDDLE_CENTER); } addComponent(new Label("")); addComponent(new Label("")); Label copyright = new Label("\u00A9 SkySQL Corporation Ab, 2014."); copyright.setSizeUndefined(); addComponent(copyright); setComponentAlignment(copyright, Alignment.MIDDLE_CENTER); Link link = new Link("MariaDB is a trademark of SkySQL Corporation Ab.", new ExternalResource("http://www.mariadb.com/about/legal/trademarks")); link.setTargetName("_blank"); addComponent(link); setComponentAlignment(link, Alignment.MIDDLE_CENTER); }
From source file:com.trivago.mail.pigeon.web.components.templates.ModalAddTemplate.java
License:Apache License
private void assembleHelpComponents(final Panel helpRootPanel) { VerticalLayout vHelpLayout = new VerticalLayout(); Link velocityLink = new Link("Velocity User Guide", new ExternalResource("http://velocity.apache.org/engine/releases/velocity-1.7/user-guide.html")); velocityLink.setTargetName("_blank"); Label helpText1 = new Label( "<p>You can find the basic template language user guide at the vendors homepage.</p>", Label.CONTENT_XHTML); Label helpText2 = new Label( "<p>The standard set of commands is enriched with our application specific variables." + "Those will help you to get the newsletter personalized. See below for a list of variables and and macros.</p>", Label.CONTENT_XHTML); Accordion accordion = new Accordion(); // Sender//from w w w .j a v a 2s. c om StringBuilder senderText = new StringBuilder("<dl>"); senderText.append("<dt>sender.uuid.id</dt><dd>The unique id of the sender</dd>"); senderText.append("<dt>sender.name</dt><dd>The name of the sender</dd>"); senderText.append("<dt>sender.email.from</dt><dd>The 'from' eMail of the sender</dd>"); senderText.append("<dt>sender.email.replyto</dt><dd>The reply-to eMail of the sender</dd>"); senderText.append("</dl>"); Label senderLabel = new Label(senderText.toString(), Label.CONTENT_XHTML); VerticalLayout senderBox = new VerticalLayout(); senderBox.addComponent(senderLabel); senderBox.setMargin(true); accordion.addTab(senderBox).setCaption("Sender"); // Recipient StringBuilder recipientText = new StringBuilder("<dl>"); recipientText.append("<dt>recipient.uuid.id</dt><dd>The unique id of the recipient</dd>"); recipientText.append( "<dt>recipient.uuid.external</dt><dd>The external (e.g. imported from the live system) id of the recipient</dd>"); recipientText.append("<dt>recipient.name</dt><dd>The name of the recipient</dd>"); recipientText.append("<dt>recipient.email</dt><dd>The eMail of the recipient</dd>"); recipientText.append("<dt>recipient.name.title</dt><dd>The reply-to eMail of the sender</dd>"); recipientText.append("<dt>recipient.name.first</dt><dd>The reply-to eMail of the sender</dd>"); recipientText.append("<dt>recipient.name.last</dt><dd>The reply-to eMail of the sender</dd>"); recipientText.append("<dt>recipient.gender</dt><dd>The reply-to eMail of the sender</dd>"); recipientText.append("<dt>recipient.birthday</dt><dd>The reply-to eMail of the sender</dd>"); recipientText.append("<dt>recipient.language</dt><dd>The reply-to eMail of the sender</dd>"); recipientText.append("<dt>recipient.location.city</dt><dd>The reply-to eMail of the sender</dd>"); recipientText.append("<dt>recipient.location.country</dt><dd>The reply-to eMail of the sender</dd>"); recipientText.append("</dl>"); Label recipientLabel = new Label(recipientText.toString(), Label.CONTENT_XHTML); VerticalLayout recipientBox = new VerticalLayout(); recipientBox.addComponent(recipientLabel); recipientBox.setMargin(true); accordion.addTab(recipientBox).setCaption("Recipient"); // Mail StringBuilder mailText = new StringBuilder("<dl>"); mailText.append("<dt>recipient.uuid.id</dt><dd>The unique id of the recipient</dd>"); mailText.append( "<dt>recipient.uuid.external</dt><dd>The external (e.g. imported from the live system) id of the recipient</dd>"); mailText.append("</dl>"); Label mailLabel = new Label(mailText.toString(), Label.CONTENT_XHTML); VerticalLayout mailBox = new VerticalLayout(); mailBox.addComponent(mailLabel); mailBox.setMargin(true); accordion.addTab(mailBox).setCaption("Mail"); // Campaign StringBuilder campaignText = new StringBuilder("<dl>"); campaignText.append("<dt>recipient.uuid.id</dt><dd>The unique id of the recipient</dd>"); campaignText.append( "<dt>recipient.uuid.external</dt><dd>The external (e.g. imported from the live system) id of the recipient</dd>"); campaignText.append("<dt>recipient.name</dt><dd>The name of the recipient</dd>"); campaignText.append("<dt>recipient.email</dt><dd>The eMail of the recipient</dd>"); campaignText.append("<dt>sender.email.replyto</dt><dd>The reply-to eMail of the sender</dd>"); campaignText.append("</dl>"); Label campaignLabel = new Label(campaignText.toString(), Label.CONTENT_XHTML); VerticalLayout campaignBox = new VerticalLayout(); campaignBox.addComponent(campaignLabel); campaignBox.setMargin(true); accordion.addTab(campaignBox).setCaption("Campaign"); vHelpLayout.addComponent(helpText1); vHelpLayout.addComponent(velocityLink); vHelpLayout.addComponent(helpText2); vHelpLayout.addComponent(accordion); helpRootPanel.addComponent(vHelpLayout); }
From source file:de.catma.CatmaApplication.java
License:Open Source License
@Override public void init() { Properties properties = loadProperties(); backgroundService = new BackgroundService(this); final Window mainWindow = new Window("CATMA 4.1 - CLA " + VERSION); mainWindow.addParameterHandler(this); HorizontalLayout mainLayout = new HorizontalLayout(); mainLayout.setSizeUndefined();//from www. ja va2s. c o m mainLayout.setMargin(true); mainLayout.setSpacing(true); mainWindow.addStyleName("catma-mainwindow"); mainWindow.setContent(mainLayout); MenuFactory menuFactory = new MenuFactory(); try { initTempDirectory(properties); tagManager = new TagManager(); repositoryManagerView = new RepositoryManagerView(new RepositoryManager(this, tagManager, properties)); tagManagerView = new TagManagerView(tagManager); taggerManagerView = new TaggerManagerView(); analyzerManagerView = new AnalyzerManagerView(); visualizationManagerView = new VisualizationManagerView(); defaultProgressIndicator = new ProgressIndicator(); defaultProgressIndicator.setIndeterminate(true); defaultProgressIndicator.setEnabled(false); defaultProgressIndicator.setPollingInterval(500); progressWindow = new ProgressWindow(defaultProgressIndicator); menu = menuFactory.createMenu(mainLayout, new MenuFactory.MenuEntryDefinition("Repository Manager", new RepositoryManagerWindow(repositoryManagerView)), new MenuFactory.MenuEntryDefinition("Tag Manager", new TagManagerWindow(tagManagerView)), new MenuFactory.MenuEntryDefinition("Tagger", new TaggerManagerWindow(taggerManagerView)), new MenuFactory.MenuEntryDefinition("Analyzer", new AnalyzerManagerWindow(analyzerManagerView)), new MenuFactory.MenuEntryDefinition("Visualizer", new VisualizationManagerWindow(visualizationManagerView))); Link aboutLink = new Link("About", new ExternalResource("http://www.catma.de")); aboutLink.setTargetName("_blank"); mainLayout.addComponent(aboutLink); mainLayout.setComponentAlignment(aboutLink, Alignment.TOP_RIGHT); mainLayout.setExpandRatio(aboutLink, 1.0f); Link helpLink = new Link("Help", new ExternalResource(getURL() + "manual/")); helpLink.setTargetName("_blank"); mainLayout.addComponent(helpLink); mainLayout.setComponentAlignment(helpLink, Alignment.TOP_RIGHT); Label helpLabel = new Label(); helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", this)); helpLabel.setWidth("20px"); helpLabel.setDescription( "<h3>Hints</h3>" + "<p>Watch out for these little question mark icons while navigating " + "through CATMA. They provide useful hints for managing the first " + "steps within a CATMA component.</p>" + "<h4>Login</h4>" + "Once you're logged in, you will see the Repository Manager, " + "which will explain the first steps to you. " + "Just hover your mouse over the question mark icons!"); VerticalLayout helpWrapper = new VerticalLayout(); helpWrapper.addComponent(helpLabel); helpWrapper.setComponentAlignment(helpLabel, Alignment.TOP_RIGHT); Animator helpAnimator = new Animator(helpWrapper); helpAnimator.setFadedOut(true); mainLayout.addComponent(helpAnimator); mainLayout.setComponentAlignment(helpAnimator, Alignment.TOP_RIGHT); helpAnimator.fadeIn(2000, 300); MenuBar loginLogoutMenu = new MenuBar(); LoginLogoutCommand loginLogoutCommand = new LoginLogoutCommand(menu, repositoryManagerView, this); MenuItem loginLogoutitem = loginLogoutMenu.addItem("Login", loginLogoutCommand); loginLogoutCommand.setLoginLogoutItem(loginLogoutitem); mainLayout.addComponent(loginLogoutMenu); mainLayout.setComponentAlignment(loginLogoutMenu, Alignment.TOP_RIGHT); mainLayout.setWidth("100%"); } catch (Exception e) { showAndLogError("The system could not be initialized!", e); } setMainWindow(mainWindow); setTheme("cleatheme"); }
From source file:de.catma.ui.CatmaApplication.java
License:Open Source License
@Override protected void init(VaadinRequest request) { backgroundService = new UIBackgroundService(true); storeParameters(request.getParameterMap()); Page.getCurrent().setTitle("CATMA 5.0 " + MINORVERSION); mainLayout = new VerticalLayout(); mainLayout.setSizeFull();/*from w ww. j a v a 2 s .co m*/ menuPanel = new Panel(); menuPanel.addStyleName("menuPanel"); mainLayout.addComponent(menuPanel); contentPanel = new Panel(); contentPanel.setHeight("100%"); contentPanel.addStyleName("contentPanel"); defaultContentPanelLabel = new Label("Please log in to get started"); defaultContentPanelLabel.addStyleName("defaultContentPanelLabel"); contentPanel.setContent(defaultContentPanelLabel); mainLayout.addComponent(contentPanel); mainLayout.setExpandRatio(contentPanel, 1.0f); menuLayout = new HorizontalLayout(); menuLayout.setMargin(true); menuLayout.setSpacing(true); logoResource = new ThemeResource("catma-logo.png"); Link logoImage = new Link(null, new ExternalResource("http://www.catma.de")); logoImage.setIcon(logoResource); logoImage.setTargetName("_blank"); menuLayout.addComponent(logoImage); MenuFactory menuFactory = new MenuFactory(); try { initTempDirectory(); tagManager = new TagManager(); repositoryManagerView = new RepositoryManagerView( new RepositoryManager(this, tagManager, RepositoryProperties.INSTANCE.getProperties())); tagManagerView = new TagManagerView(tagManager); taggerManagerView = new TaggerManagerView(); analyzerManagerView = new AnalyzerManagerView(); visualizationManagerView = new VisualizationManagerView(); menu = menuFactory.createMenu(menuLayout, contentPanel, new MenuFactory.MenuEntryDefinition("Repository Manager", repositoryManagerView), new MenuFactory.MenuEntryDefinition("Tag Type Manager", tagManagerView), new MenuFactory.MenuEntryDefinition("Tagger", taggerManagerView), new MenuFactory.MenuEntryDefinition("Analyzer", analyzerManagerView), new MenuFactory.MenuEntryDefinition("Visualizer", visualizationManagerView)); addPropertyChangeListener(CatmaApplicationEvent.userChange, menu.userChangeListener); Link latestFeaturesLink = new Link("Latest Features", new ExternalResource("http://www.catma.de/latestfeatures")); latestFeaturesLink.setTargetName("_blank"); menuLayout.addComponent(latestFeaturesLink); menuLayout.setComponentAlignment(latestFeaturesLink, Alignment.TOP_RIGHT); menuLayout.setExpandRatio(latestFeaturesLink, 1.0f); Link aboutLink = new Link("About", new ExternalResource("http://www.catma.de")); aboutLink.setTargetName("_blank"); menuLayout.addComponent(aboutLink); menuLayout.setComponentAlignment(aboutLink, Alignment.TOP_RIGHT); Link termsOfUseLink = new Link("Terms of Use", new ExternalResource("http://www.catma.de/termsofuse")); termsOfUseLink.setTargetName("_blank"); menuLayout.addComponent(termsOfUseLink); menuLayout.setComponentAlignment(termsOfUseLink, Alignment.TOP_RIGHT); Link manualLink = new Link("Manual", new ExternalResource(request.getContextPath() + "/manual/")); manualLink.setTargetName("_blank"); menuLayout.addComponent(manualLink); menuLayout.setComponentAlignment(manualLink, Alignment.TOP_RIGHT); Link helpLink = new Link("Helpdesk", new ExternalResource("http://www.catma.de/helpdesk/")); helpLink.setTargetName("_blank"); menuLayout.addComponent(helpLink); menuLayout.setComponentAlignment(helpLink, Alignment.TOP_RIGHT); helpLink.setVisible(false); btHelp = new Button(FontAwesome.QUESTION_CIRCLE); btHelp.addStyleName("help-button"); btHelp.addStyleName("application-help-button"); menuLayout.addComponent(btHelp); btHelp.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { if (uiHelpWindow.getParent() == null) { UI.getCurrent().addWindow(uiHelpWindow); } else { UI.getCurrent().removeWindow(uiHelpWindow); } } }); LoginLogoutCommand loginLogoutCommand = new LoginLogoutCommand(menu, repositoryManagerView); Button btloginLogout = new Button("Sign in", event -> loginLogoutCommand.menuSelected(null)); btloginLogout.setStyleName(BaseTheme.BUTTON_LINK); btloginLogout.addStyleName("application-loginlink"); loginLogoutCommand.setLoginLogoutButton(btloginLogout); menuLayout.addComponent(btloginLogout); menuLayout.setComponentAlignment(btloginLogout, Alignment.TOP_RIGHT); menuLayout.setWidth("100%"); menuPanel.setContent(menuLayout); setContent(mainLayout); if (getParameter(Parameter.USER_IDENTIFIER) != null) { btloginLogout.click(); } setPollInterval(10000); if ((getParameter(Parameter.AUTOLOGIN) != null) && (getUser() == null)) { getPage().setLocation(repositoryManagerView.createAuthenticationDialog().createLogInClick(this, RepositoryPropertyKey.CATMA_oauthAuthorizationCodeRequestURL.getValue(), RepositoryPropertyKey.CATMA_oauthAccessTokenRequestURL.getValue(), RepositoryPropertyKey.CATMA_oauthClientId.getValue(), RepositoryPropertyKey.CATMA_oauthClientSecret.getValue(), URLEncoder.encode("/", "UTF-8"))); } } catch (Exception e) { showAndLogError("The system could not be initialized!", e); } }
From source file:de.metas.procurement.webui.ui.view.LoginView.java
License:Open Source License
public LoginView() { super();/*from www.java 2 s . c o m*/ Application.autowire(this); addStyleName(STYLE); // // Content { final VerticalComponentGroup content = new VerticalComponentGroup(); final Resource logoResource = getLogoResource(); final Image logo = new Image(null, logoResource); logo.addStyleName(STYLE_Logo); content.addComponent(logo); this.email = new EmailField(i18n.get("LoginView.fields.email")); email.addStyleName(STYLE_LoginEmail); email.setIcon(FontAwesome.USER); content.addComponent(email); this.password = new PasswordField(i18n.get("LoginView.fields.password")); password.addStyleName(STYLE_LoginPassword); password.setIcon(FontAwesome.LOCK); content.addComponent(password); final Button loginButton = new Button(i18n.get("LoginView.fields.loginButton")); loginButton.addStyleName(STYLE_LoginButton); loginButton.setClickShortcut(KeyCode.ENTER); loginButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { onUserLogin(email.getValue(), password.getValue()); } }); final Button forgotPasswordButton = new Button(i18n.get("LoginView.fields.forgotPasswordButton")); forgotPasswordButton.setStyleName(STYLE_ForgotPasswordButton); forgotPasswordButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { onForgotPassword(email.getValue()); } }); final CssLayout contentWrapper = new CssLayout(content, loginButton, forgotPasswordButton); contentWrapper.addStyleName(STYLE_LoginFormWrapper); setContent(contentWrapper); } // // Bottom: { // // Powered-by logo resource // Use the configured one if any; fallback to default embedded powered-by logo final Resource poweredByLogoResource; if (poweredByLogoUrl != null && !poweredByLogoUrl.trim().isEmpty()) { poweredByLogoResource = new ExternalResource(poweredByLogoUrl.trim()); } else { poweredByLogoResource = Constants.RESOURCE_PoweredBy; } // // Powered-by component: final Component poweredByComponent; if (poweredByLinkUrl != null && !poweredByLinkUrl.trim().isEmpty()) { final Link link = new Link(); link.setIcon(poweredByLogoResource); link.setResource(new ExternalResource(poweredByLinkUrl.trim())); link.setTargetName("_blank"); poweredByComponent = link; } else { final Image image = new Image(null, poweredByLogoResource); poweredByComponent = image; } // poweredByComponent.addStyleName(STYLE_PoweredBy); setToolbar(poweredByComponent); } }