private void updateGoalsList() { GoalsManager goalManager = Lookup.getDefault().lookup(MixR.class).getGoalManager(); if (goalManager.getCurrentGoals() != null) { updateGoalsList(goalManager.getCurrentGoals()); } else { updateGoalsList(null); } }
@Override public void componentClosed() { // Unregister to 'goal change' events in MixR's goal manager: if (goalsChangedListener != null) { GoalsManager goalManager = Lookup.getDefault().lookup(MixR.class).getGoalManager(); goalManager.addPropertyChangeListener( goalsChangedListener, GoalsManager.CurrentGoalsChangedEvent); } }
// <editor-fold defaultstate="collapsed" desc="TopComponent-Specific Stuff"> @Override public void componentOpened() { // Register to 'goal change' events in MixR's goal manager: if (goalsChangedListener == null) { goalsChangedListener = new GoalsChangedListenerImpl(); } GoalsManager goalManager = Lookup.getDefault().lookup(MixR.class).getGoalManager(); goalManager.addPropertyChangeListener( goalsChangedListener, GoalsManager.CurrentGoalsChangedEvent); updateGoalsList(); }