Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.tips.core/src/org/eclipse/tips/core/internal/FinalTip.java')
-rw-r--r--org.eclipse.tips.core/src/org/eclipse/tips/core/internal/FinalTip.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/FinalTip.java b/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/FinalTip.java
new file mode 100644
index 000000000..fbc8b8c26
--- /dev/null
+++ b/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/FinalTip.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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.internal;
+
+import java.io.IOException;
+import java.util.Calendar;
+import java.util.Date;
+
+import org.eclipse.tips.core.IHtmlTip;
+import org.eclipse.tips.core.Tip;
+import org.eclipse.tips.core.TipImage;
+import org.eclipse.tips.core.TipProvider;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+
+/**
+ * Special generic tip that tells the user that there are no more tips.
+ *
+ */
+public class FinalTip extends Tip implements IHtmlTip {
+
+ /**
+ * Constructor.
+ */
+ public FinalTip(String providerId) {
+ super(providerId);
+ }
+
+ @Override
+ public Date getCreationDate() {
+ Calendar instance = Calendar.getInstance();
+ return instance.getTime();
+ }
+
+ @Override
+ public String getSubject() {
+ return "No more tips";
+ }
+
+ @Override
+ public String getHTML() {
+ return "<h1>There are no more tips</h1>" //
+ + "This provider has no more new tips. You can toggle the " //
+ + "<b>Unread</b> checkbox below or select another provider.";
+ }
+
+ @Override
+ public TipImage getImage() {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ try {
+ return new TipImage(bundle.getEntry("images/nomoretips.png")).setAspectRatio(417, 640, false);
+ } catch (IOException e) {
+// getManager().log(LogUtil.error(getClass(), e));
+ }
+ return null;
+ }
+} \ No newline at end of file

Back to the top