0
votes

yet a new Eclipse Scout question from me:

In my Scout Application which is roughly based on the template "Outline Tree and Table Form" I managed to add new instances of a (search)form with a click on a node. My form's display properties are configured like this:

  @Override
  protected int getConfiguredDisplayHint() { return DISPLAY_HINT_VIEW; }    
  @Override
  protected String getConfiguredDisplayViewId() { return VIEW_ID_PAGE_DETAIL; }

I'm not adding the forms to pages with the built-in methods(e.g. setDetailForm(IForm form)), but I set them as a new attribute to the pages and start them via their FormHandler. In this way I achieve that the Scout renderer tabs the forms next to each other and this is exactly what I want. Adding them as forms to the page causes the renderer to close the other forms whenever a page is activated, so only one form is displayed at one time.

My problems with this implementation are:

  1. Reactivation of the tabs is only possible in the RAP client. For the RAP client it is enough to call the activate() method of the form to reactivate and focus the corresponding tab. On the other hand the SWT client (which I depend on) doesn't seem to care at all about the activate() call and therefore does not reactivate the page. So I'm searching for a safe and easy way to persuade the SWT renderer of
    1. tabbing the forms next to each other preferably without the use of a Scout TabField. As described above, this is already working, but I'm not sure if this is the recommended way.
    2. reactivate the tabs on a NodeClick as the RAP client already does
  2. Receive events when clicking on the tab closing the tab (X-button in SWT, no button in RAP -.-), or whatever. I think this question is bit broader as it is a general problem in Scout to step into product-specific processes which are not part of the abstract programming model of Scout. Nevertheless, it would be nice to process those event and others out of the global client without tweaking the specific rendering products.

A screenshot of my program's UI to make things easier to follow: Screenshot of the Scout application

In the screenshot the fifth form is activated as a view and the corresponding node in the outline tree on the left is also marked. As you see, there are multiple forms added which all belong to a node in the outline tree. When I click a node in the tree, I want the corresponding form to be activated and focuse if it hasn't been openend before. Apart from that the tabs should stay the same. I don't want to reinitialize the forms that already exist.


I'm using Scout Version 5.0

1

1 Answers

0
votes

The RAP UI is nearer to the SWING UI than to the SWT. This is why, out of the box, the views can not be closed with the x in RAP (similar to Swing).

For SWT we rely on the workbench provided by the Eclipse Platform. This defines how views are opened and tabbed in a View Stack.

For me it is Ok to use scout (SWT renderer) that way. Here an example:

Form opened as view

The ComplexForm is opened as a SWT View next to the already opened Form.


I am surpised to hear that activate() on the scout Form doesn't work for you. I had a similar problem, raised Bug 433010 and we decided to close it, exactly because the activate() method was the solution.

ComplexForm form = new ComplexForm();
form.startNew();
form.activate();

I guess that on any event (a click somewhere on a Menu or on a Node) you can get call activate() on the form instance.

Which version of Scout are you using?

Maybe you could add a Screenshot in your question, because I am missing your point.