The largest Interview Solution Library on the web


Interview Questions
« Previous | 0 | 1 | 2 | 3 | 4 | Next »

21.What is .cache.html file in GWT?

It contains the actual program of a GWT application.
Explain bootstrap procedure for GWT application.
Following are the steps of bootstrap proceure for GWT application when a browser loads the GWT
application −

  • Browser loads the host html page and .nocache.js file.
  • Browser executes the .nocache.js file's javascript code.
  • nocache.js code resolves deferred binding configuarations forexample, browserdetection and use lookup table generated by GWT compiler to locate one of the .cache.html.
  • nocache.js code then creates a html hidden iframe, inserts that iframe into the host page's DOM, and loads the .cache.html file into the same iframe.
  • cache.html contains the actual program of a GWT application and once loaded in iframe shows the GWT application in the browser.

22.Why should a .nocache.js file never be cached?

GWT compiler generates .nocache.js file every time with the same name whenever a GWT application is compiled. So browser should always download the .nocache.js file to get the latest gwt application. gwt.js code actually appends a unique timestamp at the end of the file name so that browser always treat it a new file and should never cache it.

23.What is the purpose of Host Page?

The most important public resource is host page which is used to invoke actual GWT application. A typical HTML host page for an application might not include any visible HTML body content at all but it is always expected to include GWT application via a <script.../> tag.

24.What is the default style name of any GWT widget?

By default, the class name for each component is gwt-<classname>. For example, the Button widget has a default style of gwt-Button and similar way TextBox widgest has a default style of gwt- TextBox.

25.Do GWT compiler creates default Id attribute for its Widget by default?

No! By default, neither the browser nor GWT creates default id attributes for widgets.

26.What is the purpose of setStyleName function of a GWT widget?

This method will clear any existing styles and set the widget style to the new CSS class provided using style.

27.What is the purpose of addStyleName function of a GWT widget?

This method will add a secondary or dependent style name to the widget. A secondary style name is an additional style name that is,so if there were any previous style names applied they are kept.

28.What is the purpose of removeStyleName function of a GWT widget?

This method will remove given style from the widget and leaves any others associated with the widget.

29.What is the purpose of getStyleName function of a GWT widget?

This method gets all of the object's style names, as a space-separated list.

30.What is the purpose of setStylePrimaryName function of a GWT widget?

This method sets the object's primary style name and updates all dependent style names.

31.What is the difference between primary style and secondary styles of a GWT Widget?

By default, the primary style name of a widget will be the default style name for its widget class. For example, gwt-Button for Button widgets. When we add and remove style names using AddStyleName method, those styles are called secondary styles.

The final appearance of a widget is determined by the sum of all the secondary styles added to it, plus its primary style. You set the primary style of a widget with the setStylePrimaryNameString method.

32.How you can attach a CSS file with your GWT module?

There are multiple approaches for associating CSS files with your module. Modern GWT applications typically use a combination of CssResource and UiBinder.

  • Using a tag in the host HTML page.
  • Using the <stylesheet> element in the module XML file.
  • Using a CssResource contained within a ClientBundle.
  • Using an inline <ui:style> element in a UiBinder template.

33.Which class is the superclass of all user-interface classes?

The class UIObject is the superclass for all user-interface objects. Explain UIObject class.

  • The class UIObject is the superclass for all user-interface objects. It simply wraps a DOM element, and cannot receive events. It provides direct child classes like Widget, MenuItem, MenuItemSeparator, TreeItem.
  • All UIObject objects can be styled using CSS.
  • Every UIObject has a primary style name that identifies the key CSS style rule that should always be applied to it.
  • More complex styling behavior can be achieved by manipulating an object's secondary style names.
Explain Widget class. The class Widget is the base class for the majority of user-interface objects. Widget adds support for receiving events from the browser and being added directly to panels.

34.What is the purpose of Label widget of a GWT?

This widget contains text, not interpreted as HTML using a

element, causing it to be displayed with block layout.

35.What is the purpose of HTML widget of a GWT?

This widget can contain HTML text and displays the html content using a

element, causing it to be displayed with block layout.

36.What is the purpose of Image widget of a GWT?

This widget displays an image at a given URL.

37.What is the purpose of Anchor widget of GWT?

This widget represents a simple <a> element.

38.Which widget represents a standard push button in GWT?

Button widget represents a standard push button.

39.Which widget represents a normal push button with custom styling in GWT?

PushButton represents a normal push button with custom styling.

40.Which widget represents a stylish stateful button which allows the user to toggle between up and down states in GWT?

ToggleButton widget represents a stylish stateful button which allows the user to toggle between up and down states.

« Previous | 0 | 1 | 2 | 3 | 4 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com