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


Java Application类代码示例

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


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

示例1: setUp

import com.vaadin.Application; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	Node testNode1 = new Node(9,"172.20.1.10","Cartman");
	traceWindow = new TracerouteWindow(testNode1, "http://localhost:8080/");
	traceWindow2 = new TracerouteWindow(null, "http://localhost:8080/");
	traceWindow3 = new TracerouteWindow(testNode1, "");
	mainWindow = new Window();
	app = new Application() { //Empty Application
		@Override
		public void init() {}
	};
	app.setMainWindow(mainWindow);
	app.getMainWindow().addWindow(traceWindow);
	app.getMainWindow().addWindow(traceWindow2);
	app.getMainWindow().addWindow(traceWindow3);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:17,代码来源:TracerouteWindowTest.java

示例2: setUp

import com.vaadin.Application; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	Node testNode1 = new Node(9,"172.20.1.10","Cartman");
	
	pingWindow = new PingWindow(testNode1, "http://Localhost:8080/");
	pingWindow2 = new PingWindow(null, "http://localhost:8080/");
	pingWindow3 = new PingWindow(testNode1, "");
	
	mainWindow = new Window();
	app = new Application() { //Empty Application
		@Override
		public void init() {}
	};
	app.setMainWindow(mainWindow);
	app.getMainWindow().addWindow(pingWindow);
	app.getMainWindow().addWindow(pingWindow2);
	app.getMainWindow().addWindow(pingWindow3);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:19,代码来源:PingWindowTest.java

示例3: setUp

