Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Jongman2018-05-11 20:58:57 +0000
committerWim Jongman2018-05-11 22:37:35 +0000
commit411e8b952f1322213d5c45f5bfef5e1d0100a7e6 (patch)
tree6d074f3db0ccc66fb5f8fc8ae3c6ff17ef8a069b
parent17355c81a7dc85dd97206a735c95180fe94b38f0 (diff)
downloadeclipse.platform.ua-411e8b952f1322213d5c45f5bfef5e1d0100a7e6.tar.gz
eclipse.platform.ua-411e8b952f1322213d5c45f5bfef5e1d0100a7e6.tar.xz
eclipse.platform.ua-411e8b952f1322213d5c45f5bfef5e1d0100a7e6.zip
Bug 534595: [Tips] Create tips for tipsI20180511-2000
* Create Tips for Tips * Examples cleanup * Core cleanup Change-Id: I62c305f4d03a244434cdf376ec90727a888430f7 Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
-rw-r--r--org.eclipse.tips.core/schema/tips.exsd341
-rw-r--r--org.eclipse.tips.examples/icons/64/c++.pngbin2977 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/ecf.pngbin1642 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/eclipse.pngbin3949 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/java.pngbin4801 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/key.pngbin1467 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/nebula.pngbin9126 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/pin.pngbin1621 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/plugin.pngbin2123 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/pydev.pngbin2664 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/swt.pngbin4841 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/tips.pngbin2514 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/icons/64/twitter.pngbin2345 -> 0 bytes
-rw-r--r--org.eclipse.tips.examples/plugin.xml27
-rw-r--r--org.eclipse.tips.ide/build.properties3
-rw-r--r--org.eclipse.tips.ide/icons/tips.pngbin0 -> 2217 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/actions.pngbin0 -> 44283 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/navigate1.pngbin0 -> 15133 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/navigate2.pngbin0 -> 56333 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/photon.jpgbin0 -> 47782 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/starttip.gifbin0 -> 71600 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/starttip2.pngbin0 -> 49711 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/tip2.gifbin0 -> 16442 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/tipsfw.pngbin0 -> 105366 bytes
-rw-r--r--org.eclipse.tips.ide/images/tips/welcome.pngbin0 -> 84649 bytes
-rw-r--r--org.eclipse.tips.ide/plugin.xml8
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip1_Welcome.java57
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip2_StartingTips.java59
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip3_StartingTips.java57
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip4_Navigate.java60
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip5_Navigate.java60
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip6_ActionsTip.java100
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip7_Extend.java95
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/TipsTipProvider.java95
34 files changed, 609 insertions, 353 deletions
diff --git a/org.eclipse.tips.core/schema/tips.exsd b/org.eclipse.tips.core/schema/tips.exsd
index 93236edf6..a9d77ad84 100644
--- a/org.eclipse.tips.core/schema/tips.exsd
+++ b/org.eclipse.tips.core/schema/tips.exsd
@@ -24,7 +24,6 @@ This extension point allows bundles to hook into the eclipse tips framework.
<complexType>
<choice>
<element ref="provider" minOccurs="1" maxOccurs="unbounded"/>
- <element ref="category" minOccurs="1" maxOccurs="unbounded"/>
</choice>
<attribute name="point" type="string" use="required">
<annotation>
@@ -82,54 +81,6 @@ This extension point allows bundles to hook into the eclipse tips framework.
</appinfo>
</annotation>
</attribute>
- <attribute name="category" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.tips.core.tips/category/@id"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="category">
- <annotation>
- <documentation>
- A category to group tips in the UI.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- a unique name that will be used to identify this category
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name that will be used in the UI for this category
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="parentCategory" type="string">
- <annotation>
- <documentation>
- an optional path composed of category IDs separated by &apos;/&apos;. This
-allows the creation of a hierarchy of categories.
- </documentation>
- <appinfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.tips.core.tips/category/@id"/>
- </appinfo>
- </annotation>
- </attribute>
</complexType>
</element>
@@ -140,295 +91,35 @@ allows the creation of a hierarchy of categories.
</appinfo>
<documentation>
&lt;p&gt;
-This extension defines a parent category &quot;Java&quot;and a child category &quot;Java9&quot;. Then the provider
-is defined within category &quot;Java9&quot;.
+This extension defines a tip provider. The provider is given higher priority if the current active perspective is the java perspective.
&lt;pre&gt;
- &lt;extension
+ &amp;lt;extension
point=&quot;org.eclipse.tips.ide.tips&quot;&gt;
- &lt;category
- id=&quot;org.eclipse.tips.examples.java&quot;
- name=&quot;Java&quot;&gt;
- &lt;/category&gt;
- &lt;category
- id=&quot;org.eclipse.tips.examples.java9&quot;
- name=&quot;Java9&quot;
- parentCategory=&quot;org.eclipse.tips.examples.java9&quot;&gt;
- &lt;/category&gt;
- &lt;provider
- category=&quot;org.eclipse.tips.examples.java9&quot;
+ &amp;lt;provider
class=&quot;org.eclipse.tips.examples.java.java9.Java9TipProvider&quot;
description=&quot;Java 9 Tips&quot;
id=&quot;org.eclipse.tips.examples.java.java9.Java9TipProvider&quot;&gt;
- &lt;enablement&gt;
- &lt;with
+ &amp;lt;enablement&gt;
+ &amp;lt;with
variable=&quot;activeWorkbenchWindow.activePerspective&quot;&gt;
- &lt;equals
+ &amp;lt;equals
value=&quot;org.eclipse.jdt.ui.JavaPerspective&quot;&gt;
- &lt;/equals&gt;
- &lt;/with&gt;
- &lt;/enablement&gt;
- &lt;/provider&gt;
- &lt;/extension&gt;
+ &amp;lt;/equals&gt;
+ &amp;lt;/with&gt;
+ &amp;lt;/enablement&gt;
+ &amp;lt;/provider&gt;
+ &amp;lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
-&lt;b&gt;Sample implementation TipProvider&lt;/b&gt;
+&lt;b&gt;Example Tip Providers&lt;/b&gt;
&lt;/p&gt;
-&lt;p&gt;
-
-&lt;h1&gt;The Implementation of a TipProvider&lt;/h1&gt;
-This is an example of a TipProvider. The framework also contains an JSon TipProvider that fetches tips inside a JSon file from a remote URL.
-&lt;b&gt;
-The example below instantiates Tips from Java.
-&lt;pre&gt;
-
-/**
- * Class to provide tips to the tip framework. It is the job of this provider to
- * manage its tips. Examples of managing tips are:
- *
- * &lt;ul&gt;
- * &lt;li&gt;Loading tips from the internet&lt;/li&gt;
- * &lt;li&gt;Serve next, previous and current tip on request&lt;/li&gt;
- * &lt;/ul&gt;
- *
- * After the TipProvider is instantiated by the {@link TipManager}, the
- * TipManager will insert itself by calling {@link #setManager(TipManager)}.
- * Then the TipManager will asynchronous call this providers&apos; {@link #load()}
- * method. The job of the load() method is to do long work like fetching new
- * tips from the internet and storing them locally. There is no defined method
- * on how tips should be stored locally, implementers are free to do what is
- * needed.
- *
- * The constructor must return fast, meaning that tips may not be fetched from
- * the internet in the constructor. This should be done in the
- * {@link #load(IProgressMonitor)} method.
- *
- * To indicate that this provider is ready to serve tips, it should call the
- * {@link #setTips(List)} method which then sets its &lt;code&gt;ready&lt;/code&gt; flag.
- *
- */
-public class Java9TipProvider extends TipProvider {
-
- @Override
- /**
- * The Id is used (for example) to manage the read state of this providers tips.
- * It should be unique.
- *
- * @return the ID of this provider
- */
- public String getID() {
- return &quot;org.eclipse.tips.examples.Java9TipProvider&quot;;
- }
-
- /**
- * The 48x48 image may be used by the UI for low resolution displays.
- *
- * @return a 48x48 {@link TipImage}
- */
- @Override
- public TipImage getImage48() {
- Bundle bundle = FrameworkUtil.getBundle(getClass());
- try {
- return new TipImage(bundle.getEntry(&quot;icons/48/java.png&quot;)).setAspectRatio(1);
- } catch (IOException e) {
- getManager().log(getClass(), e);
- }
- return null;
-
- }
-
- /**
- * The 64x64 image may be used by the UI for higher resolution displays.
- *
- * @return a 64x64 {@link TipImage}
- */
- @Override
- public TipImage getImage64() {
- Bundle bundle = FrameworkUtil.getBundle(getClass());
- try {
- return new TipImage(bundle.getEntry(&quot;icons/64/java.png&quot;)).setAspectRatio(1);
- } catch (IOException e) {
- getManager().log(getClass(), e);
- }
- return null;
-
- }
-
- /**
- * Is called asynchronously during startup of the TipManager to gather new tips.
- * The provider is not available to the UI unless it has called it&apos;s
- * {@link #setTips(List)} method. It is therefore possible that the provider is
- * not immediately visible in the tip UI but will be added later.
- *
- * One strategy is to do a long running fetch in this method and then store the
- * tips locally. On the next run of the TipManager, the fetched tips can be
- * served from the constructor (i.e. by calling {@link #setTips(List)}), making
- * it immediately available.
- *
- * @param pMonitor
- * The monitor to report back progress.
- * @see TipProvider#setTips(List)
- * @see TipProvider#isReady()
- */
- @Override
- public synchronized void load(IProgressMonitor pMonitor) {
- SubMonitor subMonitor = SubMonitor.convert(pMonitor);
- subMonitor.beginTask(&quot;Loading Tips&quot;, -1);
- List&lt;Tip&gt; tips = new ArrayList&lt;&gt;();
- tips.add(new Tip1(this));
- tips.add(new Navigate2Tip(this));
- setTips(tips);
- subMonitor.done();
- }
-
- /**
- * @return the short description of this provider.
- */
- @Override
- public String getDescription() {
- return &quot;Java and Java Dev Tools Tips&quot;;
- }
-
- /**
- * Provides the opportunity to release all held resources.
- */
- @Override
- public void dispose() {
- }
-}
-
-&lt;/pre&gt;
-
-&lt;h1&gt;The Implementation of a Tip&lt;/h1&gt;
-This is an example implementation of a Tip
-&lt;pre&gt;
-/**
- * This is an example Tip class.
- *
- */
-public class Tip1 extends Tip {
-
- /**
- * Tips should be created fast.
- *
- * @param pProvider
- * the associated {@link TipProvider}
- */
- public Tip1(TipProvider pProvider) {
- super(pProvider);
- }
-
- /**
- * A getter for a {@link Runnable} action for this tip. Clients may override or
- * call {@link #setAction(Runnable)}.
- *
- * @return the action or null if not set by {@link Tip#setAction(Runnable)}.
- * @see Tip#setAction(Runnable)
- */
- @Override
- public Runnable getAction() {
- return new Runnable() {
- @Override
- public void run() {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openConfirm(null, getSubject(), &quot;We can start an action from a Tip!&quot;);
- }
- });
- }
- };
- }
-
- /**
- * Return the publish date of the tip. The {@link TipProvider} could decide to
- * server newer tips first.
- *
- * @return the date this tip was published which may not be null.
- */
- @Override
- public Date getCreationDate() {
- return DateUtil.getDateFromYYMMDD(&quot;10/01/2018&quot;);
- }
-
- /**
- * @return the subject which may not be null.
- */
- @Override
- public String getSubject() {
- return &quot;Java tip 1&quot;;
- }
-
- /**
- * This method may both return the string representation of an URL or the
- * descriptive HTML of the tip. If the html of the text is returned then an
- * effort is made to also inline the image URL. If you supply an URL then
- * {@link #getImage()} should return null.
- *
- * @return the HMTL or URL of the tip which is displayed in a browser widget.
- * @see #getImage()
- */
- @Override
- public String getHTML() {
- return &quot;&lt;h2&gt;Javatip 1&lt;/h2&gt;You see this tip because the Tip UI was opened when the java perspective &quot;
- + &quot;was active or because you selected the Java icon below.&quot; + &quot;&lt;br&gt;&lt;br&gt;&quot;
- + &quot;More java tips will be displayed here in the near future. For now, select one of the other providers&quot;
- + &quot; by clicking on the icons below.&quot;;
- }
-
- /**
- * A getter for the {@link TipImage}. Subclasses may override, the default
- * implementation returns null.
- *
- * @return a TipImage with information about the image or null if no image is
- * provided.
- */
- @Override
- public TipImage getImage() {
- Bundle bundle = FrameworkUtil.getBundle(getClass());
- try {
- return new TipImage(bundle.getEntry(&quot;images/java/duke.png&quot;)).setAspectRatio(1);
- } catch (IOException e) {
- getProvider().getManager().log(getClass(), e);
- }
- return null;
- }
-}
-&lt;/pre&gt;
-
-&lt;h1&gt;Example of a TipImage&lt;/h1&gt;
-TipImage objects are UI agnostic representations of an Image. You may pass a URL to a TipImage or a full base64 string (e.g. &quot;data:image/png;base64,iVBORw0KGgo.....CYII=&quot;).
-&lt;br&gt;
-One import aspect of the TipImage is it&apos;s aspect ratio. The Tip UI may use a browser to display it&apos;s UI. Therefore it can be scaled to the available space. Images look best when they use a 3:2 (1.5) ratio.
-&lt;br&gt;
-&lt;h4&gt;Set an image that is a square (aspect ratio = 1:1 (1))
-&lt;pre&gt;
-TipImage img = new TipImage(bundle.getEntry(&quot;images/java/duke.png&quot;)).setAspectRatio(1)
-&lt;/pre&gt;
-
-&lt;h4&gt;Set an image that is a square (aspect ratio = 1:1 (1))
-&lt;pre&gt;
- /**
- * Sets the aspect ratio of this image. If the image is 300 wide and 600 high
- * then the aspect ratio is 300/600 = 0,5 (1:2). If your image is 1200 wide and
- * 250 high then the aspect ratio (1200/250) = 4,8. With the supplied values the
- * best dimensions for the image can be calculated give the available space in
- * the UI.
- * &lt;p&gt;
- * In case you pass true for &lt;code&gt;pSetAsMax&lt;/code&gt; then the image can not be
- * up-scaled beyond the specified size. So if your image is 200x200 and you want
- * a maximum up-scale of 2 then pass 400x400 to this method to maintain the
- * aspect ratio but allow the image to be resized to maximum it&apos;s double size.
- * &lt;p&gt;
- * The recommended aspect ratio is around 3:2 (1.5) to be comfortably displayed
- * in the Tip UI.
- **
- TipImage img = new TipImage(&quot;data:image/png;base64,3ff4..eFW&quot;);
- img.setAspectRatio(800, 400, true); // Image can not be scaled up higer than 800:400
-&lt;/pre&gt;
-
+&lt;ul&gt;
+&lt;li&gt; &lt;a href=&quot;https://git.eclipse.org/c/platform/eclipse.platform.ua.git&quot;&gt;Repository with example tips.&lt;/a&gt;&lt;/li&gt;
+&lt;li&gt; &lt;a href=&quot;https://wiki.eclipse.org/Tip_of_the_Day&quot;&gt;Eclipse Wiki&lt;/a&gt;&lt;/li&gt;
+&lt;/ul&gt;
&lt;/p&gt;
</documentation>
</annotation>
diff --git a/org.eclipse.tips.examples/icons/64/c++.png b/org.eclipse.tips.examples/icons/64/c++.png
deleted file mode 100644
index a948ccbef..000000000
--- a/org.eclipse.tips.examples/icons/64/c++.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/ecf.png b/org.eclipse.tips.examples/icons/64/ecf.png
deleted file mode 100644
index 57e09478a..000000000
--- a/org.eclipse.tips.examples/icons/64/ecf.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/eclipse.png b/org.eclipse.tips.examples/icons/64/eclipse.png
deleted file mode 100644
index 01aa23b91..000000000
--- a/org.eclipse.tips.examples/icons/64/eclipse.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/java.png b/org.eclipse.tips.examples/icons/64/java.png
deleted file mode 100644
index 36cbf25c2..000000000
--- a/org.eclipse.tips.examples/icons/64/java.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/key.png b/org.eclipse.tips.examples/icons/64/key.png
deleted file mode 100644
index cc1694c12..000000000
--- a/org.eclipse.tips.examples/icons/64/key.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/nebula.png b/org.eclipse.tips.examples/icons/64/nebula.png
deleted file mode 100644
index 674fe6cb4..000000000
--- a/org.eclipse.tips.examples/icons/64/nebula.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/pin.png b/org.eclipse.tips.examples/icons/64/pin.png
deleted file mode 100644
index c065db4cf..000000000
--- a/org.eclipse.tips.examples/icons/64/pin.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/plugin.png b/org.eclipse.tips.examples/icons/64/plugin.png
deleted file mode 100644
index a75ab0593..000000000
--- a/org.eclipse.tips.examples/icons/64/plugin.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/pydev.png b/org.eclipse.tips.examples/icons/64/pydev.png
deleted file mode 100644
index ece92aa5d..000000000
--- a/org.eclipse.tips.examples/icons/64/pydev.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/swt.png b/org.eclipse.tips.examples/icons/64/swt.png
deleted file mode 100644
index 6acbcb124..000000000
--- a/org.eclipse.tips.examples/icons/64/swt.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/tips.png b/org.eclipse.tips.examples/icons/64/tips.png
deleted file mode 100644
index 32fb73b60..000000000
--- a/org.eclipse.tips.examples/icons/64/tips.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/icons/64/twitter.png b/org.eclipse.tips.examples/icons/64/twitter.png
deleted file mode 100644
index dc874f378..000000000
--- a/org.eclipse.tips.examples/icons/64/twitter.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.tips.examples/plugin.xml b/org.eclipse.tips.examples/plugin.xml
index 6c13e2410..03a18870e 100644
--- a/org.eclipse.tips.examples/plugin.xml
+++ b/org.eclipse.tips.examples/plugin.xml
@@ -14,18 +14,12 @@
<plugin>
<extension
point="org.eclipse.tips.core.tips">
- <category
- id="org.eclipse.tips.examples.tips.tipsfw"
- name="Tips Framework">
- </category>
<provider
- category="org.eclipse.tips.examples.tips.tipsfw"
class="org.eclipse.tips.examples.tipsframework.TipsTipProvider"
description="Eclipse Tips"
id="org.eclipse.tips.examples.tips.tipsframework.TipsTipProvider">
</provider>
<provider
- category="org.eclipse.tips.examples.tips.tipsfw"
class="org.eclipse.tips.examples.json.JsonTipProviderPhoton"
description="Eclipse Photon New and Noteworthy"
id="org.eclipse.tips.examples.tips.tipsframework.photonnn">
@@ -33,17 +27,7 @@
</extension>
<extension
point="org.eclipse.tips.core.tips">
- <category
- id="org.eclipse.tips.examples.tips.java"
- name="Java">
- </category>
- <category
- id="org.eclipse.tips.examples.tips.java9"
- name="Java9"
- parentCategory="org.eclipse.tips.examples.tips.java9">
- </category>
<provider
- category="org.eclipse.tips.examples.tips.java9"
class="org.eclipse.tips.examples.java.java9.Java9TipProvider"
description="Java 9 Tips"
id="org.eclipse.tips.examples.tips.java.java9.Java9TipProvider">
@@ -59,12 +43,7 @@
</extension>
<extension
point="org.eclipse.tips.core.tips">
- <category
- id="org.eclipse.tips.examples.tips.eclipsetips"
- name="Eclipse IDE Tips">
- </category>
<provider
- category="org.eclipse.tips.examples.tips.eclipsetips"
class="org.eclipse.tips.examples.eclipsetips.EclipseTipsProvider"
description="Eclipse Tips"
id="org.eclipse.tips.examples.tips.eclipsetips.EclipseTipsProvider">
@@ -72,12 +51,7 @@
</extension>
<extension
point="org.eclipse.tips.core.tips">
- <category
- id="org.eclipse.tips.examples.tips.eclipsetips"
- name="Eclipse IDE Tips">
- </category>
<provider
- category="org.eclipse.tips.examples.tips.eclipsetips"
class="org.eclipse.tips.examples.test.TestProvider"
description="Test Provider"
id="org.eclipse.tips.examples.tips.test.TestProvider">
@@ -86,7 +60,6 @@
<extension
point="org.eclipse.tips.core.tips">
<provider
- category="org.eclipse.tips.examples.tips.eclipsetips"
class="org.eclipse.tips.examples.swttip.SwtTipsProvider"
description="SWT Tips Provider"
id="org.eclipse.tips.examples.swttip.SWTTipsProvider">
diff --git a/org.eclipse.tips.ide/build.properties b/org.eclipse.tips.ide/build.properties
index 1b7dc5d80..a05b86308 100644
--- a/org.eclipse.tips.ide/build.properties
+++ b/org.eclipse.tips.ide/build.properties
@@ -14,4 +14,5 @@ bin.includes = META-INF/,\
.,\
plugin.xml,\
icons/,\
- OSGI-INF/
+ OSGI-INF/,\
+ images/
diff --git a/org.eclipse.tips.ide/icons/tips.png b/org.eclipse.tips.ide/icons/tips.png
new file mode 100644
index 000000000..cd19de252
--- /dev/null
+++ b/org.eclipse.tips.ide/icons/tips.png
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/actions.png b/org.eclipse.tips.ide/images/tips/actions.png
new file mode 100644
index 000000000..6d3276822
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/actions.png
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/navigate1.png b/org.eclipse.tips.ide/images/tips/navigate1.png
new file mode 100644
index 000000000..7867a3255
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/navigate1.png
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/navigate2.png b/org.eclipse.tips.ide/images/tips/navigate2.png
new file mode 100644
index 000000000..dcac33c9b
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/navigate2.png
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/photon.jpg b/org.eclipse.tips.ide/images/tips/photon.jpg
new file mode 100644
index 000000000..927939a49
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/photon.jpg
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/starttip.gif b/org.eclipse.tips.ide/images/tips/starttip.gif
new file mode 100644
index 000000000..045318617
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/starttip.gif
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/starttip2.png b/org.eclipse.tips.ide/images/tips/starttip2.png
new file mode 100644
index 000000000..efac56969
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/starttip2.png
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/tip2.gif b/org.eclipse.tips.ide/images/tips/tip2.gif
new file mode 100644
index 000000000..d3850990f
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/tip2.gif
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/tipsfw.png b/org.eclipse.tips.ide/images/tips/tipsfw.png
new file mode 100644
index 000000000..8eeb6009f
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/tipsfw.png
Binary files differ
diff --git a/org.eclipse.tips.ide/images/tips/welcome.png b/org.eclipse.tips.ide/images/tips/welcome.png
new file mode 100644
index 000000000..ac6834701
--- /dev/null
+++ b/org.eclipse.tips.ide/images/tips/welcome.png
Binary files differ
diff --git a/org.eclipse.tips.ide/plugin.xml b/org.eclipse.tips.ide/plugin.xml
index 9fc3c7f66..2913574c2 100644
--- a/org.eclipse.tips.ide/plugin.xml
+++ b/org.eclipse.tips.ide/plugin.xml
@@ -186,4 +186,12 @@
class="org.eclipse.tips.ide.internal.Preferences">
</initializer>
</extension>
+ <extension
+ point="org.eclipse.tips.core.tips">
+ <provider
+ class="org.eclipse.tips.ide.internal.provider.TipsTipProvider"
+ description="Tips about Tips"
+ id="org.eclipse.tips.ide.internal.provider.TipsTipProvider">
+ </provider>
+ </extension>
</plugin>
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip1_Welcome.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip1_Welcome.java
new file mode 100644
index 000000000..abb0abe7a
--- /dev/null
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip1_Welcome.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.ide.internal.provider;
+
+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;
+
+public class Tip1_Welcome extends Tip implements IHtmlTip {
+
+ private TipImage fImage;
+
+ public Tip1_Welcome(String providerId) {
+ super(providerId);
+ }
+
+ @Override
+ public Date getCreationDate() {
+ return TipsTipProvider.getDateFromYYMMDD("09/01/2019");
+ }
+
+ @Override
+ public String getSubject() {
+ return "Welcome to the tips framework";
+ }
+
+ @Override
+ public String getHTML() {
+ return "<h2>Welcome to the Tips Framework</h2>It can show tips from various tip providers which are listed in the bottom. This provider has tips about tips which will show you how to navigate this UI."
+ + "Tips appear here in various forms. They can come from Twitter, a Wiki, a Website, a file or even from Java and inline HTML, like this one."
+ + "<br><br>" + "Press <b><i>Next Tip</i></b> to see how to start tips manually.<br><br>";
+ }
+
+ @Override
+ public TipImage getImage() {
+ if (fImage == null) {
+ try {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ fImage = new TipImage(bundle.getEntry("images/tips/welcome.png")).setAspectRatio(560, 480, true);
+ } catch (Exception e) {
+ }
+ }
+ return fImage;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip2_StartingTips.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip2_StartingTips.java
new file mode 100644
index 000000000..6fe4a4555
--- /dev/null
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip2_StartingTips.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * 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.ide.internal.provider;
+
+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;
+
+public class Tip2_StartingTips extends Tip implements IHtmlTip {
+
+ public Tip2_StartingTips(String providerId) {
+ super(providerId);
+ }
+
+ @Override
+ public Date getCreationDate() {
+ return TipsTipProvider.getDateFromYYMMDD("09/01/2019");
+ }
+
+ @Override
+ public String getSubject() {
+ return "Opening the Tips Dialog";
+ }
+
+ @Override
+ public String getHTML() {
+ return "<h2>Opening the Tips Dialog</h2>The tips are started automatically at startup if there are tips available."
+ + " In case the tips are not loaded at startup you can activate the tips manually from the Help menu."
+ + "<br><br>" + "Press <b><i>Next Tip</i></b> to learn more.<br><br>";
+ }
+
+ private TipImage fImage;
+
+ @Override
+ public TipImage getImage() {
+ if (fImage == null) {
+ try {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ fImage = new TipImage(bundle.getEntry("images/tips/starttip.gif")).setAspectRatio(780, 430, true);
+ } catch (Exception e) {
+// getProvider().getManager().log(LogUtil.info(getClass(), e));
+ }
+ }
+ return fImage;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip3_StartingTips.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip3_StartingTips.java
new file mode 100644
index 000000000..8566a98cf
--- /dev/null
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip3_StartingTips.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.ide.internal.provider;
+
+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;
+
+public class Tip3_StartingTips extends Tip implements IHtmlTip {
+
+ public Tip3_StartingTips(String providerId) {
+ super(providerId);
+ }
+
+ @Override
+ public Date getCreationDate() {
+ return TipsTipProvider.getDateFromYYMMDD("09/01/2019");
+ }
+
+ @Override
+ public String getSubject() {
+ return "Opening the Tips Dialog";
+ }
+
+ @Override
+ public String getHTML() {
+ return "<h2>Tips Available?</h2>In case you do not want to start tips at startup, you can still see if there are tips available. "
+ + "Check the bottom right corner to see a little lightbulb. This lightbulb only appears if there is something to read."
+ + "<br><br>" + "Press <b><i>Next Tip</i></b> to see how to navigate Tips.<br><br>";
+ }
+
+ private TipImage fImage;
+
+ @Override
+ public TipImage getImage() {
+ if (fImage == null) {
+ try {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ fImage = new TipImage(bundle.getEntry("images/tips/starttip2.png")).setAspectRatio(968, 741, true);
+ } catch (Exception e) {
+ }
+ }
+ return fImage;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip4_Navigate.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip4_Navigate.java
new file mode 100644
index 000000000..4b0688a5d
--- /dev/null
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip4_Navigate.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.ide.internal.provider;
+
+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;
+
+public class Tip4_Navigate extends Tip implements IHtmlTip {
+
+ private TipImage fImage;
+
+ @Override
+ public TipImage getImage() {
+ if (fImage == null) {
+ try {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ fImage = new TipImage(bundle.getEntry("images/tips/navigate1.png")).setAspectRatio(570, 91, true);
+ } catch (Exception e) {
+ }
+ }
+ return fImage;
+ }
+
+ public Tip4_Navigate(String providerId) {
+ super(providerId);
+ }
+
+ @Override
+ public Date getCreationDate() {
+ return TipsTipProvider.getDateFromYYMMDD("09/01/2019");
+ }
+
+ @Override
+ public String getSubject() {
+ return "Navigate Tip 1";
+ }
+
+ @Override
+ public String getHTML() {
+ return "<h2>Navigating Tips</h2>You can navigate tips by using the button bar."
+ + "<br><br><b>Show tips at startup</b><br>A toggle to show this dialog when you start Eclipse."
+ + "<br><b>Unread only</b><br>Shows all Tips when unchecked or unread Tips when checked."
+ + "<br><b>Next Tip</b><br>Navigates to the next tip."
+ + "<br><b>Previous Tip</b><br>Navigates to the previous tip <i>if reading all tips</i>."
+ + "<br><b>Close</b><br>Closes the Dialog (<b>Escape</b> does the same)." + "<br><br><br>";
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip5_Navigate.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip5_Navigate.java
new file mode 100644
index 000000000..05e317620
--- /dev/null
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip5_Navigate.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.ide.internal.provider;
+
+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;
+
+public class Tip5_Navigate extends Tip implements IHtmlTip {
+
+ private TipImage fImage;
+
+ public Tip5_Navigate(String providerId) {
+ super(providerId);
+ }
+
+ @Override
+ public Date getCreationDate() {
+ return TipsTipProvider.getDateFromYYMMDD("09/01/2019");
+ }
+
+ @Override
+ public String getSubject() {
+ return "Navigate Tip 2";
+ }
+
+ @Override
+ public String getHTML() {
+ return "<h2>Navigating Tips</h2>You can activate other Tip Providers by clicking on the big icons below."
+ + "<br>"
+ + "You are currently looking at the Tips tips but as you can see there are other providers. Go ahead and"
+ + " select some of the other providers. If you click on the lightbulb below you will return to this tip.<br><br><br><br>";
+ }
+
+ @Override
+ public TipImage getImage() {
+ if (fImage == null) {
+ try {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ fImage = new TipImage(bundle.getEntry("images/tips/navigate2.png")).setAspectRatio(650, 220, true);
+ } catch (Exception e) {
+// getProvider().getManager().log(LogUtil.info(getClass(), e));
+ }
+ }
+ return fImage;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip6_ActionsTip.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip6_ActionsTip.java
new file mode 100644
index 000000000..241953e70
--- /dev/null
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip6_ActionsTip.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * 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.ide.internal.provider;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.tips.core.IHtmlTip;
+import org.eclipse.tips.core.Tip;
+import org.eclipse.tips.core.TipAction;
+import org.eclipse.tips.core.TipImage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+
+public class Tip6_ActionsTip extends Tip implements IHtmlTip {
+
+ private TipImage fImage;
+
+ @Override
+ public TipImage getImage() {
+ if (fImage == null) {
+ try {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ fImage = new TipImage(bundle.getEntry("images/tips/actions.png")).setAspectRatio(758, 480, true);
+ } catch (Exception e) {
+ }
+ }
+ return fImage;
+ }
+
+ public Tip6_ActionsTip(String providerId) {
+ super(providerId);
+ }
+
+ @Override
+ public List<TipAction> getActions() {
+ Runnable runnable = () -> Display.getDefault()
+ .syncExec(() -> MessageDialog.openConfirm(null, getSubject(), "We can do anything we want."));
+ Runnable clock = () -> Display.getDefault().syncExec(() -> MessageDialog.openConfirm(null, getSubject(),
+ DateFormat.getTimeInstance().format(Calendar.getInstance().getTime())));
+ Runnable runner2 = () -> Display.getDefault().syncExec(() -> {
+ PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "myPreferencePage", null, null);
+ if (pref != null)
+ pref.open();
+ });
+ ArrayList<TipAction> actions = new ArrayList<>();
+ actions.add(new TipAction("Clock", "What is the time?", clock, getImage("icons/clock.png")));
+ actions.add(
+ new TipAction("Open Preferences", "Opens the preferences", runner2, getImage("icons/bug_link.png")));
+ actions.add(
+ new TipAction("Cut or Paste", "Just another silly action", runnable, getImage("icons/lightbulb.png")));
+ actions.add(new TipAction("Eclipse Rocks, Idea Scissors", "Paper", runnable, getImage("icons/cut.png")));
+ actions.add(new TipAction("Totally Bonkers", "The quick brown fox", runnable, getImage("icons/notfound.png")));
+ return actions;
+ }
+
+ private TipImage getImage(String pIcon) {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ try {
+ return new TipImage(bundle.getEntry(pIcon)).setAspectRatio(1);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ @Override
+ public Date getCreationDate() {
+ return TipsTipProvider.getDateFromYYMMDD("09/01/2019");
+ }
+
+ @Override
+ public String getSubject() {
+ return "Actions";
+ }
+
+ @Override
+ public String getHTML() {
+ return "<h2>ActionTips</h2>Some tips enable you to start one or more actions. " //
+ + "If this is the case then an additional button will be displayed " //
+ + "like in this tip. Go ahead and press the button, or choose another "
+ + "action from the drop down menu next to the button. <br><br><br>";
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip7_Extend.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip7_Extend.java
new file mode 100644
index 000000000..139d98758
--- /dev/null
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip7_Extend.java
@@ -0,0 +1,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.ide.internal.provider;
+
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.function.Function;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.tips.core.IHtmlTip;
+import org.eclipse.tips.core.Tip;
+import org.eclipse.tips.core.TipAction;
+import org.eclipse.tips.core.TipImage;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+
+public class Tip7_Extend extends Tip implements IHtmlTip {
+
+ public Tip7_Extend(String providerId) {
+ super(providerId);
+ }
+
+ @Override
+ public List<TipAction> getActions() {
+ Function<String, Boolean> openBrowser = input -> {
+ Desktop d = Desktop.getDesktop();
+ try {
+ d.browse(new URI("https://wiki.eclipse.org/Tip_of_the_Day"));
+ } catch (IOException | URISyntaxException e) {
+ e.printStackTrace();
+ }
+ return false;
+ };
+ Runnable runner = () -> Display.getDefault().asyncExec(() -> {
+ if (Platform.isRunning() && Platform.getWS().startsWith("gtk")) {
+ boolean confirm = MessageDialog.openConfirm(null, "Action",
+ "Can't open a browser in GTK. It crashes the JVM. Press Ok to try anyway.");
+ if (confirm) {
+ openBrowser.apply("go");
+ }
+ } else {
+ openBrowser.apply("go");
+ }
+ });
+
+ ArrayList<TipAction> actions = new ArrayList<>();
+ actions.add(new TipAction("Open Browser", "Opens Eclipse Wiki.", runner, null));
+ return actions;
+ }
+
+ @Override
+ public Date getCreationDate() {
+ return TipsTipProvider.getDateFromYYMMDD("09/01/2019");
+ }
+
+ @Override
+ public String getSubject() {
+ return "On GitHub";
+ }
+
+ @Override
+ public String getHTML() {
+ return "<h2>Extending Tips</h2>You can extend this framework and add your own trip provider for your project. Press the action button to open the Eclipse Wiki for more information."
+ + "<br><br>";
+ }
+
+ private TipImage fImage;
+
+ @Override
+ public TipImage getImage() {
+ if (fImage == null) {
+ try {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ fImage = new TipImage(bundle.getEntry("images/tips/photon.jpg")).setAspectRatio(720, 480, true);
+ } catch (Exception e) {
+ }
+ }
+ return fImage;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/TipsTipProvider.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/TipsTipProvider.java
new file mode 100644
index 000000000..98e7ac603
--- /dev/null
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/TipsTipProvider.java
@@ -0,0 +1,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.ide.internal.provider;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.tips.core.Tip;
+import org.eclipse.tips.core.TipImage;
+import org.eclipse.tips.core.internal.LogUtil;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+
+@SuppressWarnings("restriction")
+public class TipsTipProvider extends org.eclipse.tips.core.TipProvider {
+
+ private TipImage fImage48;
+
+ @Override
+ public TipImage getImage() {
+ if (fImage48 == null) {
+ Bundle bundle = FrameworkUtil.getBundle(getClass());
+ try {
+ fImage48 = new TipImage(bundle.getEntry("icons/tips.png")).setAspectRatio(1);
+ } catch (IOException e) {
+ getManager().log(LogUtil.info(getClass(), e));
+ }
+ }
+ return fImage48;
+ }
+
+ @Override
+ public synchronized IStatus loadNewTips(IProgressMonitor pMonitor) {
+ SubMonitor subMonitor = SubMonitor.convert(pMonitor);
+ subMonitor.beginTask("Loading Tips", -1);
+ List<Tip> tips = new ArrayList<>();
+ tips.add(new Tip1_Welcome(getID()));
+ tips.add(new Tip2_StartingTips(getID()));
+ tips.add(new Tip3_StartingTips(getID()));
+ tips.add(new Tip4_Navigate(getID()));
+ tips.add(new Tip5_Navigate(getID()));
+ tips.add(new Tip6_ActionsTip(getID()));
+ tips.add(new Tip7_Extend(getID()));
+ setTips(tips);
+ subMonitor.done();
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Tips about Tips";
+ }
+
+ @Override
+ public String getID() {
+ return getClass().getName();
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ /**
+ * Convenience method that creates a date from a dd/mm/yy string.
+ *
+ * @param pYYMMDD the date in a dd/mm/yy format, e.g. "01/01/2017"
+ * @return the date
+ * @throws RuntimeException if the date is not correct
+ */
+ public static Date getDateFromYYMMDD(String pYYMMDD) {
+ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
+ try {
+ return sdf.parse(pYYMMDD);
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+} \ No newline at end of file

Back to the top