Hi.
赵忠伟, you’re Right!!!
Finally, I found a solution for Null point Exceptions.
A problem was happened at LanguageModelContainer.copyToInstanceLocation()..
URL url =
"">getBundle(),provider.getPath(project),
map);
A variable of plugin’s value was null. :( So I. added a this
code.
public void
start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
I appreciate your help again.. Thanks.
Here is a full source for extending PDT Language Contributions.
package co.kr.mk;
import
org.eclipse.core.runtime.IPath;
import
org.eclipse.core.runtime.Path;
import
org.eclipse.core.runtime.Plugin;
import
org.eclipse.dltk.core.IScriptProject;
import
org.eclipse.php.core.language.ILanguageModelProvider;
import
org.osgi.framework.BundleContext;
/**
* The activator
class controls the plug-in life cycle
*/
public class MKFramework
extends Plugin implements
ILanguageModelProvider {
// The
plug-in ID
public static final String PLUGIN_ID = "co.kr.mk"; //$NON-NLS-1$
// The
shared instance
private static MKFramework
plugin;
/**
* The
constructor
*/
public
MKFramework() {
}
/*
*
(non-Javadoc)
* @see
org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void
start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
*
(non-Javadoc)
* @see
org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void
stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the
shared instance
*
* @return the
shared instance
*/
public static MKFramework getDefault()
{
return plugin;
}
public IPath
getPath(IScriptProject project) {
// TODO
Auto-generated method stub
return new Path("resources/mk");
}
public String
getName() {
// TODO
Auto-generated method stub
return "MKFramework";
}
public Plugin
getPlugin() {
// TODO
Auto-generated method stub
return
MKFramework.getDefault();
}
}
From: pdt-dev-bounces@xxxxxxxxxxx
[mailto:pdt-dev-bounces@xxxxxxxxxxx] On Behalf Of 김희준
Sent: Thursday, November 11, 2010 9:18 AM
To: PDT Developers
Subject: Re: [pdt-dev] How to Extending PDT 2.2??
Hi.
I did debug my plugin and found a Null Point Exception.
PDT is caught a my path(resources/mk), but can’t
find a PHP stubs in my path. :(
A strings value of path(resources/mk) is in a path variables;
I’m trying to find a solution.
Ps. I really appreciate your help. Thanks.
From: pdt-dev-bounces@xxxxxxxxxxx
[mailto:pdt-dev-bounces@xxxxxxxxxxx] On Behalf Of ?忠?
Sent: Wednesday, November 10, 2010 5:45 PM
To: PDT Developers
Subject: Re: [pdt-dev] How to Extending PDT 2.2??
hi
could you debug your plugin and set breakpoints at
LanguageModelContainer.getBuildpathEntries() and
LanguageModelInitializer.getContributedProviders() to see what is wrong?
btw,are you sure your plugin is launched successfully?
On Wed, Nov 10, 2010 at 3:58 PM, 김희준 <hjkim@xxxxxxxxxxxxxx>
wrote:
Hi..
Sure. I added a provider tag.
Here is a my plugin.xml.
<?xml
version="1.0" encoding="UTF-8"?>
<?eclipse
version="3.4"?>
<plugin>
<extension
point="org.eclipse.php.core.languageModelProviders">
<provider class="co.kr.mk.MKFramework" />
</extension>
</plugin>
And, I checked a resource
path in build.properties.
source.. = src/
output.. = bin/
bin.includes
= META-INF/,\
.,\
plugin.xml,\
resources/
What do am I next?? :(
Thanks for your help.
hi,
did you do this:
Register this class in plugin.xml:
<extension point="org.eclipse.php.core.languageModelProviders">
<provider class="co.kr.mk.framework.MKFramework" />
</extension>
2010/11/10 김희준 <hjkim@xxxxxxxxxxxxxx>
Hi all. I’m new in PDT.
I’m trying to extending PDT 2.2 with
languageModelProviders’s extension point.
But, I’m not good at JAVA&Eclipse. :(
I’ve read a API Doc already.. but it’s not help me;;
A Doc link is http://wiki.eclipse.org/Extending_PDT_2.2#Language_library_contributions
Here is a my extending source..
Please, check my source.
It is a successfully exported and installed. But it’s not working.
package
co.kr.mk.framework;
import
org.eclipse.core.runtime.IPath;
import
org.eclipse.core.runtime.Path;
import
org.eclipse.core.runtime.Plugin;
import
org.eclipse.dltk.core.IScriptProject;
import org.eclipse.php.core.language.ILanguageModelProvider;
public class MKFramework
extends Plugin implements ILanguageModelProvider {
private static MKFramework plugin;
public MKFramework() {
}
public static MKFramework
getDefault() {
if( plugin == null ) {
plugin = new MKFramework();
}
return plugin;
}
public IPath getPath(IScriptProject project) {
//
TODO Auto-generated method stub
return new Path("resources/mk");
}
public String getName() {
//
TODO Auto-generated method stub
return null;
}
public Plugin getPlugin() {
//
TODO Auto-generated method stub
return MKFramework.getDefault();
}
}
And..
A custom php file sttub in resources/mk is..
<?php
/**
*
*
Test function
* @param string
$ppp
*/
function hjkim($ppp)
{
return $ppp;
}
How to make a code assistance for custom PHP Library Function and
Class?
Thanks all.
----------------------------------------------------------------------------------------------------------------------------------------------------------
(주) 매경닷컴 시스템 개발부 김희준 대리 | hjkim@mkinternet.com |
@powfly | 02*2000*5443 | 010*6332*9272
_______________________________________________
pdt-dev mailing list
pdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pdt-dev
--
Thanks!
Best Regards!
Zhao
_______________________________________________
pdt-dev mailing list
pdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pdt-dev
--
Thanks!
Best Regards!
Zhao