Brief introduction
As mobile platforms become more complex, the demand for mobile computing will continue to grow. The embedded Standard Widget Toolkit (ESWT) Mobile Extension is an Eclipse technology that can be used to develop Java applications that have the appearance of desktop applications for a variety of mobile phones.
Introduction to the ESWT Mobile extensions in this series, part 1th: Using simple widgets to quickly build mobile applications "quickly build mobile applications with simple widgets" provides an overview of mobile expansion packs. It also describes some of the basic controls (Captionedcontrol, Constrainedtext, Dateeditor, ListBox, and ListView).
In this article, learn how to use:
Mobileshell displays a Full-screen mobile application.
SortedList gets a sorted list that has a filter that filters useless information.
HyperLink as a way to start a local application based on the device type.
Textextension as a way to set the type of input text.
Tasktip prompts the user for the current state of the application.
Mobileshell
Unlike a typical shell, Mobileshell supports a special screen mode that uses the entire device screen space rather than the usual mode of application space. Mobileshell is especially suitable for devices that need to crop the screen dynamically at run time. An application can call the Setfullscreenmode (Boolean) method to switch between normal mode and Full-screen mode at run time. This feature is commonly used in applications such as media players and Web browsers, which can request Full-screen mode for better rendering.
Note that the Mobileshell does not support the status style on Windows®mobile.
If you create a mobileshell and attach a command button, after you call Setfullscreenmode (true), it becomes Full-screen mode with a menu bar at the bottom of the screen. Listing 1 shows the code example that created the Mobileshell.
Listing 1. Create Mobileshell
display = parent.getDisplay();
mobileshell = new MobileShell(display,SWT.RESIZE);
button= new Button(mobileshell, SWT.PUSH|SWT.BORDER);
button.setBounds(0, 0, 200, 200);
button.setText("FullScreen Mode");
button.addSelectionListener(new SelectionListener(){
public void widgetSelected(SelectionEvent e) {
if(!isFullScreen){
mobileshell.setFullScreenMode(true);
button.setText("Normal mode");
isFullScreen = true;
}else{
mobileshell.setFullScreenMode(false);
button.setText("FullScreen Mode");
isFullScreen = false;
}
}
public void widgetDefaultSelected(SelectionEvent e) {
}});
mobileshell.open();