Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1951 - in development/laboratory/ide/eclipse/TransitPlugin: . resources src/net/dpml/ide/eclipse/plugins/magic

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: pneubauer AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1951 - in development/laboratory/ide/eclipse/TransitPlugin: . resources src/net/dpml/ide/eclipse/plugins/magic
  • Date: Fri, 04 Mar 2005 16:57:12 +0100

Author: pneubauer
Date: Fri Mar 4 16:57:09 2005
New Revision: 1951

Added:
development/laboratory/ide/eclipse/TransitPlugin/resources/
development/laboratory/ide/eclipse/TransitPlugin/resources/globe.GIF
(contents, props changed)
development/laboratory/ide/eclipse/TransitPlugin/resources/globe.png
(contents, props changed)

development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/IndexActionDelegate.java
(contents, props changed)

development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicNatrue.java
(contents, props changed)
Modified:
development/laboratory/ide/eclipse/TransitPlugin/.classpath
development/laboratory/ide/eclipse/TransitPlugin/build.properties
development/laboratory/ide/eclipse/TransitPlugin/plugin.xml

development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
Log:
trying to start chooseing the index from within the project

Modified: development/laboratory/ide/eclipse/TransitPlugin/.classpath
==============================================================================
--- development/laboratory/ide/eclipse/TransitPlugin/.classpath (original)
+++ development/laboratory/ide/eclipse/TransitPlugin/.classpath Fri Mar 4
16:57:09 2005
@@ -1,12 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry exported="true" kind="lib"
path="lib/dpml-ide-common-magic-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/dpml-magic-core-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/dpml-transit-main.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/dpml-transit-tools.jar"/>
- <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="src" path="/org.eclipse.jdt.ui"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib"
path="lib/dpml-ide-common-magic-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/dpml-magic-core-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/dpml-transit-main.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/dpml-transit-tools.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>

Modified: development/laboratory/ide/eclipse/TransitPlugin/build.properties
==============================================================================
--- development/laboratory/ide/eclipse/TransitPlugin/build.properties
(original)
+++ development/laboratory/ide/eclipse/TransitPlugin/build.properties Fri
Mar 4 16:57:09 2005
@@ -2,6 +2,7 @@
output.TransitPlugin.jar = bin/
bin.includes = plugin.xml,\
TransitPlugin.jar,\
+ resources/,\
lib/dpml-ide-common-magic-SNAPSHOT.jar,\
lib/dpml-transit-main.jar,\
lib/dpml-transit-tools.jar,\

Modified: development/laboratory/ide/eclipse/TransitPlugin/plugin.xml
==============================================================================
--- development/laboratory/ide/eclipse/TransitPlugin/plugin.xml (original)
+++ development/laboratory/ide/eclipse/TransitPlugin/plugin.xml Fri Mar 4
16:57:09 2005
@@ -34,6 +34,7 @@
<import plugin="org.eclipse.jdt.core"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.debug.core"/>
+ <import plugin="org.eclipse.ui.ide"/>
</requires>
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
@@ -42,4 +43,37 @@

class="net.dpml.ide.eclipse.plugins.magic.MagicClasspathInitializer"
/>
</extension>
+ <extension
+ point="org.eclipse.core.resources.natures"
+ id="MagicNature"
+ name="Magic Nature">
+ <runtime>
+ <run class="net.dpml.ide.eclipse.plugins.magic.MagicNature">
+ </run>
+ </runtime>
+ </extension>
+ <extension
+ point = "org.eclipse.ui.newWizards">
+ <category
+ id = "net.dpml.ide.eclipse.plugins.magic.new"
+ parentCategory="Java"
+ name="Magic">
+ </category>
+</extension>
+
+<extension point = "org.eclipse.ui.popupMenus">
+ <objectContribution
+ id="net.dpml.ide.eclipse.plugins.magic.indextool"
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="index.xml">
+ <action
id="net.dpml.ide.eclipse.plugins.magic.indextool.setproject"
+ label="Reload magic index"
+ icon="resources/globe.png"
+ menubarPath="additions"
+
helpContextId="net.dpml.ide.eclipse.plugins.magic.indextool.setproject_action_context"
+ class="net.dpml.ide.eclipse.plugins.magic.IndexActionDelegate"

