-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from moacirrf/start-version-3
Start version 3
- Loading branch information
Showing
4 changed files
with
78 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,46 @@ | |
*/ | ||
package io.github.moacirrf.netbeans.markdown; | ||
|
||
import javax.swing.JOptionPane; | ||
import org.netbeans.InvalidException; | ||
import org.netbeans.ModuleManager; | ||
import org.openide.modules.ModuleInstall; | ||
import org.openide.util.Exceptions; | ||
|
||
/** | ||
* | ||
* @author Moacir da Roza Flores <[email protected]> | ||
*/ | ||
public class Installer extends ModuleInstall { | ||
|
||
|
||
private static final String MARKDOWN_SUPPORT = "org.netbeans.modules.markdown"; | ||
|
||
@Override | ||
public void restored() { | ||
ModuleManager mg = (ModuleManager) ModuleManager.getDefault(); | ||
if (mg != null) { | ||
org.netbeans.Module module = mg.get(MARKDOWN_SUPPORT); | ||
if (module != null && module.isEnabled()) { | ||
mg.disable(module); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void uninstalled() { | ||
ModuleManager mg = (ModuleManager) ModuleManager.getDefault(); | ||
if (mg != null) { | ||
org.netbeans.Module module = mg.get(MARKDOWN_SUPPORT); | ||
if (module != null && !module.isEnabled()) { | ||
try { | ||
mg.enable(module); | ||
} catch (IllegalArgumentException | InvalidException ex) { | ||
Exceptions.printStackTrace(ex); | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public boolean closing() { | ||
TempDir.removeTempDir(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters