performOperation and getOptions don't actually pass selected documents
In my DocumentOperation subclass, neither the performOperation nor the getOptions method pass in the user-selected documents, as stated in the API docs. Do I misunderstand something? DocumentUtilities.getSelectedDocuments DOES provide the selected documents.
See here for the code:
0
-
It looks like it's because you return an empty array from getSelectionSignatures. The javadoc states:
"If an operation accepts no documents as input, it should return an empty array and the operation will always be enabled but won't be passed any documents as input."
If you want to accept any selection of documents rather than no documents you should have the following:
public DocumentSelectionSignature[] getSelectionSignatures() {
return new DocumentSelectionSignature[] {
new DocumentSelectionSignature(PluginDocument.class, 1, Integer.MAX_VALUE)
};
}0 -
Ah, thanks for that!
Ayco
0
Please sign in to leave a comment.
Comments
2 comments