This repository was archived by the owner on Apr 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Plugin Development
Andre Greeff edited this page Jul 27, 2015
·
2 revisions
The snippets provided below should give some indication of how this plugin functions internally. If you notice any difference in code vs documentation in this regard, please open a new issue to report the inconsistency.
import org.openide.filesystems.FileObject;
...
FileObject fo ...
Object value = fo.getAttribute("myKey");
if (value != null) {
...
}
DataObject dataObject = ...;
FileObject fo = dataObject.getPrimaryFile();
FileLock lock = FileLock.NONE;
try {
if (!fo.isLocked()) {
BufferedOutputStream os = new BufferedOutputStream(fo.getOutputStream(lock));
os.write("Hello World".getBytes("ASCII"));
os.flush();
os.close();
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
return false;
} finally {
lock.releaseLock();
}
Reformat reformat = Reformat.get(document);
reformat.lock();
reformat.reformat(0, document.getLength());
reformat.unlock();
Preferences codeStyle = CodeStylePreferences.get(file, file.getMIMEType()).getPreferences();
codeStyle.putInt(SimpleValueNames.INDENT_SHIFT_WIDTH, 2);
codeStyle.flush();
Note: Private details such as the certificate file and keystore alias/password will not be provided publicly. The instructions related to plugin releases are intended only for official plugin developer reference.
mvn release:cleanup
mvn release:prepare -Dnbm.signing.keystore=<PATH_TO_CERT> -Dnbm.signing.keystorealias=<ALIAS> -Dnbm.signing.keystorepassword=<PASSWORD>
mvn release:perform -Dnbm.signing.keystore=<PATH_TO_CERT> -Dnbm.signing.keystorealias=<ALIAS> -Dnbm.signing.keystorepassword=<PASSWORD>
If anything goes wrong: mvn release:rollback