org.netbeans.spi.options.OptionsPanelController Java Examples

The following examples show how to use org.netbeans.spi.options.OptionsPanelController. 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: OptionsDisplayerImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@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());
            }
        });
    }
}
 
Example #2
Source File: ToDoCustomizer.java    From netbeans with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #3
Source File: BugtrackingOptions.java    From netbeans with Apache License 2.0 6 votes vote down vote up
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);
    }
}
 
Example #4
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 #5
Source File: GraphOptionsPanelController.java    From constellation with Apache License 2.0 6 votes vote down vote up
@Override
public void applyChanges() {
    if (isValid()) {
        pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);

        if (isChanged()) {
            pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);

            final Preferences prefs = NbPreferences.forModule(GraphPreferenceKeys.class);
            final GraphOptionsPanel graphOptionsPanel = getPanel();

            prefs.putInt(GraphPreferenceKeys.BLAZE_SIZE, graphOptionsPanel.getBlazeSize());
            prefs.putInt(GraphPreferenceKeys.BLAZE_OPACITY, graphOptionsPanel.getBlazeOpacity());
        }
    }
}
 
Example #6
Source File: NodeJsOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    if (!changed) {
        changed = true;
        propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #7
Source File: TracerOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #8
Source File: FrameworksPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@CheckForNull
OptionsPanelController getSelectedController() {
    AdvancedOption option = getSelectedOption();
    if (option == null) {
        return null;
    }
    return option2controller.get(option);
}
 
Example #9
Source File: GenerateOptionsPanelController.java    From jeddict with Apache License 2.0 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #10
Source File: AtoumOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    if (!changed) {
        changed = true;
        propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #11
Source File: SymfonyOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    if (!changed) {
        changed = true;
        propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #12
Source File: NetworkOptionsPanelController.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #13
Source File: HudsonOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    if (!changed) {
        changed = true;
        propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #14
Source File: EJBNameOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void changed() {
    if (!changedStatus) {
        changedStatus = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #15
Source File: OpenGLOptionsPanelController.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #16
Source File: FrameworksPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private OptionsPanelController getController(AdvancedOption option) {
    assert EventQueue.isDispatchThread();
    OptionsPanelController controller = option2controller.get(option);
    if (controller == null) {
        controller = option.create();
        // comply with javadoc
        controller.getComponent(masterLookup);
        option2controller.put(option, controller);
        controller.addPropertyChangeListener(changeListener);
    }
    return controller;
}
 
Example #17
Source File: MobilePlatformsOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void changed(boolean isChanged) {
    if (!changed) {
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    changed = isChanged;
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
    cs.fireChange();
}
 
Example #18
Source File: GruntOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    if (!changed) {
        changed = true;
        propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #19
Source File: RevengOptionsPanelController.java    From jeddict with Apache License 2.0 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        changeSupport.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    changeSupport.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #20
Source File: AutoSaveOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #21
Source File: FileAssociationsOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void changed(boolean isChanged) {
    if (!changed) {
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    changed = isChanged;
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #22
Source File: Doctrine2OptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    if (!changed) {
        changed = true;
        propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #23
Source File: MikuMikuDanceOptionsPanelController.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false,
                true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #24
Source File: VcsAdvancedOptions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isChanged() {
    for (OptionsPanelController c : getControllers()) {
        if (c.isChanged()) {
            return true;
        }
    }
    return false;
}
 
Example #25
Source File: MobileOptionsPanelController.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #26
Source File: BootPrefsOptionsPanelController.java    From nb-springboot with Apache License 2.0 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #27
Source File: SBOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #28
Source File: TracerOptionsPanelController.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
void changed() {
    if (!changed) {
        changed = true;
        pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #29
Source File: BaseOptionsPanelController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public final void stateChanged(ChangeEvent e) {
    if (!changed) {
        propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
    }
    propertyChangeSupport.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
 
Example #30
Source File: HintsAdvancedOption.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized OptionsPanelController create() {
    if ( panelController == null ) {
        HintsManager manager = HintsProvider.HintsManager.getManagerForMimeType(JsTokenId.JAVASCRIPT_MIME_TYPE);
        assert manager != null;
        panelController = manager.getOptionsController();
    }

    return panelController;
}