Skip to main content



      Home
Home » Newcomers » Newcomers » Automatic Refresh
Automatic Refresh [message #163056] Tue, 01 August 2006 10:09 Go to next message
Eclipse UserFriend
Originally posted by: wojtek.a.com

Is there a way to have Eclipse automatically refresh a file upon
application start? I am using a properties file for the I18N values, but
I am using an external editor to manage the file.

If I have the file open in an Eclipse editor, then the change is noticed
(IF I go to the editor tab), and propagated to the Web server.

I would like to have Eclipse either automatically do a refresh upon
startup, and/or have the ability to flag certain files for periodic
refresh with some settable time period.
Re: Automatic Refresh [message #163091 is a reply to message #163056] Tue, 01 August 2006 10:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

For refresh on startup: Preferences > General > Startup and shutdown >
Refresh workspace on startup.

To refresh automatically: Preferences > General > Workspace > Refresh
automatically.
--

Wojtek wrote:
> Is there a way to have Eclipse automatically refresh a file upon
> application start? I am using a properties file for the I18N values, but
> I am using an external editor to manage the file.
>
> If I have the file open in an Eclipse editor, then the change is noticed
> (IF I go to the editor tab), and propagated to the Web server.
>
> I would like to have Eclipse either automatically do a refresh upon
> startup, and/or have the ability to flag certain files for periodic
> refresh with some settable time period.
Re: Automatic Refresh [message #163123 is a reply to message #163056] Tue, 01 August 2006 12:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse4.rizzoweb.com

Wojtek wrote:
> Is there a way to have Eclipse automatically refresh a file upon
> application start? I am using a properties file for the I18N values, but
> I am using an external editor to manage the file.

In an effort to improve Eclipse:
What is it about the external editor that makes it better than what
Eclipse provides?
Have you tried any of the third-party plugins for editing resource
bundle files in Eclipse?

--
Hope this helps,
Eric
Re: Automatic Refresh [message #163169 is a reply to message #163123] Tue, 01 August 2006 16:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wojtek.a.com

Eric Rizzo wrote:
> Wojtek wrote:
> In an effort to improve Eclipse:
> What is it about the external editor that makes it better than what
> Eclipse provides?

In an effort to remove stupid typo mistakes I have created a class
called LangKey which holds the property file key. The LangKey
constructors are held in a Lang class with nested classes. This looks
like (hope the formatting holds...):

----------------------------
public class Lang
{
public static class Menu
{
public static final LangKey HOME = new LangKey("menu.home");
public static final LangKey LOGIN = new LangKey("menu.login");
}

public static class Login
{
public static final LangKey USER_ID = new LangKey("login.userid");
public static final LangKey PASSWORD= new LangKey("login.password");
}
}
----------------------------

and so on. The LangKey class has some other attributes and functionality.

The property file then has:
----------------------------
menu.home = Home
menu.login = Login
login.userid = Your User ID
login.password = Password
----------------------------

Then when showing stuff to the user (JSP):
----------------------------
<%= lang.text(Lang.Menu.HOME) %>
----------------------------

where lang is an instance of a language class for that user. This lets
the Java compiler catch any typos and also lets the code assist, well,
assist.

The problem is coordinating the keys between the two files (and more
when other languages are added). Each new entry requires an addition to
the Lang class AND a corresponding addition to the property file, plus a
lot of fluff typing (public static final LangKey .....).

So I wrote a Q&D editor in Visual Basic (don't know enough Swing :-()
which reads in both the Lang.java file and the property file, links the
two via the property file keys, and displays the classes and keys in a
tree fashion. I can then add new nested classes, keys, and edit the
language text. Along with comments which identify parameters ({0, number}).

It then generates both files. As an added bonus, I also generate JavaDoc
which contains the actual text, along with any comments:

/**
* Parameters:
* <br>0 - min length
* <br>1 - max length
* <br>Text:
* <br>The password must be between {0,number} and {1,number} in length
*/
public static final LangKey ERR_PW_LEN = new LangKey("login.err.pwLen");

So when I hover over the Lang.Login.ERR_PW_LEN I get a tooltip which
explains the language key.

So this is all somewhat customized. Hmmm, maybe I should have created a
patent for it :-)

However changes made externally were not being picked up and propagated
out to the Web Server. I usually have both Eclipse and my editor open at
the same time. I will use John's suggestion (Thanks!)

I do know that if I was to extend the basic editor, I could set the
editor as being dirty and so on, but I really do not have the time to
delve into the mysteries of Eclipse plugins. Maybe after this project is
done....
Re: Automatic Refresh [message #163176 is a reply to message #163091] Tue, 01 August 2006 17:04 Go to previous message
Eclipse UserFriend
Originally posted by: wojtek.a.com

John Arthorne wrote:
> To refresh automatically: Preferences > General > Workspace > Refresh
> automatically.

Perfect! Thanks!!
Previous Topic:Tabbed Editor Silliness
Next Topic:Variable Height Rows (treeviewer)
Goto Forum:
  


Current Time: Sat May 10 18:36:45 EDT 2025

Powered by FUDForum. Page generated in 0.14180 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top