当前位置: 首页>>代码示例>>Java>>正文


Java BrowserWindowOpener.extend方法代码示例

本文整理汇总了Java中com.vaadin.server.BrowserWindowOpener.extend方法的典型用法代码示例。如果您正苦于以下问题:Java BrowserWindowOpener.extend方法的具体用法?Java BrowserWindowOpener.extend怎么用?Java BrowserWindowOpener.extend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.server.BrowserWindowOpener的用法示例。


在下文中一共展示了BrowserWindowOpener.extend方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WebNewWindowButton

import com.vaadin.server.BrowserWindowOpener; //导入方法依赖的package包/类
public WebNewWindowButton() {
    component = new CubaButton();
    component.addStyleName(NEW_WINDOW_BUTTON_STYLENAME);
    component.setDescription(null);

    URL pageUrl;
    try {
        pageUrl = Page.getCurrent().getLocation().toURL();
    } catch (MalformedURLException ignored) {
        LoggerFactory.getLogger(WebNewWindowButton.class).warn("Couldn't get URL of current Page");
        return;
    }

    ExternalResource currentPage = new ExternalResource(pageUrl);
    final BrowserWindowOpener opener = new BrowserWindowOpener(currentPage);
    opener.setWindowName("_blank");

    opener.extend(component);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:20,代码来源:WebNewWindowButton.java

示例2: AccountModuleImpl

import com.vaadin.server.BrowserWindowOpener; //导入方法依赖的package包/类
public AccountModuleImpl() {
    addStyleName("module");
    ControllerRegistry.addController(new UserAccountController(this));

    MHorizontalLayout topPanel = new MHorizontalLayout().withFullWidth().withMargin(true).withStyleName("border-bottom");
    AccountSettingBreadcrumb breadcrumb = ViewManager.getCacheComponent(AccountSettingBreadcrumb.class);

    MButton helpBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_HELP))
            .withIcon(FontAwesome.MORTAR_BOARD).withStyleName(WebThemes.BUTTON_LINK);
    ExternalResource helpRes = new ExternalResource("https://community.mycollab.com/docs/account-management/");
    BrowserWindowOpener helpOpener = new BrowserWindowOpener(helpRes);
    helpOpener.extend(helpBtn);

    topPanel.with(breadcrumb, helpBtn).withAlign(helpBtn, Alignment.TOP_RIGHT);

    tabSheet = new VerticalTabsheet();
    tabSheet.setSizeFull();
    tabSheet.setNavigatorStyleName("sidebar-menu");
    tabSheet.addToggleNavigatorControl();
    VerticalLayout contentWrapper = tabSheet.getContentWrapper();
    contentWrapper.addStyleName("main-content");
    contentWrapper.addComponentAsFirst(topPanel);

    this.buildComponents();
    this.setContent(tabSheet);
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:27,代码来源:AccountModuleImpl.java

示例3: buildLanguageUpdatePanel

import com.vaadin.server.BrowserWindowOpener; //导入方法依赖的package包/类
private void buildLanguageUpdatePanel() {
    FormContainer formContainer = new FormContainer();
    MHorizontalLayout layout = new MHorizontalLayout().withFullWidth().withMargin(new MarginInfo(true));
    MVerticalLayout leftPanel = new MVerticalLayout().withMargin(false);
    Label logoDesc = new Label(UserUIContext.getMessage(ShellI18nEnum.OPT_LANGUAGE_DOWNLOAD));
    leftPanel.with(logoDesc).withWidth("250px");
    MVerticalLayout rightPanel = new MVerticalLayout().withMargin(false);
    MButton downloadBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_DOWNLOAD))
            .withStyleName(WebThemes.BUTTON_ACTION).withIcon(FontAwesome.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(UIConstants.META_INFO));
    layout.with(leftPanel, rightPanel).expand(rightPanel);
    formContainer.addSection("Languages", layout);
    this.with(formContainer);
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:19,代码来源:GeneralSettingViewImpl.java

示例4: getButton

import com.vaadin.server.BrowserWindowOpener; //导入方法依赖的package包/类
/**
 * @param caption
 * @param bwo
 * @param icon
 * @return un bouton pour l'assistance
 */
