|
Re: Minimized outline [message #1107450 is a reply to message #1097526] |
Thu, 12 September 2013 12:14 |
Ken Lee Messages: 97 Registered: March 2012 |
Member |
|
|
Hi Stathis,
What do you exactly refer to by "closing the outline" programmatically? Do you mean the DefaultOutlineTreeForm and the DefaultOutlineTableForm for example that are created in the Desktop?
In Scout SWT the outline tree/table form are represented as views. These views are arranged in a 3x3 matrix named North-, East-, South-, West, NorthWest-, etc. view (cf. the generated classes in the package your.project.ui.swt.views in the ui.swt bundle of your project).
The outline tree/table form are normal forms that are configured with the view display hint (see getConfiguredDisplayHint) and a display view id in Scout (see getConfiguredDisplayViewId).
If you look at the method AbstractSwtEnvironment.showStandaloneForm() you will notice that for forms configured with a "view display hint", a corresponding SWT view will be created/used taking the Scout display view id into account (the display view id in Scout is transformed to a SWT view id).
Views in SWT can be minimized/maximized programmatically for example by using the following code snippet:
private void setViewState(int state, IViewPart viewPart) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
int currentState = page.getPartState(page.getReference(viewPart));
if(currentState != state) {
page.activate(viewPart);
page.setPartState(page.getReference(viewPart), state);
}
}
by calling
setViewState(IWorkbenchPage.STATE_MINIMIZED, yourSwtView);
you can minimize your SWT view.
However, this was the SWT part only. If you have a look at the Scout Form API, there are setters and getConfigured methods for minimizedEnabled and minimized. If you configure minimizedEnabled = true and call setMinimized(true) on the form, a property will be fired from the Scout model to ViewModel (SWT). If you have a look at AbstractScoutView, there's a listener handling the minimized property. For some reason the code in the method
protected void setMinimizedFromScout(boolean minimized) {
}
has been commented out. If you paste the SWT code from above (and make some minor adjustments), you are able to minimize the outline tree/table form for example.
I will check why this code has been removed.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03964 seconds