本文整理汇总了Java中org.eclipse.core.runtime.IBundleGroupProvider类的典型用法代码示例。如果您正苦于以下问题:Java IBundleGroupProvider类的具体用法?Java IBundleGroupProvider怎么用?Java IBundleGroupProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBundleGroupProvider类属于org.eclipse.core.runtime包,在下文中一共展示了IBundleGroupProvider类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getComponentIds
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
private String getComponentIds() {
String featureId = "ru.taximaxim.codekeeper.feature";
String pluginId = "ru.taximaxim.codekeeper.ui";
String pluginName = "codekeeperUI";
if (Platform.getBundle(pluginId) != null) {
return pluginName;
} else {
for (IBundleGroupProvider bundleGroupProvider : Platform.getBundleGroupProviders()) {
for (IBundleGroup group : bundleGroupProvider.getBundleGroups()) {
if (group.getIdentifier().equals(featureId)) {
return pluginName;
}
}
}
}
return "";
}
示例2: computeBundleGroupMap
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
/**
* Returns the map of versioned feature ids -> info object for all installed features. The format
* of the versioned feature id (the key of the map) is featureId + ":" + versionId.
*
* @return map of versioned feature ids -> info object (key type: <code>String</code>, value type:
* <code>AboutInfo</code>)
* @since 3.0
*/
private Map<String, AboutInfo> computeBundleGroupMap()
{
// use tree map to get predicable order
Map<String, AboutInfo> ids = new TreeMap<String, AboutInfo>();
IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
for (int i = 0; i < providers.length; ++i)
{
IBundleGroup[] groups = providers[i].getBundleGroups();
for (int j = 0; j < groups.length; ++j)
{
IBundleGroup group = groups[j];
AboutInfo info = new AboutInfo(group);
String version = info.getVersionId();
version = version == null ? "0.0.0" //$NON-NLS-1$
: new Version(version).toString();
String versionedFeature = group.getIdentifier() + ":" + version; //$NON-NLS-1$
ids.put(versionedFeature, info);
}
}
return ids;
}
示例3: LocalizeDialog
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
public LocalizeDialog(Shell shell, ITranslatableText tabTitle, ITranslatableSet targetLanguageSet, ITranslatableSet menuTextSet) {
super(shell);
this.tabTitle = tabTitle;
this.targetLanguageSet = targetLanguageSet;
this.menuTextSet = menuTextSet;
// create a descriptive object for each BundleGroup
IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
LinkedList groups = new LinkedList();
if (providers != null) {
for (int i = 0; i < providers.length; ++i) {
IBundleGroup[] bundleGroups = providers[i].getBundleGroups();
for (int j = 0; j < bundleGroups.length; ++j) {
groups.add(new AboutBundleGroupData(bundleGroups[j]));
}
}
}
bundleGroupInfos = (AboutBundleGroupData[]) groups
.toArray(new AboutBundleGroupData[0]);
}
示例4: AboutDialog
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
/**
* @param shell
*/
public AboutDialog(Shell shell) {
super(shell);
product = Platform.getProduct();
if (product != null) {
productName = product.getName();
}
if (productName == null) {
productName = WorkbenchMessages.AboutDialog_defaultProductName;
}
// create a descriptive object for each BundleGroup
final IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
final LinkedList<AboutBundleGroupData> groups = new LinkedList<AboutBundleGroupData>();
if (providers != null) {
for (final IBundleGroupProvider provider : providers) {
final IBundleGroup[] bundleGroups = provider.getBundleGroups();
for (final IBundleGroup bundleGroup : bundleGroups) {
groups.add(new AboutBundleGroupData(bundleGroup));
}
}
}
bundleGroupInfos = groups.toArray(new AboutBundleGroupData[0]);
}
示例5: getVersion
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
private String getVersion() {
IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
if (providers != null) {
for (IBundleGroupProvider provider : providers) {
IBundleGroup[] bundleGroups = provider.getBundleGroups();
for (IBundleGroup group : bundleGroups) {
if (group.getIdentifier().equals("ru.taximaxim.codekeeper.feature")) {
return group.getVersion();
}
}
}
}
return "version_unavalable";
}
示例6: getProductInformation
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
/**
* It returns two strings, the first is the eclipse provider and the second
* is the eclipse version.
*/
private final String getProductInformation(final String shortName) {
final String[] productInfo = new String[2];
String productVendorVersion = ""; //$NON-NLS-1$
// collect this information only in case of running as eclipse plugin
if (shortName.equals(ProductName.PLUGIN)) {
productInfo[0] = Platform.getProduct().getName().replace(' ', '_');
final IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
if (providers != null) {
for (final IBundleGroupProvider provider : providers) {
final IBundleGroup[] groups = provider.getBundleGroups();
for (final IBundleGroup group : groups) {
final String groupName = group.getName();
final String groupVersion = group.getVersion();
if (groupName.equalsIgnoreCase(ECLIPSE_GROUP_NAME)) {
final int index = groupVersion.indexOf(".v"); //$NON-NLS-1$
if (index > 0) {
productInfo[1] = groupVersion.substring(0, index);
} else {
productInfo[1] = groupVersion;
}
break;
}
}
}
}
}
if (productInfo[0] != null && productInfo[1] != null) {
productVendorVersion = MessageFormat.format("{0} {1} ", productInfo[0], productInfo[1]); //$NON-NLS-1$
}
return productVendorVersion;
}
示例7: getToolsVersion
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
@VisibleForTesting
static String getToolsVersion(IBundleGroupProvider[] bundleGroupProviders) {
for (IBundleGroupProvider provider : bundleGroupProviders) {
for (IBundleGroup feature : provider.getBundleGroups()) {
if (CLOUD_TOOLS_FOR_ECLIPSE_FEATURE_ID.equals(feature.getIdentifier())) {
return feature.getVersion();
}
}
}
// May not have been installed with via a feature. Although we could report the bundle version,
// that may result in a confusing versions.
logger.fine("Feature not found: " + CLOUD_TOOLS_FOR_ECLIPSE_FEATURE_ID);
return "0.0.0";
}
示例8: testGetToolsVersion_hasFeature
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
@Test
public void testGetToolsVersion_hasFeature() {
Mockito.when(bundleGroupProvider.getBundleGroups())
.thenReturn(new IBundleGroup[] {bundleGroup});
Mockito.when(bundleGroup.getIdentifier())
.thenReturn(CloudToolsInfo.CLOUD_TOOLS_FOR_ECLIPSE_FEATURE_ID);
Mockito.when(bundleGroup.getVersion()).thenReturn("123.456.789");
Assert.assertEquals("123.456.789",
CloudToolsInfo.getToolsVersion(new IBundleGroupProvider[] {bundleGroupProvider}));
}
示例9: doImport
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
@Override
public void doImport(Version version) {
version.getFeatures().clear();
version.getBundles().clear();
IBundleGroupProvider[] features = Platform.getBundleGroupProviders();
for (IBundleGroupProvider bgProvider : features) {
loadFeatures(version, bgProvider.getBundleGroups());
}
}
示例10: initializeBundleGroupInfos
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
private void initializeBundleGroupInfos() {
if (bundleGroupInfos == null) {
final IBundleGroupProvider[] providers = Platform
.getBundleGroupProviders();
// create a descriptive object for each BundleGroup
final LinkedList groups = new LinkedList();
if (providers != null) {
for (int i = 0; i < providers.length; ++i) {
final IBundleGroup[] bundleGroups = providers[i]
.getBundleGroups();
for (int j = 0; j < bundleGroups.length; ++j) {
groups.add(new AboutBundleGroupData(bundleGroups[j]));
}
}
}
bundleGroupInfos = (AboutBundleGroupData[]) groups
.toArray(new AboutBundleGroupData[0]);
} else {
// the order of the array may be changed due to sorting, so create a
// copy, since the client set this value.
final AboutBundleGroupData[] clientArray = bundleGroupInfos;
bundleGroupInfos = new AboutBundleGroupData[clientArray.length];
System.arraycopy(clientArray, 0, bundleGroupInfos, 0,
clientArray.length);
}
AboutData.sortByProvider(reverseSort, bundleGroupInfos);
}
示例11: testGetToolsVersion_noFeature
import org.eclipse.core.runtime.IBundleGroupProvider; //导入依赖的package包/类
@Test
public void testGetToolsVersion_noFeature() {
Assert.assertEquals("0.0.0", CloudToolsInfo.getToolsVersion(new IBundleGroupProvider[0]));
}