Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Minimized outline
Minimized outline [message #1097526] Thu, 29 August 2013 17:12 Go to next message
Stathis Alexopoulos is currently offline Stathis Alexopoulos
Messages: 42
Registered: September 2010
Member
Hi all,

Does anyone know if it is possible in SWT to minimize programmatically the Outline?
Re: Minimized outline [message #1107450 is a reply to message #1097526] Thu, 12 September 2013 08:14 Go to previous messageGo to next message
Ken Lee is currently offline 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.



Re: Minimized outline [message #1108297 is a reply to message #1107450] Fri, 13 September 2013 12:46 Go to previous message
Ken Lee is currently offline Ken Lee
Messages: 97
Registered: March 2012
Member
I was told that code in AbstractScoutView.setMinimizedFromScout() might not work on Eclipse 3.x platforms. That's why the code for minimizing the view had probably been commented out.
As mentioned in my previous post, I was able to minimize the view using the above code snippet using E4 (Kepler 4.3 SR1). We should as well test the code snippet under a E3.x platform.
Even if it's still not working for an E3.x platform, as long as there are no side-effects for we should consider uncommenting the code or adjust the code snippet from above.

I created bug 417210 and set the target milestone to Luna M3.






Previous Topic:Scout Standalone Client
Next Topic:RAP Client authentication through smart card
Goto Forum:
  


Current Time: Sat Jul 26 09:31:36 EDT 2014

Powered by FUDForum. Page generated in 0.03751 seconds