Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upJBIDE-18372 - tweaking progress monitors #307
Conversation
|
|
||
| boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module); | ||
| File[] toTransfer = null; | ||
| if( !isBinaryObject ) { | ||
| File file = zipLocally(module[0], publishType, ProgressMonitorUtil.submon(monitor, 100)); | ||
| monitor.setTaskName("Zipping module: " + module[0].getName()); //$NON-NLS-1$ | ||
| File file = zipLocally(module[0], publishType, new NullProgressMonitor()); |
This comment has been minimized.
This comment has been minimized.
robstryker
Dec 3, 2014
Author
Member
Somehow missing the change here. Should not be using null progress monitor. Wtf.
e0911b0
to
4fd0b86
| @@ -308,10 +317,13 @@ private String getDeploymentOutputName(IServer server, IModule module) throws Co | |||
| public void publishServer(int kind, IProgressMonitor monitor) | |||
| throws CoreException { | |||
| // intentionally blank | |||
| monitor.beginTask("", 100); //$NON-NLS-1$ | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
robstryker
Dec 4, 2014
Author
Member
So I tested it a lot with and without these parts. Theoretically, I should have similar lines for publishStart and publishFinish. WTP is allocating sub monitors for these methods, and never marks them as done. It's my job to start, and then done() them.
The problem is if I have the monitors in publishStart and publishFinish and publishServer, then the actual publish (zip plus transfer) is really only like 40% of the monitor (depending on the number of modules being published, but for 1 module being published, it's 40%). Basically, their weights are kinda... weird.
So I decided to keep the start() and done() in only publishServer, not publishStart / publishFinish (for THIS publish method). It makes it so the progress monitor advances to about 15%, and when the publish is basically complete, the monitor is at around 78%.
If I were to put it into all three of them, then the progress monitor would read like 40% before I even did anything, and around 80% afterwards.
At this point it's kind of a value judgement and what I feel works best for the user... to see some progress in the beginning, then the slow increase during zip and mgmt calls, and then a fast end.
Tested with an example project with 5000 files in it.
Cleanup Cleanup
|
+1 looks simple enough. just wondering what the noop begintask/done is for. |
robstryker commentedNov 24, 2014
No description provided.