Refine search
/** * Create a new FileChooserBuilder. The passed key is used as a key * into NbPreferences to look up the directory the file chooser should * initially be rooted on. * * @param dirKey A non-null ad-hoc string. If a FileChooser was previously * used with the same string as is passed, then the initial directory */ public FileChooserBuilder(String dirKey) { Parameters.notNull("dirKey", dirKey); this.dirKey = dirKey; }
/** Returns list of file extensions associated with specified MIME type. In * other words files with those extensions are recognized as specified MIME type * in NetBeans' filesystem. It never returns {@code null}. * @param mimeType the MIME type (e.g. image/gif) * @return list of file extensions associated with specified MIME type, never {@code null} * @see #setMIMEType(String, String) * @since org.openide.filesystems 7.18 */ public static List<String> getMIMETypeExtensions(String mimeType) { Parameters.notEmpty("mimeType", mimeType); //NOI18N HashMap<String, String> extensionToMime = new HashMap<String, String>(); for (FileObject mimeResolverFO : MIMEResolverImpl.getOrderedResolvers()) { Map<String, Set<String>> mimeToExtensions = MIMEResolverImpl.getMIMEToExtensions(mimeResolverFO); for (Map.Entry<String, Set<String>> entry : mimeToExtensions.entrySet()) { String mimeKey = entry.getKey(); Set<String> extensions = entry.getValue(); for (String extension : extensions) { extensionToMime.put(extension, mimeKey); } } } List<String> registeredExtensions = new ArrayList<String>(); for (Map.Entry<String, String> entry : extensionToMime.entrySet()) { if (entry.getValue().equals(mimeType)) { registeredExtensions.add(entry.getKey()); } } return registeredExtensions; }
/** * Asserts the parameter value is not <code>null</code> and it is * a Java identifier. * * @param name the parameter name. * @param value the parameter value. * @throws NullPointerException if the parameter value is <code>null</code>. * @throws IllegalArgumentException if the parameter value is not * a Java identifier. */ public static void javaIdentifier(CharSequence name, CharSequence value) { notNull(name, value); javaIdentifierOrNull(name, value); }
/** * Add a listener to the listener list. * @param listener {@link PropertyChangeListener} to be added, never {@code null} * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener) */ public void addPropertyChangeListener(@NonNull PropertyChangeListener listener) { Parameters.notNull("listener", listener); propertyChangeSupport.addPropertyChangeListener(listener); }
/** * Removes a {@link PropertyChangeListener}. * @param listener the listener to be removed. */ public void removePropertyChangeListener(@NonNull final PropertyChangeListener listener) { Parameters.notNull("listener", listener); //NOI18N this.listeners.removePropertyChangeListener(listener); }
@Override public void addPropertyChangeListener(PropertyChangeListener listener) { Parameters.notNull("listener", listener); //NOI18N support.addPropertyChangeListener(listener); }
@Override public void removePropertyChangeListener(PropertyChangeListener listener) { Parameters.notNull("listener", listener); //NOI18N listeners.removePropertyChangeListener(listener); }
private Result(@NonNull final Collection<? extends JsonOptionsQueryImplementation.Result> delegates) { Parameters.notNull("delegates", delegates); //NOI18N this.delegates = delegates; this.listeners = new PropertyChangeSupport(this); this.pcl = (evt) -> listeners.firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue()); }
/** * Create a new {@code ProjectProblemsProviderSupport}. * * @param source an instance to be given as the source for events, never {@code null} */ public ProjectProblemsProviderSupport(@NonNull Object source) { Parameters.notNull("source", source); propertyChangeSupport = new PropertyChangeSupport(source); }
private Reference( @NonNull final String classPathId, @NonNull final String rawId, @NullAllowed final Profile requiredProfile) { Parameters.notNull("classPathId", classPathId); //NOI18N Parameters.notNull("rawId", rawId); //NOI18N this.classPathId = classPathId; this.rawId = rawId; this.requiredProfile = requiredProfile; }
@CheckForNull public static Command forName(@NonNull final String name) { Parameters.notNull("name", name); //NOI18N return commands.get(name.toUpperCase()); }
private ModelUnit(ClassPath bootPath, ClassPath compilePath, ClassPath sourcePath, Project project) { Parameters.notNull("sourcePath", sourcePath); this.bootPath= bootPath; this.compilePath = compilePath; this.sourcePath = sourcePath; this.projectRef = new WeakReference<Project>(project); changeSupport = new PropertyChangeSupport(this); initListeners(); }
/** * Create new annotation tag with documentation. * @param name tag name; never {@code null} * @param insertTemplate text that it inserted to the source file; never {@code null} * @param documentation documentation of the tag, HTML allowed; can be {@code null} */ public AnnotationCompletionTag(@NonNull String name, @NonNull String insertTemplate, @NullAllowed String documentation) { Parameters.notEmpty("name", name); Parameters.notEmpty("insertTemplate", insertTemplate); this.name = name; this.insertTemplate = insertTemplate; this.documentation = documentation; }
/** * Set name of the executable. This name is used for {@link ExternalExecutableValidator validation} only (before running). * <p> * The default value is {@code null} (it means "File"). * @param executableName name of the executable * @return the external executable instance itself */ public ExternalExecutable executableName(@NonNull String executableName) { Parameters.notEmpty("executableName", executableName); // NOI18N this.executableName = executableName; return this; }
@Override public void addPropertyChangeListener(@NonNull final PropertyChangeListener listener) { Parameters.notNull("listener", listener); //NOI18N pcs.addPropertyChangeListener(listener); }
@Override public void removePropertyChangeListener(@NonNull final PropertyChangeListener listener) { Parameters.notNull("listener", listener); //NOI18N pcs.removePropertyChangeListener(listener); }
@Override public void addPropertyChangeListener(PropertyChangeListener listener) { Parameters.notNull("listener", listener); //NOI18N listeners.addPropertyChangeListener(listener); }
@Override public void removePropertyChangeListener(PropertyChangeListener listener) { Parameters.notNull("listener", listener); //NOI18N support.removePropertyChangeListener(listener); }
ProjectProblemsProviderImpl(@NonNull final Lookup lkp) { Parameters.notNull("lkp", lkp); //NOI18N this.lkp = lkp; this.support = new PropertyChangeSupport(this); }