Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342929 - [Compatibility] DBCS4.1: Window->Navigation->Minimize Active View or Editor not working
Summary: [Compatibility] DBCS4.1: Window->Navigation->Minimize Active View or Editor n...
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1 M7   Edit
Assignee: Jesse CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-15 04:25 EDT by Harendra CLA
Modified: 2011-04-20 12:23 EDT (History)
6 users (show)

See Also:


Attachments
Fix for minimizing the active view (2.50 KB, patch)
2011-04-17 16:48 EDT, Jesse CLA
no flags Details | Diff
Fix for minimizing the active view (refactored) (5.32 KB, patch)
2011-04-19 14:24 EDT, Jesse CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harendra CLA 2011-04-15 04:25:42 EDT
Build Identifier: I20110329-0800

Eclipse version:I20110329-0800
OS: Ubuntu Linux 10.10
Java Version: JRE 1.6.0 IBM Linux build pxi3260sr9fp1-20110208_03 (SR9 FP1)
Locale: ja_JP.utf8

Reproducible: Always

Steps to Reproduce:
1.Open a Java class in a Java Editor.
2.Click Window->Navigation->Minimize Active View or Editor
3.The view will not be minimized.
Comment 1 Paul Webster CLA 2011-04-15 08:04:37 EDT
Is this 3.7 then?  I20110329-0800 is not a valid 4.1 build identifier.

PW
Comment 2 Paul Webster CLA 2011-04-15 11:13:08 EDT
WorkbenchActionBuilder instantiates org.eclipse.ui.actions.ActionFactory.MINIMIZE

It leads back to org.eclipse.ui.internal.handlers.MinimizePartHandler

Have a look at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon to see what changes to the model you will need in order to make the stack minimized

PW
Comment 3 Jesse CLA 2011-04-17 16:48:46 EDT
Created attachment 193441 [details]
Fix for minimizing the active view
Comment 4 Harendra CLA 2011-04-17 22:14:52 EDT
Sorry about the version numbering, was a mistake on my part. Yes it is eclipse 4.1 and the build ID is  I20110407-2200.
Comment 5 Remy Suen CLA 2011-04-19 11:13:22 EDT
(In reply to comment #3)
> Created attachment 193441 [details]
> Fix for minimizing the active view

For your state checking code, could you change it to compare against the constant values defined in IWorkbenchPage.STATE_*?

I'm also curious if it would be possible to refactor the code somehow so that both setPartState(IWorkbenchPartReference, int) and toggleZoom(IWorkbenchPartReference) could share some of the same code. Or alternatively just have toggleZoom(*) delegate to setPartState(*) after checking whether the request is ultimately a STATE_MAXIMIZED or a STATE_RESTORED.

Please also implement getPartState(IWorkbenchPartReference).
Comment 6 Jesse CLA 2011-04-19 14:24:23 EDT
Created attachment 193613 [details]
Fix for minimizing the active view (refactored)

Thanks for the suggestions, Remy. I've made the alterations/additions that you've suggested, and refactored the code such that some of it is shared between setPartState(IWorkbenchPartPreference, int) and toggleZoom(...)

- Jesse
Comment 7 Remy Suen CLA 2011-04-20 12:23:43 EDT
(In reply to comment #6)
> Created attachment 193613 [details]
> Fix for minimizing the active view (refactored)

Patch released to CVS HEAD. Thanks, Jesse!

I renamed getActiveView(IWorkbenchPartReference) to getActiveElement(IWorkbenchPartReference) instead since the returned value may not be a part and moved two methods around but didn't make any actual code changes.