public interface IMessageManager
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
Modifier and Type | Method and Description |
---|---|
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.
|
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
.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 withvoid removeMessage(Object key)
key
- the key of the message to removevoid removeMessages()
void removeMessage(Object key, Control control)
key
- the id of the message to removecontrol
- the control the message is associated withvoid removeMessages(Control control)
control
- the control the messages are associated withvoid removeAllMessages()
void update()
setAutoUpdate(boolean)
void setAutoUpdate(boolean enabled)
enabled
- sets the state of the automatic updateboolean isAutoUpdate()
true
if auto update is active, false
otherwise.void setMessagePrefixProvider(IMessagePrefixProvider provider)
provider
- the new prefix provider or null
to turn the
prefix generation off.IMessagePrefixProvider getMessagePrefixProvider()
null
if prefixes
are not generated.void setDecorationPosition(int position)
position
- the decoration positionControlDecoration
int getDecorationPosition()
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 messagesForm.addMessageHyperlinkListener(org.eclipse.ui.forms.events.IHyperlinkListener)
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.