congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
PerspectiveManager.switchToPerspective
Code IndexAdd Tabnine to your IDE (free)

How to use
switchToPerspective
method
in
org.uberfire.client.mvp.PerspectiveManager

Best Java code snippets using org.uberfire.client.mvp.PerspectiveManager.switchToPerspective (Showing top 11 results out of 315)

origin: kiegroup/appformer

private void switchToPerspective(final PlaceRequest place,
                 final PerspectiveActivity newPerspectiveActivity,
                 final ParameterizedCommand<PerspectiveDefinition> closeOldPerspectiveOpenPartsAndExecuteChainedCallback) {
  if (closeAllCurrentPanels()) {
    closeAllSplashScreens();
    addSplashScreenFor(place);
    perspectiveManager.switchToPerspective(place,
                        newPerspectiveActivity,
                        closeOldPerspectiveOpenPartsAndExecuteChainedCallback);
  } else {
    // some panels didn't want to close, so not going to launch new perspective. clean up its activity.
    try {
      newPerspectiveActivity.onClose();
    } catch (Exception ex) {
      lifecycleErrorHandler.handle(newPerspectiveActivity,
                     LifecyclePhase.OPEN,
                     ex);
    }
    existingWorkbenchActivities.remove(newPerspectiveActivity.getPlace());
    activityManager.destroyActivity(newPerspectiveActivity);
  }
}
origin: org.uberfire/uberfire-workbench-client

@Test
public void testSwitchingFromPerspectiveToSelf() throws Exception {
  PerspectiveActivity ozPerspectiveActivity = mock(PerspectiveActivity.class);
  PlaceRequest ozPerspectivePlace = new DefaultPlaceRequest("oz_perspective");
  PerspectiveDefinition ozPerspectiveDef = new PerspectiveDefinitionImpl();
  when(activityManager.getActivities(ozPerspectivePlace))
      .thenReturn(singleton((Activity) ozPerspectiveActivity));
  when(ozPerspectiveActivity.getDefaultPerspectiveLayout()).thenReturn(ozPerspectiveDef);
  when(ozPerspectiveActivity.getPlace()).thenReturn(ozPerspectivePlace);
  when(ozPerspectiveActivity.isType(ActivityResourceType.PERSPECTIVE.name())).thenReturn(true);
  when(ozPerspectiveActivity.getIdentifier()).thenReturn("oz_perspective");
  // we'll pretend we started in oz
  when(perspectiveManager.getCurrentPerspective()).thenReturn(ozPerspectiveActivity);
  final BiParameterizedCommand<Command, PlaceRequest> closeChain = mock(BiParameterizedCommand.class);
  placeManager.registerPerspectiveCloseChain("oz_perspective",
                        closeChain);
  placeManager.goTo(ozPerspectivePlace);
  verify(closeChain,
      never()).execute(any(), any());
  // verify no side effects (should stay put)
  verify(ozPerspectiveActivity,
      never()).onOpen();
  verify(perspectiveManager,
      never()).savePerspectiveState(any(Command.class));
  verify(perspectiveManager,
      never())
      .switchToPerspective(any(PlaceRequest.class),
                 any(PerspectiveActivity.class),
                 any(ParameterizedCommand.class));
}
origin: kiegroup/appformer

@Test
public void testSwitchingFromPerspectiveToSelf() throws Exception {
  PerspectiveActivity ozPerspectiveActivity = mock(PerspectiveActivity.class);
  PlaceRequest ozPerspectivePlace = new DefaultPlaceRequest("oz_perspective");
  PerspectiveDefinition ozPerspectiveDef = new PerspectiveDefinitionImpl();
  when(activityManager.getActivities(ozPerspectivePlace))
      .thenReturn(singleton((Activity) ozPerspectiveActivity));
  when(ozPerspectiveActivity.getDefaultPerspectiveLayout()).thenReturn(ozPerspectiveDef);
  when(ozPerspectiveActivity.getPlace()).thenReturn(ozPerspectivePlace);
  when(ozPerspectiveActivity.isType(ActivityResourceType.PERSPECTIVE.name())).thenReturn(true);
  when(ozPerspectiveActivity.getIdentifier()).thenReturn("oz_perspective");
  // we'll pretend we started in oz
  when(perspectiveManager.getCurrentPerspective()).thenReturn(ozPerspectiveActivity);
  final BiParameterizedCommand<Command, PlaceRequest> closeChain = mock(BiParameterizedCommand.class);
  placeManager.registerPerspectiveCloseChain("oz_perspective",
                        closeChain);
  placeManager.goTo(ozPerspectivePlace);
  verify(closeChain,
      never()).execute(any(), any());
  // verify no side effects (should stay put)
  verify(ozPerspectiveActivity,
      never()).onOpen();
  verify(perspectiveManager,
      never()).savePerspectiveState(any(Command.class));
  verify(perspectiveManager,
      never())
      .switchToPerspective(any(PlaceRequest.class),
                 any(PerspectiveActivity.class),
                 any(ParameterizedCommand.class));
}
origin: org.uberfire/uberfire-workbench-client

verify(perspectiveManager).switchToPerspective(any(PlaceRequest.class),
                        eq(ozPerspectiveActivity),
                        any(ParameterizedCommand.class));
origin: org.uberfire/uberfire-workbench-client

/**
 * Tests the basics of launching a perspective. We call it "empty" because this perspective doesn't have any panels
 * or parts in its definition.
 */
