01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui.forms;
11:
12: import org.eclipse.jface.dialogs.IMessageProvider;
13: import org.eclipse.swt.widgets.Control;
14:
15: /**
16: * This interface encapsulates a single message that can be shown in a form.
17: * Messages can be associated with controls, or be of a general nature.
18: *
19: * @see IMessageManager
20: * @since 3.3
21: */
22: public interface IMessage extends IMessageProvider {
23: /**
24: * Returns the unique message key
25: *
26: * @return the unique message key
27: */
28: Object getKey();
29:
30: /**
31: * Returns data for application use
32: *
33: * @return data object
34: */
35: Object getData();
36:
37: /**
38: * Returns the control this message is associated with.
39: *
40: * @return the control or <code>null</code> if this is a general message.
41: */
42: Control getControl();
43:
44: /**
45: * Messages that are associated with controls can be shown with a prefix
46: * that indicates the origin of the message (e.g. the label preceeding the
47: * control).
48: *
49: * @return the message prefix or <code>null</code> if this is a general
50: * message
51: */
52: String getPrefix();
53: }
|