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

项目:intellij-ce-playground    文件:ClassImplementationsSearch.java   
public static boolean processImplementations(final PsiClass psiClass, final Processor<PsiElement> processor, SearchScope scope) {
  if (!FunctionalExpressionSearch.search(psiClass, scope).forEach(new Processor<PsiFunctionalExpression>() {
    @Override
    public boolean process(PsiFunctionalExpression expression) {
      return processor.process(expression);
    }
  })) {
    return false;
  }

  final boolean showInterfaces = Registry.is("ide.goto.implementation.show.interfaces");
  return ClassInheritorsSearch.search(psiClass, scope, true).forEach(new PsiElementProcessorAdapter<PsiClass>(new PsiElementProcessor<PsiClass>() {
    public boolean execute(@NotNull PsiClass element) {
      if (!showInterfaces && element.isInterface()) {
        return true;
      }
      return processor.process(element);
    }
  }));
}
项目:intellij-ce-playground    文件:CodeStyleSchemesConfigurable.java   
@Override
public boolean isModified() {
  if (myModel != null) {
    if (Registry.is("ide.new.settings.dialog")) {
      if (myPanels != null && myPanels.size() > 0 && myPanels.get(0).isModified()) {
        return true;
      }
    }
    boolean schemeListModified = myModel.isSchemeListModified();
    if (schemeListModified) {
      myApplyCompleted = false;
      myRevertCompleted = false;
    }
    return schemeListModified;
  }

  return false;
}
项目:intellij-ce-playground    文件:UnmarkRootAction.java   
@Override
protected void doUpdate(@NotNull AnActionEvent e, @Nullable Module module, @NotNull RootsSelection selection) {
  if (!Registry.is("ide.hide.excluded.files") && !selection.mySelectedExcludeRoots.isEmpty()
      && selection.mySelectedDirectories.isEmpty() && selection.mySelectedRoots.isEmpty()) {
    e.getPresentation().setEnabledAndVisible(true);
    e.getPresentation().setText("Cancel Exclusion");
    return;
  }

  super.doUpdate(e, module, selection);

  Set<ModuleSourceRootEditHandler<?>> selectedRootHandlers = getHandlersForSelectedRoots(selection);

  if (!selectedRootHandlers.isEmpty()) {
    String text;
    if (selectedRootHandlers.size() == 1) {
      ModuleSourceRootEditHandler<?> handler = selectedRootHandlers.iterator().next();
      text = "Unmark as " + handler.getRootTypeName() + " " + StringUtil.pluralize("Root", selection.mySelectedRoots.size());
    }
    else {
      text = "Unmark Roots";
    }
    e.getPresentation().setText(text);
  }
}
项目:intellij-ce-playground    文件:DocumentationComponent.java   
private void applyFontSize() {
  Document document = myEditorPane.getDocument();
  if (!(document instanceof StyledDocument)) {
    return;
  }

  final StyledDocument styledDocument = (StyledDocument)document;

  EditorColorsManager colorsManager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = colorsManager.getGlobalScheme();
  StyleConstants.setFontSize(myFontSizeStyle, scheme.getQuickDocFontSize().getSize());
  if (Registry.is("documentation.component.editor.font")) {
    StyleConstants.setFontFamily(myFontSizeStyle, scheme.getEditorFontName());
  }

  ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
    @Override
    public void run() {
      styledDocument.setCharacterAttributes(0, styledDocument.getLength(), myFontSizeStyle, false);
    }
  });
}
项目:intellij-ce-playground    文件:IdeaDecompilerTest.java   
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);
  }
}
项目:intellij-ce-playground    文件:KeyStrokeAdapter.java   
/**
 * @param event    the specified key event to process
 * @param extended {@code true} if extended key code should be used
 * @return a key stroke or {@code null} if it is not applicable
 * @see JComponent#processKeyBindings(KeyEvent, boolean)
 */