import com.vaadin.Application; //导入依赖的package包/类
@SuppressWarnings("serial")
@Before
public void setUp() throws Exception {

	app = new Application() {
		@Override
		public void init() {}
	};
	mainWindow = new Window();
	app.setMainWindow(mainWindow);

	SSHWindow sshWindow = new SSHWindow(null, 200, 200);
	app.getMainWindow().addWindow(sshWindow);

	SshClient client = SshClient.setUpDefaultClient();
	client.start();
	ClientSession session = null;
	try {
		session = client.connect(testHost, testPort).await().getSession();
	} catch (Exception e) {
		fail("Could not connect to host");
	}
	sshTerm = new SSHTerminal(sshWindow, session, 200, 200);
	sshWindow.addComponent(sshTerm);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:26,代码来源:SSHTerminalTest.java

示例4: setup

import com.vaadin.Application; //导入依赖的package包/类
@SuppressWarnings("serial")
@Before
   public void setup () {
       app = new Application() {
           @Override
           public void init() {}
       };
       sshWindow = new SSHWindow(null, 200, 200);
       client = SshClient.setUpDefaultClient();
       client.start();
       try {
		session = client.connect(testHost, testPort).await().getSession();
	} catch (Exception e) {
		fail("Could not connect to host");
	}
       sshWindow2 = new SSHWindow(session, 200, 200);
       mainWindow = new Window();
       app.setMainWindow(mainWindow);
       app.getMainWindow().addWindow(sshWindow);
       app.getMainWindow().addWindow(sshWindow2);
       
   }
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:23,代码来源:SSHWindowTest.java

示例5: setup

import com.vaadin.Application; //导入依赖的package包/类
@SuppressWarnings("serial")
@Before
public void setup (){     
	normalWindow = new AuthWindow(testHost, testPort);
	noPortWindow = new AuthWindow(testHost, emptyPort);
	noHostWindow = new AuthWindow(emptyHost, testPort);
	emptyWindow = new AuthWindow(emptyHost, emptyPort);
	invalidHostWindow = new AuthWindow(invalidHost, testPort);

	mainWindow = new Window();
	app = new Application() { //Empty Application
		@Override
		public void init() {}
	};
	app.setMainWindow(mainWindow);
	app.getMainWindow().addWindow(normalWindow);
	app.getMainWindow().addWindow(noHostWindow);
	app.getMainWindow().addWindow(noPortWindow);
	app.getMainWindow().addWindow(emptyWindow);
	app.getMainWindow().addWindow(invalidHostWindow);

}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:23,代码来源:AuthWindowTest.java

示例6: createApplication

import com.vaadin.Application; //导入依赖的package包/类
@Override
public Application createApplication(final HttpServletRequest request) throws ServletException {
    if (m_nodeDao == null) {
        throw new RuntimeException("m_nodeDao cannot be null.");
    }
    final NodeMapsApplication app = new NodeMapsApplication();
    app.setNodeDao(m_nodeDao);
    app.setAssetRecordDao(m_assetDao);
    app.setAlarmDao(m_alarmDao);
    app.setGeocoderService(m_geocoder);
    app.setTransactionOperations(m_transaction);
    
    if (m_headerProvider != null) {
        try {
            app.setHeaderHtml(m_headerProvider.getHeaderHtml(request));
        } catch (final Exception e) {
            LogUtils.warnf(this, e, "failed to get header HTML for request " + request.getPathInfo());
        }
    }
    return app;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:22,代码来源:NodeMapsApplicationFactory.java

示例7: createApplication

import com.vaadin.Application; //导入依赖的package包/类
@Override
public Application createApplication(HttpServletRequest request) throws ServletException {
    if (eventProxy == null)
        throw new RuntimeException("eventProxy cannot be null.");
    if (eventConfDao == null)
        throw new RuntimeException("eventConfDao cannot be null.");
    if (dataCollectionDao == null)
        throw new RuntimeException("dataCollectionDao cannot be null.");
    if (mibParser == null)
        throw new RuntimeException("mibParser cannot be null.");
    MibCompilerApplication app = new MibCompilerApplication();
    app.setEventProxy(eventProxy);
    app.setEventConfDao(eventConfDao);
    app.setDataCollectionDao(dataCollectionDao);
    app.setMibParser(mibParser);
    return app;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:18,代码来源:MibCompilerApplicationFactory.java

示例8: init

import com.vaadin.Application; //导入依赖的package包/类
/**
 * Diese Methode wird einmal beim Initialisieren aufgerufen. Dort werden die Konfigurationseinstellungen
 * aus der web.xml gelesen. Darueberhinaus wird ein Spring-Application-Context aus der servletConfig
 * geholt, mit dem es moeglich ist, Beans mit Session-Scope zu erzeugen.
 * 
 * @author Christian Gahlert
 */
@SuppressWarnings("unchecked")
@Override
public void init(ServletConfig servletConfig) throws ServletException {
	super.init(servletConfig);
	
	applicationBean = servletConfig.getInitParameter("applicationBean");
	
	if(applicationBean == null) {
		throw new ServletException("ApplicationBean not specified in servlet parameters");
	}
	
	applicationContext = WebApplicationContextUtils.getWebApplicationContext(servletConfig.getServletContext());
	applicationClass = (Class<? extends Application>) applicationContext.getType(applicationBean);
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:22,代码来源:SpringApplicationServlet.java

示例9: getNewApplication

import com.vaadin.Application; //导入依赖的package包/类
/**
 * Diese Methode gibt eine neue Instanz der vaadinApp-Bean zurueck. Dabei werden die Dependencies anhand
 * des Session-Scopes neu erstellt oder wieder verwendet.
 * 
 * Zusaetzlich ist noch eine Ueberpruefung vorhanden, ob die aufgerufene URL ein ?restartApplication am Ende
 * enthaelt. Dies ermoeglicht das manuelle Neu-Starten der Vaadin-Applikation. Da hierbei jedoch die
 * HTTP-Session nicht neu gestartet wird, bleiben die Spring-Beans erhalten. Um dies zu umgehen, wird
 * hier die HTTP-Session geloescht, falls der ?restartApplication-Parameter mitgegeben wurde.
 * 
 * @author Christian Gahlert
 */
@Override
protected Application getNewApplication(HttpServletRequest request)
		throws ServletException {
	
	if (request.getParameter("restartApplication") != null) {
		try {
			request.getSession().invalidate();
		} catch(Throwable t) {
		}
	}
	
	return (Application) applicationContext.getBean(applicationBean);
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:25,代码来源:SpringApplicationServlet.java

示例10: transactionStart

import com.vaadin.Application; //导入依赖的package包/类
@Override
public synchronized void transactionStart(Application application, Object transactionData) {
	if (application == this) {
		applicationLifecycleManager.transactionStart(this, transactionData);
		// This method is sinchronized to prevent changes to the application from another thread
		// because in this method may be changed the application object
		notificationManager.updateNotifications(this, false);
	}
}
 
开发者ID:frincon,项目名称:openeos,代码行数:10,代码来源:MainApplication.java

示例11: transactionEnd

import com.vaadin.Application; //导入依赖的package包/类
@Override
public synchronized void transactionEnd(Application application, Object transactionData) {
	if (application == this) {
		applicationLifecycleManager.transactionEnd(this, transactionData);
	}

}
 
开发者ID:frincon,项目名称:openeos,代码行数:8,代码来源:MainApplication.java

示例12: URLResource

import com.vaadin.Application; //导入依赖的package包/类
public URLResource(URL url, Application application) {
	this.url = url;
	this.application = application;
	mimeType = URLConnection.guessContentTypeFromName(url.getFile());
	fileName = DigestUtils.md5Hex(url.toString()) + url.toString().substring(url.toString().lastIndexOf("."));
	application.addResource(this);
}
 
开发者ID:frincon,项目名称:openeos,代码行数:8,代码来源:URLResource.java

示例13: getIconPath

import com.vaadin.Application; //导入依赖的package包/类
public static String getIconPath(Application application, Icons icon) {
    if (application != null) {
        String theme = application.getTheme();
        if (theme == null) {
            theme = DEFAULT_THEME;
        }
        return VAADIN_THEMES_PATH + theme + FILE_SEPARATOR + icon.path();
    } else {
        return VAADIN_THEMES_PATH + DEFAULT_THEME + FILE_SEPARATOR + icon.path();
    }
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:12,代码来源:IconUtils.java

示例14: createImageTag

import com.vaadin.Application; //导入依赖的package包/类
public static String createImageTag(Application application, Icons icon, String text) {
    String tag = "<img src=\"" + getIconPath(application, icon) + "\">";
    if (StringUtils.isNotEmpty(text)) {
        tag = tag += "<div>" + text + "</div>";
    }
    return tag;
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:8,代码来源:IconUtils.java

示例15: createApplication

import com.vaadin.Application; //导入依赖的package包/类
@Override
public Application createApplication(HttpServletRequest request) throws ServletException {
       TopologyWidgetTestApplication application = (TopologyWidgetTestApplication) m_blueprintContainer.getComponentInstance(m_beanName);
       application.setHeaderHtml(getHeader(request));
       LoggerFactory.getLogger(getClass()).debug(MessageFormatter.format("created {} for servlet path {}", application, request.getServletPath()).getMessage()/* , new Exception("Show me the stack trace") */);
       return application;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:8,代码来源:TopologyWidgetTestApplicationFactory.java


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