本文整理匯總了Java中com.intellij.openapi.extensions.PluginId類的典型用法代碼示例。如果您正苦於以下問題:Java PluginId類的具體用法?Java PluginId怎麽用?Java PluginId使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PluginId類屬於com.intellij.openapi.extensions包,在下文中一共展示了PluginId類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkDependentPlugins
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
private void checkDependentPlugins() {
final IdeaPluginDescriptor hybrisPlugin = PluginManager.getPlugin(PluginId.getId(HybrisConstants.PLUGIN_ID));
final PluginId[] dependentPluginIds = hybrisPlugin.getOptionalDependentPluginIds();
Arrays.stream(dependentPluginIds).forEach(id -> {
if (id.getIdString().startsWith(EXCLUDED_ID_PREFIX)) {
return;
}
final boolean installed = PluginManager.isPluginInstalled(id);
if (!installed) {
notInstalledPlugins.add(id);
return;
}
final IdeaPluginDescriptor plugin = PluginManager.getPlugin(id);
if (!plugin.isEnabled()) {
notEnabledPlugins.add(id);
}
});
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:19,代碼來源:CheckRequiredPluginsStep.java
示例2: populateComboBox
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
public void populateComboBox() {
modifyFormComponentVisibility();
// If the selector has already been populated, do not populate it again.
if (versionComboBoxContains(VersionComboHeaders.INSTALLED.toString()) ||
versionComboBoxContains(VersionComboHeaders.AVAILABLE.toString())) {
return;
}
String relativeDependencyRootPath = DependencyResolutionBundle.key("dependency_root");
File dependencyRoot = new File(PluginManager
.getPlugin(PluginId.getId("org.idea.processing.plugin")).getPath(),
relativeDependencyRootPath);
// Populate the versions already installed.
populateVersionSelectorWithInstalledVersions(dependencyRoot);
logger.info("Querying Processing versions available for download.");
// INVOKE
populateVersionSelectorWithAvailableVersions(dependencyRoot);
}
示例3: projectOpened
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
@Override
public void projectOpened() {
TYPO3CMSSettings instance = TYPO3CMSSettings.getInstance(project);
IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("com.cedricziel.idea.typo3"));
if (plugin == null) {
return;
}
String version = instance.getVersion();
if (version == null || !plugin.getVersion().equals(version)) {
instance.setVersion(plugin.getVersion());
FileBasedIndex index = FileBasedIndex.getInstance();
index.scheduleRebuild(CoreServiceMapStubIndex.KEY, new Throwable());
index.scheduleRebuild(ExtensionNameStubIndex.KEY, new Throwable());
index.scheduleRebuild(IconIndex.KEY, new Throwable());
index.scheduleRebuild(ResourcePathIndex.KEY, new Throwable());
index.scheduleRebuild(RouteIndex.KEY, new Throwable());
index.scheduleRebuild(TablenameFileIndex.KEY, new Throwable());
index.scheduleRebuild(LegacyClassesForIDEIndex.KEY, new Throwable());
index.scheduleRebuild(MethodArgumentDroppedIndex.KEY, new Throwable());
index.scheduleRebuild(ControllerActionIndex.KEY, new Throwable());
}
}
示例4: findAssociationForFile
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
/**
* Find the Association for the given FileInfo
*
* @param file
* @return
*/
@VisibleForTesting
@Nullable
protected Association findAssociationForFile(final FileInfo file) {
Association result = null;
for (final Association association : associations) {
if (association.matches(file)) {
result = association;
break;
}
}
if (result != null && result.getName().equals("Images")) {
try {
// Icon viewer plugin
final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("ch.dasoft.iconviewer"));
if (plugin != null) {
return null;
}
} catch (Exception e) {
e.printStackTrace();
}
}
return result;
}
示例5: addAgent
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
private void addAgent(com.samebug.clients.common.tracking.RawEvent e) {
final Map<String, String> agent = new HashMap<String, String>();
final LookAndFeel laf = UIManager.getLookAndFeel();
final ApplicationInfo appInfo = ApplicationInfo.getInstance();
final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(IdeaSamebugPlugin.ID));
final String pluginVersion = plugin == null ? null : plugin.getVersion();
final String instanceId = config.instanceId;
agent.put("type", "ide-plugin");
agent.put("ideCodeName", appInfo.getBuild().getProductCode());
if (laf != null) agent.put("lookAndFeel", laf.getName());
if (pluginVersion != null) agent.put("pluginVersion", pluginVersion);
if (instanceId != null) agent.put("instanceId", instanceId);
agent.put("isRetina", Boolean.toString(UIUtil.isRetina()));
agent.put("ideBuild", appInfo.getApiVersion());
e.withField("agent", agent);
}
示例6: createDownloader
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
@NotNull
public static PluginDownloader createDownloader(@NotNull IdeaPluginDescriptor descriptor,
@Nullable String host,
@Nullable BuildNumber buildNumber) throws IOException {
try {
String url = getUrl(descriptor, host, buildNumber);
String id = descriptor.getPluginId().getIdString();
PluginDownloader downloader = new PluginDownloader(id, url, descriptor.getName(), descriptor.getVersion(), buildNumber);
downloader.setDescriptor(descriptor);
downloader.setDescription(descriptor.getDescription());
List<PluginId> depends;
if (descriptor instanceof PluginNode) {
depends = ((PluginNode)descriptor).getDepends();
}
else {
depends = new ArrayList<PluginId>(Arrays.asList(descriptor.getDependentPluginIds()));
}
downloader.setDepends(depends);
return downloader;
}
catch (URISyntaxException e) {
throw new IOException(e);
}
}
示例7: createPluginNode
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
@Nullable
public static PluginNode createPluginNode(@Nullable String host, @NotNull PluginDownloader downloader) {
IdeaPluginDescriptor descriptor = downloader.getDescriptor();
if (descriptor instanceof PluginNode) {
return (PluginNode)descriptor;
}
PluginNode node = new PluginNode(PluginId.getId(downloader.getPluginId()));
node.setName(downloader.getPluginName());
node.setVersion(downloader.getPluginVersion());
node.setRepositoryName(host);
node.setDownloadUrl(downloader.myPluginUrl);
node.setDepends(downloader.getDepends(), null);
node.setDescription(downloader.getDescription());
return node;
}
示例8: testUpdate
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
public void testUpdate() throws Exception {
CaptureService service = CaptureService.getInstance(myProject);
assertNull(service.getCapturesDirectory());
VirtualFile projectDir = LocalFileSystem.getInstance().findFileByPath(myProject.getBasePath());
assertNotNull(projectDir);
VirtualFile captures = projectDir.createChildDirectory(null, "captures");
assertTrue(service.getCaptures().isEmpty());
captures.createChildData(null, "data.capture");
service.update();
assertTrue(service.getCaptures().isEmpty());
ExtensionsArea area = Extensions.getRootArea();
Element element = readElement(" <extensions defaultExtensionNs=\"com.android\">\n" +
" <captureType implementation=\"" + MyCaptureType.class.getName() +
"\"/>\n </extensions>");
area.registerExtension(new DefaultPluginDescriptor(PluginId.getId("com.android")), element.getChild("captureType"));
MyCaptureType type = CaptureTypeService.getInstance().getType(MyCaptureType.class);
service.update();
assertEquals(1, service.getCaptures().size());
assertEquals(type, service.getCaptures().iterator().next().getType());
}
示例9: registerOrReplaceActionInner
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
private void registerOrReplaceActionInner(@NotNull Element element, @NotNull String id, @NotNull AnAction action, @Nullable PluginId pluginId) {
synchronized (myLock) {
if (Boolean.valueOf(element.getAttributeValue(OVERRIDES_ATTR_NAME))) {
if (getActionOrStub(id) == null) {
throw new RuntimeException(element.getName() + " '" + id + "' doesn't override anything");
}
AnAction prev = replaceAction(id, action, pluginId);
if (action instanceof DefaultActionGroup && prev instanceof DefaultActionGroup) {
if (Boolean.valueOf(element.getAttributeValue(KEEP_CONTENT_ATTR_NAME))) {
((DefaultActionGroup)action).copyFromGroup((DefaultActionGroup)prev);
}
}
}
else {
registerAction(id, action, pluginId, element.getAttributeValue(PROJECT_TYPE));
}
}
}
示例10: getParentGroup
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
@Nullable
public AnAction getParentGroup(final String groupId,
@Nullable final String actionName,
@Nullable final PluginId pluginId) {
if (groupId == null || groupId.isEmpty()) {
reportActionError(pluginId, actionName + ": attribute \"group-id\" should be defined");
return null;
}
AnAction parentGroup = getActionImpl(groupId, true);
if (parentGroup == null) {
reportActionError(pluginId, actionName + ": group with id \"" + groupId + "\" isn't registered; action will be added to the \"Other\" group");
parentGroup = getActionImpl(IdeActions.GROUP_OTHER_MENU, true);
}
if (!(parentGroup instanceof DefaultActionGroup)) {
reportActionError(pluginId, actionName + ": group with id \"" + groupId + "\" should be instance of " + DefaultActionGroup.class.getName() +
" but was " + parentGroup.getClass());
return null;
}
return parentGroup;
}
示例11: registerAction
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
public void registerAction(@NotNull String actionId, @NotNull AnAction action, @Nullable PluginId pluginId, @Nullable String projectType) {
synchronized (myLock) {
if (addToMap(actionId, action, pluginId, projectType) == null) return;
if (myAction2Id.containsKey(action)) {
reportActionError(pluginId, "action was already registered for another ID. ID is " + myAction2Id.get(action) +
getPluginInfo(pluginId));
return;
}
myId2Index.put(actionId, myRegisteredActionsCount++);
myAction2Id.put(action, actionId);
if (pluginId != null && !(action instanceof ActionGroup)){
THashSet<String> pluginActionIds = myPlugin2Id.get(pluginId);
if (pluginActionIds == null){
pluginActionIds = new THashSet<String>();
myPlugin2Id.put(pluginId, pluginActionIds);
}
pluginActionIds.add(actionId);
}
action.registerCustomShortcutSet(new ProxyShortcutSet(actionId, myKeymapManager), null);
}
}
示例12: replaceAction
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
private AnAction replaceAction(@NotNull String actionId, @NotNull AnAction newAction, @Nullable PluginId pluginId) {
AnAction oldAction = getActionOrStub(actionId);
if (oldAction != null) {
boolean isGroup = oldAction instanceof ActionGroup;
if (isGroup != newAction instanceof ActionGroup) {
throw new IllegalStateException("cannot replace a group with an action and vice versa: " + actionId);
}
unregisterAction(actionId);
if (isGroup) {
myId2GroupId.values().remove(actionId);
}
}
registerAction(actionId, newAction, pluginId);
for (String groupId : myId2GroupId.get(actionId)) {
DefaultActionGroup group = ObjectUtils.assertNotNull((DefaultActionGroup)getActionOrStub(groupId));
group.replaceAction(oldAction, newAction);
}
return oldAction;
}
示例13: isModified
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
@Override
public boolean isModified() {
final boolean modified = super.isModified();
if (modified) return true;
final List<String> disabledPlugins = PluginManagerCore.getDisabledPlugins();
for (int i = 0; i < pluginsModel.getRowCount(); i++) {
if (isPluginStateChanged(pluginsModel.getObjectAt(i), disabledPlugins)) {
return true;
}
}
for (IdeaPluginDescriptor descriptor : pluginsModel.filtered) {
if (isPluginStateChanged(descriptor, disabledPlugins)) {
return true;
}
}
for (Map.Entry<PluginId, Boolean> entry : ((InstalledPluginsTableModel)pluginsModel).getEnabledMap().entrySet()) {
final Boolean enabled = entry.getValue();
if (enabled != null && !enabled.booleanValue() && !disabledPlugins.contains(entry.getKey().toString())) {
return true;
}
}
return false;
}
示例14: onDescriptorDownload
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
/**
* Should be called whenever a list of plugins is loaded from a repository to check if there is an updated version.
*/
public void onDescriptorDownload(@NotNull IdeaPluginDescriptor descriptor) {
PluginId id = descriptor.getPluginId();
IdeaPluginDescriptor existing = PluginManager.getPlugin(id);
if (existing == null || (existing.isBundled() && !existing.allowBundledUpdate()) || wasUpdated(id)) {
return;
}
boolean supersedes = !PluginManagerCore.isIncompatible(descriptor) &&
(PluginDownloader.compareVersionsSkipBrokenAndIncompatible(existing, descriptor.getVersion()) > 0);
String idString = id.getIdString();
synchronized (myLock) {
if (supersedes) {
myOutdatedPlugins.add(idString);
}
else {
myOutdatedPlugins.remove(idString);
}
}
}
示例15: getPluginVersion
import com.intellij.openapi.extensions.PluginId; //導入依賴的package包/類
private static String getPluginVersion() {
IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(PLUGIN_ID));
if (plugin == null) {
return "unknown";
}
return plugin.getVersion();
}