|
|
(62 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | The next sections outline a way to develop a Rich UI application. The IDE helps you to do the tasks quickly.
| |
| | | |
− | For background information, see [http://www.eclipse.org/edt/papers/topics/egl_web_technology.html Web technology for EGL Rich UI].
| |
− |
| |
− | = Create a Handler type of stereotype RUIHandler =
| |
− |
| |
− | <source lang="java">
| |
− | package client;
| |
− |
| |
− | import org.eclipse.edt.rui.widgets.GridLayout;
| |
− |
| |
− | handler MyHandler type RUIhandler{
| |
− |
| |
− | // sets one or more widgets at the root of the widget tree.
| |
− | initialUI =[ui],
| |
− |
| |
− | // specifies the function that runs initially and without user interaction.
| |
− | onConstructionFunction = start,
| |
− |
| |
− | // identifies the CSS file that helps you to design the page.
| |
− | cssFile = "css/MyProject.css",
| |
− |
| |
− | // sets the title that is displayed at the top of your browser or browser tab.
| |
− | title = "MyHandler"}
| |
− |
| |
− | ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children =[]};
| |
− |
| |
− | function start()
| |
− | end
| |
− | end
| |
− | </source>
| |
− |
| |
− | An IDE wizard initially creates a grid layout of 3 columns and 4 rows.
| |
− |
| |
− | = Declare, customize, and display widgets =
| |
− |
| |
− | <source lang="java">
| |
− | package client;
| |
− |
| |
− | import org.eclipse.edt.rui.widgets.GridLayout;
| |
− |
| |
− | handler MyHandler type RUIhandler{
| |
− | initialUI =[ui], onConstructionFunction = start,
| |
− | cssFile = "css/MyProject.css", title = "MyHandler"}
| |
− |
| |
− | ui GridLayout{columns = 3, rows = 4, cellPadding = 4,
| |
− | children =[myLabel, myTextField, myCheckBox, myButton]};
| |
− |
| |
− | myLabel TextLabel{ layoutData = new GridLayoutData{ row = 1, column=1},
| |
− | text = "Label: " };
| |
− |
| |
− | myTextField TextField{ layoutData = new GridLayoutData{ row = 1, column = 2,
| |
− | horizontalSpan = 2 }, text = "Text field"};
| |
− |
| |
− | myCheckBox CheckBox{ layoutData = new GridLayoutData{ row = 2, column = 2,
| |
− | verticalSpan = 2 }, text="Check box" };
| |
− |
| |
− | myButton Button{ layoutData = new GridLayoutData{ row = 4, column = 1,
| |
− | horizontalSpan = 2,
| |
− | horizontalAlignment = GridLayoutLib.Align_Center },
| |
− | text="Button" };
| |
− |
| |
− |
| |
− |
| |
− | function start()
| |
− | end
| |
− | end
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− | </source>
| |
− |
| |
− | = Assign and code event handlers =
| |
− |
| |
− | <source lang="java">
| |
− |
| |
− | </source>
| |
− |
| |
− | = Write the on-construction function =
| |
− |
| |
− | <source lang="java">
| |
− |
| |
− | </source>
| |
− |
| |
− |
| |
− | <br> <br><br> ♦ [[EDT:Code snippets|Code snippets main page]] <br>
| |
− |
| |
− | [[Category:EDT]]
| |