mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
WIP plugins: add API to tell have different filtering if a plugin is local or remote
GitOrigin-RevId: 08038e6c12b6fbde127597b056f4678725d7d66f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0a65dd3acd
commit
83d1ab926e
@@ -89,7 +89,7 @@ public class ListPluginComponent extends JPanel {
|
||||
myPluginModel = pluginModel;
|
||||
mySearchListener = searchListener;
|
||||
myMarketplace = marketplace;
|
||||
myIsAllowed = PluginManagerConfigurableForOrg.getInstance().isPluginAllowed(plugin);
|
||||
myIsAllowed = PluginManagerConfigurableForOrg.getInstance().isPluginAllowed(!marketplace, plugin);
|
||||
pluginModel.addComponent(this);
|
||||
|
||||
setOpaque(true);
|
||||
|
||||
+2
-2
@@ -526,8 +526,8 @@ public class PluginDetailsPageComponent extends MultiPanel {
|
||||
public void showPluginImpl(@NotNull IdeaPluginDescriptor pluginDescriptor, @Nullable IdeaPluginDescriptor updateDescriptor) {
|
||||
myPlugin = pluginDescriptor;
|
||||
PluginManagerConfigurableForOrg org = PluginManagerConfigurableForOrg.getInstance();
|
||||
myUpdateDescriptor = updateDescriptor != null && org.isPluginAllowed(updateDescriptor) ? updateDescriptor : null;
|
||||
myIsPluginAllowed = org.isPluginAllowed(pluginDescriptor);
|
||||
myUpdateDescriptor = updateDescriptor != null && org.isPluginAllowed(!myMarketplace, updateDescriptor) ? updateDescriptor : null;
|
||||
myIsPluginAllowed = org.isPluginAllowed(!myMarketplace, pluginDescriptor);
|
||||
showPlugin();
|
||||
select(0, true);
|
||||
}
|
||||
|
||||
+4
-12
@@ -1,19 +1,9 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.plugins.org
|
||||
|
||||
import com.intellij.icons.AllIcons
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor
|
||||
import com.intellij.lang.LangBundle
|
||||
import com.intellij.openapi.application.ApplicationInfo
|
||||
import com.intellij.openapi.components.Service
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.util.SystemInfo
|
||||
import com.intellij.openapi.util.text.HtmlChunk
|
||||
import com.intellij.ui.JBColor
|
||||
import com.intellij.ui.components.JBLabel
|
||||
import com.intellij.util.ui.JBUI
|
||||
import com.intellij.util.ui.components.BorderLayoutPanel
|
||||
import javax.swing.SwingConstants
|
||||
|
||||
/**
|
||||
* This is the common service to deal with organizational
|
||||
@@ -26,10 +16,12 @@ class PluginManagerConfigurableForOrg {
|
||||
fun getInstance(): PluginManagerConfigurableForOrg = service()
|
||||
}
|
||||
|
||||
fun isPluginAllowed(descriptor: IdeaPluginDescriptor) : Boolean {
|
||||
fun isPluginAllowed(isLocalPlugin: Boolean,
|
||||
descriptor: IdeaPluginDescriptor) : Boolean {
|
||||
|
||||
if (isLocalPlugin) return true
|
||||
return descriptor.pluginId.idString.hashCode() % 2 == 0
|
||||
}
|
||||
|
||||
fun allowInstallFromDisk(): Boolean = false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user