Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2060 - in development/laboratory/ide/eclipse/magic/plugin: . src/net/dpml/ide/eclipse/plugins/magic

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: peter AT neubauer.se
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2060 - in development/laboratory/ide/eclipse/magic/plugin: . src/net/dpml/ide/eclipse/plugins/magic
  • Date: Sun, 13 Mar 2005 20:58:47 -0500

Author: peter AT neubauer.se
Date: Sun Mar 13 20:58:47 2005
New Revision: 2060

Modified:
development/laboratory/ide/eclipse/magic/plugin/.project

development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/ArtifactURLHandler.java

development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/IndexActionDelegate.java

development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicClasspathInitializer.java

development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java

development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicPlugin.java
Log:
starting formatting and commenting DPML style


Modified: development/laboratory/ide/eclipse/magic/plugin/.project
==============================================================================
--- development/laboratory/ide/eclipse/magic/plugin/.project (original)
+++ development/laboratory/ide/eclipse/magic/plugin/.project Sun Mar 13
20:58:47 2005
@@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
+
<name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -24,5 +29,6 @@
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+
<nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
</natures>
</projectDescription>

Modified:
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/ArtifactURLHandler.java
==============================================================================
---
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/ArtifactURLHandler.java
(original)
+++
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/ArtifactURLHandler.java
Sun Mar 13 20:58:47 2005
@@ -26,36 +26,50 @@
/**
* URL handler for the "artifact" protocol
*/
-public class ArtifactURLHandler extends AbstractURLStreamHandlerService {
+public class ArtifactURLHandler extends AbstractURLStreamHandlerService
+{

- private static Hashtable connectionType = new Hashtable();
+ private static Hashtable connectionType = new Hashtable();
+
+ // URL protocol designations
+ public static final String PROTOCOL = "artifact";
//$NON-NLS-1$
+
+ public static final String FILE = "file";
//$NON-NLS-1$
+
+ public static final String JAR = "jar";
//$NON-NLS-1$
+
+ public static final String BUNDLE = "bundle";
//$NON-NLS-1$
+
+ public static final String JAR_SEPARATOR = "!/";
//$NON-NLS-1$
+
+ public static final String PROTOCOL_SEPARATOR = ":";
//$NON-NLS-1$
+
+ private Handler transitHandler;
+
+ public ArtifactURLHandler() throws TransitException
+ {
+ super();
+ transitHandler = new Handler();
+ }
+
+ public URLConnection openConnection( URL url ) throws IOException
+ {
+ URLConnection connection = null;

- // URL protocol designations
- public static final String PROTOCOL = "artifact"; //$NON-NLS-1$
- public static final String FILE = "file"; //$NON-NLS-1$
- public static final String JAR = "jar"; //$NON-NLS-1$
- public static final String BUNDLE = "bundle"; //$NON-NLS-1$
- public static final String JAR_SEPARATOR = "!/"; //$NON-NLS-1$
- public static final String PROTOCOL_SEPARATOR = ":"; //$NON-NLS-1$
-
- private Handler transitHandler;
- public ArtifactURLHandler() throws TransitException {
- super();
- transitHandler = new Handler() ;
- }
-
- public URLConnection openConnection(URL url) throws IOException {
- URLConnection connection = null;
-
return null;
- }
+ }

- public static void register(String type, Class connectionClass) {
- try {
- Constructor c = connectionClass.getConstructor(new
Class[] {URL.class});
- connectionType.put(type, c);
- } catch (NoSuchMethodException e) {
- //don't register connection classes that don't
conform to the spec
- }
+ public static void register( String type, Class connectionClass )
+ {
+ try
+ {
+ Constructor c = connectionClass
+ .getConstructor( new Class[] { URL.class } );
+ connectionType.put( type, c );
+ }
+ catch ( NoSuchMethodException e )
+ {
+ // don't register connection classes that don't conform to the
spec
+ }
}
}
\ No newline at end of file

Modified:
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/IndexActionDelegate.java
==============================================================================
---
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/IndexActionDelegate.java
(original)
+++
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/IndexActionDelegate.java
Sun Mar 13 20:58:47 2005
@@ -42,28 +42,31 @@
import org.eclipse.ui.actions.SelectionListenerAction;
import org.osgi.service.prefs.BackingStoreException;

-
-public class IndexActionDelegate extends SelectionListenerAction implements
IObjectActionDelegate
+public class IndexActionDelegate extends SelectionListenerAction implements
+ IObjectActionDelegate
{

-
protected IndexActionDelegate( String text )
{
super( text );
}

public IndexActionDelegate()
- {
- this("Index Action");
- }
- private ILog log = MagicPlugin.getDefault().getLog();;
+ {
+ this( "Index Action" );
+ }
+
+ private ILog log = MagicPlugin.getDefault().getLog(); ;
+
private IResource mIndexFile;
- private IdeIndex index;
- private IProject proj;
-
+
+ private IdeIndex index;
+
+ private IProject proj;
+
public void setActivePart( IAction iAction, IWorkbenchPart iTargetPart )
{
-
+
}

public void run( IAction iAction )
@@ -81,27 +84,31 @@
index = new IdeIndex();
index.loadIndex( absoluteIndexFile );
}
- catch( NullPointerException npe )
+ catch ( NullPointerException npe )
{
- log.log(new Status(Status.WARNING, "net.dpml.MagicPlugin", 0,
"Could not initialize MagicContainer ", npe));
+ log.log( new Status( Status.WARNING, "net.dpml.MagicPlugin", 0,
+ "Could not initialize MagicContainer ", npe ) );
}
-
+
}

public void selectionChanged( IAction iAction, ISelection iSelection )
{
- if (iSelection.isEmpty())
+ if ( iSelection.isEmpty() )
{
return;
}
- StructuredSelection selection = (StructuredSelection)iSelection;
- mIndexFile = (IFile)selection.getFirstElement();
+ StructuredSelection selection = (StructuredSelection) iSelection;
+ mIndexFile = (IFile) selection.getFirstElement();
proj = mIndexFile.getProject();

- IScopeContext projectScope = new ProjectScope(proj);
- IEclipsePreferences projectNode =
projectScope.getNode("net.dpml.magic");
- if (projectNode != null) {
- projectNode.put("index.path",
mIndexFile.getProjectRelativePath().toPortableString());
+ IScopeContext projectScope = new ProjectScope( proj );
+ IEclipsePreferences projectNode = projectScope
+ .getNode( "net.dpml.magic" );
+ if ( projectNode != null )
+ {
+ projectNode.put( "index.path",
mIndexFile.getProjectRelativePath()
+ .toPortableString() );
try
{
projectNode.flush();
@@ -113,45 +120,52 @@
}
}

-
}
+
/**
* The <code>DeleteResourceAction</code> implementation of this
- * <code>SelectionListenerAction</code> method disables the action
- * if the selection contains phantom resources or non-resources
+ * <code>SelectionListenerAction</code> method disables the action if the
+ * selection contains phantom resources or non-resources
*/
- protected boolean updateSelection(IStructuredSelection selection) {
- return super.updateSelection(selection);
+ protected boolean updateSelection( IStructuredSelection selection )
+ {
+ return super.updateSelection( selection );
}
+
private void setProjetSources()
{
TreeMap collectedSources = new TreeMap();
IdeProjectDefinition[] projects = index.getProjectDefinitions();
- for ( int i = 0; i < projects.length; i++ ) {
+ for ( int i = 0; i < projects.length; i++ )
+ {
IdeProjectDefinition project = projects[i];
- MagicPlugin.logInfo( "Checking project " + project.getName());
- collectSources(project, collectedSources);
+ MagicPlugin.logInfo( "Checking project " + project.getName() );
+ collectSources( project, collectedSources );
}

List sourceEntries = new ArrayList();

Iterator collSources = collectedSources.values().iterator();
- while (collSources.hasNext())
+ while ( collSources.hasNext() )
{
IClasspathEntry srcDir = (IClasspathEntry) collSources.next();
- sourceEntries.add(srcDir);
+ sourceEntries.add( srcDir );
}
- //add the magic container
- IClasspathEntry magicContainer = JavaCore.newContainerEntry( new
Path("net.dpml.MAGIC/deps") );
- sourceEntries.add(magicContainer);
- IClasspathEntry jreContainer = JavaCore.newContainerEntry( new
Path("org.eclipse.jdt.launching.JRE_CONTAINER") );
- sourceEntries.add(jreContainer);
- IClasspathEntry[]
sourcePath=(IClasspathEntry[])sourceEntries.toArray(new
IClasspathEntry[sourceEntries.size()]);
+ // add the magic container
+ IClasspathEntry magicContainer = JavaCore.newContainerEntry( new
Path(
+ "net.dpml.MAGIC/deps" ) );
+ sourceEntries.add( magicContainer );
+ IClasspathEntry jreContainer = JavaCore.newContainerEntry( new Path(
+ "org.eclipse.jdt.launching.JRE_CONTAINER" ) );
+ sourceEntries.add( jreContainer );
+ IClasspathEntry[] sourcePath = (IClasspathEntry[]) sourceEntries
+ .toArray( new IClasspathEntry[sourceEntries.size()] );
IJavaProject javaProject = null;
try
{
- IProjectNature nature =
proj.getNature("org.eclipse.jdt.core.javanature");
- javaProject = (JavaProject)nature;
+ IProjectNature nature = proj
+ .getNature( "org.eclipse.jdt.core.javanature" );
+ javaProject = (JavaProject) nature;
}
catch ( CoreException e1 )
{
@@ -160,7 +174,7 @@
}// = proj;
try
{
- javaProject.setRawClasspath(sourcePath, null);
+ javaProject.setRawClasspath( sourcePath, null );
}
catch ( JavaModelException e )
{
@@ -168,30 +182,36 @@
e.printStackTrace();
}
}
- private void collectSources( IdeProjectDefinition project, TreeMap
collectedSources )
+
+ private void collectSources( IdeProjectDefinition project,
+ TreeMap collectedSources )
{
- IPath projectPath = new Path(project.getFullBaseDir().toString());
+ IPath projectPath = new Path( project.getFullBaseDir().toString() );
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IResource fileForLocation =
root.getContainerForLocation(projectPath);
+ IResource fileForLocation = root.getContainerForLocation(
projectPath );
IPath absoluteProjectPath = fileForLocation.getFullPath();
- IPath main = absoluteProjectPath.append("src/main");
- IPath test = absoluteProjectPath.append("src/test");
- IPath java = absoluteProjectPath.append("src/java");
- if (proj.exists(main.removeFirstSegments(1)))
- {
- //IPath source =
proj.getFullPath().append(proj.getFile(main).getProjectRelativePath());
- IPath out = absoluteProjectPath.append("target/classes");
-
collectedSources.put(main.toString(),JavaCore.newSourceEntry(main,
ClasspathEntry.INCLUDE_ALL, out ));
- }
- if (proj.exists(test.removeFirstSegments(1)))
- {
- IPath out = absoluteProjectPath.append("target/test-classes");
-
collectedSources.put(test.toString(),JavaCore.newSourceEntry(test,
ClasspathEntry.INCLUDE_ALL, out ));
- }
- if (proj.exists(java.removeFirstSegments(1)))
- {
- IPath out = absoluteProjectPath.append("target/classes");
-
collectedSources.put(test.toString(),JavaCore.newSourceEntry(java,
ClasspathEntry.INCLUDE_ALL, out ));
+ IPath main = absoluteProjectPath.append( "src/main" );
+ IPath test = absoluteProjectPath.append( "src/test" );
+ IPath java = absoluteProjectPath.append( "src/java" );
+ if ( proj.exists( main.removeFirstSegments( 1 ) ) )
+ {
+ // IPath source =
+ //
proj.getFullPath().append(proj.getFile(main).getProjectRelativePath());
+ IPath out = absoluteProjectPath.append( "target/classes" );
+ collectedSources.put( main.toString(), JavaCore.newSourceEntry(
+ main, ClasspathEntry.INCLUDE_ALL, out ) );
+ }
+ if ( proj.exists( test.removeFirstSegments( 1 ) ) )
+ {
+ IPath out = absoluteProjectPath.append( "target/test-classes" );
+ collectedSources.put( test.toString(), JavaCore.newSourceEntry(
+ test, ClasspathEntry.INCLUDE_ALL, out ) );
+ }
+ if ( proj.exists( java.removeFirstSegments( 1 ) ) )
+ {
+ IPath out = absoluteProjectPath.append( "target/classes" );
+ collectedSources.put( test.toString(), JavaCore.newSourceEntry(
+ java, ClasspathEntry.INCLUDE_ALL, out ) );
}
}
}

Modified:
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicClasspathInitializer.java
==============================================================================
---
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicClasspathInitializer.java
(original)
+++
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicClasspathInitializer.java
Sun Mar 13 20:58:47 2005
@@ -36,10 +36,15 @@
throws CoreException
{
int size = containerPath.segmentCount();
- if (size > 1) {
- if (containerPath.segment(0).equals(MAGIC)) {
- MagicContainer container = new MagicContainer(project,
containerPath);
- JavaCore.setClasspathContainer(containerPath, new
IJavaProject[] {project}, new IClasspathContainer[] {container}, null);
+ if ( size > 1 )
+ {
+ if ( containerPath.segment( 0 ).equals( MAGIC ) )
+ {
+ MagicContainer container = new MagicContainer( project,
+ containerPath );
+ JavaCore.setClasspathContainer( containerPath,
+ new IJavaProject[] { project },
+ new IClasspathContainer[] { container }, null );
}
}


Modified:
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
==============================================================================
---
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
(original)
+++
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
Sun Mar 13 20:58:47 2005
@@ -38,7 +38,6 @@
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
@@ -46,35 +45,74 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.ClasspathEntry;
-import org.eclipse.ui.internal.Workbench;
-import org.osgi.service.prefs.BackingStoreException;

+/**
+ * Serves up the dependencies from the index dynamically by populating a
+ * container
+ */
public class MagicContainer implements IClasspathContainer
{
-
- private IPath path;
- private IdeIndex index = null;
- private ILog log;
- public final static String ID = "net.dpml.MAGIC";
- private IFile indexFile;
- private IJavaProject javaProject;
- private IProject proj;
-
+ /**
+ * the coinatiner path in case we need it
+ */
+ private IPath m_containerPath;
+
+ /**
+ * the processed index
+ */
+ private IdeIndex m_index = null;
+
+ /**
+ * Eclipse logger
+ */
+ private ILog m_log;
+
+ /**
+ * the identification id in the .classpath, the same as the plugin has
+ * registered for this handler
+ */
+ public static final String ID = "net.dpml.MAGIC";
+
+ /**
+ * the current index file
+ */
+ private IFile m_indexFile;
+
+ /**
+ * the current java project
+ */
+ private IJavaProject m_javaProject;
+
+ /**
+ * the eclipse resource project
+ */
+ private IProject m_reosurceProject;
+
+ /**
+ *
+ * @param project
+ * the eclipse project to work on
+ * @param containerPath
+ * the path of the container entry in .classpath for
validation
+ * purposes
+ */
public MagicContainer( IJavaProject project, IPath containerPath )
{
- this.javaProject = project;
- log = MagicPlugin.getDefault().getLog();
- log.log(new Status(Status.INFO, "net.dpml.MagicPlugin", 0,
"ContainerPath: " + containerPath, null));
- log.log(new Status(Status.INFO, "net.dpml.MagicPlugin", 0,
"Project: " + proj, null));
- this.path = containerPath;
- if (!containerPath.segment(0).equals(ID))
+ this.m_javaProject = project;
+ m_log = MagicPlugin.getDefault().getLog();
+ m_log.log( new Status( Status.INFO, "net.dpml.MagicPlugin", 0,
+ "ContainerPath: " + containerPath, null ) );
+ m_log.log( new Status( Status.INFO, "net.dpml.MagicPlugin", 0,
+ "Project: " + m_reosurceProject, null ) );
+ this.m_containerPath = containerPath;
+ if ( !containerPath.segment( 0 ).equals( ID ) )
{
return;
}
- proj =
ResourcesPlugin.getWorkspace().getRoot().getProject(project.getElementName());
- log.log(new Status(Status.INFO, "net.dpml.MagicPlugin", 0,
"Project: " + proj, null));
+ m_reosurceProject = ResourcesPlugin.getWorkspace().getRoot()
+ .getProject( project.getElementName() );
+ m_log.log( new Status( Status.INFO, "net.dpml.MagicPlugin", 0,
+ "Project: " + m_reosurceProject, null ) );
try
{
getIndexFile();
@@ -82,61 +120,70 @@
catch ( Exception e )
{
e.printStackTrace();
- log.log(new Status(Status.ERROR, "net.dpml.MagicPlugin", 0,
"Could not load index file form the project prefs. try reloading the magic
index again to get it set.", null));
+ m_log
+ .log( new Status(
+ Status.ERROR,
+ "net.dpml.MagicPlugin",
+ 0,
+ "Could not load index file form the project
prefs. try reloading the magic index again to get it set.",
+ null ) );
return;
-
+
}
try
{
- String location = indexFile.getLocation().toOSString();
+ String location = m_indexFile.getLocation().toOSString();
File absoluteIndexFile = new File( location );
- index = new IdeIndex();
- index.loadIndex( absoluteIndexFile );
+ m_index = new IdeIndex();
+ m_index.loadIndex( absoluteIndexFile );
}
- catch( NullPointerException npe )
+ catch ( NullPointerException npe )
{
- log.log(new Status(Status.WARNING, "net.dpml.MagicPlugin",
0, "Could not initialize MagicContainer ", npe));
+ m_log.log( new Status( Status.WARNING,
"net.dpml.MagicPlugin",
+ 0, "Could not initialize MagicContainer ", npe ) );
}
}

-
-
-
-
-
+ /**
+ *
+ * @throws Exception
+ * the indx file could not be found (missing project prefs
for
+ * example)
+ */
private void getIndexFile() throws Exception
{
- IScopeContext projectScope = new ProjectScope(proj);
- IEclipsePreferences projectNode =
projectScope.getNode("net.dpml.magic");
+ IScopeContext projectScope = new ProjectScope( m_reosurceProject );
+ IEclipsePreferences projectNode = projectScope
+ .getNode( "net.dpml.magic" );
String indexPath = null;
- if (projectNode != null) {
- indexPath = projectNode.get("index.path", null);
+ if ( projectNode != null )
+ {
+ indexPath = projectNode.get( "index.path", null );
}
else
{
- throw new Exception("could not find index file!");
+ throw new Exception( "could not find index file!" );
}
- if (indexPath!=null)
+ if ( indexPath != null )
{
- indexFile = proj.getFile(new Path(indexPath));
+ m_indexFile = m_reosurceProject.getFile( new Path( indexPath ) );
}
-
- }
-
-
-
-

+ }

+ /**
+ *
+ * @see org.eclipse.jdt.core.IClasspathContainer#getClasspathEntries()
+ */
public IClasspathEntry[] getClasspathEntries()
{
- if(index==null)
+ if ( m_index == null )
{
return null;
}
try
{
- index.flattenProjectDependencies();
+ m_index.flattenProjectDependencies();
}
catch ( UnresolvedDependencyException e )
{
@@ -145,8 +192,9 @@
}
TreeMap collectedDeps = new TreeMap();
TreeMap collectedSources = new TreeMap();
- IdeProjectDefinition[] projects = index.getProjectDefinitions();
- for ( int i = 0; i < projects.length; i++ ) {
+ IdeProjectDefinition[] projects = m_index.getProjectDefinitions();
+ for ( int i = 0; i < projects.length; i++ )
+ {
IdeProjectDefinition project = projects[i];
try
{
@@ -158,62 +206,80 @@
e.printStackTrace();
}
IdeDependency[] deps = project.getDependencies();
- for (int k= 0; k<deps.length;k++ )
+ for ( int k = 0; k < deps.length; k++ )
{
IdeDependency dep = deps[k];
- IdeDefinition resolved = index.resolve(dep.getKey());
+ IdeDefinition resolved = m_index.resolve( dep.getKey() );
File depPath = getDependencyPath( resolved );
- if (depPath!=null)
+ if ( depPath != null )
{
- collectedDeps.put(dep.getKey(), depPath);
+ collectedDeps.put( dep.getKey(), depPath );
}
}
}
List entries = new ArrayList();
Iterator collEntries = collectedDeps.values().iterator();
- //for (int i = 0; i < rs.length; i++) {
- while (collEntries.hasNext())
- {
+ // for (int i = 0; i < rs.length; i++) {
+ while ( collEntries.hasNext() )
+ {
File dep = (File) collEntries.next();
- entries.add(JavaCore.newLibraryEntry(new
Path(dep.getAbsolutePath()), null, null));
+ entries.add( JavaCore.newLibraryEntry( new Path( dep
+ .getAbsolutePath() ), null, null ) );
}
- return (IClasspathEntry[])entries.toArray(new
IClasspathEntry[entries.size()]);
+ return (IClasspathEntry[]) entries.toArray( new
IClasspathEntry[entries
+ .size()] );
}

-
-
-
-
- private File getDependencyPath( IdeDefinition resolved )
+ /**
+ *
+ * @param dependency
+ * the dependency
+ * @return the full path in the file system
+ */
+ private File getDependencyPath( IdeDefinition dependency )
{
File resolvedPath = null;
- if ( resolved != null ) {
- if ( resolved.isProjectDefinition() ) {
- IdeProjectDefinition projectDependency =
(IdeProjectDefinition)resolved;
+ if ( dependency != null )
+ {
+ if ( dependency.isProjectDefinition() )
+ {
+ IdeProjectDefinition projectDependency =
(IdeProjectDefinition) dependency;
resolvedPath = null;
}
- else {
- IdeResourceDefinition resource =
(IdeResourceDefinition)resolved;
+ else
+ {
+ IdeResourceDefinition resource = (IdeResourceDefinition)
dependency;
resolvedPath = resource.getFullPath();
}
}
return resolvedPath;
}

+ /**
+ *
+ * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
+ */
public String getDescription()
{
- return "[" +indexFile + "] Magic Dependencies";
+ return "[" + m_indexFile + "] Magic Dependencies";
}

+ /**
+ *
+ * @see org.eclipse.jdt.core.IClasspathContainer#getKind()
+ */
public int getKind()
{
return IClasspathContainer.K_APPLICATION;
}

+ /**
+ *
+ * @see org.eclipse.jdt.core.IClasspathContainer#getPath()
+ */
public IPath getPath()
{
- return path;
+ return m_containerPath;
}
-

}

Modified:
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicPlugin.java
==============================================================================
---
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicPlugin.java
(original)
+++
development/laboratory/ide/eclipse/magic/plugin/src/net/dpml/ide/eclipse/plugins/magic/MagicPlugin.java
Sun Mar 13 20:58:47 2005
@@ -24,7 +24,7 @@
/**
* The main plugin class to be used in the desktop.
*/
-public class MagicPlugin extends Plugin implements IStartup
+public class MagicPlugin extends Plugin implements IStartup
{
// The shared instance.
private static MagicPlugin plugin;
@@ -58,24 +58,29 @@
AntCorePreferences prefs =
AntCorePlugin.getPlugin().getPreferences();
IAntClasspathEntry[] coreClasspath =
prefs.getDefaultAntHomeEntries();
IAntClasspathEntry[] newClasspath;
- String pluginPath =
MagicPlugin.getDefault().getBundle().getLocation().substring(7);
+ String pluginPath =
MagicPlugin.getDefault().getBundle().getLocation()
+ .substring( 7 );
try
{
- transitClasspath[0] = new AntClasspathEntry(pluginPath +
"lib/dpml-transit-main.jar");
- transitClasspath[1] = new AntClasspathEntry(pluginPath +
"lib/dpml-transit-tools.jar");
- transitClasspath[2] = new AntClasspathEntry(pluginPath +
"lib/junit-3.8.1.jar");
+ transitClasspath[0] = new AntClasspathEntry( pluginPath
+ + "lib/dpml-transit-main.jar" );
+ transitClasspath[1] = new AntClasspathEntry( pluginPath
+ + "lib/dpml-transit-tools.jar" );
+ transitClasspath[2] = new AntClasspathEntry( pluginPath
+ + "lib/junit-3.8.1.jar" );
}
catch ( Exception e )
{
// TODO Auto-generated catch block
e.printStackTrace();
}
- newClasspath = new AntClasspathEntry[coreClasspath.length +
transitClasspath.length];
+ newClasspath = new AntClasspathEntry[coreClasspath.length
+ + transitClasspath.length];
System.arraycopy( coreClasspath, 0, newClasspath, 0,
coreClasspath.length );
System.arraycopy( transitClasspath, 0, newClasspath,
coreClasspath.length, transitClasspath.length );
- prefs.setAntHomeClasspathEntries(newClasspath);
+ prefs.setAntHomeClasspathEntries( newClasspath );
}

/**
@@ -164,14 +169,16 @@

public static void log( String string, int severity )
{
- MagicPlugin.getDefault().getLog().log(new Status(Status.INFO,
MagicPlugin.getDefault().getClass().getName(), 0, string, null));
-
+ MagicPlugin.getDefault().getLog().log(
+ new Status( Status.INFO, MagicPlugin.getDefault().getClass()
+ .getName(), 0, string, null ) );
+
}

public static void logInfo( String message )
{
- log(message, Status.INFO);
-
+ log( message, Status.INFO );
+
}

}



  • svn commit: r2060 - in development/laboratory/ide/eclipse/magic/plugin: . src/net/dpml/ide/eclipse/plugins/magic, peter, 03/13/2005

Archive powered by MHonArc 2.6.24.

Top of Page