How to run RText from Eclipse ?

Questions on using RText should go here.

Moderator: robert

How to run RText from Eclipse ?

Postby Darren » Mon Jul 06, 2009 6:30 pm

I've downloaded the source-code and I would like to be able to run RText from Eclipse, (so I can step through the code using Eclipse's debugger).

So I created a directory, placed the RText-source-directories in there, ('Rtext', 'Common' and 'com'), and created a Java-project in Eclipse.

But that is obviously not enough, because I get a whole lot of compile-errors, like, for instance :
Code: Select all
Application     cannot be resolved to a type   OSXAdapter.java           RText/com/apple/osxadapter          
AutoCompletion  cannot be resolved to a type   RegexAwareComboBox.java   RText/Common/src/org/fife/ui/search

So my question is :
What do I need to do to be able to compile and run Rtext from Eclipse ?
Darren
 

How to run RText from Eclipse ? II

Postby Darren » Mon Jul 06, 2009 6:57 pm

I'm making progress. :-)

I've added 'autocomplete.jar' and 'rsyntaxtextarea.jar' to the build-path and removed OSXAdapter.java from the project
and now it compiles. So far, so good.

Now when I try to run it, Eclispes is missing the resource-files :
Code: Select all
Can't find bundle for base name org.fife.rtext.RText, locale en
   at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)

I tried to add '\RText\RText\i18n\org' as library and/or source-dir (in Eclipse), but that doesn't help.

So, where to set the path of the resourec-files ?
Darren
 

Re: How to run RText from Eclipse ? III

Postby Darren » Mon Jul 06, 2009 7:31 pm

I noticed that the resources-directory does not contain any '_en'-resources at all, (English is just the
default). Why is it specifically looking for 'en' then ? (I have an 'English' Windows, but my culture is 'nl',
does that have anything to do with it, maybe ?).

How to fix this problem ?
Darren
 

Re: How to run RText from Eclipse ?

Postby robert » Tue Jul 07, 2009 3:06 am

Hi Darren,

There would be a few manual issues to get RText running in Eclipse. I've not worried about this too much myself, because I tried to use RText itself while developing it (more usage == find more bugs :D ).

I believe you'll need to add both RText/i18n and Common/i18n as Source Folders in Eclipse (without the "org" folder one level deeper). Your next problem would be that, at runtime, RText assumes some resources can be found at relative paths to the directory it's running from (XML files, for example). And I think the source distribution has these resources thrown about in various (different from their runtime) locations.

I can see about making the source distribution more Eclipse-friendly, I think I'll have some time to do so in the next couple of days. I can help you figger it out if you need some help, and maybe make the next "official" release more Eclipse friendly as well (should be very soon).

Another idea is to use Eclipse to build the RText distribution via Ant (Alt+X, Q from RText's build.xml in an editor), then create an External Tool that runs RText/dist/RText.jar. But unfortunately that won't let you interactively debug the code.

As to why it's looking for _en.properties files when there are none, it seems to just be the way the error message in the stack trace from ResourceBundle is designed. It always says "en" (probably really the system default Locale?) even though it always looks for default properties files as well before throwing the Exception.
User avatar
robert
 
Posts: 794
Joined: Sat May 10, 2008 5:16 pm

Re: How to run RText from Eclipse ?

Postby Darren » Tue Jul 07, 2009 6:41 pm

I've got it working now. It compiles and starts without errors, however, the toolbar does not contain any buttons (?).
But that's ok, everything else seems to work fine.

This is the Java Build Path, (in Eclipse, Project Properties, tab 'Source') :

RText/Common/i8n
RText/Common/src
RText/RText/i8n
RText/RText/src

And I needed to tweak two paths :
Code: Select all
private void loadPossibleIconGroups() {
      // String loc = getInstallLocation() + "/distfiles/icongroups/ExtraIcons.xml";   
      String loc = getInstallLocation() + "/RText/distfiles/icongroups/ExtraIcons.xml";      
      iconGroupMap = IconGroupLoader.loadIconGroups(this, loc);
   }

   protected ExtendedLookAndFeelInfo[] get3rdPartyLookAndFeelInfo() {
      try {
      //return ThirdPartyLookAndFeelManager.get3rdPartyLookAndFeelInfo(this, "lnfs/lookandfeels.xml");
         return ThirdPartyLookAndFeelManager.get3rdPartyLookAndFeelInfo(this, "RText/distfiles/lnfs/lookandfeels.xml");

@Robert, thanks for your help, I will send you some feedback on RText soon.
Darren
 


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron