-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a case sensitive variant of IContentType.isAssociatedWith #673 #1235
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,9 @@ | |
*******************************************************************************/ | ||
package org.eclipse.core.runtime.content; | ||
|
||
import java.io.*; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.Reader; | ||
import org.eclipse.core.runtime.CoreException; | ||
import org.eclipse.core.runtime.QualifiedName; | ||
import org.eclipse.core.runtime.preferences.IScopeContext; | ||
|
@@ -167,26 +169,56 @@ public interface IContentType extends IContentTypeSettings { | |
String getName(); | ||
|
||
/** | ||
* Returns whether this content type is associated with the | ||
* given file name. | ||
* Returns whether this content type is associated with the given file name. The | ||
* association is done ignoring case "c"=="C" | ||
* | ||
* @param fileName the file name | ||
* @return <code>true</code> if this content type is associated with | ||
* the given file name, <code>false</code> otherwise | ||
* @return <code>true</code> if this content type is associated with the given | ||
* file name, <code>false</code> otherwise | ||
* @see #isAssociatedWith(String, IScopeContext) | ||
*/ | ||
@Deprecated | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you deprecate it, there should be javadoc explaining what to use instead. I wonder though, why deprecate it instead of having a default method that calls the new method with true, which has been the behavior of the past? But then, you've deprecated two methods and replaced them with a single method, so if I have a string but not a scope context, what will I do to fix the deprecation warning? |
||
boolean isAssociatedWith(String fileName); | ||
|
||
/** | ||
* Returns whether this content type is associated with the | ||
* given file name in the given preference scope. | ||
* Returns whether this content type is associated with the given file name. | ||
* | ||
* @param fileName the file name | ||
* @param caseStrict if true the string comparison is case sensitive else the | ||
* comparison is ignoring case | ||
* | ||
* @return <code>true</code> if this content type is associated with the given | ||
* file name, <code>false</code> otherwise | ||
* @see #isAssociatedWith(String, IScopeContext) | ||
* @since 3.10 | ||
*/ | ||
boolean isAssociatedWith(String fileName, boolean caseStrict); | ||
|
||
/** | ||
* Returns whether this content type is associated with the given file name in | ||
* the given preference scope. | ||
* | ||
* @param fileName the file name | ||
* @param caseStrict if true the string comparison is case sensitive else the | ||
* comparison is ignoring case | ||
* @param context a preference scope context | ||
* @return <code>true</code> if this content type is associated with the given | ||
* file name, <code>false</code> otherwise | ||
* @since 3.10 | ||
*/ | ||
boolean isAssociatedWith(String fileName, boolean caseStrict, IScopeContext context); | ||
|
||
/** | ||
* Returns whether this content type is associated with the given file name in | ||
* the given preference scope. The association is done ignoring case "c"=="C" | ||
* | ||
* @param fileName the file name | ||
* @param context a preference scope context | ||
* @return <code>true</code> if this content type is associated with | ||
* the given file name, <code>false</code> otherwise | ||
* @param context a preference scope context | ||
* @return <code>true</code> if this content type is associated with the given | ||
* file name, <code>false</code> otherwise | ||
* @since 3.1 | ||
*/ | ||
@Deprecated | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you deprecate it, there should be javadoc explaining what to use instead. |
||
boolean isAssociatedWith(String fileName, IScopeContext context); | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we already have a typeMask, why not having a new flag controlling the behavior?