Package org.uberfire.mvp

Examples of org.uberfire.mvp.PlaceRequest


    public PlaceRequest getPlaceRequest( String fullIdentifier ) {
        final String identifier = fullIdentifier.contains( "?" ) ? fullIdentifier.substring( 0, fullIdentifier.indexOf( "?" ) ) : fullIdentifier;
        final String query = fullIdentifier.contains( "?" ) ? fullIdentifier.substring( fullIdentifier.indexOf( "?" ) + 1 ) : "";
        final Map<String, String> parameters = getParameters( query );

        final PlaceRequest placeRequest;
        if ( parameters.containsKey( "path_uri" ) ) {
            if ( parameters.containsKey( "has_version_support" ) ) {
                placeRequest = new PathPlaceRequest( PathFactory.newPath( parameters.remove( "file_name" ), parameters.remove( "path_uri" ), new HashMap<String, Object>() {{
                    put( PathFactory.VERSION_PROPERTY, Boolean.valueOf( parameters.remove( "has_version_support" ) ) );
                }} ), identifier );
            } else {
                placeRequest = new PathPlaceRequest( PathFactory.newPath( parameters.remove( "file_name" ), parameters.remove( "path_uri" ) ), identifier );
            }
        } else {
            placeRequest = new DefaultPlaceRequest( identifier );
        }

        for ( String parameterName : parameters.keySet() ) {
            placeRequest.addParameter( parameterName, parameters.get( parameterName ) );
        }

        return placeRequest;
    }
View Full Code Here


    private void buildParts( final PanelDefinition panel,
                             final JsArray<JSPartDefinition> parts ) {
        if ( parts != null ) {
            for ( int i = 0; i < parts.length(); i++ ) {
                final JSPartDefinition part = parts.get( i );
                final PlaceRequest placeRequest = new DefaultPlaceRequest( part.getPlaceName() );

                if ( part.getParameters() != null ) {
                    final JSONObject json = new JSONObject( part.getParameters() );
                    for ( final String key : json.keySet() ) {
                        placeRequest.addParameter( key, json.get( key ).isString().stringValue() );
                    }
                }

                final PartDefinition partDefinition = new PartDefinitionImpl( placeRequest );
                partDefinition.setContextDisplayMode( JSNativePerspective.this.getContextDisplayMode( part.getContextDisplayModeAsString(), ContextDisplayMode.SHOW ) );
View Full Code Here

        nativePerspective.getPanelManager().setPerspective( perspective );

        Set<PartDefinition> parts = nativePerspective.getPanelManager().getRoot().getParts();
        for ( PartDefinition part : parts ) {
            final PlaceRequest place = clonePlaceAndMergeParameters( part.getPlace() );
            part.setPlace( place );
            nativePerspective.getPlaceManager().goTo( part, nativePerspective.getPanelManager().getRoot() );
        }
        buildPerspective( nativePerspective.getPanelManager().getRoot() );
View Full Code Here

    }

    private void addChildren( final PanelDefinition panel ) {
        final Set<PartDefinition> parts = panel.getParts();
        for ( final PartDefinition part : parts ) {
            final PlaceRequest place = clonePlaceAndMergeParameters( part.getPlace() );
            part.setPlace( place );
            nativePerspective.getPlaceManager().goTo( part, panel );
        }
        buildPerspective( panel );
    }
View Full Code Here

    public void onFocus() {
        Window.alert( "focus!" );
    }

    public void launchUnknownPlace() {
        final PlaceRequest place = new DefaultPlaceRequest( "somewhere.that.does.not.exist" );
        placeManager.goTo( place );
    }
View Full Code Here

    public IsWidget getView() {
        return this.view;
    }

    public void panelMinimized( @Observes MinimizePlaceEvent event ) {
        final PlaceRequest place = event.getPlace();
        view.addPlace( place );
    }
View Full Code Here

        final PlaceRequest place = event.getPlace();
        view.addPlace( place );
    }

    public void partRestored( @Observes RestorePlaceEvent event ) {
        final PlaceRequest place = event.getPlace();
        view.removePlace( place );
    }
View Full Code Here

        final PlaceRequest place = event.getPlace();
        view.removePlace( place );
    }

    void onWorkbenchPartClose( @Observes ClosePlaceEvent event ) {
        final PlaceRequest place = event.getPlace();
        view.removePlace( place );
    }
View Full Code Here

TOP

Related Classes of org.uberfire.mvp.PlaceRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.