Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Jongman2018-02-15 12:10:39 +0000
committerWim Jongman2018-02-28 10:43:23 +0000
commit855e377e4232cf456912f5d4d0088e86d157eabd (patch)
tree3792982215a3b81d3a30a9c9bc48bc1e2054d562 /org.eclipse.tips.core/src/org/eclipse/tips/core/ITipManager.java
parenta5d490a262a6e2f6f3dfcb36372dba07b98566a7 (diff)
downloadeclipse.platform.ua-855e377e4232cf456912f5d4d0088e86d157eabd.tar.gz
eclipse.platform.ua-855e377e4232cf456912f5d4d0088e86d157eabd.tar.xz
eclipse.platform.ua-855e377e4232cf456912f5d4d0088e86d157eabd.zip
Bug 307889 - [Intro] having "tip of the day" functionalityI20180228-2000
This is the initial contribution of a Tip of the Day framework to Eclipse. It provides a dialog with tips that can be started from the Help menu. Optionally is is show at IDE or RCP application starts. Extenders can provide their own tips by implementing a TipProvider. TipProviders can be added to the tips extension point and/or can be initialized from a JSon file. TipProviders can get priority based on an enabled when expression similar to commands and handlers. For example, EMF tips may be shown when the modeling perspective is open. Tips can be created from straight up HTML, hosted on a separate web page (e.g. Eclipse wiki), created from a Json file or be a full blown SWT implementation. Tips can provide actions to enable the user to open a view, set some preferences or whatever. The framework is UI agnostic but comes with a separate SWT implementation. Examples on how to create a Tips and TipProviders are available. Documentation is on the wiki: https://wiki.eclipse.org/Tip_of_the_Day The Tips framework uses null annotations, by default all methods cannot return null, except if they annotated with @Nullable. Changes done by Lars in cooperation with Wim ==Wim 16/feb== * removed annotations in core for now * Fixed some javadoc == Lars 16/feb== Removed the TipThemeManager Remove TipProvider from the Tip API, the Tip does not need to know its provider Tip now require the TipID Tips hashcode and equals methods are based on summary, providerID and creation date Removed the special getImage64 methods and refactored getImage48 to getImage == Wim 27 feb == Removed json plugin Change-Id: Ib65e150bdeb5f3f38075d8c6432e5b476bfa064d Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
Diffstat (limited to 'org.eclipse.tips.core/src/org/eclipse/tips/core/ITipManager.java')
-rw-r--r--org.eclipse.tips.core/src/org/eclipse/tips/core/ITipManager.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/org.eclipse.tips.core/src/org/eclipse/tips/core/ITipManager.java b/org.eclipse.tips.core/src/org/eclipse/tips/core/ITipManager.java
new file mode 100644
index 000000000..a722914b5
--- /dev/null
+++ b/org.eclipse.tips.core/src/org/eclipse/tips/core/ITipManager.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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;
+
+/**
+ * The model maintained by the TipManager.
+ *
+ */
+public interface ITipManager {
+
+ /**
+ * Indicates whether already read tips must be served or not.
+ *
+ * @return true or false
+ * @see TipManager#setServeReadTips(boolean)
+ */
+ public 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.
+ */
+ public abstract boolean isRead(Tip tip);
+
+ /**
+ * Instructs the TipManager to mark this tip as read.
+ *
+ * @param tip
+ * the tip to set as read.
+ * @return this
+ */
+ public abstract ITipManager setAsRead(Tip tip);
+
+ /**
+ * Central place of logging for the Tip Framework.
+ *
+ * @param status
+ * the {@link IStatus} which may not be null
+ * @return this
+ */
+ public 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
+ */
+ public ITipManager register(TipProvider provider);
+
+ /**
+ * Returns the disposed stated.
+ *
+ * @return true if this manager is disposed, false otherwise.
+ */
+ public boolean isDisposed();
+} \ No newline at end of file

Back to the top