Search in sources :

Example 1 with PerspectiveActivity

use of org.uberfire.client.mvp.PerspectiveActivity in project kie-wb-common by kiegroup.

the class WorkbenchConfigurationPopup method refreshPerspective.

private void refreshPerspective() {
    final PerspectiveActivity currentPerspective = perspectiveManager.getCurrentPerspective();
    perspectiveManager.removePerspectiveStates(new org.uberfire.mvp.Command() {

        @Override
        public void execute() {
            if (currentPerspective != null) {
                final PlaceRequest pr = new ForcedPlaceRequest(currentPerspective.getIdentifier(), currentPerspective.getPlace().getParameters());
                placeManager.goTo(pr);
            }
        }
    });
}
Also used : ForcedPlaceRequest(org.uberfire.mvp.impl.ForcedPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) ForcedPlaceRequest(org.uberfire.mvp.impl.ForcedPlaceRequest) PerspectiveActivity(org.uberfire.client.mvp.PerspectiveActivity)

Example 2 with PerspectiveActivity

use of org.uberfire.client.mvp.PerspectiveActivity in project kie-wb-common by kiegroup.

the class DefaultWorkbenchFeaturesMenusHelper method getPerspectivesMenuItems.

public List<MenuItem> getPerspectivesMenuItems() {
    final List<MenuItem> perspectives = new ArrayList<>();
    for (final PerspectiveActivity perspective : getPerspectiveActivities()) {
        final String name = perspective.getDefaultPerspectiveLayout().getName();
        final MenuItem item = newSimpleItem(name).perspective(perspective.getIdentifier()).endMenu().build().getItems().get(0);
        perspectives.add(item);
    }
    return perspectives;
}
Also used : PerspectiveActivity(org.uberfire.client.mvp.PerspectiveActivity) ArrayList(java.util.ArrayList) MenuItem(org.uberfire.workbench.model.menu.MenuItem)

Aggregations

PerspectiveActivity (org.uberfire.client.mvp.PerspectiveActivity)2 ArrayList (java.util.ArrayList)1 PlaceRequest (org.uberfire.mvp.PlaceRequest)1 ForcedPlaceRequest (org.uberfire.mvp.impl.ForcedPlaceRequest)1 MenuItem (org.uberfire.workbench.model.menu.MenuItem)1