Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[riena-dev] Do we need a MessageBoxRidget?

Hi everybody!

 

Should there be a Ridget that allows to show standard messages like information->ok or question->yes/no? A Ridget delegates to an actual UI-widget but offers a higher level of abstraction and is independent of the UI-toolkit (SWT). A MessageBoxRidget could delegate to a org.eclipse.swt.widgets.MessageBox or a org.eclipse.jface.dialogs.MessageDialog.

 

Problem

The SWT-widgets MessageBox and MessageDialog are different from the widgets usually bound to Ridgets insofar as they appear only when needed. Besides a method to show the widget the Ridget should have methods to set the message, the title, the type/icon and the combination of buttons. When using a MessageDialog all this information is set in the constructor. When using a MessageBox the type/icon and the buttons are part of the style that can also be set only in the constructor. So both widgets can't be sufficiently modified by the Ridget.

 

How it could be done

There could be a special Riena MessageBox-widget that is bound to the MessageBoxRidget. The Riena MessageBox-widget would use a org.eclipse.swt.widgets.MessageBox or a org.eclipse.jface.dialogs.MessageDialog to show the actual message dialog. The MessageBox-widget would be SWT-specific while the MessageBoxRidget would offer an SWT-independent interface IMessageBoxRidget.

 

Pros

- would allow a controller that does not depend on a specific UI-toolkit to show messages

- would ensure uniform appearance of messages throughout an application (when consistently used)

 

Cons

- yet another way to show messages beside MessageBox, MessageDialog, ErrorDialog,...

- MessageDialog already offers a convenient way to show standard messages (openInformation(..), openQuestion(..), etc.) so that the Ridget would not add much extra functionality

 

Any ideas or comments?

 

Greetings,

Carsten

 


Back to the top