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


Java ExternalResource类代码示例

本文整理汇总了Java中com.vaadin.terminal.ExternalResource的典型用法代码示例。如果您正苦于以下问题:Java ExternalResource类的具体用法?Java ExternalResource怎么用?Java ExternalResource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getOverviewComponent

import com.vaadin.terminal.ExternalResource; //导入依赖的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()));
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:21,代码来源:UrlAttachmentRenderer.java

示例2: getDetailComponent

import com.vaadin.terminal.ExternalResource; //导入依赖的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;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:UrlAttachmentRenderer.java

示例3: NodeInfoWindow

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * The NodeInfoWindow method constructs a sub-window instance which can be added to a main window.
 * The sub-window contains an embedded browser which displays the Node Info page of the currently selected
 * node.
 * @param node Selected node
 * @param width Width of the main window
 * @param height Height of the main window
 * @throws MalformedURLException
 */
public NodeInfoWindow(final Node node, final URL nodeURL) throws MalformedURLException{
    
    nodeInfoBrowser = new Embedded("", new ExternalResource(nodeURL));

    String label = node == null? "" : node.getLabel();
    /*Sets up window settings*/
    if (label == null || label.equals("") || label.equalsIgnoreCase(noLabel)) {
        label = "";
    } else label = " - " + label;
    setCaption("Node Info" + label);
    setImmediate(true);
    setResizable(false);
    
    /*Adds the browser to the main layout*/
    VerticalLayout layout = new VerticalLayout();
    layout.addComponent(nodeInfoBrowser);

    addComponent(layout);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:29,代码来源:NodeInfoWindow.java

示例4: ResourceGraphsWindow

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * The ResourceGraphsWindow method constructs a sub-window instance which can be added to a
 * main window. The sub-window contains an embedded browser which displays the Resource Graphs
 * page of the currently selected node
 * @param node Selected node
 * @param width Width of the main window
 * @param height Height of the main window
 * @throws MalformedURLException
 */
public ResourceGraphsWindow(final Node node, final URL nodeURL) throws MalformedURLException{
	
	rgBrowser = new Embedded("", new ExternalResource(nodeURL));
	
	String label = node == null? "" : node.getLabel();
	/*Sets up window settings*/
	if (label == null || label.equals("") || label.equalsIgnoreCase(noLabel)) {
		label = "";
	} else {
	    label = " - " + label;
	}
	setCaption("Resource Graphs" + label);
	setImmediate(true);
	setResizable(false);
	
	/*Adds the browser component to the main layout*/
	VerticalLayout layout = new VerticalLayout();
	layout.addComponent(rgBrowser);
	
	addComponent(layout);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:31,代码来源:ResourceGraphsWindow.java

示例5: buttonClick

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
@Override
public void buttonClick(ClickEvent event) {
	Button b = event.getButton();
	if (b == btnJobQueueStatus) {
		Window subWindow = new Window("Job Manager");
		subWindow.setWidth("500px");
		subWindow.center();
		getApplication().getMainWindow().addWindow(subWindow);

		Panel p = new Panel(new JobsStatusViewComponent(getApplication().getURL()));
		p.getContent().setWidth("100%");
		p.setWidth("100%");
		subWindow.addComponent(p);
		subWindow.setModal(true);
	} else if (b == help) {
		String HelpURL = getApplication().getURL().toExternalForm() + "doc";
		getApplication().getMainWindow().open(new ExternalResource(HelpURL), "_blank");
	} else if (b == restart) {
		((ExpressZipWindow) getApplication().getMainWindow()).getApplication().close();
	}
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:22,代码来源:MapToolbarViewComponent.java

示例6: buildMainLayout

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
private void buildMainLayout() {
	// common part: create layout    		
   	pnYoutube = new Panel();    	
   	pnYoutube.setWidth("100%");
   	pnYoutube.setHeight("100%");
   	
   	thkYoutube = new Embedded(null, new ExternalResource("http://www.youtube.com/watch?v=mkKsWguqJRU"));
   	thkYoutube.setAlternateText("Thingtrack Quickstart video");
   	thkYoutube.setMimeType("application/x-shockwave-flash");
   	thkYoutube.setParameter("allowFullScreen", "true");
   	thkYoutube.setSizeFull();
   	//thkYoutube.setWidth("320px");
   	//thkYoutube.setHeight("265px");
   	
   	pnYoutube.addComponent(thkYoutube);
   	    	        
	// top-level component properties
       addComponent(pnYoutube);
	
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:21,代码来源:YoutubePortlet.java

示例7: showInitialView

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * Die Methode triggert die Anzeige der Projektuebersichtsseite, sobald der User
 * sich erfolgreich eingeloggt hat. 
 * 
 * 
 * @author Julius Hacker, Marcel Rosenberger
 * @param event Der ausgeloeste ShowUserEvent
 */
@EventHandler
public void showInitialView(ShowUserEvent event) {
	this.removeWindow(processView);
	this.removeWindow(initialScreenView);
	this.removeWindow(parameterScreenView);
	initialScreenView.setName("overview");
	addWindow(initialScreenView);
	setMainWindow(initialScreenView);
	logInScreenView.open(new ExternalResource(initialScreenView.getURL()));

	eventBus.fireEvent(new ShowInitialScreenViewEvent(event.getUser()));
	LOGGER.debug("ShowInitialScreenViewEvent gefeuert");
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:22,代码来源:BHApplication.java

示例8: showParameterScreenView

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * Die Methode triggert die Anzeige des ParameterScreen entspricht Schritt 2.
 * 
 * 
 * @author Tobias Lindner
 * @param event Der ausgeloest ShowParameterScreenViewEvent
 */
@EventHandler
public void showParameterScreenView (ShowParameterScreenViewEvent event) {
	this.removeWindow(processView);
	this.removeWindow(logInScreenView);
	parameterScreenView.setName("parameterScreen");
	addWindow(parameterScreenView);
	setMainWindow(parameterScreenView);
	initialScreenView.open(new ExternalResource(parameterScreenView.getURL()));
	LOGGER.debug("ParameterScreenView gesetzt");
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:18,代码来源:BHApplication.java

示例9: showProcessView

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * Die Methode triggert die Anzeige der Prozessansicht, sobald an einer
 * Stelle des Programmes ein Projekt angezeigt wurde. 
 * 
 * @author Julius Hacker, Marcel Rosenberger
 * @param event
 *            Der ausgeloeste ShowProjectEvent
 */
@EventHandler
public void showProcessView(ShowProjectEvent event) {
	//
		this.removeWindow(parameterScreenView);
	//
	
	processView.setName("process");
	addWindow(processView);
	setMainWindow(processView);
	initialScreenView.open(new ExternalResource(processView.getURL()));

	eventBus.fireEvent(new ShowProcessViewEvent());
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:22,代码来源:BHApplication.java

示例10: showLoginView

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * Die Methode triggert die Anzeige der Loginview, sobald an einer
 * Stelle des Programmes (entweder InitialScreen oder in den ProcessViews) 
 * der Logout-Button betätigt wurde. 
 * Nachdem der Login-Screen als Main-Window gesetzt wurde müssen noch 
 * Initialscreen und ProcessView gelöscht werden.
 * 
 * @author Marcel Rosenberger
 * @param event
 *            Das ausgeloeste LogoutEvent
 */
@EventHandler
public void showLoginView(LogoutEvent event) {
	this.removeWindow(logInScreenView);
	logInScreenView.setName("login");
	addWindow(logInScreenView);
	setMainWindow(logInScreenView);
	logInScreenView.open(new ExternalResource(logInScreenView.getURL()));
	this.removeWindow(processView);
	this.removeWindow(initialScreenView);
	eventBus.fireEvent(new ShowLogInScreenEvent());
	LOGGER.debug("ShowLogInScreenEvent gefeuert");
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:24,代码来源:BHApplication.java

示例11: changeBrowserURL

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * The changeBrowserURL method changes the address of the results browser whenever a new
 * ping request form is submitted and refreshes the browser.
 * @param url New web address
 */
private void changeBrowserURL(URL url) {
	if (url != null) {
		/* This setVisible(false/true) toggle is used to refresh the browser.
		 * Due to to the fact that the updates to the client require a call to
		 * the server, this is currently one of the only ways to accomplish the
		 * the needed update.
		 */
		resultsBrowser.setVisible(false); 
		resultsBrowser.setSource(new ExternalResource(url));
		resultsBrowser.setVisible(true);
	}
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:18,代码来源:PingWindow.java

示例12: changeBrowserURL

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * The changeBrowserURL method changes the address of the results browser whenever a new
 * traceroute request form is submitted and refreshes the browser.
 * @param url New web address
 */
private void changeBrowserURL(URL url) {
	if (url != null) {
		/* This setVisible(false/true) toggle is used to refresh the browser.
		 * Due to to the fact that the updates to the client require a call to
		 * the server, this is currently one of the only ways to accomplish the
		 * the needed update.
		 */
		resultsBrowser.setVisible(false);
		resultsBrowser.setSource(new ExternalResource(url));
		resultsBrowser.setVisible(true);
	}
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:18,代码来源:TracerouteWindow.java

示例13: EventsAlarmsWindow

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
/**
 * The EventsAlarmsWindow method constructs a sub-window instance which can be added to a
 * main window. The sub-window contains two embedded browsers which are directed at the Events
 * and Alarms page of the selected node
 * @param node Selected node
 * @param width Width of main window
 * @param height Height of main window
 * @throws MalformedURLException
 */
public EventsAlarmsWindow(final Node node, final URL eventsURL, final URL alarmsURL) throws MalformedURLException {
	eventsBrowser = new Embedded("", new ExternalResource(eventsURL));
	alarmsBrowser = new Embedded("", new ExternalResource(alarmsURL));
	
	String label = node == null? "" : node.getLabel();
	/*Sets up window settings*/
	if (label == null || label.equals("") || label.equalsIgnoreCase(noLabel)) {
		label = "";
	} else {
	    label = " - " + label;
	}
	
	setCaption("Events & Alarms" + label);
	setImmediate(true);
	setResizable(false);
	
	/*Adds the two browsers to separate tabs in a tabsheet layout*/
	TabSheet tabsheet = new TabSheet();
	tabsheet.addTab(eventsBrowser, "Events");
	tabsheet.addTab(alarmsBrowser, "Alarms");
	
	/*Adds tabsheet component to the main layout of the sub-window*/
	VerticalLayout layout = new VerticalLayout();
	layout.addComponent(tabsheet);
	
	addComponent(layout);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:37,代码来源:EventsAlarmsWindow.java

示例14: LinkField

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
public LinkField(Item item, Object propertyId) {

		String url = (String) item.getItemProperty(propertyId).getValue();
		link = new Link(url, new ExternalResource(url));
		link.setTargetName("_blank");
		setCompositionRoot(link);
	}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:8,代码来源:LinkField.java

示例15: initContactSection

import com.vaadin.terminal.ExternalResource; //导入依赖的package包/类
protected void initContactSection() {
  Label header = createProfileHeader(infoPanelLayout, i18nManager.getMessage(Messages.PROFILE_CONTACT));
  header.addStyleName(ExplorerLayout.STYLE_H3);
  header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
  infoPanelLayout.addComponent(header);
  
  GridLayout contactLayout = createInfoSectionLayout(2, 4);
  // Email
  if (!editable && isDefined(user.getEmail())) {
    addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_EMAIL), user.getEmail());
  } else if (editable) {
    emailField = new TextField();
    addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_EMAIL), emailField, user.getEmail());
  }
  
  // Phone
  if (!editable && isDefined(phone)) {
    addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_PHONE), phone);
  } else if (editable) {
    phoneField = new TextField();
    addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_PHONE), phoneField, phone);
  }
  
  // Twitter
  if (!editable && isDefined(twitterName)) {
    Link twitterLink = new Link(twitterName, new ExternalResource("http://www.twitter.com/"+twitterName)); 
    addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_TWITTER), twitterLink);
  } else if (editable) {
    twitterField = new TextField();
    addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_TWITTER), twitterField, twitterName);
  }
  
  // Skype
  if (!editable && isDefined(skypeId)) {
    // The skype entry shows the name + skype icon, laid out in a small grid
    GridLayout skypeLayout = new GridLayout(2,1);
    skypeLayout.setSpacing(true);
    skypeLayout.setSizeUndefined();
    
    Label skypeIdLabel = new Label(skypeId);
    skypeIdLabel.setSizeUndefined();
    skypeLayout.addComponent(skypeIdLabel);
    
    addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_SKYPE), skypeLayout);
  } else if (editable) {
    skypeField = new TextField();
    addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_SKYPE), skypeField, skypeId);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:50,代码来源:ProfilePanel.java


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