Java Code Examples for org.netbeans.spi.options.OptionsPanelController#addPropertyChangeListener()

The following examples show how to use org.netbeans.spi.options.OptionsPanelController#addPropertyChangeListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TabbedController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
    pcs.addPropertyChangeListener(l);
    for (OptionsPanelController c : getControllers()) {
        c.addPropertyChangeListener(l);
    }
}
 
Example 2
Source File: FolderBasedController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized JComponent getComponent(Lookup masterLookup) {
    if (panel == null) {
        this.masterLookup = masterLookup;
        for (Entry<String, OptionsPanelController> e : getMimeType2delegates ().entrySet()) {
            OptionsFilter f = OptionsFilter.create(filterDocument, new FilteringUsedCallback(e.getKey()));
            Lookup innerLookup = new ProxyLookup(masterLookup, Lookups.singleton(f));
            OptionsPanelController controller = e.getValue();
            controller.getComponent(innerLookup);
            controller.addPropertyChangeListener(this);
        }
        panel = new FolderBasedOptionPanel(this, filterDocument, allowFiltering);
    }
    return panel;
}
 
Example 3
Source File: BugtrackingOptions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
    for (OptionsPanelController c: categoryToController.values()) {
        c.addPropertyChangeListener(l);
    }
    tasksPanel.getPropertySupport().addPropertyChangeListener(l);
}
 
Example 4
Source File: Model.java    From netbeans with Apache License 2.0 4 votes vote down vote up
void addPropertyChangeListener(PropertyChangeListener listener) {
    propertyChangeListener = listener;
    for(OptionsPanelController controller : categoryToController.values()) {
        controller.addPropertyChangeListener(listener);
    }
}
 
Example 5
Source File: TabbedController.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Replace placeholder with real panel and change help context. */
  private void handleTabSwitched(String searchText, List<String> matchedKeywords) {
      final int selectedIndex = pane.getSelectedIndex();
      if (selectedIndex != -1) {
          String tabTitle = pane.getTitleAt(selectedIndex);
          OptionsPanelController controller = tabTitle2controller.get(tabTitle);
          if (pane.getSelectedComponent() instanceof JLabel) {
              JComponent comp;
              if (controller == null) {
                  AdvancedOption advancedOption = tabTitle2Option.get(tabTitle);
                  if (advancedOption == null) {
                      LOGGER.log(Level.INFO, "AdvancedOption for {0} is not present.", tabTitle);
                      return;
                  } else {
                      controller = advancedOption.create();
                      tabTitle2controller.put(tabTitle, controller);
                      // must be here because many controllers rely on fact that getComponent() is called first than other methods
                      comp = controller.getComponent(masterLookup);
                      // add existing listeners
                      for (PropertyChangeListener pcl : pcs.getPropertyChangeListeners()) {
                          controller.addPropertyChangeListener(pcl);
                      }
                  }
              } else {
                  comp = controller.getComponent(masterLookup);
              }
              if( null == comp.getBorder() ) {
                  comp.setBorder(BorderFactory.createEmptyBorder(11,11,11,11));
              }
              JScrollPane scroll = new JScrollPane(comp);
              scroll.setBorder(BorderFactory.createEmptyBorder());
              scroll.setOpaque(false);
              scroll.getViewport().setOpaque(false);
              scroll.getVerticalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
              scroll.getHorizontalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
              pane.setComponentAt(selectedIndex, scroll);
              controller.update();
controller.isValid();
          }
   if (searchText != null && matchedKeywords != null) {
controller.handleSuccessfulSearch(searchText, matchedKeywords);
          }
          pcs.firePropertyChange(OptionsPanelController.PROP_HELP_CTX, null, null);
      }
  }