public void setFocus() {
if (getActivePage() == 1) {
// check if translation does succeed
try {
DefaultExpander expander = new DefaultExpander();
String content = dslRuleEditor.getContent();
Reader reader = DSLAdapter.getDSLContent(content, dslRuleEditor.getResource());
if (reader == null) {
throw new IllegalArgumentException("Could not find dsl definition.");
}
DSLMappingFile mapping = new DSLTokenizedMappingFile();
mapping.parseAndLoad(reader);
reader.close();
expander.addDSLMapping(mapping.getMapping());
expander.expand(content);
// if translation succeeds, change to drl viewer
drlRuleViewer.setInput(getEditorInput());
drlRuleViewer.setSelectedRange(selection);
} catch (Throwable t) {
t.printStackTrace();