Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 795c5c57fec6585d24f5a9b118fd2c3e3a520606 (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
/*******************************************************************************
 * Copyright (c) 2018 Remain Software
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * 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.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 {

	private static final String EH1 = "</h1>"; //$NON-NLS-1$
	private static final String H1 = "<h1>"; //$NON-NLS-1$

	/**
	 * Constructor.
	 */
	public FinalTip(String providerId) {
		super(providerId);
	}

	@Override
	public Date getCreationDate() {
		Calendar instance = Calendar.getInstance();
		return instance.getTime();
	}

	@Override
	public String getSubject() {
		return Messages.FinalTip_2;
	}

	@Override
	public String getHTML() {
		return H1 + Messages.FinalTip_3 + EH1 //
				+ Messages.FinalTip_4;
	}

	@Override
	public TipImage getImage() {
		Bundle bundle = FrameworkUtil.getBundle(getClass());
		try {
			return new TipImage(bundle.getEntry("images/nomoretips.png")).setAspectRatio(417, 640, false); //$NON-NLS-1$
		} catch (IOException e) {
//			getManager().log(LogUtil.error(getClass(), e));
		}
		return null;
	}
}

Back to the top

.xml?h=2018-09_M1&id=dd99c91e069b69c264c4dae41e0e03c6e7b3f730'>^
0fc0a77e ^
0065902f ^
ad3425c6 ^
d5261ea0 ^