Created
March 5, 2022 22:44
-
-
Save jorgecc/c9bec0c17bac4df51b2ac58bc3ff01b3 to your computer and use it in GitHub Desktop.
fix for phpunit_codecoverage_display
This file contains hidden or 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
package cc.takacs.php_codeverage_display; | |
import cc.takacs.php_codeverage_display.toolbar.ToggleIconService; | |
import com.intellij.ide.util.PropertiesComponent; | |
import com.intellij.openapi.actionSystem.ActionManager; | |
import com.intellij.openapi.actionSystem.AnAction; | |
import com.intellij.openapi.application.ApplicationManager; | |
import com.intellij.openapi.components.ApplicationComponent; | |
import org.jetbrains.annotations.NotNull; | |
import java.util.concurrent.TimeUnit; | |
/** | |
* @author Zsolt Takacs <[email protected]> | |
* hacky fix by Jorge Castro [email protected] | |
*/ | |
public class ApplicationPlugin implements ApplicationComponent { | |
@Override | |
public void initComponent() { | |
ApplicationManager.getApplication().executeOnPooledThread(() -> { | |
try { | |
TimeUnit.SECONDS.sleep(30); | |
} catch (InterruptedException e) { | |
} | |
AnAction toolbarButton = ActionManager.getInstance().getAction("cc.takacs.php_codeverage_display.toolbar.enable"); | |
final boolean enabled = PropertiesComponent.getInstance().getBoolean("cc.takacs.php_codeverage_display.enabled", true); | |
new ToggleIconService().toggleIcon(toolbarButton.getTemplatePresentation(), enabled); | |
}); | |
} | |
@Override | |
public void disposeComponent() { | |
} | |
@NotNull | |
@Override | |
public String getComponentName() { | |
return "ApplicationPlugin"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment