当前位置: 首页>>代码示例>>Java>>正文


Java Registry.get方法代码示例

本文整理汇总了Java中com.intellij.openapi.util.registry.Registry.get方法的典型用法代码示例。如果您正苦于以下问题:Java Registry.get方法的具体用法?Java Registry.get怎么用?Java Registry.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.util.registry.Registry的用法示例。


在下文中一共展示了Registry.get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initComponent

import com.intellij.openapi.util.registry.Registry; //导入方法依赖的package包/类
@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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:IdeTooltipManager.java

示例2: testLineNumberMapping

import com.intellij.openapi.util.registry.Registry; //导入方法依赖的package包/类
public void testLineNumberMapping() {
  RegistryValue value = Registry.get("decompiler.use.line.mapping");
  boolean old = value.asBoolean();
  try {
    value.setValue(true);

    VirtualFile file = getTestFile("LineNumbers.class");
    assertNull(file.getUserData(LineNumbersMapping.LINE_NUMBERS_MAPPING_KEY));

    new IdeaDecompiler().getText(file);

    LineNumbersMapping mapping = file.getUserData(LineNumbersMapping.LINE_NUMBERS_MAPPING_KEY);
    assertNotNull(mapping);
    assertEquals(11, mapping.bytecodeToSource(3));
    assertEquals(23, mapping.bytecodeToSource(13));
  }
  finally {
    value.setValue(old);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:IdeaDecompilerTest.java

示例3: setUp

import com.intellij.openapi.util.registry.Registry; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  myMessageDigest = BytecodeAnalysisConverter.getMessageDigest();
  RegistryValue registryValue = Registry.get(ProjectBytecodeAnalysis.NULLABLE_METHOD);
  nullableMethodRegistryValue = registryValue.asBoolean();
  registryValue.setValue(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BytecodeAnalysisIntegrationTest.java

示例4: QuickAccessSettings

import com.intellij.openapi.util.registry.Registry; //导入方法依赖的package包/类
public QuickAccessSettings() {
  myModifiersValue = Registry.get("actionSystem.quickAccessModifiers");
  myModifiersValue.addListener(new RegistryValueListener.Adapter() {
    @Override
    public void afterValueChanged(RegistryValue value) {
      applyModifiersFromRegistry();
    }
  }, ApplicationManager.getApplication());

  applyModifiersFromRegistry();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:QuickAccessSettings.java

示例5: update

import com.intellij.openapi.util.registry.Registry; //导入方法依赖的package包/类
@Override
public void update(@NotNull AnActionEvent e) {
  if (e.getProject() == null) {
    e.getPresentation().setEnabled(false);
    return;
  }
  RegistryValue value = Registry.get(key);
  boolean selected = value.asBoolean();
  e.getPresentation().setText((selected ? "Exit" : "Enter") + " Distraction Free Mode");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ToggleDistractionFreeModeAction.java

示例6: actionPerformed

import com.intellij.openapi.util.registry.Registry; //导入方法依赖的package包/类
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
  Project project = e.getProject();
  RegistryValue value = Registry.get(key);
  boolean enter = !value.asBoolean();
  value.setValue(enter);

  if (project == null) return;

  PropertiesComponent p = PropertiesComponent.getInstance();
  UISettings ui = UISettings.getInstance();
  EditorSettingsExternalizable.OptionSet eo = EditorSettingsExternalizable.getInstance().getOptions();
  DaemonCodeAnalyzerSettings ds = DaemonCodeAnalyzerSettings.getInstance();

  String before = "BEFORE.DISTRACTION.MODE.";
  String after = "AFTER.DISTRACTION.MODE.";
  if (enter) {
    applyAndSave(p, ui, eo, ds, before, after, false);
    TogglePresentationModeAction.storeToolWindows(project);
  }
  else {
    applyAndSave(p, ui, eo, ds, after, before, true);    
    TogglePresentationModeAction.restoreToolWindows(project, true, false);
  }

  UISettings.getInstance().fireUISettingsChanged();
  LafManager.getInstance().updateUI();
  EditorUtil.reinitSettings();
  DaemonCodeAnalyzer.getInstance(project).settingsChanged();
  EditorFactory.getInstance().refreshAllEditors();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:ToggleDistractionFreeModeAction.java

示例7: setShortNotationOfBooleanAttributeIsPreferred

import com.intellij.openapi.util.registry.Registry; //导入方法依赖的package包/类
@TestOnly
public static void setShortNotationOfBooleanAttributeIsPreferred(boolean value, Disposable parent) {
  final boolean oldValue = isShortNotationOfBooleanAttributePreferred();
  final RegistryValue registryValue = Registry.get("html.prefer.short.notation.of.boolean.attributes");
  registryValue.setValue(value);
  Disposer.register(parent, new Disposable() {
    @Override
    public void dispose() {
      registryValue.setValue(oldValue);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:HtmlUtil.java

示例8: testWorkingDirsFileWhenConfigurationSpansToMultipleModules

import com.intellij.openapi.util.registry.Registry; //导入方法依赖的package包/类
public void testWorkingDirsFileWhenConfigurationSpansToMultipleModules() throws Exception {
  final Module mod1 = setupModule("mod1", "T1");
  final Module mod2 = setupModule("mod2", "T2");

  final JUnitConfiguration configuration =
    new JUnitConfiguration("p", getProject(), JUnitConfigurationType.getInstance().getConfigurationFactories()[0]);
  configuration.setWorkingDirectory("$MODULE_DIR$");
  final JUnitConfiguration.Data persistentData = configuration.getPersistentData();
  persistentData.setScope(TestSearchScope.SINGLE_MODULE);
  configuration.setModule(mod1);
  persistentData.PACKAGE_NAME = "p";
  persistentData.TEST_OBJECT = JUnitConfiguration.TEST_PACKAGE;

  final ExecutionEnvironment environment =
    ExecutionEnvironmentBuilder.create(DefaultRunExecutor.getRunExecutorInstance(), configuration).build();
  final TestPackage aPackage = new TestPackage(configuration, environment) {
    @Override
    protected boolean createTempFiles() {
      return true;
    }
  };

  //ensure no fork if single module is selected
  aPackage.createSearchingForTestsTask().startSearch();
  File workingDirsFile = aPackage.getWorkingDirsFile();
  assertNotNull(workingDirsFile);
  assertEmpty(FileUtil.loadFile(workingDirsFile));

  //ensure fork when whole project is used
  persistentData.setScope(TestSearchScope.WHOLE_PROJECT);
  final RegistryValue smRunnerProperty = Registry.get("junit_sm");
  final boolean oldValue = smRunnerProperty.asBoolean();
  try {
    //check old format
    smRunnerProperty.setValue(false);
    aPackage.createSearchingForTestsTask().startSearch();
    workingDirsFile = aPackage.getWorkingDirsFile();
    assertNotNull(workingDirsFile);
    String file = preparePathsForComparison(FileUtil.loadFile(workingDirsFile), mod1, mod2);
    assertEquals("p\n" +
                 "MODULE_1\n" +
                 "mod1\n" +
                 "IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
                 "1\n" +
                 "p.T1\n" +
                 "MODULE_2\n" +
                 "mod2\n" +
                 "IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
                 "1\n" +
                 "p.T2\n", file);

    //check sm runner
    smRunnerProperty.setValue(true);
    aPackage.createSearchingForTestsTask().startSearch();
    workingDirsFile = aPackage.getWorkingDirsFile();
    assertNotNull(workingDirsFile);
    file = preparePathsForComparison(FileUtil.loadFile(workingDirsFile), mod1, mod2);
    assertEquals("p\n" +
                 "MODULE_1\n" +
                 "mod1\n" +
                 "IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
                 "1\n" +
                 "p.T1\n" +
                 "MODULE_2\n" +
                 "mod2\n" +
                 "IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
                 "1\n" +
                 "p.T2\n", file);
  }
  finally {
    smRunnerProperty.setValue(oldValue);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:74,代码来源:JUnitClasspathTest.java


注:本文中的com.intellij.openapi.util.registry.Registry.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。