Author: fmancinelli
Date: 2007-11-01 17:04:36 +0100 (Thu, 01 Nov 2007)
New Revision: 5596

Added:
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-page-conflict.png
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-page.png
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceAdapter.java
Removed:
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceDescriptorAdapter.java
Modified:
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-page-cached.png
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-space.png
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/XWikiEclipseConstants.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/AdapterFactory.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiPageAdapter.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/IXWikiPage.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/AbstractXWikiConnection.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/DiskCacheDAO.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/IXWikiCacheDAO.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiCachedConnection.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiPage.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiPlainConnection.java
   
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/views/XWikiExplorerView.java
Log:
XECLIPSE-30

* Added logic for testing the cached state of a page
* Added icons to the UI for reflecting the page state

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-page-cached.png
===================================================================
(Binary files differ)

Added: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-page-conflict.png
===================================================================
(Binary files differ)


Property changes on: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-page-conflict.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-page.png
===================================================================
(Binary files differ)


Property changes on: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-page.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/icons/xwiki-space.png
===================================================================
(Binary files differ)

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/XWikiEclipseConstants.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/XWikiEclipseConstants.java
  2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/XWikiEclipseConstants.java
  2007-11-01 16:04:36 UTC (rev 5596)
@@ -10,5 +10,8 @@
     
     public static final String CONNECTION_SETTINGS_BANNER = 
"icons/connection-settings-banner.png";
     public static final String XWIKI_ICON = "icons/xwiki.png";
-      
+    public static final String XWIKI_SPACE_ICON = "icons/xwiki-space.png";
+    public static final String XWIKI_PAGE_ICON = "icons/xwiki-page.png";
+    public static final String XWIKI_PAGE_CACHED_ICON = 
"icons/xwiki-page-cached.png";
+    public static final String XWIKI_PAGE_CONFLICT_ICON = 
"icons/xwiki-page-conflict.png";  
 }

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/AdapterFactory.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/AdapterFactory.java
        2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/AdapterFactory.java
        2007-11-01 16:04:36 UTC (rev 5596)
@@ -42,7 +42,7 @@
      * The adapter for XWiki spaces.
      */
     private IDeferredWorkbenchAdapter xwikiSpaceAdapter =
-        new XWikiSpaceDescriptorAdapter();
+        new XWikiSpaceAdapter();
 
     /**
      * The adapter for XWiki pages.

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiPageAdapter.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiPageAdapter.java
      2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiPageAdapter.java
      2007-11-01 16:04:36 UTC (rev 5596)
@@ -22,6 +22,8 @@
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.xwiki.plugins.eclipse.XWikiEclipsePlugin;
+import org.xwiki.xeclipse.XWikiEclipseConstants;
 import org.xwiki.xeclipse.model.IXWikiPage;
 
 /**
@@ -47,6 +49,16 @@
      */
     public ImageDescriptor getImageDescriptor(Object object)
     {
+        if (object instanceof IXWikiPage) {
+            IXWikiPage page = (IXWikiPage) object;
+            
+            if(page.isCached()) {
+                return 
XWikiEclipsePlugin.getImageDescriptor(XWikiEclipseConstants.XWIKI_PAGE_CACHED_ICON);
+            }
+            
+            return 
XWikiEclipsePlugin.getImageDescriptor(XWikiEclipseConstants.XWIKI_PAGE_ICON);
+        }
+        
         return null;
     }
 

Copied: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceAdapter.java
 (from rev 5547, 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceDescriptorAdapter.java)
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceAdapter.java
                             (rev 0)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceAdapter.java
     2007-11-01 16:04:36 UTC (rev 5596)