+ enablesFor="1">
+ </action>
+ </objectContribution>
+ </extension>
</plugin>

Added: development/laboratory/ide/eclipse/TransitPlugin/resources/globe.GIF
==============================================================================
Binary file. No diff available.

Added: development/laboratory/ide/eclipse/TransitPlugin/resources/globe.png
==============================================================================
Binary file. No diff available.

Added:
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/IndexActionDelegate.java
==============================================================================
--- (empty file)
+++
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/IndexActionDelegate.java
Fri Mar 4 16:57:09 2005
@@ -0,0 +1,131 @@
+/*
+ * Created on 2005-mar-04
+ *
+ */
+package net.dpml.ide.eclipse.plugins.magic;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TreeMap;
+
+import net.dpml.ide.common.magic.IdeIndex;
+import net.dpml.ide.common.magic.IdeProjectDefinition;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.actions.SelectionListenerAction;
+import org.eclipse.ui.part.ShowInContext;
+
+
+public class IndexActionDelegate extends ShowInContext implements
IObjectActionDelegate
+{
+
+ public IndexActionDelegate( Object input, ISelection iSelection )
+ {
+ super( input, iSelection );
+ log = MagicPlugin.getDefault().getLog();
+ }
+
+ private ILog log;
+ private IResource mIndexFile;
+ private IdeIndex index;
+
+ public void setActivePart( IAction iAction, IWorkbenchPart iTargetPart )
+ {
+
+ }
+
+ public void run( IAction iAction )
+ {
+
+// List resources = getSelectedResources();
+// if (resources.size()>0)
+// {
+// mIndexFile = (IResource)resources.get(0);
+// }
+// getIndex();
+ //setProjetSources();
+ }
+
+ private void getIndex()
+ {
+ try
+ {
+ String location = mIndexFile.getLocation().toOSString();
+ File absoluteIndexFile = new File( location );
+ index = new IdeIndex();
+ index.loadIndex( absoluteIndexFile );
+ }
+ catch( NullPointerException npe )
+ {
+ log.log(new Status(Status.WARNING, "net.dpml.MagicPlugin", 0,
"Could not initialize MagicContainer ", npe));
+ }
+
+ }
+
+ public void selectionChanged( IAction iAction, ISelection iSelection )
+ {
+ // TODO Auto-generated method stub
+
+ }
+ /**private void setProjetSources()
+ {
+ TreeMap collectedSources = new TreeMap();
+ IdeProjectDefinition[] projects = index.getProjectDefinitions();
+ for ( int i = 0; i < projects.length; i++ ) {
+ IdeProjectDefinition project = projects[i];
+ System.out.println( "Checking project " + project.getName());
+ collectSources(project, collectedSources);
+ }
+
+ List sourceEntries = new ArrayList();
+
+ Iterator collSources = collectedSources.values().iterator();
+ while (collSources.hasNext())
+ {
+ IClasspathEntry srcDir = (IClasspathEntry) collSources.next();
+ sourceEntries.add(srcDir);
+ }
+ //add the magic container
+ IClasspathEntry magicContainer = JavaCore.newContainerEntry( path );
+ sourceEntries.add(magicContainer);
+ IClasspathEntry[]
sourcePath=(IClasspathEntry[])sourceEntries.toArray(new
IClasspathEntry[sourceEntries.size()]);
+ try
+ {
+ javaProject.setRawClasspath(sourcePath,
proj.getFullPath().append(new Path("bin")), null);
+ }
+ catch ( JavaModelException e )
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ }*/
+ /**private void collectSources( IdeProjectDefinition project, TreeMap
collectedSources )
+ {
+ IPath basePath = new Path(project.getBasePath());
+ IPath main = basePath.append("src/main");
+ IPath test = basePath.append("src/test");
+ IPath java = basePath.append("src/java");
+ if (proj.exists(main))
+ {
+ IPath source =
proj.getFullPath().append(proj.getFile(main).getProjectRelativePath());
+
collectedSources.put(main.toString(),JavaCore.newSourceEntry(source));
+ }
+ }*/
+
+}

