當前位置: 首頁>>代碼示例>>Java>>正文


Java EventBus.addHandler方法代碼示例

本文整理匯總了Java中com.google.web.bindery.event.shared.EventBus.addHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java EventBus.addHandler方法的具體用法?Java EventBus.addHandler怎麽用?Java EventBus.addHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.web.bindery.event.shared.EventBus的用法示例。


在下文中一共展示了EventBus.addHandler方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TextEditorsViewPresenter

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public TextEditorsViewPresenter(
        AppContext appContext,
        TextEditorsView textViewEditors,
        ResourceManager.ResourceManagerFactory resourceManagerFactory,
		EditorAgent editorAgent,
		EventBus eventBus) {
	this.textEditorsView = textViewEditors;

	this.resourceManagerFactory = resourceManagerFactory;
    resourceManager = resourceManagerFactory.newResourceManager(appContext.getDevMachine());
    this.editorAgent = editorAgent;

	eventBus.addHandler(FileEvent.TYPE, this);
	exportOpenEditor();
}
 
開發者ID:convertigo,項目名稱:convertigo-che-assembly,代碼行數:17,代碼來源:TextEditorsViewPresenter.java

示例2: CommandProducerActionManager

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public CommandProducerActionManager(
    Set<CommandProducer> commandProducers,
    EventBus eventBus,
    ActionManager actionManager,
    CommandProducerActionFactory commandProducerActionFactory,
    Resources resources,
    ProducerMessages messages) {
  this.actionManager = actionManager;
  this.commandProducerActionFactory = commandProducerActionFactory;
  this.resources = resources;
  this.messages = messages;

  this.commandProducers = new HashSet<>();

  if (commandProducers != null) {
    this.commandProducers.addAll(commandProducers);
  }

  eventBus.addHandler(BasicIDEInitializedEvent.TYPE, e -> init());
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:22,代碼來源:CommandProducerActionManager.java

示例3: PanelSelectorPresenter

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public PanelSelectorPresenter(
    PanelSelectorView view, PerspectiveManager perspectiveManager, EventBus eventBus) {
  this.view = view;
  this.perspectiveManager = perspectiveManager;

  view.setDelegate(this);

  eventBus.addHandler(
      PartStackStateChangedEvent.TYPE,
      new PartStackStateChangedEvent.Handler() {
        @Override
        public void onPartStackStateChanged(PartStackStateChangedEvent event) {
          updateButtonState();
        }
      });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:18,代碼來源:PanelSelectorPresenter.java

示例4: ProjectTreeNotificationsSubscriber

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public ProjectTreeNotificationsSubscriber(
    EventBus eventBus,
    AppContext appContext,
    RequestTransmitter requestTransmitter,
    DtoFactory dtoFactory) {
  this.requestTransmitter = requestTransmitter;
  this.dtoFactory = dtoFactory;

  eventBus.addHandler(WsAgentServerRunningEvent.TYPE, event -> subscribe());

  // in case ws-agent is already running
  eventBus.addHandler(
      BasicIDEInitializedEvent.TYPE,
      event -> {
        if (appContext.getWorkspace().getStatus() == RUNNING) {
          subscribe();
        }
      });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:21,代碼來源:ProjectTreeNotificationsSubscriber.java

示例5: ProcessesOutputRestorer

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public ProcessesOutputRestorer(
    EventBus eventBus, AppContext appContext, ExecAgentCommandManager execAgentCommandManager) {
  this.eventBus = eventBus;
  this.execAgentCommandManager = execAgentCommandManager;

  eventBus.addHandler(
      ExecAgentServerRunningEvent.TYPE, event -> restoreLogs(event.getMachineName()));

  // in case workspace is already running
  eventBus.addHandler(
      BasicIDEInitializedEvent.TYPE,
      event -> {
        final WorkspaceImpl workspace = appContext.getWorkspace();

        if (workspace.getStatus() == RUNNING) {
          final RuntimeImpl runtime = workspace.getRuntime();

          if (runtime != null) {
            runtime.getMachines().values().forEach(m -> restoreLogs(m.getName()));
          }
        }
      });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:25,代碼來源:ProcessesOutputRestorer.java

示例6: PreviewsPresenter

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public PreviewsPresenter(
    PreviewsView view,
    ExecAgentCommandManager execAgentClient,
    CommandManager commandManager,
    AppContext appContext,
    EventBus eventBus,
    Provider<MacroProcessor> macroProcessorProvider,
    PromiseProvider promiseProvider,
    ToolbarMessages messages) {
  this.view = view;
  this.execAgentClient = execAgentClient;
  this.commandManager = commandManager;
  this.appContext = appContext;
  this.macroProcessorProvider = macroProcessorProvider;
  this.promiseProvider = promiseProvider;
  this.messages = messages;

  view.setDelegate(this);

  eventBus.addHandler(ProcessStartedEvent.TYPE, event -> updateView());
  eventBus.addHandler(ProcessFinishedEvent.TYPE, event -> updateView());
  eventBus.addHandler(WorkspaceStoppedEvent.TYPE, e -> updateView());
  eventBus.addHandler(CommandsLoadedEvent.getType(), e -> updateView());
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:26,代碼來源:PreviewsPresenter.java

示例7: JavaRefactoringRename

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public JavaRefactoringRename(
    RenamePresenter renamePresenter,
    RefactoringUpdater refactoringUpdater,
    JavaLocalizationConstant locale,
    RefactoringServiceClient refactoringServiceClient,
    ClientServerEventService clientServerEventService,
    DtoFactory dtoFactory,
    EventBus eventBus,
    DialogFactory dialogFactory,
    NotificationManager notificationManager) {
  this.renamePresenter = renamePresenter;
  this.refactoringUpdater = refactoringUpdater;
  this.locale = locale;
  this.clientServerEventService = clientServerEventService;
  this.dialogFactory = dialogFactory;
  this.refactoringServiceClient = refactoringServiceClient;
  this.dtoFactory = dtoFactory;
  this.notificationManager = notificationManager;

  isActiveLinkedEditor = false;

  eventBus.addHandler(FileEvent.TYPE, this);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:25,代碼來源:JavaRefactoringRename.java

示例8: EditorPropertiesPresenter

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public EditorPropertiesPresenter(
    final EditorPropertiesView view,
    final EventBus eventBus,
    final Set<EditorPropertiesSection> sections,
    final EditorPreferenceSectionFactory editorPreferenceSectionFactory) {
  this.view = view;
  this.sections = sections;
  this.editorPreferenceSectionFactory = editorPreferenceSectionFactory;
  this.eventBus = eventBus;

  eventBus.addHandler(BasicIDEInitializedEvent.TYPE, e -> init());
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:14,代碼來源:EditorPropertiesPresenter.java

示例9: WsAgentJsonRpcInitializer

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public WsAgentJsonRpcInitializer(
    JsonRpcInitializer initializer,
    AppContext appContext,
    EventBus eventBus,
    RequestTransmitter requestTransmitter,
    AgentURLModifier agentURLModifier,
    WsAgentServerUtil wsAgentServerUtil) {
  this.appContext = appContext;
  this.initializer = initializer;
  this.requestTransmitter = requestTransmitter;
  this.agentURLModifier = agentURLModifier;
  this.wsAgentServerUtil = wsAgentServerUtil;

  eventBus.addHandler(WsAgentServerRunningEvent.TYPE, event -> initializeJsonRpcService());
  eventBus.addHandler(
      WsAgentServerStoppedEvent.TYPE,
      event -> initializer.terminate(WS_AGENT_JSON_RPC_ENDPOINT_ID));

  // in case ws-agent is already running
  eventBus.addHandler(
      BasicIDEInitializedEvent.TYPE,
      event -> {
        if (appContext.getWorkspace().getStatus() == RUNNING) {
          initializeJsonRpcService();
        }
      });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:29,代碼來源:WsAgentJsonRpcInitializer.java

示例10: ExecAgentJsonRpcInitializer

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public ExecAgentJsonRpcInitializer(
    JsonRpcInitializer initializer,
    AppContext appContext,
    EventBus eventBus,
    AgentURLModifier agentURLModifier) {
  this.appContext = appContext;
  this.initializer = initializer;
  this.agentURLModifier = agentURLModifier;

  eventBus.addHandler(
      ExecAgentServerRunningEvent.TYPE,
      event -> initializeJsonRpcService(event.getMachineName()));
  eventBus.addHandler(
      ExecAgentServerStoppedEvent.TYPE, event -> initializer.terminate(event.getMachineName()));

  // in case workspace is already running
  eventBus.addHandler(
      BasicIDEInitializedEvent.TYPE,
      event -> {
        final WorkspaceImpl workspace = appContext.getWorkspace();

        if (workspace.getStatus() == RUNNING) {
          final RuntimeImpl runtime = workspace.getRuntime();

          if (runtime != null) {
            runtime
                .getMachines()
                .values()
                .stream()
                .map(MachineImpl::getName)
                .forEach(this::initializeJsonRpcService);
          }
        }
      });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:37,代碼來源:ExecAgentJsonRpcInitializer.java

示例11: TreeResourceRevealer

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public TreeResourceRevealer(
    ProjectExplorerView projectExplorer, EventBus eventBus, PromiseProvider promises) {
  this.tree = projectExplorer.getTree();

  queue = promises.resolve(null);

  eventBus.addHandler(
      RevealResourceEvent.getType(),
      new RevealResourceHandler() {
        @Override
        public void onRevealResource(final RevealResourceEvent event) {
          queue.thenPromise(
              new Function<Void, Promise<Void>>() {
                @Override
                public Promise<Void> apply(Void ignored) throws FunctionException {
                  return reveal(
                          event.getLocation(),
                          event.isSelectionRequired(),
                          event.isFocusRequired())
                      .catchError(
                          new Function<PromiseError, Void>() {
                            @Override
                            public Void apply(PromiseError arg) throws FunctionException {
                              return null;
                            }
                          });
                }
              });
        }
      });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:33,代碼來源:TreeResourceRevealer.java

示例12: CommandsExplorerPresenter

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public CommandsExplorerPresenter(
    CommandsExplorerView view,
    CommandResources commandResources,
    CommandManager commandManager,
    NotificationManager notificationManager,
    CommandTypeChooser commandTypeChooser,
    ExplorerMessages messages,
    RefreshViewTask refreshViewTask,
    DialogFactory dialogFactory,
    NodeFactory nodeFactory,
    Provider<EditorAgent> editorAgentProvider,
    AppContext appContext,
    EventBus eventBus) {
  this.view = view;
  this.resources = commandResources;
  this.commandManager = commandManager;
  this.notificationManager = notificationManager;
  this.commandTypeChooser = commandTypeChooser;
  this.messages = messages;
  this.refreshViewTask = refreshViewTask;
  this.dialogFactory = dialogFactory;
  this.nodeFactory = nodeFactory;
  this.editorAgentProvider = editorAgentProvider;
  this.appContext = appContext;

  view.setDelegate(this);

  eventBus.addHandler(
      CommandAddedEvent.getType(), e -> refreshViewAndSelectCommand(e.getCommand()));
  eventBus.addHandler(CommandRemovedEvent.getType(), e -> refreshView());
  eventBus.addHandler(CommandUpdatedEvent.getType(), e -> refreshView());
  eventBus.addHandler(CommandsLoadedEvent.getType(), e -> refreshView());
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:35,代碼來源:CommandsExplorerPresenter.java

示例13: LinkWithEditorAction

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public LinkWithEditorAction(
    CoreLocalizationConstant localizationConstant,
    Provider<EditorAgent> editorAgentProvider,
    EventBus eventBus,
    PreferencesManager preferencesManager) {
  super(localizationConstant.actionLinkWithEditor());

  this.editorAgentProvider = editorAgentProvider;
  this.eventBus = eventBus;
  this.preferencesManager = preferencesManager;

  eventBus.addHandler(ActivePartChangedEvent.TYPE, this);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:15,代碼來源:LinkWithEditorAction.java

示例14: EditorContentSynchronizerImpl

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public EditorContentSynchronizerImpl(
    EventBus eventBus, Provider<EditorGroupSynchronization> editorGroupSyncProvider) {
  this.editorGroupSyncProvider = editorGroupSyncProvider;
  this.editorGroups = new HashMap<>();
  eventBus.addHandler(ActivePartChangedEvent.TYPE, this);
  eventBus.addHandler(ResourceChangedEvent.getType(), this);
  eventBus.addHandler(EditorDirtyStateChangedEvent.TYPE, this);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:10,代碼來源:EditorContentSynchronizerImpl.java

示例15: ExecuteCommandActionManager

import com.google.web.bindery.event.shared.EventBus; //導入方法依賴的package包/類
@Inject
public ExecuteCommandActionManager(
    Provider<CommandManager> commandManagerProvider,
    ActionManager actionManager,
    CommandsActionGroup commandsActionGroup,
    GoalPopUpGroupFactory goalPopUpGroupFactory,
    ExecuteCommandActionFactory commandActionFactory,
    CommandGoalRegistry goalRegistry,
    EventBus eventBus) {
  this.commandManagerProvider = commandManagerProvider;
  this.actionManager = actionManager;
  this.commandsActionGroup = commandsActionGroup;
  this.goalPopUpGroupFactory = goalPopUpGroupFactory;
  this.commandActionFactory = commandActionFactory;
  this.goalRegistry = goalRegistry;

  commandActions = new HashMap<>();
  goalPopUpGroups = new HashMap<>();

  initialize();

  eventBus.addHandler(CommandAddedEvent.getType(), e -> addAction(e.getCommand()));
  eventBus.addHandler(CommandRemovedEvent.getType(), e -> removeAction(e.getCommand()));
  eventBus.addHandler(
      CommandUpdatedEvent.getType(),
      e -> {
        removeAction(e.getInitialCommand());
        addAction(e.getUpdatedCommand());
      });

  eventBus.addHandler(WsAgentServerStoppedEvent.TYPE, e -> disposeActions());

  eventBus.addHandler(
      CommandsLoadedEvent.getType(),
      e -> {
        disposeActions();
        registerActions();
      });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:40,代碼來源:ExecuteCommandActionManager.java


注:本文中的com.google.web.bindery.event.shared.EventBus.addHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。