Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

View source for Scout/Concepts/Application Templates

Revision as of 09:36, 19 November 2013 by Matthias.zimmermann.bsiag.com (Talk | contribs) (Application with a single Form)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Scout documentation has been moved to https://eclipsescout.github.io/.

In the second step of the SDK wizard New Scout Project... shown below, it is possible to choose from different application templates.

New project wizard app templates.jpg

  • An empty Application
  • Outline Tree and Table Form
  • Application with a single Form

Depending on the user's choice, the Scout SDK will create slightly different forms of initial client server applications. The differences between the application templates are all driven by the user interface elements that are initially available in a newly created Scout project.

The empty Application

This is the simplest application template. It's client only contains an empty desktop with a menu tree. As the desktop remains emty it need not be populated with andy UI elements, and no implementation for execOpened is needed.

Outline Tree and Table Form

This template is a useful start to write applications that contain a tree to browse for elements and a table that displays the available entities for the element selected in the tree. The template "Outline Tree and Table Form" is used in the The Scout documentation has been moved to https://eclipsescout.github.io/. tutorial.

In contrast to the empty application template, the outline tree and table form overwrites the desktop's method execOpened:

  @Override
  protected void execOpened() throws ProcessingException {
    //If it is a mobile or tablet device, the DesktopExtension in the mobile plugin takes care of starting the correct forms.
    if (!UserAgentUtility.isDesktopDevice()) {
      return;
    }
 
    // outline tree
    DefaultOutlineTreeForm treeForm = new DefaultOutlineTreeForm();
    treeForm.setIconId(Icons.EclipseScout);
    treeForm.startView();
 
    //outline table
    DefaultOutlineTableForm tableForm = new DefaultOutlineTableForm();
    tableForm.setIconId(Icons.EclipseScout);
    tableForm.startView();
 
    if (getAvailableOutlines().length > 0) {
      setOutline(getAvailableOutlines()[0]);
    }
  }

In addition to the tree and the table the template features a first outline button with the label Standard. Outlines are a concept very similar to Eclipse perspectives and used in Scout applications to group business functionality according to responsibilities of departments, user roles, etc.

This fact is reflected in the Desktop class by overriding it's method getConfiguredOutlines and adding the inner class StandardOutlineViewButton. The template creates the following implementation for getConfiguredOutlines:

  @Override
  @SuppressWarnings("unchecked")
  protected Class<? extends IOutline>[] getConfiguredOutlines() {
    return new Class[]{StandardOutline.class};
  }

And the StandardOutlineViewButton:

  @Order(10.0)
  public class StandardOutlineViewButton extends AbstractOutlineViewButton {
 
    public StandardOutlineViewButton() {
      super(Desktop.this, StandardOutline.class);
    }
 
    @Override
    protected String getConfiguredText() {
      return TEXTS.get("StandardOutline");
    }
  }

Besides these changes in the client's Desktop class, the tree and table template also creates the following elements:

  • Client plugin project
    • StandardOutline UI class
  • Shared plugin project
    • IStandardOutlineService service interface
  • Server plugin project
    • StandardOutlineService service class

Application with a single Form

This template is a useful start to write simple, form based Scout applications. Instead of populating the Desktop with a tree and table compoement it contains just a simple desktop form. The template "Outline Tree and Table Form" is used in the The Scout documentation has been moved to https://eclipsescout.github.io/. tutorial.

The Desktop's method execOpened is implemented as follows:

  @Override
  protected void execOpened() throws ProcessingException {
    //If it is a mobile or tablet device, the DesktopExtension in the mobile plugin takes care of starting the correct forms.
    if (!UserAgentUtility.isDesktopDevice()) {
      return;
    }
    DesktopForm desktopForm = new DesktopForm();
    desktopForm.setIconId(Icons.EclipseScout);
    desktopForm.startView();
  }

Compared to the empty template, the Single Form template also creates the following elements:

  • Client plugin project
    • DesktopForm UI class
  • Shared plugin project
    • IDesktopService service interface
    • DesktopFormData data transfer object
  • Server plugin project
    • DesktopService service class

Copyright © Eclipse Foundation, Inc. All Rights Reserved.