forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r226833 - in /forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse: actions/Utilities.java views/LocationmapView.java views/NavigationView.java
Date Mon, 01 Aug 2005 16:07:59 GMT
Author: rgardler
Date: Mon Aug  1 09:07:48 2005
New Revision: 226833

URL: http://svn.apache.org/viewcvs?rev=226833&view=rev
Log:
Locationmap view extends NavigationView.java (partial fix for FOR-587)

Modified:
    forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/actions/Utilities.java
    forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/LocationmapView.java
    forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/NavigationView.java

Modified: forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/actions/Utilities.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/actions/Utilities.java?rev=226833&r1=226832&r2=226833&view=diff
==============================================================================
--- forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/actions/Utilities.java
(original)
+++ forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/actions/Utilities.java
Mon Aug  1 09:07:48 2005
@@ -54,9 +54,7 @@
             logger.debug("getPathToXDocs() - start");
         }
 
-        // FIXME: get this value from the package config file (forrest.properties)
-        String path = "src" + java.io.File.separator + "documentation"
-                + java.io.File.separator + "content" + java.io.File.separator
+        String path = getPathToContent() + java.io.File.separator
                 + "xdocs";
 
         if (logger.isDebugEnabled()) {

Modified: forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/LocationmapView.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/LocationmapView.java?rev=226833&r1=226832&r2=226833&view=diff
==============================================================================
--- forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/LocationmapView.java
(original)
+++ forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/LocationmapView.java
Mon Aug  1 09:07:48 2005
@@ -23,15 +23,12 @@
 import org.apache.forrest.eclipse.actions.Utilities;
 import org.apache.forrest.eclipse.wizards.NewLocationElement;
 import org.apache.forrest.eclipse.wizards.NewMatchElement;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -46,11 +43,8 @@
 import org.eclipse.ui.ISelectionListener;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
 import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -60,15 +54,8 @@
  * drop from the navigator and supports a number of context 
  * menus for editing. 
  */
-public class LocationmapView extends ViewPart implements IMenuListener,
+public class LocationmapView extends NavigationView implements IMenuListener,
         ISelectionListener {
-    protected TreeViewer treeViewer;
-    protected Document document;
-    protected String projectName;
-    protected String path;
-    protected String contentPath;
-    protected IStructuredSelection treeSelection;
-    protected IProject activeProject;
 	private Action AddMatch;
 	private Action AddLocation;
 	private Action RemoveElement;
@@ -265,31 +252,7 @@
      * @return the name (without pat) of the document to view
      */
     protected String getFilename() {
-        return "locationmap.xml";
-    }
-    /**
-     * When the selection in the navigator view is changed 
-     * we look to see if the new selection is an IProject.
-     * If it is then we load the locationmap.xml file into this
-     * LocationmapView.
-     */
-    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-        if (selection instanceof IStructuredSelection) {
-            Object first = ((IStructuredSelection) selection).getFirstElement();
-            IResource resource = (IResource) first;
-            if (resource instanceof IProject) {
-                activeProject = (IProject) resource;
-                projectName = activeProject.getProject().getName();
-                contentPath = (activeProject.getProject().getLocation()
-                        .toString()
-                        + java.io.File.separator
-                        + Utilities.getPathToContent()
-                        + java.io.File.separator) ;
-                path = contentPath + getFilename();
-                document = DOMUtilities.loadDOM(path);
-                treeViewer.setInput(document);
-            }
-        }
+        return Utilities.getPathToContent() + java.io.File.separator + "locationmap.xml";
     }
 	
 }

Modified: forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/NavigationView.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/NavigationView.java?rev=226833&r1=226832&r2=226833&view=diff
==============================================================================
--- forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/NavigationView.java
(original)
+++ forrest/trunk/tools/eclipse/plugins/org.apache.forrest/src/org/apache/forrest/eclipse/views/NavigationView.java
Mon Aug  1 09:07:48 2005
@@ -104,9 +104,11 @@
     }
 
     /**
-     * Get the anme and path of the file this editor view represents.
-     * This name does not include the path. For example.
-     * 'site.xml' or 'tabs.xml'
+     * Get the name and path of the file this editor view represents.
+     * This name does not include the full path, it is the path
+     * relative to the project root. For example.
+     * 'src/documentation/content/xdocs/site.xml'
+     * 
      * @return the name (without pat) of the document to view
      */
     protected abstract String getFilename();



Mime
View raw message