當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewChangeEvent類代碼示例

本文整理匯總了Java中com.vaadin.navigator.ViewChangeListener.ViewChangeEvent的典型用法代碼示例。如果您正苦於以下問題:Java ViewChangeEvent類的具體用法?Java ViewChangeEvent怎麽用?Java ViewChangeEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ViewChangeEvent類屬於com.vaadin.navigator.ViewChangeListener包,在下文中一共展示了ViewChangeEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fireViewOnShow

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * Fire {@link OnShow} view methods
 * @param view View instance (not null)
 * @param configuration View configuration (not null)
 * @param event View change event
 * @param refresh <code>true</code> if is a page refresh
 * @throws ViewConfigurationException Error invoking view methods
 */
public static <E extends ViewChangeEvent & ViewNavigatorChangeEvent> void fireViewOnShow(View view,
		ViewConfiguration configuration, E event, boolean refresh) throws ViewConfigurationException {
	if (view == null) {
		throw new ViewConfigurationException("Null view instance");
	}
	if (configuration == null) {
		throw new ViewConfigurationException("Missing view configuration");
	}

	for (Method method : configuration.getOnShowMethods()) {
		if (!refresh || configuration.isFireOnRefresh(method)) {
			try {
				if (method.getParameterCount() == 0) {
					method.invoke(view, new Object[0]);
				} else {
					method.invoke(view, new Object[] { event });
				}
			} catch (Exception e) {
				throw new ViewConfigurationException("Failed to fire OnShow method " + method.getName()
						+ " on view class " + view.getClass().getName(), e);
			}
		}
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:33,代碼來源:ViewNavigationUtils.java

示例2: fireViewOnLeave

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * Fire {@link OnLeave} view methods
 * @param view View instance (not null)
 * @param configuration View configuration (not null)
 * @param event View change event
 * @throws ViewConfigurationException Error invoking view methods
 */
public static <E extends ViewChangeEvent & ViewNavigatorChangeEvent> void fireViewOnLeave(View view,
		ViewConfiguration configuration, E event) throws ViewConfigurationException {
	if (view == null) {
		throw new ViewConfigurationException("Null view instance");
	}
	if (configuration == null) {
		throw new ViewConfigurationException("Missing view configuration");
	}

	for (Method method : configuration.getOnLeaveMethods()) {
		try {
			if (method.getParameterCount() == 0) {
				method.invoke(view, new Object[0]);
			} else {
				method.invoke(view, new Object[] { event });
			}
		} catch (Exception e) {
			throw new ViewConfigurationException("Failed to fire OnLeave method " + method.getName()
					+ " on view class " + view.getClass().getName(), e);
		}
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:30,代碼來源:ViewNavigationUtils.java

示例3: checkViewOnShowOrLeaveMethod

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * Check given method has a valid signature for {@link OnShow} or {@link OnLeave} view method
 * @param viewClass View class
 * @param method Method to check
 * @param message Error message annotation description
 * @throws ViewConfigurationException Method is not valid
 */
private static void checkViewOnShowOrLeaveMethod(Class<?> viewClass, Method method, String message)
		throws ViewConfigurationException {
	if (method.getReturnType() != Void.class && method.getReturnType() != Void.TYPE) {
		throw new ViewConfigurationException("Invalid " + message + " method in view class " + viewClass.getName()
				+ ": method must be a void return method");
	}
	int params = method.getParameterCount();
	if (params > 1) {
		throw new ViewConfigurationException("Invalid " + message + " method in view class " + viewClass.getName()
				+ ": method must have no parameters or only one parameter of type ViewChangeEvent");
	}
	if (params == 1) {
		Parameter param = method.getParameters()[0];
		if (param.isVarArgs() || !(ViewChangeEvent.class.isAssignableFrom(param.getType())
				|| ViewNavigatorChangeEvent.class.isAssignableFrom(param.getType()))) {
			throw new ViewConfigurationException(
					"Invalid " + message + " method in view class " + viewClass.getName()
							+ ": method must have no parameters or only one parameter of type ViewChangeEvent");
		}
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:29,代碼來源:ViewNavigationUtils.java

示例4: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的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)));
}
 
開發者ID:vianneyfaivre,項目名稱:Persephone,代碼行數:19,代碼來源:EndpointsPage.java

示例5: fireViewOnLeave

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * Fire {@link OnLeave} view methods
 * @param <E> Actual event type
 * @param view View instance (not null)
 * @param configuration View configuration (not null)
 * @param event View change event
 * @throws ViewConfigurationException Error invoking view methods
 */
public static <E extends ViewChangeEvent & ViewNavigatorChangeEvent> void fireViewOnLeave(View view,
		ViewConfiguration configuration, E event) throws ViewConfigurationException {
	if (view == null) {
		throw new ViewConfigurationException("Null view instance");
	}
	if (configuration == null) {
		throw new ViewConfigurationException("Missing view configuration");
	}

	for (Method method : configuration.getOnLeaveMethods()) {
		try {
			if (method.getParameterCount() == 0) {
				method.invoke(view, new Object[0]);
			} else {
				method.invoke(view, new Object[] { event });
			}
		} catch (Exception e) {
			throw new ViewConfigurationException("Failed to fire OnLeave method " + method.getName()
					+ " on view class " + view.getClass().getName(), e);
		}
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin,代碼行數:31,代碼來源:ViewNavigationUtils.java

示例6: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
 */
@Override
public void enter(ViewChangeEvent event) {		
	cptMin = candidatController.getCompteMinima();
	if (cptMin==null){
		return;
	}
	String lockError = candidatController.getLockError(cptMin, ConstanteUtils.LOCK_ODF);
	if (lockError!=null){
		isLocked = true;
		lockLabel.setVisible(true);
		return;
	}		
	lockLabel.setVisible(false);
	isLocked = false;
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:19,代碼來源:OffreFormationView.java

示例7: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
 */
@Override
public void enter(ViewChangeEvent event) {
	userController.validSecurityUserCptMin();
	restResultParam = event.getParameters();
	if (restResultParam==null || restResultParam.equals("") || restResultParam.equals(ConstanteUtils.REST_VALID_ERROR)){
		restResultParam = ConstanteUtils.REST_VALID_ERROR;
	}		
	
	if (userController.isCandidat() && (restResultParam.equals(ConstanteUtils.REST_VALID_ALREADY_VALID) || restResultParam.equals(ConstanteUtils.REST_VALID_SUCCESS))){
		connexionLayout.setVisible(false);
		((MainUI) UI.getCurrent()).constructMainMenu();
	}else if (restResultParam.equals(ConstanteUtils.REST_VALID_ALREADY_VALID) || restResultParam.equals(ConstanteUtils.REST_VALID_SUCCESS)){
		connexionLayout.setVisible(true);
	}else{
		connexionLayout.setVisible(false);
	}
	updateLangue(cacheController.getLangueDefault());
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:22,代碼來源:CandidatCompteMinimaView.java

示例8: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
@Override
public void enter(ViewChangeEvent event) {
	// set the view form product value
	viewForm.setValue(
			// load product using id parameter
			datastore.query().target(DataTarget.named("products")).filter(MProduct.ID.eq(id))
					.findOne(MProduct.PRODUCT)
					// throw an exception if not found
					.orElseThrow(() -> new DataAccessException("Product not found: " + id)));
}
 
開發者ID:holon-platform,項目名稱:holon-examples,代碼行數:11,代碼來源:View.java

示例9: preAfterViewChange

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
public void preAfterViewChange(ViewChangeEvent event) {
	// fire OnShow on new view
	if (event.getNewView() != null) {
		ViewConfiguration configuration = getViewConfiguration(event.getNewView().getClass());
		if (configuration != null) {
			ViewNavigationUtils.fireViewOnShow(event.getNewView(), configuration,
					DefaultViewNavigatorChangeEvent.create(event, previousViewName, navigator,
							getViewWindow(buildNavigationState(event.getViewName(), event.getParameters()))),
					false);
		} else {
			LOGGER.warn("Failed to obtain ViewConfiguration for view class " + event.getOldView().getClass()
					+ ": OnShow methods firing skipped");
		}
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin,代碼行數:16,代碼來源:NavigatorActuator.java

示例10: preAfterViewChange

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
public void preAfterViewChange(ViewChangeEvent event) {
	// fire OnShow on new view
	if (event.getNewView() != null) {
		ViewConfiguration configuration = getViewConfiguration(event.getNewView().getClass());
		if (configuration != null) {
			ViewNavigationUtils.fireViewOnShow(event.getNewView(), configuration,
					DefaultViewNavigatorChangeEvent.create(event, navigator,
							getViewWindow(buildNavigationState(event.getViewName(), event.getParameters()))),
					false);
		} else {
			LOGGER.warn("Failed to obtain ViewConfiguration for view class " + event.getOldView().getClass()
					+ ": OnShow methods firing skipped");
		}
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:16,代碼來源:NavigatorActuator.java

示例11: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
 */
@Override
public void enter(ViewChangeEvent event) {
	
	if (majView(applicationContext.getMessage("stage.title", null, UI.getCurrent().getLocale()), true,  ConstanteUtils.LOCK_STAGE)){
		majComponents();
	}
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:11,代碼來源:CandidatStageView.java

示例12: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
 */
@Override
public void enter(ViewChangeEvent event) {
	if (majView(applicationContext.getMessage("infoperso.title", null, UI.getCurrent().getLocale()), false,  ConstanteUtils.LOCK_INFOS_PERSO)){
		majComponentsInfoPerso(candidat);
	}
	if (isLectureSeule || isArchive){
		changeContactBtn.setVisible(false);
	}
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:13,代碼來源:CandidatInfoPersoView.java

示例13: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
 */
@Override
public void enter(ViewChangeEvent event) {
	Authentication auth = userController.getCurrentAuthentication();
	setTxtMessageAccueil(auth);
	refreshLayoutConnexion(auth);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:10,代碼來源:CandidatCreerCompteView.java

示例14: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
 */
@Override
public void enter(ViewChangeEvent event) {
	if (majView(applicationContext.getMessage("formationpro.title", null, UI.getCurrent().getLocale()), true,  ConstanteUtils.LOCK_FORMATION_PRO)){
		majComponents();
	}
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:10,代碼來源:CandidatFormationProView.java

示例15: enter

import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; //導入依賴的package包/類
/**
 * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
 */
@Override
public void enter(ViewChangeEvent event) {
	String title;
	if(parametreController.getIsGetCursusInterne()){
		title = applicationContext.getMessage("cursusexterne.title", null, UI.getCurrent().getLocale());
	}else{
		title = applicationContext.getMessage("cursusexterne.title.withoutCursusInterne", null, UI.getCurrent().getLocale());
	}
	if (majView(title, true,  ConstanteUtils.LOCK_CURSUS_EXTERNE)){
		majComponentsPostBac(candidat.getCandidatCursusPostBacs());
	}
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:16,代碼來源:CandidatCursusExterneView.java


注:本文中的com.vaadin.navigator.ViewChangeListener.ViewChangeEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。