use of org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.NullSourceEditingTextTools in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method createSourceEditingTextTools.
/**
* @return
*/
private ISourceEditingTextTools createSourceEditingTextTools() {
ISourceEditingTextTools tools = null;
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] ids = getConfigurationPoints();
for (int i = 0; tools == null && i < ids.length; i++) {
tools = (ISourceEditingTextTools) builder.getConfiguration(NullSourceEditingTextTools.ID, ids[i]);
}
if (tools == null) {
tools = NullSourceEditingTextTools.getInstance();
((NullSourceEditingTextTools) tools).setTextEditor(this);
}
// $NON-NLS-1$
Method method = null;
try {
// $NON-NLS-1$
method = tools.getClass().getMethod("setTextEditor", new Class[] { StructuredTextEditor.class });
} catch (NoSuchMethodException e) {
}
if (method == null) {
try {
// $NON-NLS-1$
method = tools.getClass().getMethod("setTextEditor", new Class[] { ITextEditor.class });
} catch (NoSuchMethodException e) {
}
}
if (method == null) {
try {
// $NON-NLS-1$
method = tools.getClass().getMethod("setTextEditor", new Class[] { IEditorPart.class });
} catch (NoSuchMethodException e) {
}
}
if (method != null) {
if (!method.isAccessible()) {
method.setAccessible(true);
}
try {
method.invoke(tools, new Object[] { this });
} catch (Exception e) {
// $NON-NLS-1$
Logger.logException("Problem creating ISourceEditingTextTools implementation", e);
}
}
return tools;
}
Aggregations