|
From: <caw...@us...> - 2007-07-31 23:42:53
|
Revision: 2908
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2908&view=rev
Author: cawilliams
Date: 2007-07-31 16:42:51 -0700 (Tue, 31 Jul 2007)
Log Message:
-----------
when user forces refresh of view, clear cache before reloading (so we don't just load up the exact same cached contents).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-07-31 23:37:00 UTC (rev 2907)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-07-31 23:42:51 UTC (rev 2908)
@@ -158,6 +158,7 @@
private void contributeToActionBars() {
IAction refreshAction = new Action() {
public void run() {
+ clearCache();
updatePage();
}
};
@@ -169,7 +170,14 @@
manager.add(refreshAction);
}
- private void updatePage() {
+ protected void clearCache() {
+ File index = getCachedIndex();
+ if (index != null) {
+ index.delete();
+ }
+ }
+
+ private void updatePage() {
initSearchList();
Display.getDefault().asyncExec(new Runnable () {
public void run () {
@@ -416,27 +424,24 @@
protected void handleOutput(final String content) {
if (content == null)
return;
-// try {
- buffer = new StringBuffer();
- buffer.append(content.replace("\n", "<br/>"));
- buffer.insert(0, HEADER); // Put the header before all the contents
- buffer.append(TAIL); // Put the body and html close tags at end
- final String text = buffer.toString();
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- searchResult.setText(text);
- }
- });
-// } catch (IOException ioe) {
-// ioe.printStackTrace();
-// }
+ buffer = new StringBuffer();
+ buffer.append(content.replace("\n", "<br/>"));
+ buffer.insert(0, HEADER); // Put the header before all the contents
+ buffer.append(TAIL); // Put the body and html close tags at end
+ final String text = buffer.toString();
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ searchResult.setText(text);
+ }
+ });
}
}
/**
- * When teh rdoc has changed, automatically update/regenerate the view
+ * When the rdoc has changed, automatically update/regenerate the view
*/
public void rdocChanged() {
+ clearCache();
updatePage();
}
@@ -517,6 +522,7 @@
}
public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
+ clearCache();
updatePage();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|