Exemplo n.º 1
0
  @Inject
  public AppContextImpl(EventBus eventBus, BrowserQueryFieldRenderer browserQueryFieldRenderer) {
    this.eventBus = eventBus;
    this.browserQueryFieldRenderer = browserQueryFieldRenderer;

    projectsInImport = new ArrayList<>();

    eventBus.addHandler(SelectionChangedEvent.TYPE, this);
    eventBus.addHandler(ExtServerStateEvent.TYPE, this);
    eventBus.addHandler(ProjectUpdatedEvent.getType(), this);
  }
Exemplo n.º 2
0
  @Override
  public void onProjectUpdated(ProjectUpdatedEvent event) {
    final ProjectConfigDto updatedProjectDescriptor = event.getUpdatedProjectDescriptor();
    final String updatedProjectDescriptorPath = updatedProjectDescriptor.getPath();

    if (updatedProjectDescriptorPath.equals(currentProject.getProjectConfig().getPath())) {
      currentProject.setProjectConfig(updatedProjectDescriptor);
      eventBus.fireEvent(new CurrentProjectChangedEvent(updatedProjectDescriptor));
    }

    if (updatedProjectDescriptorPath.equals(currentProject.getRootProject().getPath())) {
      currentProject.setRootProject(updatedProjectDescriptor);
      browserQueryFieldRenderer.setProjectName(updatedProjectDescriptor.getName());
    }
  }