本文整理汇总了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);
}
示例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());
}
示例3: isOptimizeImportsAvailable
import com.intellij.lang.LanguageImportStatements; //导入依赖的package包/类
private static boolean isOptimizeImportsAvailable(final PsiFile file) {
return !LanguageImportStatements.INSTANCE.forFile(file).isEmpty();
}
示例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;
}