本文整理汇总了Java中com.intellij.util.PlatformUtils.isPyCharm方法的典型用法代码示例。如果您正苦于以下问题:Java PlatformUtils.isPyCharm方法的具体用法?Java PlatformUtils.isPyCharm怎么用?Java PlatformUtils.isPyCharm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.PlatformUtils
的用法示例。
在下文中一共展示了PlatformUtils.isPyCharm方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FindSettingsImpl
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
public FindSettingsImpl() {
recentFileMasks.add("*.properties");
recentFileMasks.add("*.html");
recentFileMasks.add("*.jsp");
recentFileMasks.add("*.xml");
recentFileMasks.add("*.java");
recentFileMasks.add("*.js");
recentFileMasks.add("*.as");
recentFileMasks.add("*.css");
recentFileMasks.add("*.mxml");
if (PlatformUtils.isPyCharm()) {
recentFileMasks.add("*.py");
}
else if (PlatformUtils.isRubyMine()) {
recentFileMasks.add("*.rb");
}
else if (PlatformUtils.isPhpStorm()) {
recentFileMasks.add("*.php");
}
}
示例2: visitPyFile
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
@Override
public void visitPyFile(PyFile node) {
super.visitPyFile(node);
if (PlatformUtils.isPyCharm()) {
final Module module = ModuleUtilCore.findModuleForPsiElement(node);
if (module != null) {
final Sdk sdk = PythonSdkType.findPythonSdk(module);
if (sdk == null) {
registerProblem(node, "No Python interpreter configured for the project", new ConfigureInterpreterFix());
}
else if (PythonSdkType.isInvalid(sdk)) {
registerProblem(node, "Invalid Python interpreter selected for the project", new ConfigureInterpreterFix());
}
}
}
}
示例3: addLibrariesFromModule
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
private static void addLibrariesFromModule(Module module, Collection<String> list) {
final OrderEntry[] entries = ModuleRootManager.getInstance(module).getOrderEntries();
for (OrderEntry entry : entries) {
if (entry instanceof LibraryOrderEntry) {
final String name = ((LibraryOrderEntry)entry).getLibraryName();
if (name != null && name.endsWith(LibraryContributingFacet.PYTHON_FACET_LIBRARY_NAME_SUFFIX)) {
// skip libraries from Python facet
continue;
}
for (VirtualFile root : ((LibraryOrderEntry)entry).getRootFiles(OrderRootType.CLASSES)) {
final Library library = ((LibraryOrderEntry)entry).getLibrary();
if (!PlatformUtils.isPyCharm()) {
addToPythonPath(root, list);
}
else if (library instanceof LibraryImpl) {
final PersistentLibraryKind<?> kind = ((LibraryImpl)library).getKind();
if (kind == PythonLibraryType.getInstance().getKind()) {
addToPythonPath(root, list);
}
}
}
}
}
}
示例4: FindSettingsImpl
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
public FindSettingsImpl() {
RECENT_FILE_MASKS.add("*.properties");
RECENT_FILE_MASKS.add("*.html");
RECENT_FILE_MASKS.add("*.jsp");
RECENT_FILE_MASKS.add("*.xml");
RECENT_FILE_MASKS.add("*.java");
RECENT_FILE_MASKS.add("*.js");
RECENT_FILE_MASKS.add("*.as");
RECENT_FILE_MASKS.add("*.css");
RECENT_FILE_MASKS.add("*.mxml");
if (PlatformUtils.isPyCharm()) {
RECENT_FILE_MASKS.add("*.py");
}
else if (PlatformUtils.isRubyMine()) {
RECENT_FILE_MASKS.add("*.rb");
}
else if (PlatformUtils.isPhpStorm()) {
RECENT_FILE_MASKS.add("*.php");
}
}
示例5: isEnabled
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
public boolean isEnabled(@NotNull PsiElement anchor) {
if (myIsEnabled == null) {
final boolean isPyCharm = PlatformUtils.isPyCharm();
if (PySkeletonRefresher.isGeneratingSkeletons()) {
myIsEnabled = false;
}
else if (isPyCharm) {
myIsEnabled = PythonSdkType.getSdk(anchor) != null || PyUtil.isInScratchFile(anchor);
}
else {
myIsEnabled = true;
}
}
return myIsEnabled;
}
示例6: setupDialog
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
void setupDialog(Project project, final List<Sdk> allSdks) {
myProject = project;
final GridBagLayout layout = new GridBagLayout();
myMainPanel = new JPanel(layout);
myName = new JTextField();
myDestination = new TextFieldWithBrowseButton();
myMakeAvailableToAllProjectsCheckbox = new JBCheckBox(PyBundle.message("sdk.create.venv.dialog.make.available.to.all.projects"));
if (project == null || project.isDefault() || !PlatformUtils.isPyCharm()) {
myMakeAvailableToAllProjectsCheckbox.setSelected(true);
myMakeAvailableToAllProjectsCheckbox.setVisible(false);
}
layoutPanel(allSdks);
init();
setOKActionEnabled(false);
registerValidators(new FacetValidatorsManager() {
public void registerValidator(FacetEditorValidator validator, JComponent... componentsToWatch) {
}
public void validate() {
checkValid();
}
});
myMainPanel.setPreferredSize(new Dimension(300, 50));
checkValid();
setInitialDestination();
addUpdater(myName);
new LocationNameFieldsBinding(project, myDestination, myName, myInitialPath, PyBundle.message("sdk.create.venv.dialog.select.venv.location"));
}
示例7: checkSdk
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
private void checkSdk() throws RuntimeConfigurationError {
if (PlatformUtils.isPyCharm()) {
final String path = getInterpreterPath();
if (path == null) {
throw new RuntimeConfigurationError("Please select a valid Python interpreter");
}
}
else {
if (!myUseModuleSdk) {
if (StringUtil.isEmptyOrSpaces(getSdkHome())) {
final Sdk projectSdk = ProjectRootManager.getInstance(getProject()).getProjectSdk();
if (projectSdk == null || !(projectSdk.getSdkType() instanceof PythonSdkType)) {
throw new RuntimeConfigurationError(PyBundle.message("runcfg.unittest.no_sdk"));
}
}
else if (!PythonSdkType.getInstance().isValidSdkHome(getSdkHome())) {
throw new RuntimeConfigurationError(PyBundle.message("runcfg.unittest.no_valid_sdk"));
}
}
else {
Sdk sdk = PythonSdkType.findPythonSdk(getModule());
if (sdk == null) {
throw new RuntimeConfigurationError(PyBundle.message("runcfg.unittest.no_module_sdk"));
}
}
}
}
示例8: isAvailable
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
public static boolean isAvailable() {
return Registry.is("ide.new.welcome.screen")
&& (PlatformUtils.isIntelliJ() || PlatformUtils.isCidr() || PlatformUtils.isWebStorm() ||
PlatformUtils.isPyCharm() || PlatformUtils.isRubyMine() || PlatformUtils.isPhpStorm());
}
示例9: getDescription
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
@Override
public String getDescription() {
return PlatformUtils.isPyCharm()
? "Project interpreter path"
: "Module SDK path";
}
示例10: getDisplayPriority
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
@Override
public DisplayPriority getDisplayPriority() {
return PlatformUtils.isPyCharm() ? DisplayPriority.KEY_LANGUAGE_SETTINGS : DisplayPriority.LANGUAGE_SETTINGS;
}
示例11: getPriority
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
@Override
public DisplayPriority getPriority() {
return PlatformUtils.isPyCharm() ? DisplayPriority.KEY_LANGUAGE_SETTINGS : DisplayPriority.LANGUAGE_SETTINGS;
}
示例12: getDisplayName
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
@Nls
@Override
public String getDisplayName() {
return PlatformUtils.isPyCharm() ? "External Documentation" : "Python External Documentation";
}
示例13: isApplicable
import com.intellij.util.PlatformUtils; //导入方法依赖的package包/类
@Override
public boolean isApplicable(@NotNull Project project) {
return PlatformUtils.isPyCharm() || PythonSdkType.hasValidSdk();
}