• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java HectorComponentPanel类的典型用法和代码示例

java 1次浏览

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

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

示例1: isModified

点赞 3

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
private boolean isModified() {
  final FileViewProvider viewProvider = myFile.getViewProvider();
  for (Language language : mySliders.keySet()) {
    JSlider slider = mySliders.get(language);
    final PsiFile root = viewProvider.getPsi(language);
    HighlightingLevelManager highlightingLevelManager = HighlightingLevelManager.getInstance(myFile.getProject());
    if (root != null && getValue(highlightingLevelManager.shouldHighlight(root), highlightingLevelManager.shouldInspect(root)) != slider.getValue()) {
      return true;
    }
  }
  for (HectorComponentPanel panel : myAdditionalPanels) {
    if (panel.isModified()) {
      return true;
    }
  }

  return false;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:19,
代码来源:HectorComponent.java

示例2: isModified

点赞 3

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
private boolean isModified() {
  final FileViewProvider viewProvider = myFile.getViewProvider();
  for (Language language : mySliders.keySet()) {
    JSlider slider = mySliders.get(language);
    final PsiFile root = viewProvider.getPsi(language);
    if (root != null && getValue(HighlightLevelUtil.shouldHighlight(root), HighlightLevelUtil.shouldInspect(root)) != slider.getValue()) {
      return true;
    }
  }
  for (HectorComponentPanel panel : myAdditionalPanels) {
    if (panel.isModified()) {
      return true;
    }
  }

  return false;
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:18,
代码来源:HectorComponent.java

示例3: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
@Override
public HectorComponentPanel createConfigurable(@NotNull PsiFile file) {
  return new HectorComponentPanel() {
    private final JCheckBox myCheckBox = new JCheckBox("Power Save Mode");

    @Override
    public JComponent createComponent() {
      return myCheckBox;
    }

    @Override
    public boolean isModified() {
      return myCheckBox.isSelected() != PowerSaveMode.isEnabled();
    }

    @Override
    public void apply() throws ConfigurationException {
      PowerSaveMode.setEnabled(myCheckBox.isSelected());
    }

    @Override
    public void reset() {
      myCheckBox.setSelected(PowerSaveMode.isEnabled());
    }

    @Override
    public void disposeUIResources() {
    }
  };
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:31,
代码来源:PowerSaveHectorProvider.java

示例4: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
@Override
@Nullable
public HectorComponentPanel createConfigurable(@NotNull final PsiFile file) {
  if (DumbService.getInstance(file.getProject()).isDumb()) {
    return null;
  }
  if (myIncludeManager.getIncludingFiles(file.getVirtualFile(), false).length > 0) {
    return new FileIncludeContextHectorPanel(file, myIncludeManager);
  }
  return null;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:12,
代码来源:FileIncludeContextHectorProvider.java

示例5: onClose

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
private void onClose() {
  if (isModified()) {
    for (HectorComponentPanel panel : myAdditionalPanels) {
      try {
        panel.apply();
      }
      catch (ConfigurationException e) {
        //shouldn't be
      }
    }
    forceDaemonRestart();
    DaemonListeners.getInstance(myFile.getProject()).updateStatusBar();
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:15,
代码来源:HectorComponent.java

示例6: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
@Override
@Nullable
public HectorComponentPanel createConfigurable(@NotNull PsiFile file) {
  if (file instanceof XmlFile) {
    try {
      final XmlTag rootTag = ((XmlFile)file).getDocument().getRootTag();
      if (rootTag.getNamespace().length() == 0) {
        return new NoNamespaceConfigPanel(NoNamespaceConfig.getInstance(file.getProject()), file);
      }
    } catch (NullPointerException e) {
      return null;
    }
  }
  return null;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:16,
代码来源:NoNamespaceConfigImpl.java

示例7: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
@Nullable
public HectorComponentPanel createConfigurable(@NotNull PsiFile file) {
  if (file instanceof XmlFile) {
    try {
      final XmlTag rootTag = ((XmlFile)file).getDocument().getRootTag();
      if (rootTag.getNamespace().length() == 0) {
        return new NoNamespaceConfigPanel(NoNamespaceConfig.getInstance(file.getProject()), file);
      }
    } catch (NullPointerException e) {
      return null;
    }
  }
  return null;
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:15,
代码来源:NoNamespaceConfigImpl.java

示例8: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
@Override
public HectorComponentPanel createConfigurable(@Nonnull PsiFile file) {
  return new HectorComponentPanel() {
    private JCheckBox myCheckBox = new JCheckBox("Power Save Mode");

    @Override
    public JComponent createComponent() {
      return myCheckBox;
    }

    @Override
    public boolean isModified() {
      return myCheckBox.isSelected() != PowerSaveMode.isEnabled();
    }

    @Override
    public void apply() throws ConfigurationException {
      PowerSaveMode.setEnabled(myCheckBox.isSelected());
    }

    @Override
    public void reset() {
      myCheckBox.setSelected(PowerSaveMode.isEnabled());
    }

    @Override
    public void disposeUIResources() {
    }
  };
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:31,
代码来源:PowerSaveHectorProvider.java

示例9: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
@Override
@Nullable
public HectorComponentPanel createConfigurable(@Nonnull final PsiFile file) {
  if (DumbService.getInstance(file.getProject()).isDumb()) {
    return null;
  }
  if (myIncludeManager.getIncludingFiles(file.getVirtualFile(), false).length > 0) {
    return new FileIncludeContextHectorPanel(file, myIncludeManager);
  }
  return null;
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:12,
代码来源:FileIncludeContextHectorProvider.java

示例10: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
@Override
public HectorComponentPanel createConfigurable(@NotNull final PsiFile file) {
  final Project project = file.getProject();
  final DaemonCodeAnalyzer analyzer = DaemonCodeAnalyzer.getInstance(project);
  final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
  final VirtualFile virtualFile = file.getVirtualFile();
  assert virtualFile != null;
  final boolean notInLibrary =
    !fileIndex.isInLibrarySource(virtualFile) && !fileIndex.isInLibraryClasses(virtualFile) || fileIndex.isInContent(virtualFile);

  return new HectorComponentPanel() {
    private JCheckBox myImportPopupCheckBox = new JCheckBox(EditorBundle.message("hector.import.popup.checkbox"));
    @Override
    public JComponent createComponent() {
      DialogUtil.registerMnemonic(myImportPopupCheckBox);
      return myImportPopupCheckBox;
    }

    @Override
    public boolean isModified() {
      return myImportPopupCheckBox.isSelected() != analyzer.isImportHintsEnabled(file);
    }

    @Override
    public void apply() throws ConfigurationException {
      analyzer.setImportHintsEnabled(file, myImportPopupCheckBox.isSelected());
    }

    @Override
    public void reset() {
      myImportPopupCheckBox.setSelected(analyzer.isImportHintsEnabled(file));
      myImportPopupCheckBox.setEnabled(analyzer.isAutohintsAvailable(file));
      myImportPopupCheckBox.setVisible(notInLibrary);
    }

    @Override
    public void disposeUIResources() {
      myImportPopupCheckBox = null;
    }
  };
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:42,
代码来源:ImportPopupHectorComponentProvider.java

示例11: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
public HectorComponentPanel createConfigurable(@NotNull final PsiFile file) {
  if (file instanceof XmlFile && AntDomFileDescription.isAntFile(((XmlFile)file))) {
    return new AntHectorConfigurable(((XmlFile)file));
  }
  return null;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:7,
代码来源:AntHectorPanelProvider.java

示例12: createConfigurable

点赞 2

import com.intellij.openapi.editor.HectorComponentPanel; //导入依赖的package包/类
@Override
public HectorComponentPanel createConfigurable(@Nonnull final PsiFile file) {
  final Project project = file.getProject();
  final DaemonCodeAnalyzer analyzer = DaemonCodeAnalyzer.getInstance(project);
  final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
  final VirtualFile virtualFile = file.getVirtualFile();
  assert virtualFile != null;
  final boolean notInLibrary =
    !fileIndex.isInLibrarySource(virtualFile) && !fileIndex.isInLibraryClasses(virtualFile) || fileIndex.isInContent(virtualFile);

  return new HectorComponentPanel() {
    private JCheckBox myImportPopupCheckBox = new JCheckBox(EditorBundle.message("hector.import.popup.checkbox"));
    @Override
    public JComponent createComponent() {
      DialogUtil.registerMnemonic(myImportPopupCheckBox);
      return myImportPopupCheckBox;
    }

    @Override
    public boolean isModified() {
      return myImportPopupCheckBox.isSelected() != analyzer.isImportHintsEnabled(file);
    }

    @Override
    public void apply() throws ConfigurationException {
      analyzer.setImportHintsEnabled(file, myImportPopupCheckBox.isSelected());
    }

    @Override
    public void reset() {
      myImportPopupCheckBox.setSelected(analyzer.isImportHintsEnabled(file));
      myImportPopupCheckBox.setEnabled(analyzer.isAutohintsAvailable(file));
      myImportPopupCheckBox.setVisible(notInLibrary);
    }

    @Override
    public void disposeUIResources() {
      myImportPopupCheckBox = null;
    }
  };
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:42,
代码来源:ImportPopupHectorComponentProvider.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)