Modified:
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
==============================================================================
---
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
(original)
+++
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
Fri Mar 4 16:57:09 2005
@@ -82,43 +82,11 @@
{
log.log(new Status(Status.WARNING, "net.dpml.MagicPlugin",
0, "Could not initialize MagicContainer ", npe));
}
- setProjetSources();
}



- private void setProjetSources()
- {
- TreeMap collectedSources = new TreeMap();
- IdeProjectDefinition[] projects = index.getProjectDefinitions();
- for ( int i = 0; i < projects.length; i++ ) {
- IdeProjectDefinition project = projects[i];
- System.out.println( "Checking project " + project.getName());
- collectSources(project, collectedSources);
- }
-
- List sourceEntries = new ArrayList();
-
- Iterator collSources = collectedSources.values().iterator();
- while (collSources.hasNext())
- {
- IClasspathEntry srcDir = (IClasspathEntry) collSources.next();
- sourceEntries.add(srcDir);
- }
- IClasspathEntry[]
sourcePath=(IClasspathEntry[])sourceEntries.toArray(new
IClasspathEntry[sourceEntries.size()]);
- try
- {
- javaProject.setRawClasspath(sourcePath,
proj.getFullPath().append(new Path("bin")), null);
- }
- catch ( JavaModelException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
- }
-
+


public IClasspathEntry[] getClasspathEntries()
@@ -173,27 +141,7 @@
return (IClasspathEntry[])entries.toArray(new
IClasspathEntry[entries.size()]);
}

- private void collectSources( IdeProjectDefinition project, TreeMap
collectedSources )
- {
- IPath basePath = new Path(project.getBasePath());
- IPath main = basePath.append("src/main");
- IPath test = basePath.append("src/test");
- IPath java = basePath.append("src/java");
- if (proj.exists(main))
- {
- IPath source =
proj.getFullPath().append(proj.getFile(main).getProjectRelativePath());
-
collectedSources.put(main.toString(),JavaCore.newSourceEntry(source));
- }
- /**
- if (proj.exists(test))
- {
-
collectedSources.put(test.toString(),JavaCore.newSourceEntry(proj.getFolder(test).getProjectRelativePath()));
- }
- if (proj.exists(java))
- {
-
collectedSources.put(java.toString(),JavaCore.newSourceEntry(proj.getFolder(java).getProjectRelativePath()));
- }*/
- }
+




Added:
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicNatrue.java
==============================================================================
--- (empty file)
+++
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicNatrue.java
Fri Mar 4 16:57:09 2005
@@ -0,0 +1,46 @@
+/*
+ * Created on 2005-mar-04
+ *
+ */
+package net.dpml.ide.eclipse.plugins.magic;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+
+
+public class MagicNatrue implements IProjectNature
+{
+
+ private IProject m_project;
+
+ public MagicNatrue()
+ {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public void configure() throws CoreException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void deconfigure() throws CoreException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public IProject getProject()
+ {
+ return m_project;
+ }
+
+ public void setProject( IProject iProject )
+ {
+ m_project = iProject;
+
+ }
+
+}



  • svn commit: r1951 - in development/laboratory/ide/eclipse/TransitPlugin: . resources src/net/dpml/ide/eclipse/plugins/magic, pneubauer, 03/04/2005

Archive powered by MHonArc 2.6.24.

Top of Page