当前位置: 首页>>代码示例>>Java>>正文


Java OptionsPanelController.getComponent方法代码示例

本文整理汇总了Java中org.netbeans.spi.options.OptionsPanelController.getComponent方法的典型用法代码示例。如果您正苦于以下问题:Java OptionsPanelController.getComponent方法的具体用法?Java OptionsPanelController.getComponent怎么用?Java OptionsPanelController.getComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.spi.options.OptionsPanelController的用法示例。


在下文中一共展示了OptionsPanelController.getComponent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: change

import org.netbeans.spi.options.OptionsPanelController; //导入方法依赖的package包/类
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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:PerProjectHintsPanelUI.java

示例2: actionPerformed

import org.netbeans.spi.options.OptionsPanelController; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
    optionsPanel.setVisible(false);
    optionsPanel.removeAll();
    String mimeType = (String)languageCombo.getSelectedItem();
    if (mimeType != null) {
        OptionsPanelController opc = controller.getController(mimeType);
        if (opc != null) {
            JComponent component = opc.getComponent(controller.getLookup());
            optionsPanel.add(component, BorderLayout.CENTER);
            optionsPanel.setVisible(true);
        }
    }

    searchEnableDisable();
    if (isShowing()) { //remember the last selected option only when panel is visible
        lastSelectedMimeType = mimeType;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:FolderBasedOptionPanel.java

示例3: getComponent

import org.netbeans.spi.options.OptionsPanelController; //导入方法依赖的package包/类
@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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:FolderBasedController.java

示例4: handleTabSwitched

import org.netbeans.spi.options.OptionsPanelController; //导入方法依赖的package包/类
/** 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);
      }
  }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:46,代码来源:TabbedController.java


注:本文中的org.netbeans.spi.options.OptionsPanelController.getComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。