|
Eclipse Platform Release 3.3 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
This interface provides for managing typed messages in a form. Typed messages are messages associated with a type that indicates their severity (error, warning, information). The interface is responsible for:
To use it in a form, do the following:
addMessage method.This interface should only be referenced. It must not be implemented or extended.
IMessageProvider,
IManagedForm| Method Summary | |
|---|---|
void |
addMessage(Object key,
String messageText,
Object data,
int type)
Adds a general message that is not associated with any decorated field. |
void |
addMessage(Object key,
String messageText,
Object data,
int type,
Control control)
Adds a message that should be associated with the provided control. |
String |
createSummary(IMessage[] messages)
When message manager is used in context of a form, and there are hyperlink listeners for messages in the header, the hyperlink event will carry an object of type IMessage[] as an href. |
int |
getDecorationPosition()
Returns the currently used decoration position for all control messages. |
IMessagePrefixProvider |
getMessagePrefixProvider()
|
boolean |
isAutoUpdate()
Tests whether the form will be automatically updated when messages are added or removed. |
void |
removeAllMessages()
Removes all the local field messages and all the general container messages. |
void |
removeMessage(Object key)
Removes the general message with the provided key. |
void |
removeMessage(Object key,
Control control)
Removes a keyed message associated with the provided control. |
void |
removeMessages()
Removes all the general messages. |
void |
removeMessages(Control control)
Removes all the messages associated with the provided control. |
void |
setAutoUpdate(boolean enabled)
Controls whether the form is automatically updated when messages are added or removed. |
void |
setDecorationPosition(int position)
Message manager uses SWT.LEFT|SWT.BOTTOM for the default decoration position. |
void |
setMessagePrefixProvider(IMessagePrefixProvider provider)
Sets the alternative message prefix provider. |
void |
update()
Updates the message container with the messages currently in the manager. |
| Method Detail |
public void addMessage(Object key,
String messageText,
Object data,
int type)
key - a unique message key that will be used to look the message up
latermessageText - the message to adddata - an object for application use (can be null)type - the message type as defined in IMessageProvider.
public void addMessage(Object key,
String messageText,
Object data,
int type,
Control control)
key - the unique message keymessageText - the message to adddata - an object for application use (can be null)type - the message typecontrol - the control to associate the message withpublic void removeMessage(Object key)
key - the key of the message to removepublic void removeMessages()
public void removeMessage(Object key,
Control control)
key - the id of the message to removecontrol - the control the message is associated withpublic void removeMessages(Control control)
control - the control the messages are associated withpublic void removeAllMessages()
public void update()
setAutoUpdate(boolean)public void setAutoUpdate(boolean enabled)
enabled - sets the state of the automatic updatepublic boolean isAutoUpdate()
true if auto update is active, false
otherwise.public void setMessagePrefixProvider(IMessagePrefixProvider provider)
provider - the new prefix provider or null to turn the
prefix generation off.public IMessagePrefixProvider getMessagePrefixProvider()
null if prefixes
are not generated.public void setDecorationPosition(int position)
position - the decoration positionControlDecorationpublic int getDecorationPosition()
public String createSummary(IMessage[] messages)
IMessage[] as an href. You can use
this method to create a summary text from this array consistent with the
tool tip used by the form header.
messages - an array of messages
Form.addMessageHyperlinkListener(org.eclipse.ui.forms.events.IHyperlinkListener)
|
Eclipse Platform Release 3.3 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.