use of org.uberfire.mvp.impl.PathPlaceRequest in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphEditorPresenterTest method getPresenter.
@Override
protected GuidedDecisionTableGraphEditorPresenter getPresenter() {
return new GuidedDecisionTableGraphEditorPresenter(view, dtServiceCaller, docks, mock(PerspectiveManager.class), dtGraphServiceCaller, moduleServiceCaller, graphSaveAndRenameServiceCaller, notification, saveInProgressEvent, decisionTableSelectedEvent, mock(GuidedDecisionTableDocksHandler.class), analysisReportScreen, validationPopup, dtGraphResourceType, editMenuBuilder, viewMenuBuilder, insertMenuBuilder, radarMenuBuilder, modeller, helper, beanManager, placeManager, lockManager, columnsPage, saveAndRenameCommandBuilder, alertsButtonMenuItemBuilder, downloadMenuItemBuilder, editorSearchIndex, searchBarComponent, searchableElementFactory, searchPerformed) {
{
workbenchContext = GuidedDecisionTableGraphEditorPresenterTest.this.workbenchContext;
projectController = GuidedDecisionTableGraphEditorPresenterTest.this.projectController;
promises = GuidedDecisionTableGraphEditorPresenterTest.this.promises;
}
@Override
protected Command getSaveAndRenameCommand() {
return mock(Command.class);
}
@Override
PathPlaceRequest getPathPlaceRequest(final Path path) {
// Avoid use of IOC.getBeanManager().lookupBean(..) in PathPlaceRequest for Unit Tests
final PathPlaceRequest pathPlaceRequest = new PathPlaceRequest(path) {
@Override
protected ObservablePath createObservablePath(final Path path) {
final ObservablePath op = new ObservablePathImpl().wrap(path);
return op;
}
};
return pathPlaceRequest;
}
};
}
use of org.uberfire.mvp.impl.PathPlaceRequest in project kie-wb-common by kiegroup.
the class NewFormDefinitionlHandler method create.
@Override
public void create(org.guvnor.common.services.project.model.Package pkg, String baseFileName, final NewResourcePresenter presenter) {
BusyPopup.showMessage(translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse));
modelerService.call(path -> {
BusyPopup.close();
presenter.complete();
notifySuccess();
PlaceRequest place = new PathPlaceRequest((Path) path, "FormEditor");
placeManager.goTo(place);
}, (message, throwable) -> {
BusyPopup.close();
ErrorPopup.showMessage(CommonConstants.INSTANCE.SorryAnItemOfThatNameAlreadyExistsInTheRepositoryPleaseChooseAnother());
return false;
}).createForm(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), formModelsPresenter.getFormModel());
}
use of org.uberfire.mvp.impl.PathPlaceRequest in project kie-wb-common by kiegroup.
the class AbstractProjectDiagramEditor method onLoadError.
private void onLoadError(final ClientRuntimeError error) {
showError(error);
// close editor in case of error when opening the editor
placeManager.forceClosePlace(new PathPlaceRequest(versionRecordManager.getCurrentPath(), getEditorIdentifier()));
}
use of org.uberfire.mvp.impl.PathPlaceRequest in project kie-wb-common by kiegroup.
the class ClientProjectOpenReusableSubprocessService method openReusableSubprocess.
public void openReusableSubprocess(List<String> processData) {
PlaceRequest placeRequestImpl = new PathPlaceRequest(// "test.bpmn"
PathFactory.newPathBasedOn(// "test.bpmn"
processData.get(0), // "default://master@testSpace/ProjectTest/src/main/resources/com/test.bpmn"
processData.get(1), // not really used
new PathFactory.PathImpl()));
placeRequestImpl.addParameter("uuid", processData.get(1));
placeRequestImpl.addParameter("profile", "jbpm");
this.placeManager.goTo(placeRequestImpl);
}
use of org.uberfire.mvp.impl.PathPlaceRequest in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method setup.
@Before
public void setup() {
when(user.getIdentifier()).thenReturn("user");
when(sessionInfo.getIdentity()).thenReturn(user);
when(libraryPerspective.getPlace()).thenReturn(LIBRARY_PERSPECTIVE_PLACE_REQUEST);
when(otherPerspective.getPlace()).thenReturn(OTHER_PERSPECTIVE_PLACE_REQUEST);
windowParameters = new HashMap<>();
libraryServiceCaller = new CallerMock<>(libraryService);
vfsServiceCaller = new CallerMock<>(vfsService);
repositoryServiceCaller = new CallerMock<>(repositoryService);
organizationalUnitServiceCaller = new CallerMock<>(organizationalUnitService);
libraryBreadcrumbs = spy(new LibraryBreadcrumbs(breadcrumbs, translationUtils, ts, resourceUtils, projectBranchBreadcrumb));
libraryPlaces = spy(new LibraryPlaces(breadcrumbs, ts, assetDetailEvent, libraryServiceCaller, new CallerMock<>(projectService), new CallerMock<>(moduleService), placeManager, projectContext, projectContextChangeEvent, notificationEvent, translationUtils, vfsServiceCaller, importRepositoryPopUpPresenters, assetListUpdateEvent, closeUnsavedProjectAssetsPopUpPresenter, projectsSetupEvent, libraryBreadcrumbs, sessionInfo, repositoryServiceCaller, new SyncPromises(), mock(OrganizationalUnitController.class), organizationalUnitServiceCaller, logger, cookie, perspectiveManager) {
@Override
protected Map<String, List<String>> getParameterMap() {
return windowParameters;
}
});
doNothing().when(libraryPlaces).expose();
libraryPlaces.setup();
libraryPlaces.init(mock(LibraryPerspective.class));
activeOrganizationalUnit = mock(OrganizationalUnit.class);
activeSpace = mock(Space.class);
activeRepository = mock(Repository.class);
activeBranch = new Branch("main", mock(Path.class));
activeModule = mock(Module.class);
doReturn(Optional.of(activeOrganizationalUnit)).when(projectContext).getActiveOrganizationalUnit();
activeProject = new WorkspaceProject(activeOrganizationalUnit, activeRepository, activeBranch, activeModule);
doReturn(Optional.of(activeProject)).when(projectContext).getActiveWorkspaceProject();
doReturn(Optional.of(activeModule)).when(projectContext).getActiveModule();
doReturn(Optional.empty()).when(projectContext).getActiveRepositoryRoot();
doReturn(Optional.empty()).when(projectContext).getActivePackage();
when(current.getOrganizationalUnit()).thenReturn(activeOrganizationalUnit);
when(current.getWorkspaceProject()).thenReturn(activeProject);
when(current.getModule()).thenReturn(activeModule);
when(activeOrganizationalUnit.getSpace()).thenReturn(activeSpace);
when(activeRepository.getAlias()).thenReturn("repository");
when(activeRepository.getIdentifier()).thenReturn("repository");
when(activeRepository.getSpace()).thenReturn(activeSpace);
final URIStructureExplorerModel model = mock(URIStructureExplorerModel.class);
doReturn(mock(Repository.class)).when(model).getRepository();
doReturn(mock(Module.class)).when(model).getModule();
doReturn(mock(Path.class)).when(vfsService).get(any());
final PathPlaceRequest pathPlaceRequest = mock(PathPlaceRequest.class);
doReturn(mock(ObservablePath.class)).when(pathPlaceRequest).getPath();
doReturn(pathPlaceRequest).when(libraryPlaces).createPathPlaceRequest(any());
doReturn(importRepositoryPopUpPresenter).when(importRepositoryPopUpPresenters).get();
lastSpaceCookie = user.getIdentifier() + "_lastSpace";
lastProjectCookie = user.getIdentifier() + "_lastProject";
lastBranchCookie = user.getIdentifier() + "_" + activeProject.getName() + "_lastBranch";
doReturn("").when(cookie).get(any());
}
Aggregations