Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mjancar:Eclipse
eclipse
eclipse-updatehomedir-ui.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File eclipse-updatehomedir-ui.patch of Package eclipse
Index: src/org/eclipse/update/internal/ui/wizards/InstallWizard2.java =================================================================== RCS file: /home/eclipse/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/InstallWizard2.java,v retrieving revision 1.7 diff -u -r1.7 InstallWizard2.java --- src/org/eclipse/update/internal/ui/wizards/InstallWizard2.java 15 Nov 2005 22:06:50 -0000 1.7 +++ src/org/eclipse/update/internal/ui/wizards/InstallWizard2.java 2 Dec 2005 06:18:58 -0000 @@ -151,7 +151,7 @@ addPage(licensePage); optionalFeaturesPage = new OptionalFeaturesPage(config); addPage(optionalFeaturesPage); - targetPage = new TargetPage(config); + targetPage = new TargetPage(config, isUpdate); addPage(targetPage); } Index: src/org/eclipse/update/internal/ui/wizards/TargetPage.java =================================================================== RCS file: /home/eclipse/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java,v retrieving revision 1.74 diff -u -r1.74 TargetPage.java --- src/org/eclipse/update/internal/ui/wizards/TargetPage.java 21 Nov 2005 21:39:24 -0000 1.74 +++ src/org/eclipse/update/internal/ui/wizards/TargetPage.java 2 Dec 2005 06:18:59 -0000 @@ -13,6 +13,9 @@ import java.io.*; import java.util.*; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.resource.*; import org.eclipse.jface.viewers.*; @@ -41,6 +44,7 @@ private Label installLocation; private Button changeLocation; static HashSet added; + private boolean isUpdate; // whether the wizard is updating a feature or installing a new one class JobsContentProvider extends DefaultContentProvider @@ -113,13 +117,14 @@ /** * Constructor for ReviewPage2 */ - public TargetPage(IInstallConfiguration config) { + public TargetPage(IInstallConfiguration config, boolean isUpdate) { super("Target"); //$NON-NLS-1$ setTitle(UpdateUIMessages.InstallWizard_TargetPage_title); setDescription(UpdateUIMessages.InstallWizard_TargetPage_desc); this.config = config; UpdateUI.getDefault().getLabelProvider().connect(this); configListener = new ConfigListener(); + this.isUpdate = isUpdate; } public void setJobs(IInstallFeatureOperation[] jobs) { @@ -150,7 +155,7 @@ label.setLayoutData(gd); installLocation = new Label(client, SWT.NULL); - installLocation.setText("foo"); //$NON-NLS-1$ + installLocation.setText(""); //$NON-NLS-1$ gd = new GridData(GridData.FILL_HORIZONTAL); installLocation.setLayoutData(gd); @@ -360,8 +365,27 @@ continue; } - jobs[i].setTargetSite(getFirstTargetSite(jobs[i])); + IConfiguredSite csite = getFirstTargetSite(jobs[i]); + if (csite == null && Platform.getInstallLocation().isReadOnly() && isUpdate == false) { + // there are no updateable sites, the installation location is read-only and we are installing a new feature + // make an update site in the user's home direcotry + String sitePath = System.getProperty("user.home") + File.separator + ".eclipse" + File.separator + //$NON-NLS-1$ + Platform.getProduct().getId() + File.separator + "updates"; //$NON-NLS-1$ + + try { + csite = config.createConfiguredSite(new File(sitePath)); + config.addConfiguredSite(csite); + IStatus status = csite.verifyUpdatableStatus(); + if (!status.isOK()) + throw new CoreException(status); + + } catch (CoreException e) { + // there was a problem, the user must choose an installation site + csite = null; + } + } + jobs[i].setTargetSite(csite); } } @@ -370,7 +394,8 @@ IConfiguredSite[] sites = config.getConfiguredSites(); for (int i = 0; i < sites.length; i++) { IConfiguredSite csite = sites[i]; - if (getSiteVisibility(csite, job)) + if (getSiteVisibility(csite, job) && + csite.getSite().getCurrentConfiguredSite().verifyUpdatableStatus().isOK()) return csite; } return null;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor