Home » Archived » Visual Editor (VE) » Add addition library when creating my own project
Add addition library when creating my own project [message #69731] |
Wed, 03 November 2004 03:01  |
Eclipse User |
|
|
|
Originally posted by: txfen.hands.com.my
Hi,
I have two plugins. one is to create my own project, let's say ABC
project, and another plugin is extending the VE.
to use the plugin which extend the VE, everytime when i create a new
project, i need to add that library for the VE to the ABC project i
create. is there a way to automatically include that library in the build
path when i create my ABC project?
Thanks a lot guys.
klutzie
|
|
|
Re: Add addition library when creating my own project [message #69792 is a reply to message #69731] |
Wed, 03 November 2004 09:24   |
Eclipse User |
|
|
|
Originally posted by: myersj.nospam.gmail.com
Hi Klutzie,
When you're talking about creating your own projects, are you creating
normal Java projects, or have you added your own project type? We are
doing something like what you're asking when you create an SWT Visual
Class in the new Visual Class wizard. The wizard adds the SWT container
to the project if it's not already there when creating an SWT class. If
you look at the plugin.xml for the org.eclipse.ve.swt plug-in, you'll
see that components added to the Visual Class wizard via the
newStyleComponent extension point have a container="SWT_CONTAINER"
attribute.
What you may be able to do is define an addition to the New Visual Class
wizard to add one of your components to the list, and then when you
create one of your components it'll add your classpath container
automatically.
Good luck,
- Jeff
klutzie wrote:
> Hi,
>
> I have two plugins. one is to create my own project, let's say ABC
> project, and another plugin is extending the VE.
>
> to use the plugin which extend the VE, everytime when i create a new
> project, i need to add that library for the VE to the ABC project i
> create. is there a way to automatically include that library in the
> build path when i create my ABC project?
>
>
>
> Thanks a lot guys.
>
>
> klutzie
>
|
|
|
Re: Add addition library when creating my own project [message #74267 is a reply to message #69792] |
Tue, 07 December 2004 22:22   |
Eclipse User |
|
|
|
Originally posted by: klutzie.xxx.com
Hi Jeff,
Well, I'm adding my own project, not a Java project. And I can't really do
what you described here, bcoz none of my components is a container.
Meaning that, when i wanna create a new Visual Class, it wont make sense
to have something like KzTextField (my customized component) in the Visual
Class Wizard.
What I would like to achieve is that, when I create my own project, the
plugin that I've created (the library or the container) will be added to
the Java Build Path of the project, instead of requiring the users to
create the project first, then add the library later in the Project
Properties -> Add Library.
Any idea?
Thanks,
klutzie
Jeff Myers wrote:
> Hi Klutzie,
> When you're talking about creating your own projects, are you creating
> normal Java projects, or have you added your own project type? We are
> doing something like what you're asking when you create an SWT Visual
> Class in the new Visual Class wizard. The wizard adds the SWT container
> to the project if it's not already there when creating an SWT class. If
> you look at the plugin.xml for the org.eclipse.ve.swt plug-in, you'll
> see that components added to the Visual Class wizard via the
> newStyleComponent extension point have a container="SWT_CONTAINER"
> attribute.
> What you may be able to do is define an addition to the New Visual Class
> wizard to add one of your components to the list, and then when you
> create one of your components it'll add your classpath container
> automatically.
> Good luck,
> - Jeff
> klutzie wrote:
>> Hi,
>>
>> I have two plugins. one is to create my own project, let's say ABC
>> project, and another plugin is extending the VE.
>>
>> to use the plugin which extend the VE, everytime when i create a new
>> project, i need to add that library for the VE to the ABC project i
>> create. is there a way to automatically include that library in the
>> build path when i create my ABC project?
>>
>>
>>
>> Thanks a lot guys.
>>
>>
>> klutzie
>>
|
|
| |
Re: Add addition library when creating my own project [message #74339 is a reply to message #74303] |
Wed, 08 December 2004 20:36   |
Eclipse User |
|
|
|
Originally posted by: klutzie.xxx.com
Hi Rich,
Yes, im creating my own java project.
I've inserted the following codes (got from the eclipse help files) in my
wizard for my new java project, but it doesnt seem to work
----------------------------------------
IClasspathEntry varEntry = JavaCore.newContainerEntry( new
path("MY_CONTAINER"), false);
JavaCore.setClasspathContainer(
new Path("MY_CONTAINER"),
new IJavaProject[]{ myProject },
new IClasspathContainer[] {
new IClasspathContainer() {
public IClasspathEntry[] getClasspathEntries() {
return new IClasspathEntry[]{
JavaCore.newLibraryEntry(new Path("MY_CONTAINER"), null, null,
false);
};
}
public String getDescription() { return "My Container"; }
public int getKind() { return IClasspathContainer.K_SYSTEM; }
public IPath getPath() { return new Path("MY_CONTAINER"); }
}
},
null);
----------------------------------------
and i have this in my VE plugin:
----------------------------------------
<extension
point="org.eclipse.jdt.ui.classpathContainerPage">
<classpathContainerPage
name="My Widgets"
class=" org.eclipse.ve.internal.java.wizard.RegisteredClasspathConta inerWizardPage "
id="MY_CONTAINER">
</classpathContainerPage>
</extension>
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class=" org.eclipse.ve.internal.java.core.RegisteredClasspathContain erInitializer "
id="MY_CONTAINER">
</classpathContainerInitializer>
</extension>
----------------------------------------
after i've created my own java project, MY_CONTAINER is not added into the
build path of my project.
any idea?
thanks,
klutzie
Rich Kulp wrote:
> In that case, since it is your wizard that is creating the project, it
> is up to your wizard to update the classpath to add the necessary
> library. This is only for non-plugin projects. By the way, it needs to
> also be a java project. The visual editor will not work in a non-java
> project.
> If the project you are creating is a plugin project (i.e. you are
> developing a plugin), then your wizard should NOT update the classpath,
> it should instead update the plugin.xml file. That is because in plugin
> projects the classpath is maintained by PDE via the plugin.xml, not
> directly by the user.
|
|
|
Re: Add addition library when creating my own project [message #74408 is a reply to message #74339] |
Thu, 09 December 2004 11:01  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You don't create classpath container's on the fly. If you want to use
the VE's RegisteredClasspath Container Wizard and initializer, you use
the VE Registration plugin.xml extension point to point to your jars
that you are supplying. Then you just create a newContainerEntry to
MY_CONTAINER and add it to the classpath. The MY_CONTAINER container
itself will be an instance of RegisteredClasspathContainer configured to
add your jar (from the registration extension point). This will be done
automatically once it sees MY_CONTAINER in the classpath.
klutzie wrote:
> Hi Rich,
>
> Yes, im creating my own java project.
>
> I've inserted the following codes (got from the eclipse help files) in
> my wizard for my new java project, but it doesnt seem to work
>
> ----------------------------------------
>
> IClasspathEntry varEntry = JavaCore.newContainerEntry( new
> path("MY_CONTAINER"), false);
The above piece of code is correct, but it needs to be added to the
classpath.
This piece of code that follows is wrong and shouldn't be used in the
new project wizard.
> JavaCore.setClasspathContainer(
> new Path("MY_CONTAINER"), new IJavaProject[]{ myProject },
> new IClasspathContainer[] {
> new IClasspathContainer() {
> public IClasspathEntry[] getClasspathEntries() {
> return new IClasspathEntry[]{
> JavaCore.newLibraryEntry(new Path("MY_CONTAINER"), null, null, false);
> }; }
> public String getDescription() { return "My Container"; }
> public int getKind() { return IClasspathContainer.K_SYSTEM; }
> public IPath getPath() { return new Path("MY_CONTAINER"); }
> }
> }, null);
>
The big question is how do you get the varEntry into the classpath from
your wizard. I don't how your wizard works, so that is up to you.
--
Thanks,
Rich Kulp
|
|
|
Re: Add addition library when creating my own project [message #602534 is a reply to message #69731] |
Wed, 03 November 2004 09:24  |
Eclipse User |
|
|
|
Hi Klutzie,
When you're talking about creating your own projects, are you creating
normal Java projects, or have you added your own project type? We are
doing something like what you're asking when you create an SWT Visual
Class in the new Visual Class wizard. The wizard adds the SWT container
to the project if it's not already there when creating an SWT class. If
you look at the plugin.xml for the org.eclipse.ve.swt plug-in, you'll
see that components added to the Visual Class wizard via the
newStyleComponent extension point have a container="SWT_CONTAINER"
attribute.
What you may be able to do is define an addition to the New Visual Class
wizard to add one of your components to the list, and then when you
create one of your components it'll add your classpath container
automatically.
Good luck,
- Jeff
klutzie wrote:
> Hi,
>
> I have two plugins. one is to create my own project, let's say ABC
> project, and another plugin is extending the VE.
>
> to use the plugin which extend the VE, everytime when i create a new
> project, i need to add that library for the VE to the ABC project i
> create. is there a way to automatically include that library in the
> build path when i create my ABC project?
>
>
>
> Thanks a lot guys.
>
>
> klutzie
>
|
|
|
Re: Add addition library when creating my own project [message #603777 is a reply to message #69792] |
Tue, 07 December 2004 22:22  |
Eclipse User |
|
|
|
Originally posted by: klutzie.xxx.com
Hi Jeff,
Well, I'm adding my own project, not a Java project. And I can't really do
what you described here, bcoz none of my components is a container.
Meaning that, when i wanna create a new Visual Class, it wont make sense
to have something like KzTextField (my customized component) in the Visual
Class Wizard.
What I would like to achieve is that, when I create my own project, the
plugin that I've created (the library or the container) will be added to
the Java Build Path of the project, instead of requiring the users to
create the project first, then add the library later in the Project
Properties -> Add Library.
Any idea?
Thanks,
klutzie
Jeff Myers wrote:
> Hi Klutzie,
> When you're talking about creating your own projects, are you creating
> normal Java projects, or have you added your own project type? We are
> doing something like what you're asking when you create an SWT Visual
> Class in the new Visual Class wizard. The wizard adds the SWT container
> to the project if it's not already there when creating an SWT class. If
> you look at the plugin.xml for the org.eclipse.ve.swt plug-in, you'll
> see that components added to the Visual Class wizard via the
> newStyleComponent extension point have a container="SWT_CONTAINER"
> attribute.
> What you may be able to do is define an addition to the New Visual Class
> wizard to add one of your components to the list, and then when you
> create one of your components it'll add your classpath container
> automatically.
> Good luck,
> - Jeff
> klutzie wrote:
>> Hi,
>>
>> I have two plugins. one is to create my own project, let's say ABC
>> project, and another plugin is extending the VE.
>>
>> to use the plugin which extend the VE, everytime when i create a new
>> project, i need to add that library for the VE to the ABC project i
>> create. is there a way to automatically include that library in the
>> build path when i create my ABC project?
>>
>>
>>
>> Thanks a lot guys.
>>
>>
>> klutzie
>>
|
|
|
Re: Add addition library when creating my own project [message #603787 is a reply to message #74267] |
Wed, 08 December 2004 11:03  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
In that case, since it is your wizard that is creating the project, it
is up to your wizard to update the classpath to add the necessary
library. This is only for non-plugin projects. By the way, it needs to
also be a java project. The visual editor will not work in a non-java
project.
If the project you are creating is a plugin project (i.e. you are
developing a plugin), then your wizard should NOT update the classpath,
it should instead update the plugin.xml file. That is because in plugin
projects the classpath is maintained by PDE via the plugin.xml, not
directly by the user.
--
Thanks,
Rich Kulp
|
|
|
Re: Add addition library when creating my own project [message #603791 is a reply to message #74303] |
Wed, 08 December 2004 20:36  |
Eclipse User |
|
|
|
Originally posted by: klutzie.xxx.com
Hi Rich,
Yes, im creating my own java project.
I've inserted the following codes (got from the eclipse help files) in my
wizard for my new java project, but it doesnt seem to work
----------------------------------------
IClasspathEntry varEntry = JavaCore.newContainerEntry( new
path("MY_CONTAINER"), false);
JavaCore.setClasspathContainer(
new Path("MY_CONTAINER"),
new IJavaProject[]{ myProject },
new IClasspathContainer[] {
new IClasspathContainer() {
public IClasspathEntry[] getClasspathEntries() {
return new IClasspathEntry[]{
JavaCore.newLibraryEntry(new Path("MY_CONTAINER"), null, null,
false);
};
}
public String getDescription() { return "My Container"; }
public int getKind() { return IClasspathContainer.K_SYSTEM; }
public IPath getPath() { return new Path("MY_CONTAINER"); }
}
},
null);
----------------------------------------
and i have this in my VE plugin:
----------------------------------------
<extension
point="org.eclipse.jdt.ui.classpathContainerPage">
<classpathContainerPage
name="My Widgets"
class=" org.eclipse.ve.internal.java.wizard.RegisteredClasspathConta inerWizardPage "
id="MY_CONTAINER">
</classpathContainerPage>
</extension>
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class=" org.eclipse.ve.internal.java.core.RegisteredClasspathContain erInitializer "
id="MY_CONTAINER">
</classpathContainerInitializer>
</extension>
----------------------------------------
after i've created my own java project, MY_CONTAINER is not added into the
build path of my project.
any idea?
thanks,
klutzie
Rich Kulp wrote:
> In that case, since it is your wizard that is creating the project, it
> is up to your wizard to update the classpath to add the necessary
> library. This is only for non-plugin projects. By the way, it needs to
> also be a java project. The visual editor will not work in a non-java
> project.
> If the project you are creating is a plugin project (i.e. you are
> developing a plugin), then your wizard should NOT update the classpath,
> it should instead update the plugin.xml file. That is because in plugin
> projects the classpath is maintained by PDE via the plugin.xml, not
> directly by the user.
|
|
|
Re: Add addition library when creating my own project [message #603804 is a reply to message #74339] |
Thu, 09 December 2004 11:01  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You don't create classpath container's on the fly. If you want to use
the VE's RegisteredClasspath Container Wizard and initializer, you use
the VE Registration plugin.xml extension point to point to your jars
that you are supplying. Then you just create a newContainerEntry to
MY_CONTAINER and add it to the classpath. The MY_CONTAINER container
itself will be an instance of RegisteredClasspathContainer configured to
add your jar (from the registration extension point). This will be done
automatically once it sees MY_CONTAINER in the classpath.
klutzie wrote:
> Hi Rich,
>
> Yes, im creating my own java project.
>
> I've inserted the following codes (got from the eclipse help files) in
> my wizard for my new java project, but it doesnt seem to work
>
> ----------------------------------------
>
> IClasspathEntry varEntry = JavaCore.newContainerEntry( new
> path("MY_CONTAINER"), false);
The above piece of code is correct, but it needs to be added to the
classpath.
This piece of code that follows is wrong and shouldn't be used in the
new project wizard.
> JavaCore.setClasspathContainer(
> new Path("MY_CONTAINER"), new IJavaProject[]{ myProject },
> new IClasspathContainer[] {
> new IClasspathContainer() {
> public IClasspathEntry[] getClasspathEntries() {
> return new IClasspathEntry[]{
> JavaCore.newLibraryEntry(new Path("MY_CONTAINER"), null, null, false);
> }; }
> public String getDescription() { return "My Container"; }
> public int getKind() { return IClasspathContainer.K_SYSTEM; }
> public IPath getPath() { return new Path("MY_CONTAINER"); }
> }
> }, null);
>
The big question is how do you get the varEntry into the classpath from
your wizard. I don't how your wizard works, so that is up to you.
--
Thanks,
Rich Kulp
|
|
|
Goto Forum:
Current Time: Thu May 08 12:51:02 EDT 2025
Powered by FUDForum. Page generated in 0.09081 seconds
|