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


Java Registry类代码示例

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


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

示例1: processImplementations

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

示例2: isModified

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

示例3: doUpdate

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

示例4: applyFontSize

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

示例5: 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

示例6: getKeyStroke

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

示例7: startComputingChildren

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

示例8: setMouseSelectionState

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

示例9: addCandidates

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

示例10: createUIComponents

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

示例11: paint

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

示例12: createInvalidRootsDescription

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

示例13: createPanel

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

示例14: getDelegate

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

示例15: getRootDirs

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


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