@@ -0,0 +1,132 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
+package org.xwiki.xeclipse.adapters;
+
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
+import org.eclipse.ui.progress.IElementCollector;
+import org.xwiki.plugins.eclipse.XWikiEclipsePlugin;
+import org.xwiki.xeclipse.XWikiEclipseConstants;
+import org.xwiki.xeclipse.model.IXWikiPage;
+import org.xwiki.xeclipse.model.IXWikiSpace;
+import org.xwiki.xeclipse.model.XWikiConnectionException;
+
+/**
+ * The adapter for XWiki spaces
+ */
+public class XWikiSpaceAdapter implements IDeferredWorkbenchAdapter
+{
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(Object)
+     */
+    public Object[] getChildren(Object o)
+    {
+        if(o instanceof IXWikiSpace) {
+            IXWikiSpace space = (IXWikiSpace) o;
+            Collection<IXWikiPage> result = null;
+            
+            try {
+                result = space.getPages();
+            } catch (XWikiConnectionException e) {
+                e.printStackTrace();
+            } 
+            
+            return result != null ? result.toArray() : 
XWikiEclipseConstants.NO_OBJECTS;           
+        }
+        
+        return XWikiEclipseConstants.NO_OBJECTS;
+    }
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(Object)
+     */
+    public ImageDescriptor getImageDescriptor(Object object)
+    {
+        return 
XWikiEclipsePlugin.getImageDescriptor(XWikiEclipseConstants.XWIKI_SPACE_ICON);
+    }
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(Object)
+     */
+    public String getLabel(Object object)
+    {
+        if (object instanceof IXWikiSpace) {
+            IXWikiSpace space = (IXWikiSpace) object;
+
+            return space.getName();
+        }
+
+        return null;
+    }
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(Object)
+     */
+    public Object getParent(Object o)
+    {
+        return null;
+    }
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see 
org.eclipse.ui.progress.IDeferredWorkbenchAdapter#fetchDeferredChildren(Object,
+     *      IElementCollector, IProgressMonitor)
+     */
+    public void fetchDeferredChildren(Object object, IElementCollector 
collector,
+        IProgressMonitor monitor)
+    {
+        collector.add(getChildren(object), monitor);
+        collector.done();
+    }
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(Object)
+     */
+    public ISchedulingRule getRule(Object object)
+    {
+        return null;
+    }
+
+    /**
+     * [EMAIL PROTECTED] Always returns true because an XWiki space is 
supposed to contain pages.
+     * 
+     * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
+     */
+    public boolean isContainer()
+    {
+        return true;
+    }
+}

Deleted: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceDescriptorAdapter.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceDescriptorAdapter.java
   2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/adapters/XWikiSpaceDescriptorAdapter.java
   2007-11-01 16:04:36 UTC (rev 5596)
@@ -1,131 +0,0 @@
-/*
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- */
-package org.xwiki.xeclipse.adapters;
-
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
-import org.eclipse.ui.progress.IElementCollector;
-import org.xwiki.xeclipse.XWikiEclipseConstants;
-import org.xwiki.xeclipse.model.IXWikiPage;
-import org.xwiki.xeclipse.model.IXWikiSpace;
-import org.xwiki.xeclipse.model.XWikiConnectionException;
-
-/**
- * The adapter for XWiki spaces
- */
-public class XWikiSpaceDescriptorAdapter implements IDeferredWorkbenchAdapter
-{
-    /**
-     * [EMAIL PROTECTED]
-     * 
-     * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(Object)
-     */
-    public Object[] getChildren(Object o)
-    {
-        if(o instanceof IXWikiSpace) {
-            IXWikiSpace space = (IXWikiSpace) o;
-            Collection<IXWikiPage> result = null;
-            
-            try {
-                result = space.getPages();
-            } catch (XWikiConnectionException e) {
-                e.printStackTrace();
-            } 
-            
-            return result != null ? result.toArray() : 
XWikiEclipseConstants.NO_OBJECTS;           
-        }
-        
-        return XWikiEclipseConstants.NO_OBJECTS;
-    }
-
-    /**
-     * [EMAIL PROTECTED]
-     * 
-     * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(Object)
-     */
-    public ImageDescriptor getImageDescriptor(Object object)
-    {
-        return null;
-    }
-
-    /**
-     * [EMAIL PROTECTED]
-     * 
-     * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(Object)
-     */
-    public String getLabel(Object object)
-    {
-        if (object instanceof IXWikiSpace) {
-            IXWikiSpace space = (IXWikiSpace) object;
-
-            return space.getName();
-        }
-
-        return null;
-    }
-
-    /**
-     * [EMAIL PROTECTED]
-     * 
-     * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(Object)
-     */
-    public Object getParent(Object o)
-    {
-        return null;
-    }
-
-    /**
-     * [EMAIL PROTECTED]
-     * 
-     * @see 
org.eclipse.ui.progress.IDeferredWorkbenchAdapter#fetchDeferredChildren(Object,
-     *      IElementCollector, IProgressMonitor)
-     */
-    public void fetchDeferredChildren(Object object, IElementCollector 
collector,
-        IProgressMonitor monitor)
-    {
-        collector.add(getChildren(object), monitor);
-        collector.done();
-    }
-
-    /**
-     * [EMAIL PROTECTED]
-     * 
-     * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(Object)
-     */
-    public ISchedulingRule getRule(Object object)
-    {
-        return null;
-    }
-
-    /**
-     * [EMAIL PROTECTED] Always returns true because an XWiki space is 
supposed to contain pages.
-     * 
-     * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
-     */
-    public boolean isContainer()
-    {
-        return true;
-    }
-}

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/IXWikiPage.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/IXWikiPage.java
       2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/IXWikiPage.java
       2007-11-01 16:04:36 UTC (rev 5596)
