本文整理汇总了Java中org.eclipse.equinox.p2.ui.ProvisioningUI类的典型用法代码示例。如果您正苦于以下问题:Java ProvisioningUI类的具体用法?Java ProvisioningUI怎么用?Java ProvisioningUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProvisioningUI类属于org.eclipse.equinox.p2.ui包,在下文中一共展示了ProvisioningUI类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doExecute
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
@Override
protected void doExecute(final LoadMetadataRepositoryJob job) {
final ProvisioningUI provisioningUI = getProvisioningUI();
final Policy policy = provisioningUI.getPolicy();
if (hasNoRepos) {
if (policy.getRepositoriesVisible()) {
final boolean goToSites = MessageDialog.openQuestion(
getShell(),
ProvSDKMessages.UpdateHandler_NoSitesTitle,
ProvSDKMessages.UpdateHandler_NoSitesMessage);
if (goToSites) {
provisioningUI.manipulateRepositories(getShell());
}
}
return;
}
// Report any missing repositories.
job.reportAccumulatedStatus();
if (policy.continueWorkingWithOperation(operation, getShell())) {
provisioningUI.openUpdateWizard(false, operation, job);
}
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:27,代码来源:UpdateHandler.java
示例2: setUpdateSites
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
/**
* After trying to set addRepository with p2.inf for 2 full days, I ended up to set it
* programmatically like others also did, found a solution here: <a href=
* "http://coopology.com/2012/08/eclipse-rcp-setting-p2-repositories-update-sites-programmatically-for-when-p2-inf-fails/"
* >http://coopology.com/2012/08/eclipse-rcp-setting-p2-repositories-update-sites-
* programmatically-for-when-p2-inf-fails/</a>
*
* @param memento
* @throws InvocationTargetException
*/
public static void setUpdateSites(final IMemento memento) {
//
// Original
//
// ElementUtils.updateRepositoryUsingElements(ui, DEFAULT_UPDATE_SITES, null);
//
final MetadataRepositoryElement[] mergedRepos = mergeRepositories(memento);
try {
updateRepositoryUsingElements(ProvisioningUI.getDefaultUI(), mergedRepos, null);
} catch (final Exception e) {
// this can occure when running in the IDE
StatusUtil.handleStatus(e, 0);
}
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:31,代码来源:P2_Activator.java
示例3: 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());
}
}
开发者ID:fbricon,项目名称:pde.source.lookup,代码行数:12,代码来源:IntegrationTest.java
示例4: setRepositories
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
/**
* Sets the defaults repositories to look into.
* <p>
*
* We programmatically set the repositories as alternative to the p2.inf method.
* In fact, if the RCP application is installed into a user-write protected directory,
* p2.inf will fail to be able to add the repositories (as it tries to modify the
* configuration on the first RCP run).
*
* @param repositoryURLs the list of repository URLs
*/
public static void setRepositories(List<String> repositoryURLs){
try {
List<MetadataRepositoryElement> repos = new ArrayList<MetadataRepositoryElement>(repositoryURLs.size());
for(String url : repositoryURLs){
MetadataRepositoryElement repoEl =
new MetadataRepositoryElement(null, new URI(url), true);
repos.add(repoEl);
}
ElementUtils.updateRepositoryUsingElements(
ProvisioningUI.getDefaultUI(), repos.toArray(new MetadataRepositoryElement[repos.size()]), null);
} catch (URISyntaxException e) {
Activator.getDefault().logError(Messages.P2Util_ErrorMessage, e);
}
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:P2Util.java
示例5: UpdateDescriptionPage
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
/**
* root 参数未使用
* @param operation
* @param root
* @param ui
*/
protected UpdateDescriptionPage(UpdateOperation operation, IUElementListRoot root, ProvisioningUI ui) {
super("MyUpdsateDescriptionPage");
setTitle(P2UpdateUtil.UI_WIZARD_DESC_PAGE_TITLE);
setDescription(P2UpdateUtil.UI_WIZARD_DESC_PAGE_DESC);
this.ui = ui;
this.root = root;
this.operation = operation;
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:15,代码来源:UpdateDescriptionPage.java
示例6: UpdateWizardPage
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
protected UpdateWizardPage(UpdateOperation operation,IUElementListRoot root, ProvisioningUI ui) {
super("MyUpdasteWizardPage1", ui, null);
this.ui = ui;
this.operation = operation;
this.input = root;
setTitle(P2UpdateUtil.UI_WIZARD_PAGE_TITLE);
setDescription(P2UpdateUtil.UI_WIZARD_PAGE_DESC);
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:9,代码来源:UpdateWizardPage.java
示例7: UpdateWizard
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
public UpdateWizard(ProvisioningUI ui, UpdateOperation operation, Object[] initialSelections) {
Assert.isLegal(operation.hasResolved(), "Cannot create an update wizard on an unresolved operation"); //$NON-NLS-1$
setWindowTitle(P2UpdateUtil.UI_WIZARD_DIALOG_TITLE);
// setDefaultPageImageDescriptor(ProvUIImages.getImageDescriptor(ProvUIImages.WIZARD_BANNER_UPDATE));
this.operation = operation;
// this.initialSelections = (Update[]) initialSelections;
this.ui = ui;
// initializeResolutionModelElements(initialSelections);
setNeedsProgressMonitor(true);
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:11,代码来源:UpdateWizard.java
示例8: 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);
}
开发者ID:Pro-Nouns,项目名称:LinGUIne,代码行数:18,代码来源:AboutWizardPage.java
示例9: loadRepository
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
/**
* Establishes all the repositories and repository managers needed for the install job
*
* @param agent the current ProvisioningAgent
* @param repositoryLocation the valid p2 repository location
* @return metadata repository object from a valid p2 repository
* @throws ProvisionException
*/
@SuppressWarnings("restriction")
public static IMetadataRepository loadRepository(IProvisioningAgent agent, URI repositoryLocation) throws ProvisionException{
final ProvisioningUI ui = ProvUIActivator.getDefault().getProvisioningUI();
IArtifactRepositoryManager artifactManager = ProvUI.getArtifactRepositoryManager(ui.getSession());
IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
artifactManager.addRepository(repositoryLocation);
IMetadataRepository repository = manager.loadRepository(repositoryLocation, new NullProgressMonitor());
return repository;
}
开发者ID:Pro-Nouns,项目名称:LinGUIne,代码行数:18,代码来源:InstallUtils.java
示例10: 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;
}
开发者ID:fbricon,项目名称:pde.source.lookup,代码行数:46,代码来源:P2SourceLocator.java
示例11: init
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
public void init(IWorkbench workbench) {
final ProvisioningUI ui = ProvUIActivator.getDefault().getProvisioningUI();
uri = URI.create("http://lamport.org/tlatoolbox/ci/toolboxUpdate/");
artifactRepositoryManager = ProvUI.getArtifactRepositoryManager(ui.getSession());
metadataRepositoryManager = ProvUI.getMetadataRepositoryManager(ui.getSession());
}
开发者ID:tlaplus,项目名称:tlaplus,代码行数:7,代码来源:AutomaticUpdatesPreferencePage.java
示例12: getProvisioningUI
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
protected ProvisioningUI getProvisioningUI() {
return ProvisioningUI.getDefaultUI();
}
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:4,代码来源:PreloadingRepositoryHandler.java
示例13: getProvisioningUI
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
protected ProvisioningUI getProvisioningUI() {
return ProvisioningUI.getDefaultUI();
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:4,代码来源:PreloadingRepositoryHandler.java
示例14: setColocatedRepositoryEnablement
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
private static void setColocatedRepositoryEnablement( final ProvisioningUI ui,
final URI location,
final boolean enable) {
ProvUI.getArtifactRepositoryManager(ui.getSession()).setEnabled(location, enable);
ProvUI.getMetadataRepositoryManager(ui.getSession()).setEnabled(location, enable);
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:7,代码来源:P2_Activator.java
示例15: getProvisioningUI
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
public ProvisioningUI getProvisioningUI() {
return ProvisioningUI.getDefaultUI();
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:4,代码来源:P2_Activator.java
示例16: getProvisioningUI
import org.eclipse.equinox.p2.ui.ProvisioningUI; //导入依赖的package包/类
protected ProvisioningUI getProvisioningUI(){
return ProvisioningUI.getDefaultUI();
}
开发者ID:elexis,项目名称:elexis-3-core,代码行数:4,代码来源:PreloadingRepositoryHandler.java
示例17: 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);
}
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:40,代码来源:P2_Activator.java
注:本文中的org.eclipse.equinox.p2.ui.ProvisioningUI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论