I recently found a solution for doing this within the view that you are trying to control:
class MyView extends ViewPart {
/**
* @param state one of the IWorkbenchPage STATE_* values: STATE_MAXIMIZED,
* STATE_MINIMIZED, STATE_RESTORED
*/
private void setViewState(int state) {
IWorkbenchPage page
= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
int currentState = page.getPartState(page.getReference(this));
if(currentState != state) {
page.activate(this);
page.setPartState(page.getReference(this), state);
}
}
}
Adding this method to your view class will let you maximize the view by calling:
setViewState(IWorkbenchPage STATE_MAXIMIZED)
restore it by calling:
setViewState(IWorkbenchPage STATE_RESTORED)
and of course minimize it by calling:
setViewState(IWorkbenchPage STATE_MINIMIZED)
The effect will be that if you maximize this view, all other views get minimized, restore it and all the views go back to their previous state, and minimize and the other views will fight it out for real-estate
share and enjoy!