public static KeyStroke getKeyStroke(KeyEvent event, boolean extended) {
  if (event != null && !event.isConsumed()) {
    int id = event.getID();
    if (id == KeyEvent.KEY_TYPED) {
      return extended ? null : getKeyStroke(event.getKeyChar(), 0);
    }
    boolean released = id == KeyEvent.KEY_RELEASED;
    if (released || id == KeyEvent.KEY_PRESSED) {
      int code = event.getKeyCode();
      if (extended) {
        if (Registry.is("actionSystem.extendedKeyCode.disabled")) {
          return null;
        }
        code = getExtendedKeyCode(event);
        if (code == event.getKeyCode()) {
          return null;
        }
      }
      return getKeyStroke(code, event.getModifiers(), released);
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:XStackFrameNode.java   
@Override
public void startComputingChildren() {
  if (Registry.is("debugger.watches.in.variables")) {
    XDebugSession session = XDebugView.getSession(getTree());
    XDebuggerEvaluator evaluator = getValueContainer().getEvaluator();
    if (session != null && evaluator != null) {
      XDebugSessionData data = ((XDebugSessionImpl)session).getSessionData();
      XExpression[] expressions = data.getWatchExpressions();
      for (final XExpression expression : expressions) {
        evaluator.evaluate(expression, new XDebuggerEvaluator.XEvaluationCallback() {
          @Override
          public void evaluated(@NotNull XValue result) {
            addChildren(XValueChildrenList.singleton(expression.getExpression(), result), false);
          }

          @Override
          public void errorOccurred(@NotNull String errorMessage) {
            // do not add anything
          }
        }, getValueContainer().getSourcePosition());
      }
    }
  }
  super.startComputingChildren();
}
项目:intellij-ce-playground    文件:bigFile.java   
private void setMouseSelectionState(int mouseSelectionState) {
  if (getMouseSelectionState() == mouseSelectionState) return;

  myMouseSelectionState = mouseSelectionState;
  myMouseSelectionChangeTimestamp = System.currentTimeMillis();

  myMouseSelectionStateAlarm.cancelAllRequests();
  if (myMouseSelectionState != MOUSE_SELECTION_STATE_NONE) {
    if (myMouseSelectionStateResetRunnable == null) {
      myMouseSelectionStateResetRunnable = new Runnable() {
        @Override
        public void run() {
          resetMouseSelectionState(null);
        }
      };
    }
    myMouseSelectionStateAlarm.addRequest(myMouseSelectionStateResetRunnable, Registry.intValue("editor.mouseSelectionStateResetTimeout"),
                                          ModalityState.stateForComponent(myEditorComponent));
  }
}
项目:intellij-ce-playground    文件:PythonReferenceImporter.java   
@Nullable
private static AutoImportQuickFix addCandidates(PyElement node, PsiReference reference, String refText, @Nullable String asName) {
  AutoImportQuickFix fix = new AutoImportQuickFix(node, reference, refText, !PyCodeInsightSettings.getInstance().PREFER_FROM_IMPORT);
  Set<String> seenFileNames = new HashSet<String>(); // true import names

  PsiFile existingImportFile = addCandidatesFromExistingImports(node, refText, fix, seenFileNames);
  if (fix.getCandidatesCount() == 0 || fix.hasProjectImports() || Registry.is("python.import.always.ask")) {
    // maybe some unimported file has it, too
    ProgressManager.checkCanceled(); // before expensive index searches
    addSymbolImportCandidates(node, refText, asName, fix, seenFileNames, existingImportFile);
  }

  for(PyImportCandidateProvider provider: Extensions.getExtensions(PyImportCandidateProvider.EP_NAME)) {
    provider.addImportCandidates(reference, refText, fix);
  }
  if (fix.getCandidatesCount() > 0) {
    fix.sortCandidates();
    return fix;
  }
  return null;
}
项目:intellij-ce-playground    文件:PresentationModeProgressPanel.java   
private void createUIComponents() {
  myRootPanel = new TransparentPanel(0.5f) {
    @Override
    public boolean isVisible() {
      UISettings ui = UISettings.getInstance();
      return ui.PRESENTATION_MODE || !ui.SHOW_STATUS_BAR && Registry.is("ide.show.progress.without.status.bar");
    }
  };
  IconButton iconButton = new IconButton(myProgress.getInfo().getCancelTooltipText(),
                                               AllIcons.Process.Stop,
                                               AllIcons.Process.StopHovered);
  myCancelButton = new InplaceButton(iconButton, new ActionListener() {
    public void actionPerformed(@NotNull ActionEvent e) {
      myProgress.cancelRequest();
    }
  }).setFillBg(false);
}
项目:intellij-ce-playground    文件:GradientViewport.java   
@Override
public void paint(Graphics g) {
  super.paint(g);
  g = g.create();
  try {
    Component view = getView();
    Color background = view == null ? null : view.getBackground();
    Component header = getHeader();
    if (header != null) {
      header.setBounds(0, 0, getWidth(), header.getPreferredSize().height);
      if (background != null) {
        g.setColor(background);
        g.fillRect(header.getX(), header.getY(), header.getWidth(), header.getHeight());
      }
    }
    if (g instanceof Graphics2D && background != null && !Registry.is("ui.no.bangs.and.whistles")) {
      paintGradient((Graphics2D)g, background, 0, header == null ? 0 : header.getHeight());
    }
    if (header != null) {
      header.paint(g);
    }
  }
  finally {
    g.dispose();
  }
}
项目:intellij-ce-playground    文件:LibraryProjectStructureElement.java   
private static String createInvalidRootsDescription(List<String> invalidClasses, String rootName, String libraryName) {
  StringBuilder buffer = new StringBuilder();
  final String name = StringUtil.escapeXml(libraryName);
  buffer.append("Library ");
  if (Registry.is("ide.new.project.settings")) {
    buffer.append("<a href='http://library/").append(name).append("'>").append(name).append("</a>");
  } else {
    buffer.append("'").append(name).append("'");
  }
  buffer.append(" has broken " + rootName + " " + StringUtil.pluralize("path", invalidClasses.size()) + ":");
  for (String url : invalidClasses) {
    buffer.append("<br>&nbsp;&nbsp;");
    buffer.append(PathUtil.toPresentableUrl(url));
  }
  return XmlStringUtil.wrapInHtml(buffer);
}
项目:intellij-ce-playground    文件:ModuleEditor.java   
private JPanel createPanel() {
  getModifiableRootModel(); //initialize model if needed
  getModifiableRootModelProxy();

  myGenericSettingsPanel = new ModuleEditorPanel();

  createEditors(getModule());

  if (!Registry.is("ide.new.project.settings")) {
    JPanel northPanel = new JPanel(new GridBagLayout());
    myGenericSettingsPanel.add(northPanel, BorderLayout.NORTH);
  }

  final JComponent component = createCenterPanel();
  myGenericSettingsPanel.add(component, BorderLayout.CENTER);
  myEditorsInitialized = true;
  return myGenericSettingsPanel;
}
项目:intellij-ce-playground    文件:AbstractSyntaxAwareReaderTransferableData.java   
@NotNull
private Reader getDelegate() {
  if (myDelegate != null) {
    return myDelegate;
  }

  int maxLength = Registry.intValue("editor.richcopy.max.size.megabytes") * FileUtilRt.MEGABYTE;
  final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
  try {
    try {
      build(buffer, maxLength);
    }
    catch (Exception e) {
      LOG.error(e);
    }
    String s = buffer.toString();
    if (LOG.isDebugEnabled()) {
      LOG.debug("Resulting text: \n" + s);
    }
    myDelegate = new StringReader(s);
    return myDelegate;
  }
  finally {
    StringBuilderSpinAllocator.dispose(buffer);
  }
}
项目:intellij-ce-playground    文件:SettingsProviderComponent.java   
public Set<String> getRootDirs(final Project project) {
  if (!Registry.is("editor.config.stop.at.project.root")) {
    return Collections.emptySet();
  }

  return CachedValuesManager.getManager(project).getCachedValue(project, new CachedValueProvider<Set<String>>() {
    @Nullable
    @Override
    public Result<Set<String>> compute() {
      final Set<String> dirs = new HashSet<String>();
      final VirtualFile projectBase = project.getBaseDir();
      if (projectBase != null) {
        dirs.add(project.getBasePath());
        for (Module module : ModuleManager.getInstance(project).getModules()) {
          for (VirtualFile root : ModuleRootManager.getInstance(module).getContentRoots()) {
            if (!VfsUtilCore.isAncestor(projectBase, root, false)) {
              dirs.add(root.getPath());
            }
          }
        }
      }
      dirs.add(PathManager.getConfigPath());
      return new Result<Set<String>>(dirs, ProjectRootModificationTracker.getInstance(project));
    }
  });
}
项目:intellij-ce-playground    文件:ModuleDefaultVcsRootPolicy.java   
@Override
@Nullable
public VirtualFile getVcsRootFor(final VirtualFile file) {
  if (myBaseDir != null && PeriodicalTasksCloser.getInstance().safeGetService(myProject, FileIndexFacade.class)
    .isValidAncestor(myBaseDir, file)) {
    return myBaseDir;
  }
  final VirtualFile contentRoot = ProjectRootManager.getInstance(myProject).getFileIndex().getContentRootForFile(file, Registry.is("ide.hide.excluded.files"));
  if (contentRoot != null) {
    return contentRoot;
  }
  if (ProjectUtil.isDirectoryBased(myProject) && (myBaseDir != null)) {
    final VirtualFile ideaDir = myBaseDir.findChild(Project.DIRECTORY_STORE_FOLDER);
    if (ideaDir != null && ideaDir.isValid() && ideaDir.isDirectory()) {
      if (VfsUtilCore.isAncestor(ideaDir, file, false)) {
        return ideaDir;
      }
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:MnemonicHelper.java   
private static void fixMacMnemonicKeyStroke(JComponent component, String type) {
  if (SystemInfo.isMac && Registry.is("ide.mac.alt.mnemonic.without.ctrl")) {
    // hack to make component's mnemonic work for ALT+KEY_CODE on Macs.
    // Default implementation uses ALT+CTRL+KEY_CODE (see BasicLabelUI).
    InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    if (inputMap != null) {
      KeyStroke[] strokes = inputMap.allKeys();
      if (strokes != null) {
        int mask = KeyEvent.ALT_MASK | KeyEvent.CTRL_MASK;
        for (KeyStroke stroke : strokes) {
          if (mask == (mask & stroke.getModifiers())) {
            inputMap.put(getKeyStrokeWithoutCtrlModifier(stroke), type != null ? type : inputMap.get(stroke));
          }
        }
      }
    }
  }
}
项目:intellij-ce-playground    文件:XVariablesViewBase.java   
protected void buildTreeAndRestoreState(@NotNull final XStackFrame stackFrame) {
  XDebuggerTree tree = myDebuggerTreePanel.getTree();
  final XSourcePosition position = stackFrame.getSourcePosition();
  tree.setSourcePosition(position);
  tree.setRoot(new XStackFrameNode(tree, stackFrame), false);
  final Project project = tree.getProject();
  project.putUserData(XVariablesView.DEBUG_VARIABLES, new XVariablesView.InlineVariablesInfo());
  project.putUserData(XVariablesView.DEBUG_VARIABLES_TIMESTAMPS, new ObjectLongHashMap<VirtualFile>());
  Object newEqualityObject = stackFrame.getEqualityObject();
  if (myFrameEqualityObject != null && newEqualityObject != null && myFrameEqualityObject.equals(newEqualityObject)
      && myTreeState != null) {
    disposeTreeRestorer();
    myTreeRestorer = myTreeState.restoreState(tree);
  }
  if (position != null && Registry.is("debugger.valueTooltipAutoShowOnSelection")) {
    registerInlineEvaluator(stackFrame, position, project);
  }
}
项目:intellij-ce-playground    文件:IdeTooltipManager.java   
public void hideCurrentNow(boolean animationEnabled) {
  if (myCurrentTipUi != null) {
    myCurrentTipUi.setAnimationEnabled(animationEnabled);
    myCurrentTipUi.hide();
    myCurrentTooltip.onHidden();
    myShowDelay = false;
    myAlarm.addRequest(new Runnable() {
      @Override
      public void run() {
        myShowDelay = true;
      }
    }, Registry.intValue("ide.tooltip.reshowDelay"));
  }

  myShowRequest = null;
  myCurrentTooltip = null;
  myCurrentTipUi = null;
  myCurrentComponent = null;
  myQueuedComponent = null;
  myQueuedTooltip = null;
  myCurrentEvent = null;
  myCurrentTipIsCentered = false;
  myX = -1;
  myY = -1;
}
项目:intellij-ce-playground    文件:FileManagerImpl.java   
@Nullable
private PsiDirectory findDirectoryImpl(@NotNull VirtualFile vFile) {
  PsiDirectory psiDir = myVFileToPsiDirMap.get(vFile);
  if (psiDir != null) return psiDir;

  if (Registry.is("ide.hide.excluded.files")) {
    if (myFileIndex.isExcludedFile(vFile)) return null;
  }
  else {
    if (myFileIndex.isUnderIgnored(vFile)) return null;
  }

  VirtualFile parent = vFile.getParent();
  if (parent != null) { //?
    findDirectoryImpl(parent);// need to cache parent directory - used for firing events
  }

  psiDir = PsiDirectoryFactory.getInstance(myManager.getProject()).createDirectory(vFile);
  return ConcurrencyUtil.cacheOrGet(myVFileToPsiDirMap, vFile, psiDir);
}
项目:intellij-ce-playground    文件:SpeedSearchUtil.java   
public static void appendColoredFragmentForMatcher(@NotNull String text,
                                                   SimpleColoredComponent component,
                                                   @NotNull final SimpleTextAttributes attributes,
                                                   Matcher matcher,
                                                   Color selectedBg,
                                                   boolean selected) {
  if (!(matcher instanceof MinusculeMatcher) || (Registry.is("ide.highlight.match.in.selected.only") && !selected)) {
    component.append(text, attributes);
    return;
  }

  final Iterable<TextRange> iterable = ((MinusculeMatcher)matcher).matchingFragments(text);
  if (iterable != null) {
    final Color fg = attributes.getFgColor();
    final int style = attributes.getStyle();
    final SimpleTextAttributes plain = new SimpleTextAttributes(style, fg);
    final SimpleTextAttributes highlighted = new SimpleTextAttributes(selectedBg, fg, null, style | SimpleTextAttributes.STYLE_SEARCH_MATCH);
    appendColoredFragments(component, text, iterable, plain, highlighted);
  }
  else {
    component.append(text, attributes);
  }
}
项目:intellij-ce-playground    文件:X11UiUtil.java   
@SuppressWarnings("SpellCheckingInspection")
public static void patchDetectedWm(String wmName) {
  if (X11 == null || !Registry.is("ide.x11.override.wm")) return;

  try {
    if (wmName.startsWith("Mutter") || "Muffin".equals(wmName) || "GNOME Shell".equals(wmName)) {
      setWM("MUTTER_WM", "METACITY_WM");
    }
    else if ("Marco".equals(wmName)) {
      setWM("MARCO_WM", "METACITY_WM");
    }
    else if ("awesome".equals(wmName)) {
      String version = getAwesomeWMVersion();
      if (StringUtil.compareVersionNumbers(version, "3.5") >= 0) {
        setWM("SAWFISH_WM");
      }
      else if (version != null) {
        setWM("OTHER_NONREPARENTING_WM", "LG3D_WM");
      }
    }
  }
  catch (Throwable t) {
    LOG.warn(t);
  }
}
项目:intellij-ce-playground    文件:ChangesTreeList.java   
@Override
public boolean isFileColorsEnabled() {
  final boolean enabled = Registry.is("file.colors.in.commit.dialog")
                    && FileColorManager.getInstance(myProject).isEnabled()
                    && FileColorManager.getInstance(myProject).isEnabledForProjectView();
  final boolean opaque = isOpaque();
  if (enabled && opaque) {
    setOpaque(false);
  } else if (!enabled && !opaque) {
    setOpaque(true);
  }
  return enabled;
}
项目:intellij-ce-playground    文件:EditorImpl.java   
private boolean shouldSoftWrapsBeForced() {
  if (mySettings.isUseSoftWraps() ||
      // Disable checking for files in intermediate states - e.g. for files during refactoring.
      myProject != null && PsiDocumentManager.getInstance(myProject).isDocumentBlockedByPsi(myDocument)) {
    return false;
  }
  int lineWidthLimit = Registry.intValue("editor.soft.wrap.force.limit");
  for (int i = 0; i < myDocument.getLineCount(); i++) {
    if (myDocument.getLineEndOffset(i) - myDocument.getLineStartOffset(i) > lineWidthLimit) {
      return true;
    }
  }
  return false;
}
项目:intellij-ce-playground    文件:XDebugSessionImpl.java   
public void setWatchExpressions(@NotNull XExpression[] watchExpressions) {
  mySessionData.setWatchExpressions(watchExpressions);
  myDebuggerManager.getWatchesManager().setWatches(getWatchesKey(), watchExpressions);
  if (Registry.is("debugger.watches.in.variables")) {
    rebuildViews();
  }
}
项目:intellij-ce-playground    文件:NavBarUpdateQueue.java   
public NavBarUpdateQueue(NavBarPanel panel) {
  super("NavBar", Registry.intValue("navBar.updateMergeTime"), true, MergingUpdateQueue.ANY_COMPONENT, panel);
  myPanel = panel;
  setTrackUiActivity(true);
  IdeEventQueue.getInstance().addActivityListener(new Runnable() {
      @Override
      public void run() {
        restartRebuild();
      }
    }, panel);
}
项目:intellij-ce-playground    文件:AppIcon.java   
@Override
public final boolean hideProgress(Project project, Object processId) {
  if (Registry.is("ide.appIcon.progress")) {
    return _hideProgress(getIdeFrame(project), processId);
  }
  else {
    return false;
  }
}
项目:intellij-ce-playground    文件:VariableLookupItem.java   
public static void makeFinalIfNeeded(@NotNull InsertionContext context, @NotNull PsiVariable variable) {
  PsiElement place = context.getFile().findElementAt(context.getTailOffset() - 1);
  if (!Registry.is("java.completion.make.outer.variables.final") ||
      place == null || PsiUtil.isLanguageLevel8OrHigher(place) || JspPsiUtil.isInJspFile(place)) {
    return;
  }

  if (HighlightControlFlowUtil.getInnerClassVariableReferencedFrom(variable, place) != null &&
      !HighlightControlFlowUtil.isReassigned(variable, new HashMap<PsiElement, Collection<ControlFlowUtil.VariableInfo>>())) {
    PsiUtil.setModifierProperty(variable, PsiModifier.FINAL, true);
  }
}
项目:intellij-ce-playground    文件:JavaDirectoryIconProvider.java   
@Override
@Nullable
public Icon getIcon(@NotNull PsiElement element, int flags) {
  if (element instanceof PsiDirectory) {
    final PsiDirectory psiDirectory = (PsiDirectory)element;
    final VirtualFile vFile = psiDirectory.getVirtualFile();
    final Project project = psiDirectory.getProject();

    SourceFolder sourceFolder;
    Icon symbolIcon;
    if (vFile.getParent() == null && vFile.getFileSystem() instanceof ArchiveFileSystem) {
      symbolIcon = PlatformIcons.JAR_ICON;
    }
    else if (ProjectRootsUtil.isModuleContentRoot(vFile, project)) {
      Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(vFile);
      symbolIcon = module != null ? ModuleType.get(module).getIcon() : PlatformIcons.CONTENT_ROOT_ICON_CLOSED;
    }
    else if ((sourceFolder = ProjectRootsUtil.getModuleSourceRoot(vFile, project)) != null) {
      symbolIcon = SourceRootPresentation.getSourceRootIcon(sourceFolder);
    }
    else if (JavaDirectoryService.getInstance().getPackage(psiDirectory) != null) {
      symbolIcon = PlatformIcons.PACKAGE_ICON;
    }
    else if (!Registry.is("ide.hide.excluded.files") && ProjectRootManager.getInstance(project).getFileIndex().isExcluded(vFile)) {
      symbolIcon = AllIcons.Modules.ExcludeRoot;
    }
    else {
      symbolIcon = PlatformIcons.DIRECTORY_CLOSED_ICON;
    }

    return ElementBase.createLayeredIcon(element, symbolIcon, 0);
  }

  return null;
}
项目:intellij-ce-playground    文件:ClipboardSynchronizer.java   
@Nullable
private Transferable doGetContents() throws IllegalStateException {
  if (Registry.is("ide.mac.useNativeClipboard")) {
    final Transferable safe = getContentsSafe();
    if (safe != null) {
      return safe;
    }
  }

  return super.getContents();
}
项目: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);
}
项目:intellij-ce-playground    文件:MarkExcludeRootAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);

  if (Registry.is("ide.hide.excluded.files")) {
    String message = files.length == 1 ? FileUtil.toSystemDependentName(files[0].getPath()) : files.length + " selected files";
    final int rc = Messages.showOkCancelDialog(e.getData(CommonDataKeys.PROJECT), getPromptText(message), "Mark as Excluded",
                                               Messages.getQuestionIcon());
    if (rc != Messages.OK) {
      return;
    }
  }
  super.actionPerformed(e);
}
项目:intellij-ce-playground    文件:AppUIUtil.java   
public static void registerBundledFonts() {
  if (Registry.is("ide.register.bundled.fonts")) {
    registerFont("/fonts/Inconsolata.ttf");
    registerFont("/fonts/SourceCodePro-Regular.ttf");
    registerFont("/fonts/SourceCodePro-Bold.ttf");
    registerFont("/fonts/SourceCodePro-It.ttf");
    registerFont("/fonts/SourceCodePro-BoldIt.ttf");
  }
}
项目:intellij-ce-playground    文件:MacUtil.java   
public static Object wakeUpNeo(String reason) {
  // http://lists.apple.com/archives/java-dev/2014/Feb/msg00053.html
  // https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Classes/NSProcessInfo_Class/index.html#//apple_ref/c/tdef/NSActivityOptions
  if (SystemInfo.isMacOSMavericks && Registry.is("idea.mac.prevent.app.nap")) {
    ID processInfo = invoke("NSProcessInfo", "processInfo");
    ID activity = invoke(processInfo, "beginActivityWithOptions:reason:",
                       (0x00FFFFFFL & ~(1L << 20))  /* NSActivityUserInitiatedAllowingIdleSystemSleep */ |
                       0xFF00000000L /* NSActivityLatencyCritical */,
                       nsString(reason));
    cfRetain(activity);
    return activity;
  }
  return null;
}
项目:intellij-ce-playground    文件:BytecodeAnalysisIntegrationTest.java   
@Override
protected void setUp() throws Exception {
  super.setUp();
  myMessageDigest = BytecodeAnalysisConverter.getMessageDigest();
  RegistryValue registryValue = Registry.get(ProjectBytecodeAnalysis.NULLABLE_METHOD);
  nullableMethodRegistryValue = registryValue.asBoolean();
  registryValue.setValue(true);
}
项目:intellij-ce-playground    文件:ProjectViewDirectoryHelper.java   
private boolean shouldBeShown(VirtualFile dir, ViewSettings settings) {
  DirectoryInfo directoryInfo = myIndex.getInfoForFile(dir);
  if (directoryInfo.isInProject()) return true;

  if (!Registry.is("ide.hide.excluded.files") && settings instanceof ProjectViewSettings && ((ProjectViewSettings)settings).isShowExcludedFiles()) {
    return directoryInfo.isExcluded();
  }
  return false;
}
项目:intellij-ce-playground    文件:SMTestRunnerResultsForm.java   
private void selectAndNotify(@Nullable final AbstractTestProxy testProxy, @Nullable Runnable onDone) {
  selectWithoutNotify(testProxy, onDone);

  // Is used by Statistic tab to differ use selection in tree
  // from manual selection from API (e.g. test runner events)
  if (Registry.is("tests.view.old.statistics.panel")) {
    showStatisticsForSelectedProxy(testProxy, false);
  }
}
项目:intellij-ce-playground    文件:LibraryProjectStructureElement.java   
@Override
public ProjectStructureProblemDescription createUnusedElementWarning() {
  final List<ConfigurationErrorQuickFix> fixes = Arrays.asList(new AddLibraryToDependenciesFix(), new RemoveLibraryFix(), new RemoveAllUnusedLibrariesFix());
  final String name = StringUtil.escapeXml(myLibrary.getName());
  String libraryName = Registry.is("ide.new.project.settings") ? "<a href='http://library/" + name + "'>" + name + "</a>"
                       : "'" + name + "'";
  return new ProjectStructureProblemDescription("Library " + libraryName + " is not used", null, createPlace(),
                                                ProjectStructureProblemType.unused("unused-library"), ProjectStructureProblemDescription.ProblemLevel.PROJECT,
                                                fixes, false);
}
项目:intellij-ce-playground    文件:EditorPaintingTest.java   
@Override
protected void tearDown() throws Exception {
  try {
    Registry.get("editor.new.rendering").setValue(false);
    FontLayoutService.setInstance(null);
  }
  finally {
    super.tearDown();
  }
}
项目:intellij-ce-playground    文件:ProjectConfigurable.java   
@Override
public JComponent createOptionsPanel() {
  myDetailsComponent = new DetailsComponent(!Registry.is("ide.new.project.settings"), !Registry.is("ide.new.project.settings"));
  myDetailsComponent.setContent(myPanel);
  myDetailsComponent.setText(getBannerSlogan());

  myProjectJdkConfigurable.createComponent(); //reload changed jdks

  return myDetailsComponent.getComponent();
}