SnipEx sx = (SnipEx)element;
text.setText(sx.toString());
preview.setText(sx.getSource().toString());
} else if(element instanceof Library) {
Library lib = (Library)element;
text.setText(lib.getName());
preview.setText(lib.getDescription());
} else if(element instanceof Snippet) {
Snippet snip = (Snippet)element;
text.setText(snip.getDescription());
preview.setText(snip.getStartText()+snip.getEndText());