Bug 292134 - [EditorMgmt] Introduce "Workspace:Refresh on focus" as alternative to "Refresh Automatically"
Summary: [EditorMgmt] Introduce "Workspace:Refresh on focus" as alternative to "Refres...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-13 07:29 EDT by Neale Upstone CLA
Modified: 2019-09-06 16:10 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neale Upstone CLA 2009-10-13 07:29:47 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2b1pre) Gecko/20091008 Namoroka/3.6b1pre (.NET CLR 3.5.30729)
Build Identifier: 3.5.x

Eclipse often refreshes unhelpfully when it is does not have the UI focus.

An 'in-between' option of "Refresh of focus" would be a good solution for people who do not want to use "Refresh Automatically" but would want Eclipse to refresh when switching focus back to it.

As it's an option, it would be a safe enhancement to include.

Reproducible: Always

Steps to Reproduce:
[... not needed for an enhancement..]
Comment 1 John Arthorne CLA 2009-10-16 12:53:29 EDT
I believe editors already perform a refresh when they gain focus. Are you thinking of refreshing the entire workspace on gained focus?
Comment 2 Neale Upstone CLA 2009-10-20 12:07:24 EDT
Simply put, yes.

I'm thinking that it's the way that IntelliJ works, which means that if you're running something like Maven from the command line, it doesn't start a fight.
Comment 3 Boris Bokowski CLA 2009-11-17 12:59:37 EST
Remy is now responsible for watching the [EditorMgmt] component area.
Comment 4 Martin Oberhuber CLA 2010-02-04 23:37:10 EST
"Refresh on Focus" is a fantastic idea! I would suggest a "Refresh on Focus" UI Preference with a combobox to select the scope of refresh-on-focus:

  (o) Refresh on Focus [visible items|parent folders|workspace]

I personally would not use the autorefresh-workspace option, so that would be for Neal's use cases. Let me slightly expand the user story from our point of view:

   "As a developer on a very large project, I want Eclipse to refresh the
   visible items I work on when they get in focus, such that I always feel 
   like working on an up-to-date system even without global autorefresh 
   which would cost too much performance."

Here is some more background: My project is really large, and autorefresh  / refresh-on-startup / global refresh all take too much time in which operations tend to bring up the "Waiting for ..." popup dialog. I often make updates to my project outside Eclipse (due to building or generating files, updating from my CM system, editing test data, ...). In most cases though, these updates are not relevant for the source code I'm editing, or the global state of my project that I'm searching/indexing. 

Essentially, I want a user experience very similar to Windows Explorer:
  * It is OK to not see new files/folders while I don't click on them
  * When expanding a folder in project explorer, always refresh the 
    expanded folder (1 level only) to give me latest content
  * When dbl clicking a file to edit, always refresh (potentially not only
    the file but also its parent folder since that doesn't cost much more
    performance and gives extra safety).

(In reply to comment #1)
> I believe editors already perform a refresh when they gain focus.

Yes, open editors do refresh and may bring up the "Content has changed..." dialog popup. But when I double click a file to initially open an editor, I often see the "Resource is out of sync... please press F5" pseudo-editor which is extremely annoying and very bad user experience. When the system wants me to refresh something, and knows what to refresh, why doesn't it refresh that thing itself?
Comment 5 Remy Suen CLA 2010-02-22 12:09:44 EST
CC'ed parties of this bug may be interested in bug 303517.
Comment 6 Neale Upstone CLA 2010-03-12 05:53:29 EST
I have a use case that this request is targetted at which I'm struggling with at the moment, which is:

- I'm working with a Maven project with M2E.
- I have Refresh Automatically and Build Automatically set
- My workspace builds the 'local' maven profile.
- To deploy to our "preview servers", I go to the command line and run "mvn clean install -Pprv"
- If I don't disable Build Automatically, Eclipse starts a fight with Maven, building while Maven is trying to clean.

How I'd love this to work is:
- I set "Refresh automatically when focused"
- When I switch to my command prompt and do my maven build, Eclipse doesn't notice, as it's not refreshing.
- When I switch back to Eclipse, it refreshes the workspace and builds as necessary.

Naturally, there are other ways of doing these things, but Eclipse doesn't make this particular one easy by any means!
Comment 7 Eclipse Webmaster CLA 2019-09-06 16:10:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.