Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Scout"
m (→How Tos) |
|||
Line 1: | Line 1: | ||
− | + | {| class="FCK__ShowTableBorders" align="right" | |
+ | |- | ||
+ | | __TOC__ | ||
+ | |} | ||
− | + | The [http://www.eclipse.org/proposals/scout/ Eclipse Scout] project is a proposed open source project under the Eclipse Technology Project. | |
− | == | + | == What is it == |
− | + | The eclipse scout Plug-Ins are used to build applications based on eclipse and equinox. These may be standalone apps, client/server apps, headless apps on server-side equinox etc. | |
− | + | ||
− | === Where do I load data into a TablePage? === | + | Eclipse scout consists of a runtime and an sdk part. The runtime part consists of approx. five Plug-Ins, the sdk consists of approx. three Plug-Ins. |
− | * override method '''execLoadTableData ''' where you call an outline service operation that returns a Object[][] field | + | |
− | * Parameter SearchFilter of execLoadTableData contains all additional WHERE clauses (that start with „AND…“) defined in the getConfiguredSearchTerm methods | + | The runtime is purely based on equinox, and eclipse. The sdk part is an extension to JDT and PDE with a complete perspective for easy click-and-build of a complete application. |
+ | |||
+ | == Key Concepts == | ||
+ | |||
+ | An applications built with eclipse scout typically has a ui with perspectives, views, forms and pages. It may also have a back-end part that is running in an application server with server-side equinox. Perspectives, views, forms and pages are not limited to swt, scout supports complete gui pluggability. | ||
+ | |||
+ | With eclipse scout you have | ||
+ | |||
+ | #separation of ui (user interface layer) and gui (graphical user interface), swt and swing gui factory | ||
+ | #complete workspace overview, multiple Plug-Ins participating to the same application are visualized with their high-level dependencies | ||
+ | #much convenience and support in writing only the code you want to write when for example writing a new form with many sections and fields | ||
+ | #automatic nls support as-you-type | ||
+ | #soap-based remote service tunnel for hi-speed service remoting to a eclipse server-side application | ||
+ | #extension point for declaring osgi services and remote service proxies | ||
+ | #extension point for ui component to gui widget mapping | ||
+ | #complete abstration layer for desktop (workbench), outlines (perspectives), forms (views, dialogs) and fields | ||
+ | #configurable code | ||
+ | #template concept for creating abstract class libraries | ||
+ | #strong typed code, minimized "string binding" and therefore best support by PDE and JDT | ||
+ | #no meta data and no one-way code genration; everything is in the java code you write, you may write code manually and via click-and-build, doesn't matter | ||
+ | #... | ||
+ | |||
+ | == Screens == | ||
+ | |||
+ | | ||
+ | |||
+ | == My first application == | ||
+ | |||
+ | Easiest way to begin is creating a new eclipse scout project group and choosing the mail sample application. A project group is a set of Plug-Ins that make up your application. Project name: com.example.mail Project parts: client, server, swt ui This will create the Plug-Ins (listed by layer) | ||
+ | |||
+ | #com.example.mail.ui.swt.core | ||
+ | #com.example.mail.client.core | ||
+ | #com.example.mail.shared.core | ||
+ | #com.example.mail.server.core | ||
+ | |||
+ | == A scout form == | ||
+ | |||
+ | To get an idea consider this form with a title and two string fields. That's it. | ||
+ | This form is displayed as a complete swt form with swt fields when using the swt gui Plug-In. | ||
+ | It can also be displayed using the swing gui Plug-In, or (in development) using the apache wicket gui Plug-In to serve the form from the server as a web page. | ||
+ | |||
+ | public class PersonForm extends AbstractForm{ | ||
+ | |||
+ | public PersonForm(){ | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * This method and all other getConfigured* and exec* methods can be written manually or via the property editor in the scout sdk view | ||
+ | */ | ||
+ | @Override | ||
+ | protected String getConfiguredTitle(){ | ||
+ | return Texts.get("MailReader"); | ||
+ | } | ||
+ | |||
+ | |||
+ | public MainBox getMainBox(){ | ||
+ | return (MainBox)getRootGroupBox(); | ||
+ | } | ||
+ | |||
+ | public FirstNameField getFirstNameField(){ | ||
+ | return getFieldByClass(FirstNameField.class); | ||
+ | } | ||
+ | |||
+ | public LastNameField getLastNameField(){ | ||
+ | return getFieldByClass(LastNameField.class); | ||
+ | } | ||
+ | |||
+ | public OkButton getOkButton(){ | ||
+ | return getFieldByClass(OkButton.class); | ||
+ | } | ||
+ | |||
+ | public CancelButton getCancelButton(){ | ||
+ | return getFieldByClass(CancelButton.class); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Start the form with the create handler | ||
+ | */ | ||
+ | public void startCreate() throws ProcessingException{ | ||
+ | startInternal(new CreateHandler()); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Start the form with the modify handler | ||
+ | */ | ||
+ | public void startModify() throws ProcessingException{ | ||
+ | startInternal(new ModifyHandler()); | ||
+ | } | ||
+ | |||
+ | |||
+ | @Order(10) | ||
+ | public class MainBox extends AbstractGroupBox{ | ||
+ | |||
+ | @Order(10) | ||
+ | public class FirstNameField extends AbstractStringField{ | ||
+ | @Override | ||
+ | protected String getConfiguredLabel(){ | ||
+ | return Texts.get("FirstName"); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | @Order(20) | ||
+ | public class LastNameField extends AbstractStringField{ | ||
+ | @Override | ||
+ | protected String getConfiguredLabel(){ | ||
+ | return Texts.get("LastName"); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | @Order(30) | ||
+ | public class OkButton extends AbstractOkButton{ | ||
+ | } | ||
+ | |||
+ | @Order(40) | ||
+ | public class CancelButton extends AbstractCancelButton{ | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | /** | ||
+ | * This is the form handler when started with .startCreate(); | ||
+ | */ | ||
+ | public class CreateHandler extends AbstractFormHandler{ | ||
+ | protected void execLoad() throws ProcessingException{ | ||
+ | //... | ||
+ | } | ||
+ | |||
+ | protected void execStore() throws ProcessingException{ | ||
+ | //... | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * This is the form handler when started with .startModify(); | ||
+ | */ | ||
+ | public class ModifyHandler extends AbstractFormHandler{ | ||
+ | protected void execLoad() throws ProcessingException{ | ||
+ | //... | ||
+ | } | ||
+ | |||
+ | protected void execStore() throws ProcessingException{ | ||
+ | //... | ||
+ | } | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | <br> | ||
+ | |||
+ | == How Tos == | ||
+ | |||
+ | *[[Create a Scout Dialog]] | ||
+ | *[[Create a Scout Process Service]] | ||
+ | |||
+ | === Where do I load data into a TablePage? === | ||
+ | |||
+ | *override method '''execLoadTableData '''where you call an outline service operation that returns a Object[][] field | ||
+ | *Parameter SearchFilter of execLoadTableData contains all additional WHERE clauses (that start with „AND…“) defined in the getConfiguredSearchTerm methods |
Revision as of 12:25, 10 March 2010
The Eclipse Scout project is a proposed open source project under the Eclipse Technology Project.
What is it
The eclipse scout Plug-Ins are used to build applications based on eclipse and equinox. These may be standalone apps, client/server apps, headless apps on server-side equinox etc.
Eclipse scout consists of a runtime and an sdk part. The runtime part consists of approx. five Plug-Ins, the sdk consists of approx. three Plug-Ins.
The runtime is purely based on equinox, and eclipse. The sdk part is an extension to JDT and PDE with a complete perspective for easy click-and-build of a complete application.
Key Concepts
An applications built with eclipse scout typically has a ui with perspectives, views, forms and pages. It may also have a back-end part that is running in an application server with server-side equinox. Perspectives, views, forms and pages are not limited to swt, scout supports complete gui pluggability.
With eclipse scout you have
- separation of ui (user interface layer) and gui (graphical user interface), swt and swing gui factory
- complete workspace overview, multiple Plug-Ins participating to the same application are visualized with their high-level dependencies
- much convenience and support in writing only the code you want to write when for example writing a new form with many sections and fields
- automatic nls support as-you-type
- soap-based remote service tunnel for hi-speed service remoting to a eclipse server-side application
- extension point for declaring osgi services and remote service proxies
- extension point for ui component to gui widget mapping
- complete abstration layer for desktop (workbench), outlines (perspectives), forms (views, dialogs) and fields
- configurable code
- template concept for creating abstract class libraries
- strong typed code, minimized "string binding" and therefore best support by PDE and JDT
- no meta data and no one-way code genration; everything is in the java code you write, you may write code manually and via click-and-build, doesn't matter
- ...
Screens
My first application
Easiest way to begin is creating a new eclipse scout project group and choosing the mail sample application. A project group is a set of Plug-Ins that make up your application. Project name: com.example.mail Project parts: client, server, swt ui This will create the Plug-Ins (listed by layer)
- com.example.mail.ui.swt.core
- com.example.mail.client.core
- com.example.mail.shared.core
- com.example.mail.server.core
A scout form
To get an idea consider this form with a title and two string fields. That's it. This form is displayed as a complete swt form with swt fields when using the swt gui Plug-In. It can also be displayed using the swing gui Plug-In, or (in development) using the apache wicket gui Plug-In to serve the form from the server as a web page.
public class PersonForm extends AbstractForm{
public PersonForm(){ }
/** * This method and all other getConfigured* and exec* methods can be written manually or via the property editor in the scout sdk view */ @Override protected String getConfiguredTitle(){ return Texts.get("MailReader"); }
public MainBox getMainBox(){ return (MainBox)getRootGroupBox(); } public FirstNameField getFirstNameField(){ return getFieldByClass(FirstNameField.class); }
public LastNameField getLastNameField(){ return getFieldByClass(LastNameField.class); } public OkButton getOkButton(){ return getFieldByClass(OkButton.class); }
public CancelButton getCancelButton(){ return getFieldByClass(CancelButton.class); }
/** * Start the form with the create handler */ public void startCreate() throws ProcessingException{ startInternal(new CreateHandler()); }
/** * Start the form with the modify handler */ public void startModify() throws ProcessingException{ startInternal(new ModifyHandler()); }
@Order(10) public class MainBox extends AbstractGroupBox{
@Order(10) public class FirstNameField extends AbstractStringField{ @Override protected String getConfiguredLabel(){ return Texts.get("FirstName"); } }
@Order(20) public class LastNameField extends AbstractStringField{ @Override protected String getConfiguredLabel(){ return Texts.get("LastName"); } }
@Order(30) public class OkButton extends AbstractOkButton{ } @Order(40) public class CancelButton extends AbstractCancelButton{ } }
/** * This is the form handler when started with .startCreate(); */ public class CreateHandler extends AbstractFormHandler{ protected void execLoad() throws ProcessingException{ //... }
protected void execStore() throws ProcessingException{ //... } }
/** * This is the form handler when started with .startModify(); */ public class ModifyHandler extends AbstractFormHandler{ protected void execLoad() throws ProcessingException{ //... }
protected void execStore() throws ProcessingException{ //... } } }
How Tos
Where do I load data into a TablePage?
- override method execLoadTableData where you call an outline service operation that returns a Object[][] field
- Parameter SearchFilter of execLoadTableData contains all additional WHERE clauses (that start with „AND…“) defined in the getConfiguredSearchTerm methods