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

The following examples show how to use org.netbeans.spi.options.OptionsPanelController#update() . 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: PerProjectHintsPanelUI.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void change() {
    final LanguageDescription mimeType = (LanguageDescription) languageCombo.getSelectedItem();
    customPanel.removeAll();
    
    if (mimeType != null) {
        JComponent panel = mimeType2OptionsPanel.get(mimeType);
        
        if (panel == null) {
            OptionsPanelController c = mimeType2OptionsController.get(mimeType);
            panel = c.getComponent(Lookups.fixed(PerProjectHintsPanelUI.this.preferencesProvider.getPreferences(mimeType.mimeType),
                                                 OptionsFilter.create(searchText.getDocument(), new Runnable() {
                @Override public void run() {
                    supportsFiltering.add(mimeType.mimeType);
                    searchEnableDisable();
                }
            })));
            mimeType2OptionsPanel.put(mimeType, panel);
            c.update();
        }
        customPanel.add(panel, BorderLayout.CENTER);
    }
    
    customPanel.invalidate();
    customPanel.revalidate();
}
 
Example 2
Source File: Model.java    From netbeans with Apache License 2.0 4 votes vote down vote up
void update (String category) {
    OptionsPanelController controller = categoryToController.get(category);
    if (controller != null) {
        controller.update();
    }
}
 
Example 3
Source File: TabbedController.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void update() {
    for (OptionsPanelController c : getControllers()) {
        c.update();
    }
}
 
Example 4
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);
      }
  }
 
Example 5
Source File: FrameworksPanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
void update() {
    for (OptionsPanelController controller : option2controller.values()) {
        controller.update();
    }
}
 
Example 6
Source File: VcsAdvancedOptions.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void update() {
    for (OptionsPanelController c : getControllers()) {
        c.update();
    }
}