Java 类com.intellij.openapi.util.registry.RegistryValueListener 实例源码

项目:intellij-ce-playground    文件:JBEditorTabs.java   
public JBEditorTabs(@Nullable Project project, @NotNull ActionManager actionManager, IdeFocusManager focusManager, @NotNull Disposable parent) {
  super(project, actionManager, focusManager, parent);
  Registry.get(TABS_ALPHABETICAL_KEY).addListener(new RegistryValueListener.Adapter() {

    @Override
    public void afterValueChanged(RegistryValue value) {
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          resetTabsCache();
          relayout(true, false);
        }
      });
    }
  }, parent);
}
项目:intellij-ce-playground    文件:IdeTooltipManager.java   
@Override
public void initComponent() {
  myIsEnabled = Registry.get("ide.tooltip.callout");
  myIsEnabled.addListener(new RegistryValueListener.Adapter() {
    @Override
    public void afterValueChanged(RegistryValue value) {
      processEnabled();
    }
  }, ApplicationManager.getApplication());

  Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);

  ActionManager.getInstance().addAnActionListener(new AnActionListener.Adapter() {
    @Override
    public void beforeActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
      hideCurrent(null, action, event);
    }
  }, ApplicationManager.getApplication());

  processEnabled();
}
项目:tools-idea    文件:CompilerOutputIndexer.java   
@Override
public final void projectOpened() {
  Registry.get(REGISTRY_KEY).addListener(new RegistryValueListener.Adapter() {
    @Override
    public void afterValueChanged(final RegistryValue value) {
      myEnabled.set(value.asBoolean());
      if (myEnabled.get()) {
        doEnable();
      }
    }
  }, myProject);

  myEnabled = new AtomicBoolean(Registry.is(REGISTRY_KEY) || ApplicationManager.getApplication().isUnitTestMode());
  if (myEnabled.get()) {
    doEnable();
  }
}
项目:tools-idea    文件:IdeTooltipManager.java   
@Override
public void initComponent() {
  myIsEnabled = Registry.get("ide.tooltip.callout");
  myIsEnabled.addListener(new RegistryValueListener.Adapter() {
    @Override
    public void afterValueChanged(RegistryValue value) {
      processEnabled();
    }
  }, ApplicationManager.getApplication());

  Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);

  ActionManager.getInstance().addAnActionListener(new AnActionListener.Adapter() {
    @Override
    public void beforeActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
      hideCurrent(null, action, event);
    }
  }, ApplicationManager.getApplication());

  processEnabled();
}
项目:consulo    文件:IdeTooltipManager.java   
@Override
public void initComponent() {
  myIsEnabled = Registry.get("ide.tooltip.callout");
  myIsEnabled.addListener(new RegistryValueListener.Adapter() {
    @Override
    public void afterValueChanged(RegistryValue value) {
      processEnabled();
    }
  }, ApplicationManager.getApplication());

  Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);

  ActionManager.getInstance().addAnActionListener(new AnActionListener.Adapter() {
    @Override
    public void beforeActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
      hideCurrent(null, action, event);
    }
  }, ApplicationManager.getApplication());

  processEnabled();
}
项目:intellij-ce-playground    文件:QuickAccessSettings.java   
public QuickAccessSettings() {
  myModifiersValue = Registry.get("actionSystem.quickAccessModifiers");
  myModifiersValue.addListener(new RegistryValueListener.Adapter() {
    @Override
    public void afterValueChanged(RegistryValue value) {
      applyModifiersFromRegistry();
    }
  }, ApplicationManager.getApplication());

  applyModifiersFromRegistry();
}
项目:intellij-ce-playground    文件:SvnExecutableChecker.java   
public SvnExecutableChecker(@NotNull SvnVcs vcs) {
  super(vcs.getProject(), getNotificationTitle(), getWrongPathMessage());

  myVcs = vcs;
  Registry.get(SVN_EXECUTABLE_LOCALE_REGISTRY_KEY).addListener(new RegistryValueListener.Adapter() {
    @Override
    public void afterValueChanged(@NotNull RegistryValue value) {
      myVcs.checkCommandLineVersion();
    }
  }, myProject);
}
项目:tools-idea    文件:QuickAccessSettings.java   
public void initComponent() {
  myModifiersValue = Registry.get("actionSystem.quickAccessModifiers");
  myModifiersValue.addListener(new RegistryValueListener.Adapter() {
    public void afterValueChanged(RegistryValue value) {
      applyModifiersFromRegistry();
    }
  }, this);

  KeymapManager kmMgr = KeymapManager.getInstance();
  kmMgr.addKeymapManagerListener(this);

  activeKeymapChanged(kmMgr.getActiveKeymap());

  applyModifiersFromRegistry();
}
项目:tools-idea    文件:InspectionGadgetsPlugin.java   
public static boolean getUpToDateTelemetryEnabled(@NotNull final Consumer<Boolean> consumer, @NotNull Disposable disposable) {
  final RegistryValue registryValue = Registry.get("inspectionGadgets.telemetry.enabled");
  registryValue.addListener(new RegistryValueListener.Adapter() {
    @Override
    public void afterValueChanged(RegistryValue value) {
      consumer.consume(Boolean.valueOf(value.asBoolean()));
    }
  }, disposable);
  return registryValue.asBoolean();
}