i'm not experienced with OpenTools at all, so maybe my question is lame,
but... i need sometimes (maybe at JBuilder startup) to change (update,
due to new jars in some directories) "required libs" list (i mean
project required libraries).
User can use OpenTool to generate code depending on new jars, even when
they're not in project required libraries list, and there will be some
compilation errors.
Is adding new libraries in currently opened project possible (without
restarting jbuilder)? Where should i search methods for adding such
libraries? I've found PathSet and ProjectPathSet class and
setRequired(...) is this what i'm looking for?
Thanks for your help.
--
Greetings
Krystian
You should look into the MevenIDE opentool for JBuilder. I think it
does exactly what you want to do.
http://mevenide.codehaus.org/mevenide-ui-jbuilder/features.html
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html
>
> You should look into the MevenIDE opentool for JBuilder. I think it
> does exactly what you want to do.
>
> http://mevenide.codehaus.org/mevenide-ui-jbuilder/features.html
>
Let me clarify that. MevenIDE does for Maven, exactly what you want to
do for your project. So looking at the source for MevenIDE will
probably show you what you need.
Thanks for help!
I think you wrote about FileNodeWorker.java file and this piece of code:
JBProject jbProject = (JBProject) project;
...
PathSet mavenLibrary = projectPathSet.getLibrary("MavenAutoUpdated");
...
mavenLibrary.setClassPath(mavenDependencies);
mavenLibrary.setUrl(new Url(mavenLibraryFile));
mavenLibrary.save();
projectPathSet.reloadLibraries();
but i think this isn't exactly what i'm looking for... (or more
probably, i don't know how to use it properly)
I should describe current code implementation i'm working with. In
JBuilder project i've got some libraries (they can be seen in Project ->
Properties -> Required Libraries tab). There is one library (e.g called
"dynamic") which can be changed for some reason - sometimes new jars are
added - using code like this (i have no JBuilder here, so this is
overview only):
PathSet dynamic = projectPathSet.getLibrary("dynamic");
... jars array preparation ...
dynamic.setClassPath(newJarUrlsArray[]);
dynamic.save();
after this Project -> Properties -> ClassPath tab (if i understand
correctly it contains jars from all libraries) - doesn't contains new
jars. But when i look in "dynamic" library contents (Required Libraries
-> "dynamic" "Edit" i can see new jars) and if i click "OK" button
without any changes in library edit window, ClassPath will be updated
and i can see new jars in it - code using new jars is compilable then.
I tried projectPathSet.reloadLibraries(); after dynamic.save(); but the
problem still existed (ClassPath wasn't updated).
I wrote code using PathSetCollection - unfortunately OpenTools API
doesn't contain doc about this class (why?), so i can't remember exactly
what i did. But i can can describe it... i removed "dynamic" from
PathSetCollection and added it again after changes. And it works. I
think this isn't good solution. :/
Is any better solution for this?
Sorry for my english, i hope you can understand me clearly. ;)
--
Greetings
Krystian
> [...]
> I wrote code using PathSetCollection - unfortunately OpenTools API
> doesn't contain doc about this class (why?), so i can't remember exactly
> what i did. But i can can describe it... i removed "dynamic" from
> PathSetCollection and added it again after changes. And it works. I
> think this isn't good solution. :/
I did some work on creating libraries and then adding
them to newly created projects, and I remember that
this was not as obvious as it could be. Better docs
would be helpful, but the claim for the OTAPI docs is
that they'll remain spotty because large areas of the OTAPI
are subject to change. (Now, with the move to JBuilder as
a set of Eclipse plug-ins, one can rely more on Eclipse
docs, books on Eclipse, and of course, the source code.)
I think the reason you have to remove and add it has
to do with classloaders. I could be wrong, but the way
you are doing doesn't seem to be so bad, especially if
it works. ... Oh, I just remembered something: the more
likely possibility is that when you invoke "get...()"
what you get is a copy: changes you make to that
don't change the original. There are a lot of
instances in the OTAPI where getters return copies in
order to protect the original. So, removing the current
and adding your modified version makes sense. (So does
the protection scheme of giving you a copy, not the original.)
> Is any better solution for this?
Probably not, besides trying something like project.refresh()
[that's pseudo code; I cannot look this up at the moment).
--
Paul Furbacher (TeamB)
Save time, search the archives:
http://info.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.
Thank you for your answer.
Unfortunately there is problem i can't solve. If i remove&add
PathSetCollection code based on new jars is compilable, but... this
OpenTool uses also JBuilder Jot* (com.borland.jbuilder.jot) classes for
code investigation e.g. they check if a java source code has some fields
based on a special interface. Sometimes there is such code executed
(pseudo):
someJotField.getType().getJotClass()...
and returned JotClass is null
Without my PathSetCollection changes code above returns appropriate
JotClass object. I don't know solution for this. :(
> are subject to change. (Now, with the move to JBuilder as
> a set of Eclipse plug-ins, one can rely more on Eclipse
> docs, books on Eclipse, and of course, the source code.)
Where can i find information about JBuilder to Eclipse "migration"? When
it will be ended, when new JBuilder will be released?
I really appreciate your help, thanks again.
--
Greetings
Krystian Lewandowski
> Unfortunately there is problem i can't solve. If i remove&add
> PathSetCollection code based on new jars is compilable, but... this
> OpenTool uses also JBuilder Jot* (com.borland.jbuilder.jot) classes for
> code investigation e.g. they check if a java source code has some fields
> based on a special interface. Sometimes there is such code executed
> (pseudo):
>
> someJotField.getType().getJotClass()...
>
> and returned JotClass is null
>
> Without my PathSetCollection changes code above returns appropriate
> JotClass object. I don't know solution for this. :(
I don't either and will be out of town and not really
be able to pursue this. Hopefully, someone else will
be able to jump in and lend some help.
The only thing that comes to mind is that when you
change the path set collection, you change the compiled
status of the class in question?! Don't know, just
taking a wild guess, since I've done next to nothing
with JOT.
> Where can i find information about JBuilder to Eclipse "migration"? When
> it will be ended, when new JBuilder will be released?
No one really has any information about this except what
Borland has mentioned in various press releases and maybe
at BorCon. (I didn't attend BorCon -- rarely have the
chance or finances to do so, actually -- so I'm just
speculating that they must have said something; but maybe
they didn't.)
Anyway, until that happens, you have to manage with the relatively
little documentation there is for certain areas of the OpenTool
API.