Introduction to ESWT Mobile Extensions, part 2nd: Using advanced controls in mobile applications

Source: Internet
Author: User

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();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.