コード例 #1
0
  @Inject
  public ConsolesPanelPresenter(
      ConsolesPanelView view,
      EventBus eventBus,
      DtoFactory dtoFactory,
      DialogFactory dialogFactory,
      EntityFactory entityFactory,
      TerminalFactory terminalFactory,
      CommandConsoleFactory commandConsoleFactory,
      CommandTypeRegistry commandTypeRegistry,
      WorkspaceAgent workspaceAgent,
      NotificationManager notificationManager,
      MachineLocalizationConstant localizationConstant,
      MachineServiceClient machineService,
      MachineResources resources,
      AppContext appContext) {
    this.view = view;
    this.terminalFactory = terminalFactory;
    this.workspaceAgent = workspaceAgent;
    this.commandConsoleFactory = commandConsoleFactory;
    this.commandTypeRegistry = commandTypeRegistry;
    this.dtoFactory = dtoFactory;
    this.dialogFactory = dialogFactory;
    this.notificationManager = notificationManager;
    this.localizationConstant = localizationConstant;
    this.resources = resources;
    this.entityFactory = entityFactory;
    this.appContext = appContext;
    this.machineService = machineService;

    this.rootChildren = new ArrayList<>();
    this.terminals = new HashMap<>();
    this.consoles = new HashMap<>();
    this.consoleCommands = new HashMap<>();
    this.machineNodes = new HashMap<>();

    fetchMachines();

    this.view.setDelegate(this);
    this.view.setTitle(localizationConstant.viewConsolesTitle());

    eventBus.addHandler(
        DevMachineStateEvent.TYPE,
        new DevMachineStateEvent.Handler() {
          @Override
          public void onDevMachineStarted(DevMachineStateEvent event) {
            fetchMachines();
          }

          @Override
          public void onDevMachineDestroyed(DevMachineStateEvent event) {}
        });

    eventBus.addHandler(ProcessFinishedEvent.TYPE, this);
    eventBus.addHandler(WorkspaceStoppedEvent.TYPE, this);
    eventBus.addHandler(MachineStateEvent.TYPE, this);
  }
コード例 #2
0
 @NotNull
 @Override
 public String getTitle() {
   return localizationConstant.viewConsolesTitle();
 }