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


Java LanguageImportStatements类代码示例

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


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

示例1: setUpActions

import com.intellij.lang.LanguageImportStatements; //导入依赖的package包/类
private void setUpActions() {
  boolean canOptimizeImports = !LanguageImportStatements.INSTANCE.forFile(myFile).isEmpty();
  myOptimizeImportsCb.setVisible(canOptimizeImports);
  if (canOptimizeImports) {
    myOptimizeImportsCb.setSelected(myLastRunOptions.getLastOptimizeImports());
  }

  boolean canRearrangeCode = Rearranger.EXTENSION.forLanguage(myFile.getLanguage()) != null;
  myRearrangeCodeCb.setVisible(canRearrangeCode);
  if (canRearrangeCode) {
    myRearrangeCodeCb.setSelected(myLastRunOptions.isRearrangeCode(myFile.getLanguage()));
  }

  myOptionalLabel.setVisible(canOptimizeImports || canRearrangeCode);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:LayoutCodeDialog.java

示例2: updateState

import com.intellij.lang.LanguageImportStatements; //导入依赖的package包/类
private void updateState() {
  myCbIncludeSubdirs.setEnabled(myRbDirectory.isSelected());
  myCbOptimizeImports.setEnabled(
    !myRbSelectedText.isSelected()
    && !(myFile != null && LanguageImportStatements.INSTANCE.forFile(myFile).isEmpty() && myRbFile.isSelected())
  );
  myCbArrangeEntries.setEnabled(myFile != null
                                && Rearranger.EXTENSION.forLanguage(myFile.getLanguage()) != null
  );

  myCbOnlyVcsChangedRegions.setEnabled(canTargetVcsRegions());
  myDoNotAskMeCheckBox.setEnabled(!myRbDirectory.isSelected());
  myRbDirectory.setEnabled(!myDoNotAskMeCheckBox.isSelected());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:LayoutCodeDialog.java

示例3: isOptimizeImportsAvailable

import com.intellij.lang.LanguageImportStatements; //导入依赖的package包/类
private static boolean isOptimizeImportsAvailable(final PsiFile file) {
  return !LanguageImportStatements.INSTANCE.forFile(file).isEmpty();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:OptimizeImportsAction.java

示例4: createCenterPanel

import com.intellij.lang.LanguageImportStatements; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
  JPanel panel = new JPanel(new GridBagLayout());
  panel.setBorder(BorderFactory.createEmptyBorder(4, 8, 8, 0));
  GridBagConstraints gbConstraints = new GridBagConstraints();
  gbConstraints.gridy = 0;
  gbConstraints.gridx = 0;
  gbConstraints.gridwidth = 3;
  gbConstraints.gridheight = 1;
  gbConstraints.weightx = 1;

  gbConstraints.fill = GridBagConstraints.BOTH;
  gbConstraints.insets = new Insets(0, 0, 0, 0);

  myRbFile = new JRadioButton(CodeInsightBundle.message("process.scope.file",
                                                        (myFile != null ? "'" + myFile.getVirtualFile().getPresentableUrl() + "'" : "")));
  panel.add(myRbFile, gbConstraints);

  myRbSelectedText = new JRadioButton(CodeInsightBundle.message("reformat.option.selected.text"));
  if (myTextSelected != null) {
    gbConstraints.gridy++;
    gbConstraints.insets = new Insets(0, 0, 0, 0);
    panel.add(myRbSelectedText, gbConstraints);
  }

  myRbDirectory = new JRadioButton();
  myCbIncludeSubdirs = new JCheckBox(CodeInsightBundle.message("reformat.option.include.subdirectories"));
  if (myDirectory != null) {
    myRbDirectory.setText(CodeInsightBundle.message("reformat.option.all.files.in.directory",
                                                    myDirectory.getVirtualFile().getPresentableUrl()));
    gbConstraints.gridy++;
    gbConstraints.insets = new Insets(0, 0, 0, 0);
    panel.add(myRbDirectory, gbConstraints);

    if (myDirectory.getSubdirectories().length > 0) {
      gbConstraints.gridy++;
      gbConstraints.insets = new Insets(0, 20, 0, 0);
      panel.add(myCbIncludeSubdirs, gbConstraints);
    }
  }

  myCbOptimizeImports = new JCheckBox(CodeInsightBundle.message("reformat.option.optimize.imports"));
  if (myTextSelected != null && LanguageImportStatements.INSTANCE.hasAnyExtensions()) {
    gbConstraints.gridy++;
    gbConstraints.insets = new Insets(0, 0, 0, 0);
    panel.add(myCbOptimizeImports, gbConstraints);
  }

  myCbArrangeEntries = new JCheckBox(CodeInsightBundle.message("reformat.option.rearrange.entries"));
  if (myFile != null && Rearranger.EXTENSION.forLanguage(myFile.getLanguage()) != null) {
    gbConstraints.gridy++;
    gbConstraints.insets = new Insets(0, 0, 0, 0);
    panel.add(myCbArrangeEntries, gbConstraints);
  }

  myCbOnlyVcsChangedRegions = new JCheckBox(CodeInsightBundle.message("reformat.option.vcs.changed.region"));
  gbConstraints.gridy++;
  panel.add(myCbOnlyVcsChangedRegions, gbConstraints);

  ButtonGroup buttonGroup = new ButtonGroup();
  buttonGroup.add(myRbFile);
  buttonGroup.add(myRbSelectedText);
  buttonGroup.add(myRbDirectory);

  myRbFile.setEnabled(myFile != null);
  myRbSelectedText.setEnabled(myTextSelected == Boolean.TRUE);

  return panel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:70,代码来源:LayoutCodeDialog.java


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