private OneClickButton getButton(String caption, String bwo, com.vaadin.server.Resource icon){
	BrowserWindowOpener browser = new BrowserWindowOpener(new ExternalResource(bwo));
	OneClickButton btn = new OneClickButton(caption, icon);
	btn.addStyleName(ValoTheme.BUTTON_LINK);
	browser.extend(btn);
	return btn;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:14,代码来源:AssistanceView.java

示例5: initializeButtons

import com.vaadin.server.BrowserWindowOpener; //导入方法依赖的package包/类
protected void initializeButtons() {
	//
	// The Save button
	//
	this.buttonSave.addClickListener(new ClickListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void buttonClick(ClickEvent event) {
			self.savePolicy();
		}
	});
	//
	// Attach a window opener to the View XML button
	//
	BrowserWindowOpener opener = new BrowserWindowOpener(new StreamResource(new StreamResource.StreamSource() {
		private static final long serialVersionUID = 1L;

		@Override
		public InputStream getStream() {
			try {
				if (logger.isDebugEnabled()) {
					logger.debug("Setting view xml button to: " + self.file.getAbsolutePath());
				}
				return new FileInputStream(self.file);
			} catch (Exception e) {
				logger.error("Failed to open input stream " + self.file);
			}
			return null;
		}
	}, self.file.getName()));
	opener.setWindowName("_new");
	opener.extend(this.buttonViewXML);
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:35,代码来源:PolicyEditor.java

示例6: initWindow

import com.vaadin.server.BrowserWindowOpener; //导入方法依赖的package包/类
private void initWindow(final String caption, final byte[] file, final String fileName) {

		setCaption(caption);

		final VerticalLayout contentContainer = new VerticalLayout();
		contentContainer.setMargin(true);
		contentContainer.setSpacing(true);

		final Label infoLbl = new Label(fileName);
		contentContainer.addComponent(infoLbl);

		final HorizontalLayout toolbar = new HorizontalLayout();
		toolbar.setSpacing(true);

		final Button downloadBtn = new Button("Скачать", Fontello.DOWNLOAD);
		createDownloader(file, fileName).extend(downloadBtn);
		toolbar.addComponent(downloadBtn);

		final Button viewBtn = new Button("Посмотреть", Fontello.SEARCH_1);
		final BrowserWindowOpener opener =
				new BrowserWindowOpener(new StreamResource(
                        () -> new ByteArrayInputStream(file), encodeWebFileName(fileName)));
		opener.extend(viewBtn);
		toolbar.addComponent(viewBtn);

		contentContainer.addComponent(toolbar);
		contentContainer.setComponentAlignment(toolbar, Alignment.MIDDLE_CENTER);

		setContent(contentContainer);
	}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:31,代码来源:DownloadFileWindow.java

示例7: PrintButton

import com.vaadin.server.BrowserWindowOpener; //导入方法依赖的package包/类
public PrintButton() {
    setIcon(FontAwesome.PRINT);
    formReportStreamSource = new FormReportStreamSource(new FormReportTemplateExecutor(""));
    BrowserWindowOpener printWindowOpener = new BrowserWindowOpener(new StreamResource(formReportStreamSource, UUID.randomUUID().toString() + ".pdf"));
    printWindowOpener.extend(this);
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:7,代码来源:PrintButton.java

示例8: attach

import com.vaadin.server.BrowserWindowOpener; //导入方法依赖的package包/类
@Override
public void attach() {
	super.attach();
	URI myUrl = UI.getCurrent().getPage().getLocation();
	String myUrlRoot = myUrl.getScheme() + "://" + myUrl.getAuthority()
			+ myUrl.getPath();

	String modelUrl = myUrlRoot + "?getmodelid=" + modelId;

	String modelUrlEnc;
	try {
		modelUrlEnc = URLEncoder.encode(modelUrl, "UTF-8");
	} catch (UnsupportedEncodingException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return;
	}

	String url = visualDesignerUrl + "?restartApplication&modelid="
			+ modelId + "&modeluri=" + modelUrlEnc;

	BrowserWindowOpener opener = new BrowserWindowOpener(url);

	Button button = new Button("Open Visual Designer");
	button.setIcon(Icons.APPLICATION_ARROW);
	opener.extend(button);

	layout.addComponent(button);
	
	Button fetchButton = new Button("Get from Visual Designer");
	fetchButton.setIcon(Icons.ARROW_180_MEDIUM);
	fetchButton.addClickListener(new ClickListener() {
		@Override
		public void buttonClick(ClickEvent event) {
			fetch(modelId);
		}
	});
	
	layout.addComponent(fetchButton);

}
 
开发者ID:ahn,项目名称:mideaas,代码行数:42,代码来源:VisualDesignerConnector.java


注:本文中的com.vaadin.server.BrowserWindowOpener.extend方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。