@Test
public void testLaunchingEmptyPerspective() throws Exception {
  PerspectiveActivity ozPerspectiveActivity = mock(PerspectiveActivity.class);
  PlaceRequest ozPerspectivePlace = new DefaultPlaceRequest("oz_perspective");
  PerspectiveDefinition ozPerspectiveDef = new PerspectiveDefinitionImpl();
  when(activityManager.getActivities(ozPerspectivePlace))
      .thenReturn(singleton((Activity) ozPerspectiveActivity));
  when(ozPerspectiveActivity.getDefaultPerspectiveLayout()).thenReturn(ozPerspectiveDef);
  when(ozPerspectiveActivity.getPlace()).thenReturn(ozPerspectivePlace);
  when(ozPerspectiveActivity.isType(ActivityResourceType.PERSPECTIVE.name())).thenReturn(true);
  placeManager.goTo(ozPerspectivePlace);
  // verify perspective changed to oz
  verify(perspectiveManager).savePerspectiveState(any(Command.class));
  verify(perspectiveManager).switchToPerspective(any(PlaceRequest.class),
                          eq(ozPerspectiveActivity),
                          any(ParameterizedCommand.class));
  verify(ozPerspectiveActivity).onOpen();
  assertEquals(PlaceStatus.OPEN,
         placeManager.getStatus(ozPerspectivePlace));
  assertTrue(placeManager.getActivePlaceRequests().contains(ozPerspectivePlace));
  assertEquals(ozPerspectiveActivity,
         placeManager.getActivity(ozPerspectivePlace));
  verify(workbenchLayout).onResize();
}
origin: kiegroup/appformer

verify(perspectiveManager).switchToPerspective(any(PlaceRequest.class),
                        eq(ozPerspectiveActivity),
                        any(ParameterizedCommand.class));
origin: kiegroup/appformer

/**
 * Tests the basics of launching a perspective. We call it "empty" because this perspective doesn't have any panels
 * or parts in its definition.
 */
@Test
public void testLaunchingEmptyPerspective() throws Exception {
  PerspectiveActivity ozPerspectiveActivity = mock(PerspectiveActivity.class);
  PlaceRequest ozPerspectivePlace = new DefaultPlaceRequest("oz_perspective");
  PerspectiveDefinition ozPerspectiveDef = new PerspectiveDefinitionImpl();
  when(activityManager.getActivities(ozPerspectivePlace))
      .thenReturn(singleton((Activity) ozPerspectiveActivity));
  when(ozPerspectiveActivity.getDefaultPerspectiveLayout()).thenReturn(ozPerspectiveDef);
  when(ozPerspectiveActivity.getPlace()).thenReturn(ozPerspectivePlace);
  when(ozPerspectiveActivity.isType(ActivityResourceType.PERSPECTIVE.name())).thenReturn(true);
  placeManager.goTo(ozPerspectivePlace);
  // verify perspective changed to oz
  verify(perspectiveManager).savePerspectiveState(any(Command.class));
  verify(perspectiveManager).switchToPerspective(any(PlaceRequest.class),
                          eq(ozPerspectiveActivity),
                          any(ParameterizedCommand.class));
  verify(ozPerspectiveActivity).onOpen();
  assertEquals(PlaceStatus.OPEN,
         placeManager.getStatus(ozPerspectivePlace));
  assertTrue(placeManager.getActivePlaceRequests().contains(ozPerspectivePlace));
  assertEquals(ozPerspectiveActivity,
         placeManager.getActivity(ozPerspectivePlace));
  verify(workbenchLayout).onResize();
}
origin: org.uberfire/uberfire-workbench-client

    return null;
}).when(perspectiveManager).switchToPerspective(any(PlaceRequest.class),
                        any(PerspectiveActivity.class),
                        any(ParameterizedCommand.class));
origin: kiegroup/appformer

    return null;
}).when(perspectiveManager).switchToPerspective(any(PlaceRequest.class),
                        any(PerspectiveActivity.class),
                        any(ParameterizedCommand.class));
origin: org.uberfire/uberfire-workbench-client

verify(perspectiveManager).savePerspectiveState(any(Command.class));
verify(perspectiveManager)
    .switchToPerspective(any(PlaceRequest.class),
        any(PerspectiveActivity.class),
        any(ParameterizedCommand.class));
origin: kiegroup/appformer

verify(perspectiveManager).savePerspectiveState(any(Command.class));
verify(perspectiveManager)
    .switchToPerspective(any(PlaceRequest.class),
        any(PerspectiveActivity.class),
        any(ParameterizedCommand.class));
org.uberfire.client.mvpPerspectiveManagerswitchToPerspective

Javadoc

This method should only be invoked by PlaceManager. To launch a perspective within an UberFire app, pass a PlaceRequest for that perspective to PlaceManager#goTo(org.uberfire.mvp.PlaceRequest).

Closes all current panels in the PanelManager (they must have already had their parts removed), then builds up the new panel arrangement based on the PerspectiveDefinition associated with the given perspective activity. If the given perspective is transient, its default perspective definition will always be used. Otherwise, the PerspectiveManager will first attempt to retrieve the current user's saved PerspectiveDefinition from the server, falling back on the default if none is found.

Popular methods of PerspectiveManager

  • getCurrentPerspective
  • savePerspectiveState
  • getCurrentPerspectivePlaceRequest
  • getLivePerspectiveDefinition
  • removePerspectiveStates
  • getDefaultPerspectiveIdentifier

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now