Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "EDT:Declaring widgets"

Line 6: Line 6:
 
*Write initialization code in the on-construction function.<br>
 
*Write initialization code in the on-construction function.<br>
  
The following sections give examples of widget use and are in the same order as the Rich UI palette sections: [[#Display and input|Display and input]], [[#Layout|Layout]], and [[#Visualization|Visualization]].<br>  
+
The following sections give examples of widget use and are in the same order as the sections of the Rich UI palette: [[#Display and input|Display and input]], [[#Layout|Layout]], and [[#Visualization|Visualization]].<br>  
  
 
<br>  
 
<br>  
Line 51: Line 51:
  
 
== Combo  ==
 
== Combo  ==
 
 
<source lang="java">
 
<source lang="java">
 +
package client;
 +
 +
import org.eclipse.edt.rui.widgets.Box;
 +
import org.eclipse.edt.rui.widgets.Combo;
 +
import org.eclipse.edt.rui.widgets.TextField;
 +
import eglx.ui.rui.Event;
 +
import eglx.ui.rui.RUIHandler;
 +
 +
 +
Handler MyHandler Type RUIHandler
 +
  { initialUI = [myBox] }
 +
 +
  myBox Box{columns=2, children= [myCombo, myTextField]};
 +
 +
  myCombo Combo
 +
  {
 +
      values = ["one", "two", "three", "four"],
 +
      selection = 2, onChange ::= changeFunction
 +
  };
 +
 +
  myTextField TextField
 +
      {text = myCombo.values[myCombo.selection]};
  
 +
  Function changeFunction(e Event IN)
 +
      myTextField.text = myCombo.values[myCombo.selection];
 +
  end
 +
end
 
</source>  
 
</source>  
  

Revision as of 14:54, 14 February 2012

When you write a Rich UI application, the typical process is as follows:

  • Create a Handler type of stereotype RUIHandler.
  • Declare the widgets and customize them; for example, by assigning and coding event handlers.
  • Display a given widget by including it either in the initialUI array of the Rich UI handler or in the children array of another widget.
  • Write initialization code in the on-construction function.

The following sections give examples of widget use and are in the same order as the sections of the Rich UI palette: Display and input, Layout, and Visualization.


Display and input

Button

 

Button (DojoButton)

 


Calendar (DojoCalendar)

 

Checkbox

 

Checkbox (DojoCheckbox)

 

ColorPalette (DojoColorPalette)

 

Combo

package client;
 
import org.eclipse.edt.rui.widgets.Box;
import org.eclipse.edt.rui.widgets.Combo;
import org.eclipse.edt.rui.widgets.TextField;
import eglx.ui.rui.Event;
import eglx.ui.rui.RUIHandler;
 
 
Handler MyHandler Type RUIHandler 
   { initialUI = [myBox] }
 
   myBox Box{columns=2, children= [myCombo, myTextField]};
 
   myCombo Combo
   {
      values = ["one", "two", "three", "four"],
      selection = 2, onChange ::= changeFunction
   };
 
   myTextField TextField
      {text = myCombo.values[myCombo.selection]};
 
   Function changeFunction(e Event IN)
      myTextField.text = myCombo.values[myCombo.selection];
   end
end


ComboBox (DojoComboBox)

 


CurrencyTextBox (DojoCurrencyTextBox)

 

DataGrid and related types

 


DateTextBox (DojoDateTextBox)

 


Editor (DojoEditor)

 

Grid (DojoGrid)

 

HorizontalSlider (DojoHorizontalSlider)

 

HTML

 

Hyperlink

 

Image

 


List

 

ListMulti

 

Menu

 

Menu (DojoMenu)

 

PasswordTextField

 


ProgressBar (DojoProgressBar)

 


RadioGroup

 


RadioGroup (DojoRadioGroup)

 

Shadow

 

Span

 

TextArea

 

TextArea (DojoTextArea)

 

TextField

 

TextField (DojoTextField)

 

TextLabel

 

TimeTextBox (DojoTimeTextBox)

 

ToggleButton (DojoToggleButton)

 

Tooltip (DojoTooltip)

 

TooltipDialog (DojoTooltipDialog)

 

Tree (DojoTree) and related types

 

Layout

AccordionContainer (DojoAccordionContainer)

 

BorderContainer (DojoBorderContainer)

 

Box

 

ContentPane (DojoContentPane)

 

ContextMenu (DojoContextMenu)

 

Dialog (DojoDialog)

 

Div, FloatLeft, and FloatRight

 

GridLayout and related types

 

Grouping

 

StackContainer (DojoStackContainer)

 

TabContainer (DojoTabContainer)

 

TitlePane (DojoTitlePane)

 


Visualization

BarGraph (DojoBarGraph)

 

BubbleChart (DojoBubbleChart)

 

LineGraph (DojoLineGraph)

 

PieChart (DojoPieChart) and related types

 




Code snippets main page

Back to the top