/** * Notifies the presenter that the user has selected an artifact reference. * The presenter will navigate to the artifacts page. * * @param artifact the selected artifact. */ public void onArtifactSelected(ArtifactReference artifact) { PlaceRequest request = new PlaceRequest(NameTokens.ARTIFACTS_PRESENTER); if (artifact != null) { request = request.with(NameTokens.ARTIFACT_REFERENCE_KEY_PARAM, URL.encode(artifact.key())); } _placeManager.revealRelativePlace(request, -1); }
/** * Notifies the presenter that the user has selected an application. The * presenter will load the application details and pass them back to the * view to be displayed. * * @param application the selected application. */ public void onApplicationSelected(Application application) { PlaceRequest request = new PlaceRequest(NameTokens.APPLICATIONS_PRESENTER); if (application != null) { request = request.with(NameTokens.APPLICATION_NAME_PARAM, URL.encode(application.getName())); } _placeManager.revealRelativePlace(request, -1); }
/** * Navigates to the application page, displaying the details of the * application. * * @param application the selected application */ public void onApplicationSelected(Application application) { if (application == null) { Console.error(Singleton.MESSAGES.error_navigateToApplication()); return; } _placeManager.revealRelativePlace( new PlaceRequest(NameTokens.APPLICATIONS_PRESENTER).with(NameTokens.APPLICATION_NAME_PARAM, URL.encode(application.getName())), -1); }
/** * Notifies the presenter that the user has selected a reference. The * presenter will load the reference details and pass them back to the view * to be displayed. * * @param reference the selected reference. */ public void onReferenceSelected(Reference reference) { PlaceRequest request = new PlaceRequest(NameTokens.REFERENCES_PRESENTER); if (reference != null && reference.getName() != null) { request = request.with(NameTokens.REFERENCE_NAME_PARAM, URL.encode(reference.getName())); if (reference.getApplication() != null) { request = request.with(NameTokens.APPLICATION_NAME_PARAM, URL.encode(reference.getApplication())); } } _placeManager.revealRelativePlace(request, -1); }
/** * Notifies the presenter that the user wishes to view details about a * specific service. * * @param service the service. * @param application the application containing the service. */ public void onNavigateToService(Service service, Application application) { if (service == null || application == null) { Console.error(Singleton.MESSAGES.error_navigateToService()); return; } _placeManager.revealRelativePlace( new PlaceRequest(NameTokens.SERVICES_PRESENTER).with(NameTokens.SERVICE_NAME_PARAM, URL.encode(service.getName())).with(NameTokens.APPLICATION_NAME_PARAM, URL.encode(application.getName())), -1); }
/** * Notifies the presenter that the user has selected a service. The * presenter will load the service details and pass them back to the view to * be displayed. * * @param service the selected service. */ public void onServiceSelected(Service service) { PlaceRequest request = new PlaceRequest(NameTokens.SERVICES_PRESENTER); if (service != null && service.getName() != null) { request = request.with(NameTokens.SERVICE_NAME_PARAM, URL.encode(service.getName())); if (service.getApplication() != null) { request = request.with(NameTokens.APPLICATION_NAME_PARAM, URL.encode(service.getApplication())); } } _placeManager.revealRelativePlace(request, -1); }
/** * Notifies the presenter that the user wishes to view details about a * specific reference. * * @param reference the reference. * @param application the application containing the reference. */ public void onNavigateToReference(Reference reference, Application application) { if (reference == null || application == null) { Console.error(Singleton.MESSAGES.error_navigateToReference()); return; } _placeManager.revealRelativePlace( new PlaceRequest(NameTokens.REFERENCES_PRESENTER).with(NameTokens.REFERENCE_NAME_PARAM, URL.encode(reference.getName())).with(NameTokens.APPLICATION_NAME_PARAM, URL.encode(application.getName())), -1); }
/** * Notifies the presenter that the user wishes to view details about a * specific extension. The presenter will load the details and pass them * back to the view to be displayed. * * @param extension the selected extension. */ public void onExtensionSelected(Component extension) { clearExtensionContent(); Builder requestBuilder = new Builder().nameToken(NameTokens.SYSTEM_CONFIG_PRESENTER); if (_componentName != null) { requestBuilder.with(NameTokens.COMPONENT_NAME_PARAM, URL.encode(_componentName)); } if (extension != null) { requestBuilder.with(NameTokens.EXTENSION_NAME_PARAM, URL.encode(extension.getName())); } _placeManager.revealRelativePlace(requestBuilder.build(), -1); }
/** * Notifies the presenter that the user wishes to view details about a * specific component. The presenter will load the details and pass them * back to the view to be displayed. * * @param component the selected component. */ public void onComponentSelected(Component component) { clearComponentContent(); Builder requestBuilder = new Builder().nameToken(NameTokens.SYSTEM_CONFIG_PRESENTER); if (_extensionName != null) { requestBuilder.with(NameTokens.EXTENSION_NAME_PARAM, URL.encode(_extensionName)); } if (component != null) { requestBuilder.with(NameTokens.COMPONENT_NAME_PARAM, URL.encode(component.getName())); } _placeManager.revealRelativePlace(requestBuilder.build(), -1); }
@Override public void onChangeUser(final ChangeUserEvent pevent) { if (tokenEquals(placeManager.getCurrentPlaceRequest().getNameToken(), logoutToken)) { final PlaceRequest loginPlaceRequest = new PlaceRequest.Builder().nameToken(loginToken).build(); placeManager.revealPlace(loginPlaceRequest); } else { if (placeManager.getHierarchyDepth() > 1) { placeManager.revealRelativePlace(-1); } else if (tokenEquals(placeManager.getCurrentPlaceRequest().getNameToken(), loginToken) && pevent.getUser() != null && pevent.getUser().isLoggedIn()) { placeManager.revealDefaultPlace(); } else if (pevent.getUser() == null || !pevent.getUser().isLoggedIn()) { // user not logged in, load page once again, maybe we are no longer allowed to see placeManager.revealCurrentPlace(); } } navigationStructure.buildVisibleNavigation(pevent.getUser()); getView().createNavigation(navigationStructure); }
@Override public void onChangeUser(final ChangeUserEvent pevent) { if (tokenEquals(placeManager.getCurrentPlaceRequest().getNameToken(), logoutToken)) { final PlaceRequest loginPlaceRequest = new PlaceRequest.Builder().nameToken(loginToken).build(); placeManager.revealPlace(loginPlaceRequest); } else { if (placeManager.getHierarchyDepth() > 1) { placeManager.revealRelativePlace(-1); } else if (tokenEquals(placeManager.getCurrentPlaceRequest().getNameToken(), loginToken) && pevent.getUser() != null && pevent.getUser().isLoggedIn()) { placeManager.revealDefaultPlace(); } else if (pevent.getUser() == null || !pevent.getUser().isLoggedIn()) { // user not logged in, load page once again, maybe we are no longer allowed to see placeManager.revealCurrentPlace(); } } navigationStructure.buildVisibleNavigation(pevent.getUser()); getView().createNavigation(navigationStructure); }