AntConfiguration: addAntConfigurationListener

I tried the following, but I my listener is never called. Any suggestions?

AntConfiguration component = ( AntConfiguration ) ProjectManager.getInstance().getDefaultProject().getComponent( AntConfiguration.class );
component.addAntConfigurationListener( new AntConfigurationListener() {
public void buildFileChanged( BuildFile buildFile ) {
System.out.println( "AntEditor.buildFileChanged" );
}

public void buildFileAdded( BuildFile buildFile ) {
System.out.println( "AntEditor.buildFileAdded" );
}

public void buildFileRemoved( BuildFile buildFile ) {
System.out.println( "AntEditor.buildFileRemoved" );
}
} );

0
2 comments

Johannes Schneider wrote:

I tried the following, but I my listener is never called. Any suggestions?


AFAIK the default project is the template that new projects are created from. This project
instance will never have an Ant file added. You need to use a "real" project reference
(e.g. by using a ProjectComponent) and get the Ant component from that project instance.

HTH,
Sascha

0

Thanks ;)...


Sascha Weinreuter wrote:


AFAIK the default project is the template that new projects are created from. This project
instance will never have an Ant file added. You need to use a "real" project reference
(e.g. by using a ProjectComponent) and get the Ant component from that project instance.

0

Please sign in to leave a comment.