Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 23387 Details for
Bug 87202
(PatchAttached)[Watch/Edit] automatic 'editors' check doesn't check for updated versions.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
cvs ui project patch (3.1 RC2 sources)
cvs-ui.patch (text/plain), 12.52 KB, created by
Rob Hughes
on 2005-06-16 17:11:01 EDT
(
hide
)
Description:
cvs ui project patch (3.1 RC2 sources)
Filename:
MIME Type:
Creator:
Rob Hughes
Created:
2005-06-16 17:11:01 EDT
Size:
12.52 KB
patch
obsolete
>Index: src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java,v >retrieving revision 1.9 >diff -u -r1.9 CVSUIMessages.java >--- src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java 31 May 2005 14:54:35 -0000 1.9 >+++ src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java 13 Jun 2005 18:45:20 -0000 >@@ -700,6 +700,10 @@ > public static String WatchEditPreferencePage_neverPrompt; > public static String WatchEditPreferencePage_alwaysPrompt; > public static String WatchEditPreferencePage_onlyPrompt; >+ public static String WatchEditPreferencePage_updatePrompt; >+ public static String WatchEditPreferencePage_autoUpdate; >+ public static String WatchEditPreferencePage_promptUpdate; >+ public static String WatchEditPreferencePage_neverUpdate; > > public static String Uneditaction_confirmMessage; > public static String Uneditaction_confirmTitle; >@@ -871,6 +875,8 @@ > > public static String FileModificationValidator_3; > public static String FileModificationValidator_4; >+ public static String FileModificationValidator_5; >+ public static String FileModificationValidator_6; > public static String CVSSynchronizeWizard_0; > public static String Participant_comparing; > public static String Participant_merging; >Index: src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java,v >retrieving revision 1.166 >diff -u -r1.166 CVSUIPlugin.java >--- src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java 30 May 2005 19:26:16 -0000 1.166 >+++ src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java 13 Jun 2005 18:45:22 -0000 >@@ -563,6 +563,7 @@ > store.setDefault(ICVSUIConstants.PREF_CHECKOUT_READ_ONLY, corePrefs.getDefaultBoolean(CVSProviderPlugin.READ_ONLY)); > store.setDefault(ICVSUIConstants.PREF_EDIT_ACTION, ICVSUIConstants.PREF_EDIT_IN_BACKGROUND); > store.setDefault(ICVSUIConstants.PREF_EDIT_PROMPT, ICVSUIConstants.PREF_EDIT_PROMPT_IF_EDITORS); >+ store.setDefault(ICVSUIConstants.PREF_UPDATE_PROMPT, ICVSUIConstants.PREF_UPDATE_PROMPT_IF_OUTDATED); > // Ensure that the preference values in UI match Core > store.setValue(ICVSUIConstants.PREF_CHECKOUT_READ_ONLY, corePrefs.getBoolean(CVSProviderPlugin.READ_ONLY)); > >Index: src/org/eclipse/team/internal/ccvs/ui/FileModificationValidator.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/FileModificationValidator.java,v >retrieving revision 1.24 >diff -u -r1.24 FileModificationValidator.java >--- src/org/eclipse/team/internal/ccvs/ui/FileModificationValidator.java 30 May 2005 19:26:16 -0000 1.24 >+++ src/org/eclipse/team/internal/ccvs/ui/FileModificationValidator.java 13 Jun 2005 18:45:23 -0000 >@@ -66,6 +66,32 @@ > throw new InterruptedException(); > } > >+ // see if the file is up to date >+ if (shell != null && promptToUpdateFiles(files, shell)) { >+ // The user wants to update the file >+ // Run the update in a runnable in order to get a busy cursor. >+ // This runnable is syncExeced in order to get a busy cursor >+ IRunnableWithProgress updateRunnable = new IRunnableWithProgress() { >+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { >+ try { >+ performUpdate(files, monitor); >+ } catch (CVSException e) { >+ new InvocationTargetException(e); >+ } >+ } >+ }; >+ if (isRunningInUIThread()) { >+ // Only show a busy cursor if validate edit is blocking the UI >+ CVSUIPlugin.runWithProgress(shell, false, updateRunnable); >+ } else { >+ // We can't show a busy cursor (i.e., run in the UI thread) >+ // since this thread may hold locks and >+ // running an edit in the UI thread could try to obtain the >+ // same locks, resulting in a deadlock. >+ updateRunnable.run(new NullProgressMonitor()); >+ } >+ } >+ > // Run the edit in a runnable in order to get a busy cursor. > // This runnable is syncExeced in order to get a busy cursor > IRunnableWithProgress editRunnable = new IRunnableWithProgress() { >@@ -139,6 +165,25 @@ > } > } > >+ private boolean promptToUpdateFiles(IFile[] files, Shell shell) throws InvocationTargetException, InterruptedException { >+ if (files.length == 0) >+ return false; >+ >+ if (isNeverUpdate()) >+ return false; >+ >+ // Contact the server to see if the files are up-to-date >+ for (int i = 0; i < files.length; i++) { >+ if (needsUpdate(files[i], new NullProgressMonitor())) { >+ if (isPromptUpdate()) >+ return (promptUpdate(shell)); >+ return true; // auto update >+ } >+ } >+ >+ return false; >+ } >+ > private boolean promptEdit(Shell shell) { > // Open the dialog using a sync exec (there are no guarentees that we > // were called from the UI thread >@@ -152,6 +197,19 @@ > return result[0]; > } > >+ private boolean promptUpdate(Shell shell) { >+ // Open the dialog using a sync exec (there are no guarentees that we >+ // were called from the UI thread >+ final boolean[] result = new boolean[] { false }; >+ int flags = isRunningInUIThread() ? 0 : CVSUIPlugin.PERFORM_SYNC_EXEC; >+ CVSUIPlugin.openDialog(shell, new CVSUIPlugin.IOpenableInShell() { >+ public void open(Shell shell) { >+ result[0] = MessageDialog.openQuestion(shell,CVSUIMessages.FileModificationValidator_5,CVSUIMessages.FileModificationValidator_6); >+ } >+ }, flags); >+ return result[0]; >+ } >+ > private boolean isPerformEdit() { > return ICVSUIConstants.PREF_EDIT_PROMPT_EDIT.equals(CVSUIPlugin.getPlugin().getPreferenceStore().getString(ICVSUIConstants.PREF_EDIT_ACTION)); > } >@@ -187,4 +245,12 @@ > private boolean isAlwaysPrompt() { > return ICVSUIConstants.PREF_EDIT_PROMPT_ALWAYS.equals(CVSUIPlugin.getPlugin().getPreferenceStore().getString(ICVSUIConstants.PREF_EDIT_PROMPT)); > } >+ >+ private boolean isPromptUpdate() { >+ return ICVSUIConstants.PREF_UPDATE_PROMPT_IF_OUTDATED.equals(CVSUIPlugin.getPlugin().getPreferenceStore().getString(ICVSUIConstants.PREF_UPDATE_PROMPT)); >+ } >+ >+ private boolean isNeverUpdate() { >+ return ICVSUIConstants.PREF_UPDATE_PROMPT_NEVER.equals(CVSUIPlugin.getPlugin().getPreferenceStore().getString(ICVSUIConstants.PREF_UPDATE_PROMPT)); >+ } > } >Index: src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java,v >retrieving revision 1.88 >diff -u -r1.88 ICVSUIConstants.java >--- src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java 30 May 2005 19:26:16 -0000 1.88 >+++ src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java 13 Jun 2005 18:45:23 -0000 >@@ -132,6 +132,12 @@ > public final String PREF_EDIT_PROMPT_NEVER = "never"; //$NON-NLS-1$ > public final String PREF_EDIT_PROMPT_ALWAYS = "always"; //$NON-NLS-1$ > public final String PREF_EDIT_PROMPT_IF_EDITORS = "only"; //$NON-NLS-1$ >+ >+ // update preferences >+ public final String PREF_UPDATE_PROMPT = "pref_upate_prompt"; >+ public final String PREF_UPDATE_PROMPT_NEVER = "never"; //$NON-NLS-1$ >+ public final String PREF_UPDATE_PROMPT_AUTO = "auto"; //$NON-NLS-1$ >+ public final String PREF_UPDATE_PROMPT_IF_OUTDATED = "only"; //$NON-NLS-1$ > > // Repositories view preferences > public final String PREF_GROUP_VERSIONS_BY_PROJECT = "pref_group_versions_by_project"; //$NON-NLS-1$ >Index: src/org/eclipse/team/internal/ccvs/ui/WatchEditPreferencePage.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WatchEditPreferencePage.java,v >retrieving revision 1.12 >diff -u -r1.12 WatchEditPreferencePage.java >--- src/org/eclipse/team/internal/ccvs/ui/WatchEditPreferencePage.java 7 Apr 2005 15:37:13 -0000 1.12 >+++ src/org/eclipse/team/internal/ccvs/ui/WatchEditPreferencePage.java 13 Jun 2005 18:45:23 -0000 >@@ -21,6 +21,7 @@ > public class WatchEditPreferencePage extends CVSFieldEditorPreferencePage { > > private RadioGroupFieldEditor promptEditor; >+ private RadioGroupFieldEditor updateEditor; > private RadioGroupFieldEditor actionEditor; > private IPreferenceStore store; > >@@ -58,7 +59,6 @@ > }, //$NON-NLS-1$ //$NON-NLS-2$ > getFieldEditorParent(), true); > addField(actionEditor); >- > > promptEditor = new RadioGroupFieldEditor( > ICVSUIConstants.PREF_EDIT_PROMPT, >@@ -69,8 +69,20 @@ > {CVSUIMessages.WatchEditPreferencePage_neverPrompt, ICVSUIConstants.PREF_EDIT_PROMPT_NEVER}, //$NON-NLS-1$ > }, //$NON-NLS-1$ //$NON-NLS-2$ > getFieldEditorParent(), true); >+ >+ updateEditor = new RadioGroupFieldEditor( >+ ICVSUIConstants.PREF_UPDATE_PROMPT, >+ CVSUIMessages.WatchEditPreferencePage_updatePrompt, //$NON-NLS-1$ >+ 1, >+ new String[][] {{CVSUIMessages.WatchEditPreferencePage_autoUpdate, ICVSUIConstants.PREF_UPDATE_PROMPT_AUTO}, //$NON-NLS-1$ >+ {CVSUIMessages.WatchEditPreferencePage_promptUpdate, ICVSUIConstants.PREF_UPDATE_PROMPT_IF_OUTDATED}, //$NON-NLS-1$ >+ {CVSUIMessages.WatchEditPreferencePage_neverUpdate, ICVSUIConstants.PREF_UPDATE_PROMPT_NEVER}, //$NON-NLS-1$ >+ }, //$NON-NLS-1$ //$NON-NLS-2$ >+ getFieldEditorParent(), true); >+ > store = getCVSPreferenceStore(); > addField(promptEditor); >+ addField(updateEditor); > } > > private boolean isEditEnabled() { >@@ -93,10 +105,10 @@ > */ > public void propertyChange(PropertyChangeEvent event) { > if (event.getSource() == actionEditor) { >- promptEditor.setEnabled( >- event.getNewValue().equals(ICVSUIConstants.PREF_EDIT_PROMPT_EDIT), >- getFieldEditorParent()); >- } >+ boolean enabled = event.getNewValue().equals(ICVSUIConstants.PREF_EDIT_PROMPT_EDIT); >+ promptEditor.setEnabled(enabled, getFieldEditorParent()); >+ updateEditor.setEnabled(enabled, getFieldEditorParent()); >+ } > super.propertyChange(event); > } > >@@ -107,5 +119,6 @@ > protected void initialize() { > super.initialize(); > promptEditor.setEnabled(isEditEnabled(), getFieldEditorParent()); >+ updateEditor.setEnabled(isEditEnabled(), getFieldEditorParent()); > } > } >Index: src/org/eclipse/team/internal/ccvs/ui/messages.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties,v >retrieving revision 1.434 >diff -u -r1.434 messages.properties >--- src/org/eclipse/team/internal/ccvs/ui/messages.properties 7 Jun 2005 15:47:43 -0000 1.434 >+++ src/org/eclipse/team/internal/ccvs/ui/messages.properties 13 Jun 2005 18:45:27 -0000 >@@ -730,6 +730,10 @@ > WatchEditPreferencePage_neverPrompt=&Never prompt > WatchEditPreferencePage_alwaysPrompt=Always &prompt > WatchEditPreferencePage_onlyPrompt=&Only prompt if there are other editors >+WatchEditPreferencePage_updatePrompt=Automatically perform a CVS update >+WatchEditPreferencePage_autoUpdate=Always &update >+WatchEditPreferencePage_promptUpdate=Only prompt if out of &date >+WatchEditPreferencePage_neverUpdate=Ne&ver update > > Uneditaction_confirmMessage=Overwrite local changes to edited files? > Uneditaction_confirmTitle=Confirm Unedit >@@ -930,6 +934,8 @@ > > FileModificationValidator_3=Perform Edit? > FileModificationValidator_4=A CVS edit notification is required to be sent to the server in order to allow editing of one or more selected files. Continue? >+FileModificationValidator_5=Perform Update? >+FileModificationValidator_6=This resource is out of date. Would you like to update it before continuing? > CVSSynchronizeWizard_0=Unknown > Participant_comparing=Comparing > Participant_merging=Merging
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 87202
:
23386
| 23387