allowedFileTypes is deprecated - objective-c

In macOS 11.0, the NSOpenPanel's allowedFileTypes property is marked as deprecated in favor of the allowedContentType property.
We're developing a plug-in to a third-party macOS app. The plug-in asks user to provide a licence file - we provide the file with our proprietary abcLicence file extension. As we cannot handle double clicks as a plug-in, we rely on NSOpenPanel triggered from the plug-in UI. Because there were close to no benefit registering the file type as we cannot respond on shell file actions, we are not including it in the plug-ins plist file. The plug-in supports macOS 10.12+.
NSOpenPanel *openDialog = [NSOpenPanel openPanel];
openDialog.title = #"Locate ABC license file";
openDialog.allowedFileTypes = #[#"abcLicence"];
How to update the code to use the new API if available while keeping supporting macOS 10.12+?

Use the delegate method panel:shouldEnableURL:, available since 10.6. With this method you can implement arbitrary logic to decide if an item should be enabled and hence selectable, in your case you can just check the extension. HTH

Related

Modify IntelliJ custom properties in plugin tests

I develop plugin for IntelliJ. How can I modify custom properties for my plugin tests?
For example I want to set idea.max.content.load.filesize property to, say, 100MiB
These are system properties, so java.lang.System#setProperty
Depending on the properties you wish to modify, you may be able to use idea.properties, which contains the "default properties used to run IntelliJ IDEA" (per the link you provided). To modify the file, you go to Help > Edit Custom Properties... (see these steps).
For example, I used this approach to address a problem where my machine's security software was blocking plugins that used IntelliJ's default config directory (C:\Users<user>\AppData...).
This is the Windows OS default Application Data directory and is included in the paths scanned by the security software. By moving my idea.properties file to a different directory (c:/development/idea/caches/), not automatically scanned by the security software, my plugins were no longer blocked.
It's a different use case from what you're describing, but may be an approach worth looking into.

how to register for files of specific type in intellij plugin

I want to write an intellij plugin that needs to have a file viewer of certain type/s.
say I have a bunch of .abc files in my project at various locations. I need my plugin to show a tree view of all those .abc files keeping their hierarchy intact.
what is the api I should look at ?
Plugin repository can discover file types supported by a plugin and later IDE gets information about file types supported by different plugins. When you open a file of the file type supported by some plugin you get a notification in the IDE.
Registering a File Type

Distriqt ANE Crashes When Using Adobe Air Sdk 15.0

I'm using InAppBilling ANE and AIR 15 crashes. Flash Builder can't create swf file when add ane extension.
There is the error below,
Process terminated unexpectedly.
The content cannot be loaded because there was a problem loading an extension: Error: Requested extension com.distriqt.InAppBilling could not be found.
Launch command details: "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0 with Air 15.0\bin\adl.exe" -runtime "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0 with Air 15.0\runtimes\air\win" -profile mobileDevice -screensize 320x455:320x480 -XscreenDPI 181 -XversionPlatform AND "C:\Users\Saygın Karahan\Adobe Flash Builder 4.6\Albatros\bin-debug\Root-app.xml" "C:\Users\Saygın Karahan\Adobe Flash Builder 4.6\Albatros\bin-debug"
Check whether you added your .ane in your project or not.
If you not added means, follow these steps to add .ane in your project.
At First, when we use .ane in flex project, we should add the .ane file for packaging.
Right click - in your project
Choose Properties
Select - Flex Build Path in left side menu.
Choose - Native Extension tab
The click Add ANE button to browse your .ane file in your system. - Here you added your .ane file into your project.
But this is not enough steps to use .ane. You should add your .ane file into your packaging, then only the release build will having the support from that .ane file.
Go To - Flex Build Packaging - in properties window.
Here, we have two options, One for Apple IOS, and Google Android.
Choose, for which device you are going to use.
After choosing that options, you having the tab Native Extension in right side.
Your added .ane file is showing in the below ANE Details data grid.
Select the check box to adding that ane file into the packaging.
Here, you can verify that ane file, which platform that ane going to support.
An alert will prompt you for confirmation, click yes, then click OK in properties window.
Now, you added your.ane file in your project.
Finally, Check your descriptor file with the tag. The added .ane package path is added in the <extensionID> tag.
<extensions>
<extensionID>ane package path</extensionID>
</extensions>
Note : When you using any .ane in your project, simulator is not support to run your application
Have you confirmed that the extension is included in the packaging options on the platform you are using?
Have a look at the getting started tutorial:
http://airnativeextensions.com/knowledgebase/tutorial/1
In particular:
Go to project settings, and to the "Build Packaging" for the platforms you are deploying and check the extension is going to be packaged (and available) with them (small checkbox on the right of the extension).

How to enable spellchecking for custom language plugins in IDEA?

IntelliJ spellchecking appears to be disabled for certain custom language plugins such as Markdown (extension ".md") and the Non-Dairy Soy Plugin (extension ".soy") even with the Spelling | Typo inspection options enabled:
Process Code
Process literals
Process comments
Is it possible to enable spellchecking for custom language plugins?
Update: I have added spellchecking support for the IntelliJ plugin Non-Dairy-Soy-Plugin. See pull request and the forked copy on Github under branch spellchecker.
End users can't force the spellchecker for the file types that are provided by the third-party plug-ins. Plugin maintainer needs to support it explicitly.
For example, Java plug-in defines this in the plugin.xml descriptor:
<spellchecker.support language="JAVA" implementationClass="com.intellij.spellchecker.JavaSpellcheckingStrategy"/>
Plugins can also provide their own dictionaries:
<extensions defaultExtensionNs="com.intellij.spellchecker">
<support language="Python" implementationClass="com.jetbrains.python.spellchecker.PythonSpellcheckerStrategy"/>
<bundledDictionaryProvider implementation="com.jetbrains.python.spellchecker.PythonBundledDictionaryProvider"/>
</extensions>
SpellcheckingStrategy class specifies how the words in the file type are tokenized and supplied to the spellchecker.
For open source plug-ins like Markdown, you can try to support it yourself and then send pull request or patch to the maintainer, or just kindly ask the maintainer to add spellchecker support in the future updates.

Google Protocol Buffers on iOS/Objective-C

I need help to configure/use protobuf in Objective-C for a iOS app.
I've tried all but I keep getting errors on xcode. Did anyone manage to make protobuf work well in Objective-C/iOS?
I have used it to some extent on iOS, and with metasyntactic's extension, it works really well. I even managed to get the code generation as a custom build step in Xcode. We switched to Thrift for our project (for other reasons), so my apologies if some details below are wrong, but in general this is how to do it.
In Xcode 4.2, open the target properties, go to the "Build Rules" tab and create a new build rule for "*.proto" files
In "Using:", choose "custom script" and use a script like this:
protoc --plugin=/usr/local/bin/protoc-gen-objc $INPUT_FILE_PATH --objc_out=$DERIVED_FILES_DIR
In Output files, add the generated files (there should be two files, $(INPUT_FILE_BASE).pb.m and $(INPUT_FILE_BASE).pb.h.
Add the .proto files to your project.