public void partActivated(IWorkbenchPart part) {
updateView(part);
}
private void updateView(IWorkbenchPart part) {
IFXPreviewAdapter adapted;
if( part instanceof IFXPreviewAdapter ) {
adapted = (IFXPreviewAdapter) part;
} else {
adapted = (IFXPreviewAdapter) part.getAdapter(IFXPreviewAdapter.class);
}
if( adapted != null ) {
if( currentEditor == null || ! currentEditor.getEditorPart().equals(adapted.getEditorPart()) ) {
if( currentEditor != null ) {
currentEditor.getEditorPart().removePropertyListener(this);
}
currentEditor = (IFXPreviewAdapter) adapted;