Skip to content

Commit

Permalink
BZ-1018832: make project explorer aware of new project creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jrenaat committed Oct 25, 2013
1 parent e3966a8 commit 7678d0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Expand Up @@ -9,14 +9,13 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import org.guvnor.common.services.project.context.ProjectContext;
import org.guvnor.common.services.project.context.ProjectContextChangeEvent;
import org.guvnor.common.services.project.events.NewProjectEvent;
import org.guvnor.common.services.project.model.POM;
import org.guvnor.common.services.project.model.Project;
import org.guvnor.common.services.project.service.ProjectService;
import org.jboss.errai.common.client.api.Caller;
import org.jboss.errai.common.client.api.RemoteCallback;
import org.kie.workbench.common.screens.projecteditor.client.resources.ProjectEditorResources;
import org.kie.workbench.common.screens.projecteditor.client.resources.i18n.ProjectEditorConstants;
import org.kie.workbench.common.widgets.client.callbacks.HasBusyIndicatorDefaultErrorCallback;
import org.kie.workbench.common.widgets.client.resources.i18n.CommonConstants;
import org.kie.workbench.common.widgets.client.widget.BusyIndicatorView;
Expand All @@ -36,7 +35,7 @@ public class NewProjectWizard
private Event<NotificationEvent> notificationEvent;

@Inject
private Event<ProjectContextChangeEvent> projectContextChangeEvent;
private Event<NewProjectEvent> newProjectEvent;

@Inject
private WizardPresenter presenter;
Expand Down Expand Up @@ -116,10 +115,8 @@ private RemoteCallback<Project> getSuccessCallback() {
@Override
public void callback( final Project project ) {
busyIndicatorView.hideBusyIndicator();
notificationEvent.fire( new NotificationEvent( CommonConstants.INSTANCE.ItemCreatedSuccessfully() ) );
projectContextChangeEvent.fire( new ProjectContextChangeEvent( context.getActiveOrganizationalUnit(),
context.getActiveRepository(),
project ) );
notificationEvent.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemCreatedSuccessfully()));
newProjectEvent.fire( new NewProjectEvent( project ) );
placeManager.goTo( "projectScreen" );
}
};
Expand Down
Expand Up @@ -446,7 +446,12 @@ public void onProjectAdded( @Observes final NewProjectEvent event ) {
}
if ( authorizationManager.authorize( project,
identity ) ) {
refresh( false );
doInitialiseViewForActiveContext( activeOrganizationalUnit,
activeRepository,
project,
null,
null,
false );
}
}

Expand Down

0 comments on commit 7678d0b

Please sign in to comment.