本文整理汇总了Java中org.netbeans.spi.options.OptionsPanelController类的典型用法代码示例。如果您正苦于以下问题:Java OptionsPanelController类的具体用法?Java OptionsPanelController怎么用?Java OptionsPanelController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OptionsPanelController类属于org.netbeans.spi.options包,在下文中一共展示了OptionsPanelController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: handleSuccessfulSearch
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
@Override
public void handleSuccessfulSearch (String searchText, List<String> matchedKeywords) {
Map<String, OptionsPanelController> m;
synchronized (categoryToController) {
m = new HashMap<String, OptionsPanelController>(categoryToController);
}
for (Map.Entry<String, OptionsPanelController> e : m.entrySet()) {
OptionsPanelController c = e.getValue();
if (c instanceof VCSOptionsKeywordsProvider) {
if (((VCSOptionsKeywordsProvider) c).acceptKeywords(matchedKeywords)) {
panel.selectCategory(e.getKey());
break;
}
}
}
}
示例3: propertyChange
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
@NbBundle.Messages({"Loading_HelpCtx_Lengthy_Operation=Please wait while help context is being loaded."})
@Override
public void propertyChange (PropertyChangeEvent ev) {
if (ev.getPropertyName ().equals ("buran" + OptionsPanelController.PROP_HELP_CTX)) { //NOI18N
AtomicBoolean helpCtxLoadingCancelled = new AtomicBoolean(false);
ProgressUtils.runOffEventDispatchThread(new Runnable() {
@Override
public void run() {
helpCtx = optionsPanel.getHelpCtx();
}
}, Bundle.Loading_HelpCtx_Lengthy_Operation(), helpCtxLoadingCancelled, false, 50, 5000);
if(helpCtxLoadingCancelled.get()) {
log.fine("Options Dialog - HelpCtx loading cancelled by user."); //NOI18N
}
descriptor.setHelpCtx(helpCtx);
} else if (ev.getPropertyName ().equals ("buran" + OptionsPanelController.PROP_VALID)) { //NOI18N
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
bOK.setEnabled(optionsPanel.dataValid());
bAPPLY.setEnabled(optionsPanel.isChanged() && optionsPanel.dataValid());
}
});
}
}
示例4: readPanels
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
private void readPanels() {
Lookup lookup = Lookups.forPath(tabFolder);
options = lookup.lookup(new Lookup.Template<AdvancedOption>( AdvancedOption.class ));
tabTitle2controller = new HashMap<String, OptionsPanelController>();
id2tabTitle = new HashMap<String, String>();
synchronized (tabTitle2Option) {
for (Lookup.Item<AdvancedOption> item : options.allItems()) {
AdvancedOption option = item.getInstance();
String displayName = option.getDisplayName();
if (displayName != null) {
tabTitle2Option.put(displayName, option);
String id = item.getId().substring(item.getId().lastIndexOf('/') + 1); //NOI18N
id2tabTitle.put(id, displayName);
} else {
LOGGER.log(Level.WARNING, "Display name not defined: {0}", item.toString()); //NOI18N
}
}
}
}
示例5: ToDoCustomizer
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
/** Creates new form ToDoCustomizer */
public ToDoCustomizer() {
initComponents();
lblError.setVisible(false);
table.getSelectionModel().setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
table.getSelectionModel().addListSelectionListener( new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
enableButtons();
}
});
table.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("tableCellEditor".equals(evt.getPropertyName())) { //NOI18N
if (!table.isEditing()) { // A cell has stopped editing
fireChanged();
firePropertyChange(OptionsPanelController.PROP_CHANGED, new Boolean(changed), Boolean.TRUE);
firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
}
}
});
jScrollPane1.getViewport().setOpaque( false );
enableButtons();
}
示例6: addSelectedToModel
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
private void addSelectedToModel(List<FileIdentifier> selectedIdentifiers) {
boolean isMime = true;
for (FileIdentifier fileIdentifier : selectedIdentifiers) {
isMime = fileIdentifier.getType().equals(FileIdentifier.Type.MIME);
if (isMime) {
mimeIdentifiers.add((MimeIdentifier) fileIdentifier);
} else {
extensionIdentifiers.add((ExtensionIdentifier) fileIdentifier);
}
}
int indexToSelect = isMime ? mimeIdentifiers.size() : mimeIdentifiers.size() + extensionIdentifiers.size() + 1;
updateListModel(indexToSelect);
boolean oldChanged = changed;
firePropertyChange(OptionsPanelController.PROP_CHANGED, oldChanged, true);
firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
示例7: btnRemoveActionPerformed
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
private void btnRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveActionPerformed
TableCellEditor editor = table.getCellEditor();
if( null != editor )
editor.cancelCellEditing();
boolean wasValid = isDataValid();
int selRow = table.getSelectedRow();
if( selRow < 0 )
return;
DefaultTableModel model = (DefaultTableModel)table.getModel();
model.removeRow( selRow );
if( selRow > model.getRowCount()-1 )
selRow--;
if( selRow >= 0 )
table.getSelectionModel().setSelectionInterval( selRow, selRow );
boolean wasChanged = changed;
fireChanged();
firePropertyChange( OptionsPanelController.PROP_CHANGED, new Boolean(wasChanged), Boolean.TRUE);
firePropertyChange( OptionsPanelController.PROP_VALID, new Boolean(wasValid), new Boolean(isDataValid()));
}
示例8: getMimeTypes
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
public synchronized Collection<? extends String> getMimeTypes() {
if (mimeTypes == null) {
mimeTypes = new HashSet<String>();
mimeTypes.add(""); //NOI18N
// filter out mime types that don't supply customizers
for(String mimeType : EditorSettings.getDefault().getAllMimeTypes()) {
Lookup l = Lookups.forPath(FORMATTING_CUSTOMIZERS_FOLDER + mimeType);
Collection<? extends PreferencesCustomizer.Factory> factories = l.lookupAll(PreferencesCustomizer.Factory.class);
if (!factories.isEmpty()) {
if (allowedMimeTypes == null || allowedMimeTypes.contains(mimeType)) {
mimeTypes.add(mimeType);
}
} else if (acceptOldControllers) {
Collection<? extends OptionsPanelController> controllers = l.lookupAll(OptionsPanelController.class);
if (!controllers.isEmpty()) {
if (allowedMimeTypes == null || allowedMimeTypes.contains(mimeType)) {
mimeTypes.add(mimeType);
}
}
}
}
}
return mimeTypes;
}
示例9: setCurrentSubcategory
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
@Override
protected void setCurrentSubcategory(String subpath) {
for (Entry<String, OptionsPanelController> e : getMimeType2delegates().entrySet()) {
if (subpath.startsWith(e.getKey())) {
panel.setCurrentMimeType(e.getKey());
subpath = subpath.substring(e.getKey().length());
if (subpath.length() > 0 && subpath.startsWith("/")) {
e.getValue().setSubcategory(subpath.substring(1));
}
return ;
}
}
Logger.getLogger(FolderBasedController.class.getName()).log(Level.WARNING, "setCurrentSubcategory: cannot open: {0}", subpath);
}
示例10: 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;
}
}
示例11: saveCurrentTemplate
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
private void saveCurrentTemplate() {
if (unsavedTemplateIndex < 0) {
return;
}
CodeTemplatesModel.TM tableModel = (CodeTemplatesModel.TM)tTemplates.getModel();
// Don't use JEditorPane.getText(), because it goes through EditorKit.write()
// and performs conversion as if the text was written to a file (eg. EOL
// translations). See #130095 for details.
try {
tableModel.setDescription(unsavedTemplateIndex, CharSequenceUtilities.toString(DocumentUtilities.getText(epDescription.getDocument(), 0, epDescription.getDocument().getLength())));
tableModel.setText(unsavedTemplateIndex, CharSequenceUtilities.toString(DocumentUtilities.getText(epExpandedText.getDocument(), 0, epExpandedText.getDocument().getLength())));
unsavedTemplateIndex = -1;
} catch (BadLocationException ble) {
Exceptions.printStackTrace(ble);
}
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}
示例12: BugtrackingOptions
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
public BugtrackingOptions() {
if (initialized) return;
initialized = true;
tasksPanel = new DashboardOptions();
panel = new BugtrackingOptionsPanel(tasksPanel);
Lookup lookup = Lookups.forPath("BugtrackingOptionsDialog"); // NOI18N
Iterator<? extends AdvancedOption> it = lookup.lookupAll(AdvancedOption.class).iterator();
while (it.hasNext()) {
AdvancedOption option = it.next();
String category = option.getDisplayName();
OptionsPanelController controller;
try {
controller = option.create();
} catch (Throwable t) {
BugtrackingManager.LOG.log(Level.WARNING, "Problems while creating option category : " + category, t); // NOI18N
continue;
}
categoryToController.put(category, controller);
}
}
示例13: changed
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
void changed() {
if (!changed) {
changed = true;
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
}
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
示例14: changed
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
private void changed () {
fireChanged();
if (!changed) {
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
}
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
示例15: changed
import org.netbeans.spi.options.OptionsPanelController; //导入依赖的package包/类
void changed() {
if (!changed) {
changed = true;
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
}
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}