Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-06-17 06:39:51 +0000
committerWim Jongman2018-06-17 10:46:20 +0000
commit3ecb22bf53d937542c8e0410af1b356468388b25 (patch)
tree66f8687649d8ab6490d7338196ad038aac4bd5f3
parent333f7bd06c56d746a249ecd73b42b77d45518ed1 (diff)
downloadeclipse.platform.ua-3ecb22bf53d937542c8e0410af1b356468388b25.tar.gz
eclipse.platform.ua-3ecb22bf53d937542c8e0410af1b356468388b25.tar.xz
eclipse.platform.ua-3ecb22bf53d937542c8e0410af1b356468388b25.zip
Bug 535975 - [Tips] Minor refactoringI20180618-0800
* Job titles shall be short and not sentences, they are displayed in the status bar and progress view * an ellipsis has 3 dots (at least in English) * fix grammar and typos * use MessageFormat instead of relying on the message in the properties file ending with a blank character, this can go wrong to easily Change-Id: Idfd85865d789d64a1c6f74fac345c41c303b6e52 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.tips.core/src/org/eclipse/tips/core/TipProvider.java18
-rw-r--r--org.eclipse.tips.core/src/org/eclipse/tips/core/internal/messages.properties2
-rw-r--r--org.eclipse.tips.examples/src/org/eclipse/tips/examples/swttip/SwtTipsProvider.java2
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/IDETipManager.java3
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/messages.properties8
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip2_StartingTips.java2
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip3_StartingTips.java2
-rw-r--r--org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/Tip7_Extend.java2
-rw-r--r--org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/TipComposite.java3
-rw-r--r--org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/messages.properties2
10 files changed, 21 insertions, 23 deletions
diff --git a/org.eclipse.tips.core/src/org/eclipse/tips/core/TipProvider.java b/org.eclipse.tips.core/src/org/eclipse/tips/core/TipProvider.java
index 86221f385..e1a3022ac 100644
--- a/org.eclipse.tips.core/src/org/eclipse/tips/core/TipProvider.java
+++ b/org.eclipse.tips.core/src/org/eclipse/tips/core/TipProvider.java
@@ -28,7 +28,7 @@ import org.eclipse.tips.core.internal.LogUtil;
* manage its tips. Examples of managing tips are:
*
* <ul>
- * <li>Loading tips from the internet</li>
+ * <li>Loading tips from the Internet</li>
* <li>Serve next, previous and current tip on request</li>
* </ul>
*
@@ -36,7 +36,7 @@ import org.eclipse.tips.core.internal.LogUtil;
* TipManager will insert itself by calling {@link #setManager(ITipManager)}.
* Then the TipManager will asynchronous call this providers'
* {@link #loadNewTips(IProgressMonitor)} method. The job of the load() method
- * is to do long work like fetching new tips from the internet and storing them
+ * 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.
*
@@ -69,22 +69,18 @@ public abstract class TipProvider {
* requirement to only serve read tips. Subclasses may replace this predicate if
* they want to add some additional tests.
*/
- private Predicate<Tip> fUnreadTipPredicate = new Predicate<Tip>() {
-
- @Override
- public boolean test(Tip pTip) {
- if (getManager().mustServeReadTips()) {
- return true;
- }
- return !getManager().isRead(pTip);
+ private Predicate<Tip> fUnreadTipPredicate = pTip -> {
+ if (getManager().mustServeReadTips()) {
+ return true;
}
+ return !getManager().isRead(pTip);
};
/**
* The zero argument constructor must be able to instantiate the TipProvider.
* This method may also be used to quickly set the available tips by calling the
* {@link #setTips(List)} method. The constructor may not be used to load tips
- * from the internet. Use the {@link #loadNewTips(IProgressMonitor)} method for
+ * from the Internet. Use the {@link #loadNewTips(IProgressMonitor)} method for
* this purpose.
*
* @see #loadNewTips(IProgressMonitor)
diff --git a/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/messages.properties b/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/messages.properties
index 75f6c7491..30aa0af29 100644
--- a/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/messages.properties
+++ b/org.eclipse.tips.core/src/org/eclipse/tips/core/internal/messages.properties
@@ -1,5 +1,5 @@
FinalTip_2=No more tips
FinalTip_3=There are no more tips
-FinalTip_4=This provider has no more new tips. You can toggle the <b>Unread</b> checkbox below or select another provider.
+FinalTip_4=This provider has no more new tips. You can toggle the <b>Unread</b> checkbox below or select another provider by clicking another of the big icons at the bottom of this dialog.
TipManager_0=Registering provider ID {0} with description {1}.
TipManager_2=This TipManager is disposed.
diff --git a/org.eclipse.tips.examples/src/org/eclipse/tips/examples/swttip/SwtTipsProvider.java b/org.eclipse.tips.examples/src/org/eclipse/tips/examples/swttip/SwtTipsProvider.java
index 3c7280dd8..a8eaf8230 100644
--- a/org.eclipse.tips.examples/src/org/eclipse/tips/examples/swttip/SwtTipsProvider.java
+++ b/org.eclipse.tips.examples/src/org/eclipse/tips/examples/swttip/SwtTipsProvider.java
@@ -47,7 +47,7 @@ public class SwtTipsProvider extends TipProvider {
public synchronized List<Tip> getTips() {
List<Tip> tips = super.getTips();
if (tips.size() <= 1) {
- Job job = new Job(getDescription() + " is getting more tips.") {
+ Job job = new Job("Load tips for " + getDescription()) {
@Override
protected IStatus run(IProgressMonitor pMonitor) {
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/IDETipManager.java b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/IDETipManager.java
index 8e10c2567..0742c1191 100644
--- a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/IDETipManager.java
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/IDETipManager.java
@@ -81,7 +81,7 @@ public class IDETipManager extends DefaultTipManager {
}
private void load(TipProvider provider) {
- Job job = new Job(Messages.IDETipManager_1 + provider.getID()) {
+ Job job = new Job(MessageFormat.format(Messages.IDETipManager_1, provider.getID())) {
@Override
protected IStatus run(IProgressMonitor monitor) {
return provider.loadNewTips(monitor);
@@ -141,6 +141,7 @@ public class IDETipManager extends DefaultTipManager {
return Status.OK_STATUS;
}
};
+ job.setSystem(true);
job.schedule();
}
diff --git a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/messages.properties b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/messages.properties
index d20960b65..e313208aa 100644
--- a/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/messages.properties
+++ b/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/messages.properties
@@ -1,10 +1,10 @@
IDETipManager_0=Registering provider
-IDETipManager_1=Loading
+IDETipManager_1=Loading {0}
IDETipManager_18=Could not read or write the state location {0}
IDETipManager_2=Load new tips job started for {0}
-IDETipManager_3=Tips save read state..
-IDETipManager_4=Saving read tips..
-IDETipManager_5=Tips status bar refresh..
+IDETipManager_3=Save tips state
+IDETipManager_4=Saving read tips...
+IDETipManager_5=Tips status bar refresh
IDETipManager_6=New tips {0}
IDETipManager_8=Evaluating expression {0}
IDETipManager_9=Evaluating expression done. Priority: {0}
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
index 6fe4a4555..56463052e 100644
--- 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
@@ -36,7 +36,7 @@ public class Tip2_StartingTips extends Tip implements IHtmlTip {
@Override
public String getHTML() {
- return "<h2>Opening the Tips Dialog</h2>The tips are started automatically at startup if there are tips available."
+ return "<h2>Opening the Tips Dialog</h2>The tips are shown 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>";
}
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
index 8566a98cf..c36d3117a 100644
--- 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
@@ -38,7 +38,7 @@ public class Tip3_StartingTips extends Tip implements IHtmlTip {
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>";
+ + "<br><br>" + "Press <b><i>Next Tip</i></b> to see how to navigate tips.<br><br>";
}
private TipImage fImage;
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
index 139d98758..4d7577770 100644
--- 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
@@ -75,7 +75,7 @@ public class Tip7_Extend extends Tip implements IHtmlTip {
@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."
+ return "<h2>Extending Tips</h2>You can extend this framework and add your own tip provider for your project. Press the action button to open the Eclipse Wiki for more information."
+ "<br><br>";
}
diff --git a/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/TipComposite.java b/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/TipComposite.java
index be908321e..b8e5d982b 100644
--- a/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/TipComposite.java
+++ b/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/TipComposite.java
@@ -12,6 +12,7 @@ package org.eclipse.tips.ui.internal;
import java.io.IOException;
import java.net.URL;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -301,7 +302,7 @@ public class TipComposite extends Composite implements ProviderSelectionListener
}
private void runTipAction(TipAction tipAction) {
- Job job = new Job(Messages.TipComposite_10 + tipAction.getTooltip()) {
+ Job job = new Job(MessageFormat.format(Messages.TipComposite_10, tipAction.getTooltip())) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
diff --git a/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/messages.properties b/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/messages.properties
index a646ead63..c0ef9449a 100644
--- a/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/messages.properties
+++ b/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/messages.properties
@@ -1,7 +1,7 @@
DefaultTipManager_0=Tip of the Day already open.
Slider_13=not advanced graphics system
TipComposite_0=Loading next Tip...
-TipComposite_10=Running
+TipComposite_10=Running {0}
TipComposite_11=Tip read timer
TipComposite_12=Unknown Tip implementation:
TipComposite_2=Unread only

Back to the top