public JsLinkToolWindow() {
runButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Application application = ApplicationManager.getApplication();
JsLintValidatorComponent validator = application.getComponent(JsLintValidatorComponent.class);
try {
((DefaultTableModel) errorList.getModel()).setRowCount(0);
totalNumberOfErrors.setText("");
DataContext toolContext = DataManager.getInstance().getDataContextFromFocus().getResult();
Project project = DataKeys.PROJECT.getData(toolContext);
Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
if (editor != null) {
Document doc = editor.getDocument();
JSLintRunner runner = JSLintRunnerManager.getInstance().getRunner();
Object[] errorBeans = runner.validateScriptString(doc.getText(),
validator.getJsLintOptions());
final DefaultTableModel model = (DefaultTableModel) errorList.getModel();
ErrorBeanWrapper errorBeanWrapper = new ErrorBeanWrapper();
if (errorBeans.length > 0) {
totalNumberOfErrors.setText(String.format("Total Number Of Errors:%d", errorBeans.length));
int counter = 1;