Skip to main content
summaryrefslogtreecommitdiffstats
blob: 82fc2dfa10c142a6f346001731cf4fd42f49a4a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*******************************************************************************
 * Copyright (c) 2018 Remain Software
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     wim.jongman@remainsoftware.com - initial API and implementation
 *******************************************************************************/
package org.eclipse.tips.core;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.tips.core.internal.TipManager;

/**
 * The ITipManager interface.
 *
 */
public interface ITipManager {

	/**
	 * Indicates whether already read tips must be served or not.
	 *
	 * @return true or false
	 * @see TipManager#setServeReadTips(boolean)
	 */
	boolean mustServeReadTips();

	/**
	 * Consults TipManager to determine the Tip's read status.
	 *
	 * @param tip the tip to query for its read status
	 * @return true if the tip is read, false otherwise.
	 */
	boolean isRead(Tip tip);

	/**
	 * Instructs the TipManager to mark this tip as read.
	 *
	 * @param tip the tip to set as read.
	 * @return this
	 */
	ITipManager setAsRead(Tip tip);

	/**
	 * Central place of logging for the Tip Framework.
	 *
	 * @param status the {@link IStatus} which may not be null
	 * @return this
	 */
	ITipManager log(IStatus status);

	/**
	 * Binds the passed provider to this manager. After registration, ITipManager
	 * implementations should asynchronously call the
	 * {@link TipProvider#loadNewTips(org.eclipse.core.runtime.IProgressMonitor)}
	 * method.
	 *
	 * @param provider the {@link TipProvider} to register which may not be null.
	 * @return this
	 */
	ITipManager register(TipProvider provider);

	/**
	 * Opens the Tip of the Day dialog.
	 *
	 * @param startUp When called from a startup situation, true must be passed for
	 *                <code>startup</code>. If in a manual starting situation, false
	 *                must be passed. This enables the manager to decide to skip
	 *                opening the dialog at startup (e.g., no new tip items).
	 *
	 * @return this
	 *
	 * @see #isOpen()
	 */
	ITipManager open(boolean startUp);

	/**
	 * Returns the open state.
	 *
	 * @return true if this manager is open, false otherwise.
	 */
	boolean isOpen();

	/**
	 * Indicates if this manager has providers with unread tips. Be aware that
	 * subsequent calls to this method may return different results based on the
	 * async nature of loading providers.
	 *
	 * @return true if this {@link TipManager} has providers with tips.
	 * @see TipProvider#getTips()
	 */
	boolean hasContent();
}

Back to the top