本文整理汇总了Java中org.eclipse.equinox.p2.ui.ProvisioningUI.getDefaultUI方法的典型用法代码示例。如果您正苦于以下问题:Java ProvisioningUI.getDefaultUI方法的具体用法?Java ProvisioningUI.getDefaultUI怎么用?Java ProvisioningUI.getDefaultUI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.equinox.p2.ui.ProvisioningUI
的用法示例。
在下文中一共展示了ProvisioningUI.getDefaultUI方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addP2Repositories
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入方法依赖的package包/类
/**
* @param resourceDir
* @param sourceLoc
* @throws IOException
*/
private void addP2Repositories(URI... p2Repos) throws IOException {
ProvisioningUI pui = ProvisioningUI.getDefaultUI();
for (URI repo : p2Repos) {
pui.getRepositoryTracker().addRepository(repo, null, pui.getSession());
}
}
示例2: getBundleInfo
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入方法依赖的package包/类
/**
* Gathers a list of all the IInstallableUnits currently running in the application during runtime.
*/
public void getBundleInfo(){
ProvisioningUI provisioningUI = ProvisioningUI.getDefaultUI();
String profileId = provisioningUI.getProfileId();
ProvisioningSession provisioningSession = provisioningUI.getSession();
IProfileRegistry profileReg = (IProfileRegistry)provisioningSession.getProvisioningAgent().getService(IProfileRegistry.SERVICE_NAME);
IQueryable<IInstallableUnit> queryable = profileReg.getProfile(profileId);
IQuery<IInstallableUnit> query = QueryUtil.createIUAnyQuery();
IQueryResult<IInstallableUnit> result = queryable.query(query, new NullProgressMonitor());
for (final IInstallableUnit iu : result)
{
installedBundles.add(iu);
}
Collections.sort(installedBundles);
}
示例3: findSources
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入方法依赖的package包/类
@Override
public IPath findSources(File jar, IProgressMonitor monitor) {
if (!BundleUtil.isBundle(jar)) {
return null;
}
IArtifactKey artifactKey = BundleUtil.getArtifactKey(jar);
if (artifactKey == null || blackList.contains(artifactKey.getId())) {
return null;
}
IArtifactKey sourceKey = BundleUtil.toSourceKey(artifactKey);
ProvisioningUI provisioningUI = ProvisioningUI.getDefaultUI();
List<URI> uris = Arrays
.asList(provisioningUI.getRepositoryTracker().getKnownRepositories(provisioningUI.getSession()));
Collections.sort(uris);// stupid trick to make eclipse.org repos being
// searched almost first
Path cacheFolder = SourceLookupPreferences.getInstance().getDownloadedSourcesDirectory();
for (URI repo : uris) {
if (monitor.isCanceled()) {
return null;
}
IArtifactRepository artifactRepo = null;
try {
artifactRepo = provisioningUI.loadArtifactRepository(repo, false, monitor);
} catch (ProvisionException ignored) {
ignored.printStackTrace();
// local urls seem to fail
}
if (artifactRepo == null || !artifactRepo.contains(sourceKey)) {
continue;
}
IArtifactDescriptor[] results = artifactRepo.getArtifactDescriptors(sourceKey);
if (results.length > 0) {
try {
return saveArtifact(artifactRepo, results[0], cacheFolder, monitor);
} catch (Exception e) {
e.printStackTrace();
}
}
}
return null;
}
示例4: getProvisioningUI
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入方法依赖的package包/类
protected ProvisioningUI getProvisioningUI() {
return ProvisioningUI.getDefaultUI();
}
示例5: getProvisioningUI
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入方法依赖的package包/类
protected ProvisioningUI getProvisioningUI() {
return ProvisioningUI.getDefaultUI();
}
示例6: getProvisioningUI
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入方法依赖的package包/类
public ProvisioningUI getProvisioningUI() {
return ProvisioningUI.getDefaultUI();
}
示例7: getProvisioningUI
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入方法依赖的package包/类
protected ProvisioningUI getProvisioningUI(){
return ProvisioningUI.getDefaultUI();
}
示例8: saveState
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入方法依赖的package包/类
/**
* Save update sites in a memento because when a new app is installed then the configuration is
* cleaned up.
*/
public static void saveState(final IMemento memento) {
try {
final ProvisioningUI ui = ProvisioningUI.getDefaultUI();
ui.signalRepositoryOperationStart();
final IMetadataRepositoryManager metaManager = ProvUI.getMetadataRepositoryManager(ui.getSession());
try {
final int visibilityFlags = ui.getRepositoryTracker().getMetadataRepositoryFlags();
final URI[] currentlyEnabledURIs = metaManager.getKnownRepositories(//
IRepositoryManager.REPOSITORIES_ALL);
final URI[] currentlyDisabledURIs = metaManager.getKnownRepositories(//
IRepositoryManager.REPOSITORIES_DISABLED | visibilityFlags);
final IMemento xmlRepositories = memento.createChild(TAG_REPOSITORIES);
saveState_URI(currentlyEnabledURIs, metaManager, xmlRepositories, true);
saveState_URI(currentlyDisabledURIs, metaManager, xmlRepositories, false);
} finally {
ui.signalRepositoryOperationComplete(null, true);
}
} catch (final Exception e) {
// this can occure when running in the IDE
StatusUtil.handleStatus(e, 0);
}
}