@@ -55,6 +55,11 @@
     public boolean isConflict();
     
     /**
+     * @return true if the page is locally cached.
+     */
+    public boolean isCached();
+    
+    /**
      * Save the page content.
      * 
      * @throws XWikiConnectionException

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/AbstractXWikiConnection.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/AbstractXWikiConnection.java
     2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/AbstractXWikiConnection.java
     2007-11-01 16:04:36 UTC (rev 5596)
@@ -87,6 +87,8 @@
     abstract boolean isPageDirty(String pageId);
 
     abstract boolean isPageConflict(String pageId);
+    
+    abstract boolean isPageCached(String pageId);
 
     abstract Page getRawPage(String pageId) throws XWikiConnectionException;
 
@@ -120,5 +122,5 @@
             final IXWikiConnectionListener listener = 
(IXWikiConnectionListener) listeners[i];
             listener.connectionClosed(this);
         }
-    }    
+    }       
 }

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/DiskCacheDAO.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/DiskCacheDAO.java
        2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/DiskCacheDAO.java
        2007-11-01 16:04:36 UTC (rev 5596)
@@ -366,4 +366,9 @@
     {
         return indexAggregate.getDirtyPagesIndex();
     }
+
+    public boolean isCached(String pageId)
+    {
+        return indexAggregate.getPageToDataFileNameIndex().get(pageId) != null 
? true : false;
+    }
 }

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/IXWikiCacheDAO.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/IXWikiCacheDAO.java
      2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/IXWikiCacheDAO.java
      2007-11-01 16:04:36 UTC (rev 5596)
@@ -12,4 +12,5 @@
     public boolean isInConflict(String pageId);
     public void setConflict(String pageId, boolean conflict);
     public void storeSpaceSummary(SpaceSummary spaceSummary) throws 
XWikiDAOException;
+    public boolean isCached(String pageId);
 }

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiCachedConnection.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiCachedConnection.java
       2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiCachedConnection.java
       2007-11-01 16:04:36 UTC (rev 5596)
@@ -464,4 +464,10 @@
         return cacheDAO;
     }
 
+    @Override
+    boolean isPageCached(String pageId)
+    {
+        return cacheDAO.isCached(pageId);        
+    }
+
 }

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiPage.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiPage.java
   2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiPage.java
   2007-11-01 16:04:36 UTC (rev 5596)
@@ -202,5 +202,9 @@
     public IXWikiConnection getConnection() {
         return connection;
     }
+    
+    public boolean isCached() {
+        return connection.isPageCached(page.getId());
+    }
 
 }

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiPlainConnection.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiPlainConnection.java
        2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/model/impl/XWikiPlainConnection.java
        2007-11-01 16:04:36 UTC (rev 5596)
@@ -257,4 +257,10 @@
     {
         return remoteDAO;
     }
+
+    @Override
+    boolean isPageCached(String pageId)
+    {      
+        return false;
+    }
 }

Modified: 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/views/XWikiExplorerView.java
===================================================================
--- 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/views/XWikiExplorerView.java
        2007-11-01 13:29:17 UTC (rev 5595)
+++ 
xwiki-extensions/xwiki-eclipse/trunk/plugins/org.xwiki.eclipse/src/main/java/org/xwiki/xeclipse/views/XWikiExplorerView.java
        2007-11-01 16:04:36 UTC (rev 5596)
@@ -85,6 +85,9 @@
                     XWikiPageEditorInput editorInput = new 
XWikiPageEditorInput(xwikiPage);
                     try {
                         page.openEditor(editorInput, XWikiPageEditor.ID);
+                        
+                        /* This updates the icon in order to reflect its new 
state after that it has been opened in the editor, i.e., cached, conflict, etc. 
*/
+                        treeViewer.refresh(xwikiPage);
                     } catch (PartInitException e) {                     
                         e.printStackTrace();
                     }

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to