Problema class nested [message #599755] |
Fri, 13 March 2009 18:24 |
Hitalo Messages: 4 Registered: July 2009 |
Junior Member |
|
|
public class StandardDrawingView ...{
....
protected void handleMouseEventException(Throwable t) {
JOptionPane.showMessageDialog(
this,
t.getClass().getName() + " - " + t.getMessage(),
"Error",
JOptionPane.ERROR_MESSAGE);
t.printStackTrace();
}
public class DrawingViewMouseListener extends MouseAdapter {
/**
* Handles mouse down events. The event is delegated to the
* currently active tool.
*/
public void mousePressed(MouseEvent e) {
try {
//throw Throwable
}
catch (Throwable t) {
handleMouseEventException(t);
}
}
}
...
}
AEW,
the problem is:
my aim is: extract the exception handler to aspect's without changing
the original code of the application. But I'm not able to make this
scenario above. I can not get the reference class StandardDrawingView to
use the method handleMouseEventException (t) in the treatment of exccacao.
Is there any way to do this?
Take the reference class DrawingViewMouseListener is easy, just use TARGET
or THIS. The problem is to take the class most external
StandardDrawingView.
Since already thank ...public class StandardDrawingView ...{
....
protected void handleMouseEventException(Throwable t) {
JOptionPane.showMessageDialog(
this,
t.getClass().getName() + " - " + t.getMessage(),
"Error",
JOptionPane.ERROR_MESSAGE);
t.printStackTrace();
}
public class DrawingViewMouseListener extends MouseAdapter {
/**
* Handles mouse down events. The event is delegated to the
* currently active tool.
*/
public void mousePressed(MouseEvent e) {
try {
//throw Throwable
}
catch (Throwable t) {
handleMouseEventException(t);
}
}
}
...
}
AEW,
the problem is:
my aim is: extract the exception handler to aspect's without changing
the original code of the application. But I'm not able to make this
scenario above. I can not get the reference class StandardDrawingView to
use the method handleMouseEventException (t) in the treatment of exccacao.
Is there any way to do this?
Take the reference class DrawingViewMouseListener is easy, just use TARGET
or THIS. The problem is to take the class most external
StandardDrawingView.
Since already thank ...
|
|
|
Powered by
FUDForum. Page generated in 0.06441 seconds