use of net.sf.eclipsecs.core.util.ExtensionClassLoader in project eclipse-cs by checkstyle.
the class CheckstyleUIPlugin method start.
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
mQuickfixExtensionClassLoader = new ExtensionClassLoader(context.getBundle(), QUICKFIX_PROVIDER_EXT_PT_ID);
// add listeners for the Check-On-Open support
final IWorkbench workbench = getWorkbench();
workbench.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
for (IWorkbenchWindow window : windows) {
if (window != null) {
// collect open editors and have then run against Checkstyle if
// appropriate
Collection<IWorkbenchPartReference> parts = new HashSet<>();
// add already opened files to the filter
// bugfix for 2923044
IWorkbenchPage[] pages = window.getPages();
for (IWorkbenchPage page : pages) {
IEditorReference[] editorRefs = page.getEditorReferences();
for (IEditorReference ref : editorRefs) {
parts.add(ref);
}
}
mPartListener.partsOpened(parts);
// remove listener first for safety, we don't want
// register the same listener twice accidently
window.getPartService().removePartListener(mPartListener);
window.getPartService().addPartListener(mPartListener);
}
}
workbench.addWindowListener(mWindowListener);
}
});
}
use of net.sf.eclipsecs.core.util.ExtensionClassLoader in project eclipse-cs by checkstyle.
the class CheckstylePlugin method start.
/**
* {@inheritDoc}
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
mAddonExtensionClassLoader = new ExtensionClassLoader(context.getBundle(), ADDON_PROVIDER_EXT_PT_ID);
try {
// $NON-NLS-1$
Logger checkstyleErrorLog = Logger.getLogger("com.puppycrawl.tools.checkstyle.ExceptionLog");
checkstyleErrorLog.addHandler(new EclipseLogHandler(this));
checkstyleErrorLog.setLevel(Level.ALL);
} catch (Exception ioe) {
CheckstyleLog.log(ioe);
}
}
Aggregations