Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Jongman2018-05-17 20:47:24 +0000
committerWim Jongman2018-05-21 15:52:11 +0000
commit22cef14145400b4f47d47c0f74e6f33a8dab1719 (patch)
tree7c68b5e64386d83cc1ade8ce6de4747ad66740e9 /org.eclipse.tips.core
parent6c2c96714c5c1add856dc0baf9042d122e6e06a0 (diff)
downloadeclipse.platform.ua-22cef14145400b4f47d47c0f74e6f33a8dab1719.tar.gz
eclipse.platform.ua-22cef14145400b4f47d47c0f74e6f33a8dab1719.tar.xz
eclipse.platform.ua-22cef14145400b4f47d47c0f74e6f33a8dab1719.zip
Bug 534376: [Tips] (fetch) job runs even if I have disabled tipsI20180521-2000
* Added "Disabled" Option * Tips startup default can be controlled by property * Fixed internal api * Fixed documentation * Fixed tests * V3 fixed preferences initializer * V4 lightbulb in trim goes away in "Disabled" mode * V5 replaced combo with menu * V6 replaced tip to reflect new menu Change-Id: I958c1d583948341ef3ef0587655bdf1b78a4f0a4 Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
Diffstat (limited to 'org.eclipse.tips.core')
-rw-r--r--org.eclipse.tips.core/src/org/eclipse/tips/core/internal/TipManager.java42
1 files changed, 31 insertions, 11 deletions
diff --git a/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/TipManager.java b/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/TipManager.java
index 564813b1c..f8bb83f7e 100644
--- a/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/TipManager.java
+++ b/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/TipManager.java
@@ -40,6 +40,21 @@ public abstract class TipManager implements ITipManager {
private PropertyChangeSupport fChangeSupport = new PropertyChangeSupport(this);
/**
+ * May start a dialog at startup.
+ */
+ public static final int START_DIALOG = 0;
+
+ /**
+ * May do background tasks but not show a dialog on startup.
+ */
+ public static final int START_BACKGROUND = 1;
+
+ /**
+ * Tips may only start on explicit user request.
+ */
+ public static final int START_DISABLE = 2;
+
+ /**
* Instantiates a new TipManager.
*/
public TipManager() {
@@ -63,7 +78,7 @@ public abstract class TipManager implements ITipManager {
* call super, and then asynchronously call the
* {@link TipProvider#loadNewTips(org.eclipse.core.runtime.IProgressMonitor)}
* method.
- *
+ *
* This manager then starts listening to the a {@link TipProvider#PROP_READY}
* property change event and resends it through its own change support.
*
@@ -74,7 +89,7 @@ public abstract class TipManager implements ITipManager {
@Override
public ITipManager register(TipProvider provider) {
checkDisposed();
- String message = MessageFormat.format(Messages.TipManager_0, provider.getID() ,provider.getDescription());
+ String message = MessageFormat.format(Messages.TipManager_0, provider.getID(), provider.getDescription());
log(LogUtil.info(message));
provider.setManager(this);
addToMaps(provider, Integer.valueOf(getPriority(provider)));
@@ -164,27 +179,32 @@ public abstract class TipManager implements ITipManager {
/**
* Determines if the Tips framework must run at startup. The default
- * implementation returns true, subclasses should probably override this.
+ * implementation returns {@link #START_DIALOG} , subclasses should probably
+ * override this if they want to give users a choice.
*
- * @return true if the Tips framework should run at startup.
- * @see TipManager#setRunAtStartup(boolean)
+ * @return Returns {@link #START_DIALOG}, {@link #START_BACKGROUND} or
+ * {@link #START_DISABLE}.
+ * @see TipManager#setStartUpBehavior(int)
*/
- public boolean isRunAtStartup() {
+ public int getStartupBehavior() {
checkDisposed();
- return true;
+ return START_DIALOG;
}
/**
- * Determines if the Tips framework must run at startup.
+ * Determines what level of startup actions the Tips framework may do.
*
- * @param shouldRun true if the tips should be displayed at startup, false
- * otherwise.
+ * @param startupBehavior Use {@link TipManager#START_DIALOG} to allow a dialog
+ * at startup and possibly query for new content,
+ * {@link #START_BACKGROUND} to query for new content but
+ * not show a dialog or {@link #START_DISABLE} to not do
+ * startup actions at all.
*
* @return this
*
* @see #isRunAtStartup()
*/
- public abstract TipManager setRunAtStartup(boolean shouldRun);
+ public abstract TipManager setStartupBehavior(int startupBehavior);
/**
* The default implementation disposes of this manager and all the TipProviders

Back to the top