X

Geertjan's Blog

  • July 18, 2011

Show Project Path As Display Name

Geertjan Wielenga
Product Manager
Funny NetBeans IDE experiment:

Like this:

public class Installer extends ModuleInstall {
@Override
public void restored() {
WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
@Override
public void run() {
TopComponent tc = WindowManager.getDefault().findTopComponent("projectTabLogical_tc");
ExplorerManager.Provider ep = (ExplorerManager.Provider) tc;
final ExplorerManager em = ep.getExplorerManager();
em.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
Node rootContext = em.getRootContext();
Children kids = rootContext.getChildren();
for (Node kid : kids.getNodes()) {
Project p = kid.getLookup().lookup(Project.class);
kid.setDisplayName(p.getProjectDirectory().getPath());
}
}
});
}
});
}
}

Join the discussion

Comments ( 1 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.