Bobeirinha, mas me ajudou muito:
fonte: http://jaitechwriteups.blogspot.com/2006/07/know-how-log4j-tries-to-configure.html
Know how log4j tries to configure itself
Large number of applications use log4j for logging. Sometimes you may encounter cases where you sense that log4j is using some other configurations, other than the one that you expected it to use. You can debug the same by switching on the debug flag on log4j. Here's how you can do it:
Add -Dlog4j.debug to the command line. log4j will output info to std. out. telling you how it tries to configure itself.
Dah pra dar uma luz
sábado, 23 de janeiro de 2010
quinta-feira, 24 de setembro de 2009
Processamento assíncrono com SWT
Se quiser bombar uma thread no splash inicial, tem q usar a classe StartupRunnable para tal.
Em suma, cole essa meleca na tua classe que herde de AbstractSplashHandler e sempre que precisar atualizar a GUI assincronamente, use esse método
Exemplo de chamada (estou atualizando uma ProgressBar fake ) :
É meio sinistro (gera uns warnings logo no import), mas furunfa...
Em suma, cole essa meleca na tua classe que herde de AbstractSplashHandler e sempre que precisar atualizar a GUI assincronamente, use esse método
@SuppressWarnings("restriction")
private void updateUI(final Runnable r) {
Shell splashShell = getSplash();
if (splashShell == null || splashShell.isDisposed())
return;
Display display = splashShell.getDisplay();
if (Thread.currentThread() == display.getThread())
r.run();
else {
StartupRunnable startupRunnable = new StartupRunnable() {
public void runWithException() throws Throwable {
r.run();
}
};
display.asyncExec(startupRunnable);
}
}
Exemplo de chamada (estou atualizando uma ProgressBar fake ) :
private void fakeUpdate(final String message, final boolean increment) {
updateUI(new Runnable() {
public void run() {
if (getSplash().isDisposed())
return;
if (increment) {
progress.setSelection( progress.getSelection() + 1 );
}
if (message != null) {
notes.setText(message);
notes.update();
}
}
});
}
É meio sinistro (gera uns warnings logo no import), mas furunfa...
Assinar:
Comentários (Atom)